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

Language |
Time Limit (seconds) |

C | 1.00 |

C++ | 1.00 |

C++14 | 1.00 |

C# | 2.00 |

Go | 2.00 |

Java | 2.00 |

JavaScript | 2.00 |

Objective-C | 2.00 |

Perl | 2.00 |

PHP | 2.00 |

Python | 2.00 |

Python3 | 2.00 |

Ruby | 2.00 |

VB.Net | 2.00 |

Solve/Submission

# | User | Language | Timing |
---|---|---|---|

01 | ash12 | Cpp14 | 0.00s |

02 | MAHRahat | Cpp14 | 0.00s |

03 | seyedssz | Cpp14 | 0.00s |

04 | sadia2427 | Cpp14 | 0.00s |

05 | 7Mahfuz | Cpp14 | 0.00s |

06 | nazmul_bzs | Cpp14 | 0.00s |

07 | SakibAlamin | Cpp14 | 0.00s |

08 | nasir_32_15 | Cpp14 | 0.00s |

09 | smriad | Cpp14 | 0.00s |

10 | pulak_ict_mbstu | Cpp | 0.00s |

11 | Morass | Cpp14 | 0.00s |

12 | feodorv | C | 0.00s |

13 | Robbinb1993 | Cpp | 0.00s |

14 | wizard | Cpp | 0.00s |

15 | uzzal_rahman | Cpp | 0.00s |

16 | prateepm | Cpp14 | 0.00s |

17 | tariqiitju | Cpp | 0.00s |

18 | ikaadil | Cpp | 0.00s |

19 | Zeerin | Cpp | 0.00s |

20 | Bruteforcekid | Cpp | 0.00s |

21 | abdulmukit | Cpp | 0.00s |

22 | mahmud2690 | Cpp | 0.01s |

23 | keiuom | CSharp | 0.01s |

24 | mahbub07 | Cpp14 | 0.01s |

25 | i_love_nikita_gautam | Cpp14 | 0.01s |

26 | nhamtan | Cpp | 0.01s |

27 | shawon100 | Cpp | 0.01s |

28 | _dipu | Cpp14 | 0.01s |

29 | emrul | Cpp14 | 0.01s |

30 | rayhan50001 | Cpp14 | 0.01s |

31 | akbor | CSharp | 0.02s |

32 | anower | CSharp | 0.02s |

33 | shahed_iu | CSharp | 0.02s |

34 | masba | Python | 0.02s |

35 | Taj025 | CSharp | 0.02s |

36 | king_of_sun | Cpp14 | 0.02s |

37 | noyonhossen | CSharp | 0.02s |

38 | rabbicse | CSharp | 0.03s |

39 | joy25896 | Cpp14 | 0.03s |

40 | ICT_backbencher | CSharp | 0.05s |

41 | haasib | Cpp14 | 0.07s |

42 | Ishrak | Cpp14 | 0.08s |

43 | jahirtheboss | Cpp14 | 0.09s |

44 | RandyWaterhouse | Python3 | 0.15s |

45 | ImagineWarrior | Cpp14 | 0.21s |

46 | bhagyo | Cpp14 | 0.33s |

47 | AngelVlza99 | Cpp14 | 0.34s |

48 | mamun4122 | Cpp14 | 0.36s |

49 | rajdipsaha | Cpp14 | 0.39s |

50 | njrafi | Cpp14 | 0.39s |

Copyright © 2015-2016 Dev Skill.

Feedback
#### Your feedback is our precious!

## Thank you for providing feedback! Our developers will be happy :)

## Sorry there was a problem when submitting the feedback. Please try again. :(