Statistics

Problem Statement for "MegaFactorialDiv2"

Problem Statement

The factorial of the k-th order of a number n is denoted n!k and defined by the following recurrences:
1) n!k = n!(k-1) * (n-1)!k for n > 0 and k > 0
2) n!k = 1 for n = 0
3) n!k = n for k = 0

For example, 7!1 = 7! (the traditional factorial), and 5!3 = 5!2 * 4!3 = (5!1 * 4!2) * 4!3.

You are given ints N and K. Compute the number of distinct divisors of the number N!K. Return the computed number modulo 1,000,000,009.

Definition

Class:
MegaFactorialDiv2
Method:
countDivisors
Parameters:
int, int
Returns:
int
Method signature:
int countDivisors(int N, int K)
(be sure your method is public)

Constraints

  • N will be between 1 and 1000, inclusive.
  • K will be between 1 and 100, inclusive.

Examples

  1. 3

    1

    Returns: 4

    3!1 = 3! = 6. The divisors of 6 are 1, 2, 3 and 6.

  2. 3

    2

    Returns: 6

    3!2 = 3!1 * 2!2 = 3! * 2!1 * 1!2 = 3! * 2! * 1!1 * 0!2 = 3! * 2! * 1! * 1 = 12. The divisors of 12 are 1, 2, 3, 4, 6 and 12.

  3. 4

    2

    Returns: 18

    4!2 is equal to 288.

  4. 6

    3

    Returns: 1392

  5. 100

    2

    Returns: 321266186

  6. 1000

    100

    Returns: 563680238

  7. 1000

    99

    Returns: 120360682

  8. 999

    100

    Returns: 229950717

  9. 1000

    1

    Returns: 791569763

  10. 123

    5

    Returns: 711693974

  11. 16

    8

    Returns: 665824235

  12. 1

    100

    Returns: 1

  13. 2

    100

    Returns: 2

  14. 6

    100

    Returns: 504967422

  15. 77

    11

    Returns: 61095262

  16. 776

    100

    Returns: 507387576

  17. 34

    69

    Returns: 867486552

  18. 333

    92

    Returns: 904299389

  19. 600

    50

    Returns: 606324195

  20. 716

    2

    Returns: 357035145

  21. 26

    96

    Returns: 901034209

  22. 12

    51

    Returns: 958733909

  23. 559

    83

    Returns: 541310848

  24. 874

    10

    Returns: 510549782

  25. 991

    60

    Returns: 204007016

  26. 300

    5

    Returns: 253539462

  27. 256

    2

    Returns: 872280411

  28. 256

    88

    Returns: 812667610

  29. 121

    37

    Returns: 760361028

  30. 137

    42

    Returns: 530106839

  31. 991

    64

    Returns: 370517844

  32. 803

    36

    Returns: 32916280

  33. 601

    92

    Returns: 993771158

  34. 601

    93

    Returns: 497645458

  35. 99

    86

    Returns: 897269756

  36. 25

    65

    Returns: 543318752

  37. 625

    84

    Returns: 183947240

  38. 237

    85

    Returns: 653821265

  39. 2

    2

    Returns: 2

  40. 1

    5

    Returns: 1

  41. 1

    1

    Returns: 1

  42. 997

    3

    Returns: 583304361

  43. 983

    43

    Returns: 860959367

  44. 100

    100

    Returns: 799296769

  45. 1000

    95

    Returns: 206248228

  46. 999

    99

    Returns: 435472594

  47. 555

    79

    Returns: 217580815

  48. 999

    3

    Returns: 831168277

  49. 1000

    10

    Returns: 999691632

  50. 10

    5

    Returns: 954492407

  51. 10

    1

    Returns: 270


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: