Permutation Coefficient Assignment
You are given two numbers N and K. Your task is to find P(N, K). P(N, K) is the permutation coefficient given as P(N, K) = N! / (N - K)! where X! Is the product of first X natural number. Since this value may be large only find it modulo 10^9 + 7.
Input Format:
The first line of input contains an integer T denoting the number of test cases. The next T lines represent the T test cases. The first and only line of each test case contains two integers N and K.
Output Format:
For each test case, print a single line containing a single integer denoting the answer for that test case modulo 10^9 + 7. Print the output of each test case in a separate line.
Note:
You do not need to print anything, it has already been taken care of. Just implement the given function.
Constraints:
1 <= T <= 50 1 <= N <= 10000 0 <= K <= N Time Limit: 1 sec