You are given a 2D matrix, and you have to go from top-left to bottom-right. You can only move a cell right or a cell down in each step.
Find out how many paths are there to go from the starting cell to the ending cell.
Matrix Size: 2 rows, 3 columns
M00 M01 M02
M10 M11 M12
We have to go from M00 to M12.
M00 → M10 → M11 → M12 (Down, Right, Right)
M00 → M01 → M11 → M12 (Right, Down, Right)
M00 → M01 → M02 → M12 (Right, Right, Down)
The first line contains a number ‘T’ denoting the number of test cases.
For each test case, one line containing space separated numbers 'n' and ‘m’ denoting the number of rows and columns respectively.
For each test case, print a line with the count of all possible paths from top-left to bottom-right.
3
2 3
3 3
5 5
3
6
70
1 <= T <= 1000
1 <= m,n <= 20