ZL's Prob.1

发布时间: 2017年6月19日 00:24   时间限制: 1000ms   内存限制: 128M

It is said that the Martian are going to have a competition with us.
They give us N kinds of different characters(not just letters), and a number K, we have an expression f which is equal as (c1+c2+c3+……+cn)^k. [ci is one of the giving characters]. 
Now, what they want to know is number of different terms after f is expanded; do help the earth.

There are muliply test cases;
for each test case,
there is only a line contains the two natural numbers N and K separated by blanks. As you can observe, N and K are both at least 1.

For each test case there is a line contains an answer.
You may safely assume that each answer fits into a 64-bit unsigned integer.

复制
3 4
15

f = (c1+c2+c3)^4 = c1^4 + c2^4 + c3^4 + 4*c1^3*c2 + 4*c1^3*c3 + 4*c2^3*c3 + 4*c2^3*c1 + 4*c3^3*c1 + 4*c3^3*c2 + 6*c1^2*c2^2 + 6*c2^2*c3^2 + 6*c3^2*c1^2 + 4*c1*c2*c3^2 + 4*c1*c2^2*c3 + 4*c1^2*c2*c3
so the total number of the expansion is 15.

1721

old_judge

old_judge_None