题目描述
Tejas has invited the Clash Team for a Dinner Party. He places V empty plates (numbered from 1 to V inclusive) in a straight line on a table. He has prepared 2 kinds of Delicious Dishes named dish A and dish B.
He has exactly V servings of Dish A and W servings of dish B.
Now he wants to serve the dishes in such a way that if theith plate has serving of Dish A then (i-1)th plate should not have serving of Dish B. Assuming all the Dishes are identical find number of ways Tejas can serve the Clash Team.
-----Input-----
- The first line of the input contains an integer T denoting the number of test cases . The description of T testcases follow.
- The first line of each test case contains two space seperated integers V W .
-----Output-----
For each test case, output the number of ways Tejas can serve the Clash Team.
-----Constraints-----
- 1 ≤ T ≤ 100
- 1 ≤ V ≤ 1000
- 1 ≤ W ≤ 1000
-----Example-----
Input:
1
3 3
Output:
4
-----Explanation-----
In the above example the 4 ways are:
AAA
AAB
ABB
BBB
输入格式
见题面
输出格式
见题面