BETA

Difficulty Level: Basic

Submissions: 4332 Accuracy:

56.53%

Number of paths
     

The problem is to count all the possible paths from top left to bottom right of a MxN matrix with the constraints that from each cell you can either move only to right or down.

Input:

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is M and N, M is number of rows and N is number of columns.

Output:

Print the number of paths.

Constraints:

1 ≤ T ≤ 30
1 ≤ M,N ≤ 10

Example:

Input
2
3 3
2 8

Output
6
8

 

** 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.