#K91927. Distinct Ways to Plant Flowers
Distinct Ways to Plant Flowers
Distinct Ways to Plant Flowers
You are given N distinct types of flowers and K distinct flower beds. Each flower bed must be planted with a unique flower. Your task is to compute the number of distinct ways to choose and arrange K flowers out of N flowers. This is equivalent to calculating the number of permutations, given by the formula: \( P(N, K) = \frac{N!}{(N-K)!} \) where \( N \ge K \).
inputFormat
The input is read from standard input (stdin). The first line contains an integer T, representing the number of test cases. Each of the following T lines contains two space-separated integers N and K.
outputFormat
For each test case, output the computed number P(N, K) on a new line to standard output (stdout).
## sample3
3 2
4 3
2 1
6
24
2
</p>