poj2992

maksyuki 发表于 oj 分类,标签:
0

Divisors

Your task in this problem is to determine the number of divisors of Cnk. Just for fun -- or do you need any special reason for such a useful computation?

Input

The input consists of several instances. Each instance consists of a single line containing two integers n and k (0 ≤ k ≤ n ≤ 431), separated by a single space.

Output

For each instance, output a line containing exactly one integer -- the number of distinct divisors of Cnk. For the input instances, this number does not exceed 263 - 1.

Sample Input

5 1

6 3

10 4

Sample Output

2

6

16

Source

CTU Open 2005

 

题目类型:阶乘素因子分解

算法分析:将440以内的阶乘的素因子求出来,使用f[i][j]表示阶乘i的素因子j的个数有多少个,然后对于每个n和k,计算f[n][i] - f[n-k][i] - f[k][i]表示组合(n,k)中素因子为i的指数个数,然后直接累乘起来