The number of combinations from N to K
Problem
Non-negative integers n and k are given. It is necessary to output the number of combinations of n by k.
The formula for the number of combinations (you must remember that 0! = 1):
\(C^k_n=\frac{n!}{k!(n-k)!}\)
Input: integers n and k, each from a new line (each number is not more than 10,
\(n >= k\))
Output: need to print one number in response
Example
№ |
Input |
Output |
1 |
3
2 |
3 |
2 |
4
4 |
1 |