#C642. Count Robot Construction Ways
Count Robot Construction Ways
Count Robot Construction Ways
Geppetto wants to build a robot using exactly k distinct components selected from n available components. Although each component comes with a given quantity, these quantities are irrelevant for the purpose of selection. You need to determine the number of ways to choose these k components from n, which is given by the combination formula: $$\binom{n}{k}$$. Note that if \(k > n\), the answer is 0.
inputFormat
The first line contains an integer t denoting the number of test cases. For each test case, the first line contains two integers n and k. The next line contains n space-separated integers representing the quantities for each component (these values are not used in the calculation).
outputFormat
For each test case, output a single line which is the number of ways to choose k components from n.## sample
2
4 2
1 2 3 4
5 3
3 3 3 3 3
6
10
</p>