|
|||
CombinationsComputing the exact number of ways that N things can be taken M at a time can be a great challenge when N and/or M becomes very large. Challenges are the stuff of contests. Therefore, you are to make just such a computation given the following: Given 5 ≤ N ≤ 100 and 5 ≤ M ≤ 100 and M ≤ N, compute the exact value of C = N! / ((N – M)! · M!).
You may assume that the final value of C will fit in a 32-bit signed integer
(Pascal: For the record, the exact value of 100! is:
Input SpecificationThe input to this program will be one or more lines, each containing zero or more leading spaces, a value for N, one or more spaces, and a value for M. The last line of the input will contain a dummy (N, M) pair, with both values equal to zero. Your program should terminate when this line is read. Output SpecificationThe output for each test case should be in the form:
Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |