Unique Paths

1000ms    65536K
6    1
Easier

Description

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).

The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).

How many possible unique paths are there?

Above is a 3 x 7 grid. How many possible unique paths are there?

Input

There are multipe test cases.

The first line contain a positive integer K. means there are K test cases.

Following N lines, for each line contains two positive integer M and N. ( 1<= M<=100, 2<=N<=100 )

Output

For each test case output the number of possible unique paths.

Sample Input

2
2 9 
3 7

Sample Output

9
28

Hint

unsigned long long will be able to hold the result.

Source

Editor

keefo on 2017-10-17 02:44:33


North University of China

OnlineJudge

NUC

NOJ

OJ

ACM/ICPC