BETA
School Problem's Submission isn't counted in score!

Total Submissions: 1640 Accuracy:

31.71%

nPr
     

Write a program to calculate nPr. nPr represents n permutation r and value of nPr is (n!) / (n-r)!.

Input: The first line of the input contains T denoting the number of testcases. First line of the test case will be the value of n and r respectively.
Output: For each test case output will be the value of nPr.
Constraints:
1<=T<=100
1 <=n,r<= 20
n>=r


Example:

Input:

2
2 1
10 4

Output:

2
5040

 

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.