Statistics

Problem Statement for "FoxMakingDiceEasy"

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

  1. 6

    7

    Returns: 2

    You can make normal dice. There are two ways to arrange the numbers.

  2. 5

    7

    Returns: 0

    You cannot make 6 sided dice with 5 numbers.

  3. 50

    1

    Returns: 105800

  4. 31

    46

    Returns: 504

  5. 10

    10

    Returns: 48

  6. 50

    2

    Returns: 105800

  7. 50

    3

    Returns: 105800

  8. 50

    4

    Returns: 105800

  9. 50

    5

    Returns: 105800

  10. 50

    6

    Returns: 105800

  11. 50

    7

    Returns: 105800

  12. 50

    8

    Returns: 105798

  13. 50

    9

    Returns: 105796

  14. 50

    10

    Returns: 105788

  15. 50

    50

    Returns: 59248

  16. 50

    91

    Returns: 40

  17. 50

    92

    Returns: 20

  18. 50

    93

    Returns: 12

  19. 50

    94

    Returns: 4

  20. 50

    95

    Returns: 2

  21. 50

    96

    Returns: 0

  22. 50

    97

    Returns: 0

  23. 50

    98

    Returns: 0

  24. 50

    99

    Returns: 0

  25. 50

    100

    Returns: 0

  26. 1

    1

    Returns: 0

  27. 2

    1

    Returns: 0

  28. 3

    1

    Returns: 0

  29. 4

    1

    Returns: 0

  30. 5

    1

    Returns: 0

  31. 6

    1

    Returns: 2

  32. 7

    1

    Returns: 6

  33. 8

    1

    Returns: 16

  34. 9

    1

    Returns: 32

  35. 10

    1

    Returns: 60

  36. 49

    29

    Returns: 93148

  37. 34

    29

    Returns: 16396

  38. 11

    5

    Returns: 100

  39. 38

    16

    Returns: 32736

  40. 21

    23

    Returns: 1080

  41. 10

    15

    Returns: 2

  42. 17

    8

    Returns: 894

  43. 44

    61

    Returns: 4732

  44. 9

    5

    Returns: 32

  45. 24

    33

    Returns: 392

  46. 23

    17

    Returns: 3350

  47. 23

    21

    Returns: 2790

  48. 46

    86

    Returns: 4

  49. 23

    41

    Returns: 2

  50. 15

    19

    Returns: 100

  51. 34

    19

    Returns: 19896

  52. 33

    36

    Returns: 7280

  53. 48

    8

    Returns: 89054

  54. 6

    3

    Returns: 2

  55. 34

    5

    Returns: 20400

  56. 16

    49

    Returns: 0

  57. 23

    52

    Returns: 0

  58. 3

    4

    Returns: 0

  59. 29

    76

    Returns: 0

  60. 38

    74

    Returns: 0

  61. 15

    67

    Returns: 0

  62. 36

    69

    Returns: 0

  63. 21

    40

    Returns: 0

  64. 41

    95

    Returns: 0

  65. 41

    98

    Returns: 0

  66. 45

    30

    Returns: 63028

  67. 20

    1

    Returns: 1920

  68. 49

    3

    Returns: 97152

  69. 49

    48

    Returns: 58190

  70. 50

    30

    Returns: 101068

  71. 42

    75

    Returns: 40

  72. 50

    25

    Returns: 103820

  73. 10

    9

    Returns: 56

  74. 1

    10

    Returns: 0


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: