Easy Math > Combinations and Permutations

In a city like New York, the roads are arrange in grid like pattern. Roads are also arranged in one way direction and you can only move right or down and never left or up. One such travel from point A to point B can be illustrated in the following picture: ![enter image description here][1] So we can see it took 11 steps to reach from point A to point B. However in our problem today, we will like to find out in how many ways we can reach from point A to point B. Input: ------ Input starts with an integer **T (1<= T <=100)**, denoting the number of test cases. Each case contains two integers **X (3 ≤ X ≤ 15)** and **Y (3 ≤ Y ≤ 15)** denoting the width and height of the grid. Output: ------- For each case of input, output the one integer **R** in a line, denoting the result - number of possible ways to reach B from A, where A is topmost and leftmost point in the grid and B is the bottom most and rightmost point in the grid. Sample Input ------------ 2 6 5 4 4 Sample Output ------------- 462 70 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/47ee783a-b6f1-c245-8448-08d34fbf5585_ee68b0c85e324c16b64640496b141deb_W351xH293.png

MD. Jalal Uddin