Forgot Password ?
New password will be sent to following email id
Number of Paths 1
Problem Code : PATH1
3 1 5 2 2 3 3
1 2 6
Time Limit :
C , C++ , Java , Python 2
Login to submit your response.
Given a grid of dimensions <b>N × M</b>. Buddy is standing at location <b>(1, 1)</b> (top most left corner) and he needs to reach at location <b>(N, M)</b> (bottom most right corner). If Buddy's current location is <b>(i, j)</b> then he is allowed to move either in right direction, i.e. <b>(i, j+1)</b>, or in down direction, i.e. <b>(i+1, j)</b>. Buddy is not allowed to move outside the grid. Print total number of ways in which Buddy can reach at location <b>(N, M)</b> modulo 10<sup>9</sup>+7.
First line contains an integer integer <b>T</b> denoting number of test cases.<br> Next <b>T</b> line contains two integers <b>N</b> and <b>M</b> respectively.
For each test case print required answer in new line.
1 ≤ <b>T</b> ≤ 1000<br> 1 ≤ <b>N, M</b> ≤ 2000