Problem Statement
Fox Jiro likes dice. He wants to make his own dice. Each die he wants to make is a cube. Each of the 6 faces has an integer between 1 and N, inclusive. No two faces have same number. Also the following condition must be satisfied: for all faces, the sum of the numbers on opposite faces must be equal and the sum must be greater than or equal to K.
He realized that there are many ways to make such dice. He wants to know how many ways there are. Please help Jiro to make a program that is given two integers N and K and returns the number of different dice satisfying the condition mentioned above.
Two dice are considered the same if you can rotate one to form the other.
Definition
- Class:
- FoxMakingDiceEasy
- Method:
- theCount
- Parameters:
- int, int
- Returns:
- int
- Method signature:
- int theCount(int N, int K)
- (be sure your method is public)
Notes
- The answer will always fit in a signed 32-bit integer.
Constraints
- N will be between 1 and 50, inclusive.
- K will be between 1 and 100, inclusive.
Examples
6
7
Returns: 2
You can make normal dice. There are two ways to arrange the numbers.
5
7
Returns: 0
You cannot make 6 sided dice with 5 numbers.
50
1
Returns: 105800
31
46
Returns: 504
10
10
Returns: 48
50
2
Returns: 105800
50
3
Returns: 105800
50
4
Returns: 105800
50
5
Returns: 105800
50
6
Returns: 105800
50
7
Returns: 105800
50
8
Returns: 105798
50
9
Returns: 105796
50
10
Returns: 105788
50
50
Returns: 59248
50
91
Returns: 40
50
92
Returns: 20
50
93
Returns: 12
50
94
Returns: 4
50
95
Returns: 2
50
96
Returns: 0
50
97
Returns: 0
50
98
Returns: 0
50
99
Returns: 0
50
100
Returns: 0
1
1
Returns: 0
2
1
Returns: 0
3
1
Returns: 0
4
1
Returns: 0
5
1
Returns: 0
6
1
Returns: 2
7
1
Returns: 6
8
1
Returns: 16
9
1
Returns: 32
10
1
Returns: 60
49
29
Returns: 93148
34
29
Returns: 16396
11
5
Returns: 100
38
16
Returns: 32736
21
23
Returns: 1080
10
15
Returns: 2
17
8
Returns: 894
44
61
Returns: 4732
9
5
Returns: 32
24
33
Returns: 392
23
17
Returns: 3350
23
21
Returns: 2790
46
86
Returns: 4
23
41
Returns: 2
15
19
Returns: 100
34
19
Returns: 19896
33
36
Returns: 7280
48
8
Returns: 89054
6
3
Returns: 2
34
5
Returns: 20400
16
49
Returns: 0
23
52
Returns: 0
3
4
Returns: 0
29
76
Returns: 0
38
74
Returns: 0
15
67
Returns: 0
36
69
Returns: 0
21
40
Returns: 0
41
95
Returns: 0
41
98
Returns: 0
45
30
Returns: 63028
20
1
Returns: 1920
49
3
Returns: 97152
49
48
Returns: 58190
50
30
Returns: 101068
42
75
Returns: 40
50
25
Returns: 103820
10
9
Returns: 56
1
10
Returns: 0