Story
On Groundhog Day, Xorin decided to take all N of his TakeOff friends on a golf course. He then divides them into groups of 4 players, any way he wants, respecting the following criteria:
- Players' order inside a group is not relevant (groups are defined by the set of players contained, not by their order). For simplicity, we will consider that a group is an ordered set of size 4.
- The order of the groups is also not relevant (i.e. configurations 1234/5678 and 5678/1234 are identical, and should not be counted twice).
However, in his attempt to stay true to the movie plot (as any Bill Murray fan would), Xorin reenacted this scenario for R consecutive days, choosing a configuration each day (not necessarily a new one).
Problem
What is the total number of ways Xorin can split the N golfers in groups of 4, over the course of R days?
The result can be a very large number. Instead of calculating the actual value, you should write a formula that, when evaluated, returns the number of possibilities.
Input
The input file contains two numbers separated by one space: N (the number of players) and R (the number of days).
Output
A formula that, when evaluated, returns the number of ways of dividing all golfers into N / 4 groups, over R days. The formula may only contain the characters 0123456789()*/+-^
. No spaces are allowed. The formula may be followed by an optional newline.
Constraints
- N is divisible by 4.
- 4 ≤ N ≤ 60
- 1 ≤ R ≤ 30
- The output (including the optional final newline) must be at most 200 characters long.
- a/b denotes the quotient of integer division. a^b is exponentiation.
Sample
Input | Output |
---|---|
8 2 | 5^3*8+15^2 |
8 1 | 7*5 |
In the 2nd example, the following are the 35 valid combinations:
- 1234/5678
- 1235/4567
- 1236/4578
- 1237/4568
- 1238/4567
- 1245/3678
- 1246/3578
- 1247/3568
- 1248/3567
- 1256/3478
- 1257/3468
- 1258/3467
- 1267/3458
- 1268/3457
- 1278/3456
- 1345/2678
- 1346/2578
- 1347/2568
- 1348/2567
- 1356/2478
- 1357/2468
- 1358/2467
- 1367/2458
- 1368/2457
- 1378/2456
- 1456/2378
- 1457/2368
- 1458/2367
- 1467/2358
- 1468/2357
- 1478/2356
- 1567/2348
- 1568/2347
- 1578/2346
- 1678/2345