Count all possible paths from top left to bottom right
Submissions: 21826   Accuracy:

34.37%

  Difficulty: Easy   Marks: 2

The task 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: 
First line consists of T test cases. First line of every test case consists of N and M, denoting the number of rows and number of column respectively.

Output: 
Single line output i.e count of all the possible paths from top left to bottom right of a mXn matrix. Since output can be very large number use %10^9+7.

Constraints:
1<=T<=100
1<=N<=100
1<=M<=100

Example:
Input:

1
3 3
Output:
6

**For More Examples Use Expected Output**

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

Contributor: Anuj Chauhan
Author: anuj0503


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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

to report an issue on this page.