当前位置: 代码迷 >> Java Web开发 >> 大数问题
  详细解决方案

大数问题

热度:231   发布时间:2006-10-21 14:30:21.0
大数问题

Lazy girl
Time Limit : 1 seconds Memory Limit : 10MB

Tracy and her classmates are learning combinatory. Today’s homework is to calculate some equation like. Tracy is a lazy girl, so she decides to calculate them with computer. Suppose you are the computer, then what’s the answer?


Input:

The input file contains several test cases. For each test case:
There’s only one line containing two integers n (n>=1) and k (0<=k<=n). Input is terminated by two zeroes for n and k.

Output:

For each test case, print one line containing the required number. This number will always fit into an 64-bit integer, i.e. it will be less than 263.

Sample Input:

4 2
10 5
49 6
0 0
Sample Output:

6
252
13983816


----------------解决方案--------------------------------------------------------
  相关解决方案