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

Starter code:

Solutions:
# cook your dish here
t=int(input())
for i in range(t):
    v,w=list(map(int,input().strip().split(" ")))
    if v==w:
        print(v+1)
    elif v<w:
        print(v+1)
    else:
        print(w+1)
        #s="a"
        #s=s*v
        #l=list(s)
        #print(l)
        ct=0
        #for i in range(w):


t=int(input())
for x in range(t):
	v,w=input().split()
	v=int(v)
	w=int(w)
	if(w>v):
		l=v+1
	else:
		l=w+1
	print(l)


T = int(input())
for t in range(T):
    V,W = [int(x) for x in input().split()]
    print(min(V,W)+1)

t=int(input())
m=0
h=[]
for d in range(1,t+1):
	u=input()
	u=u.split(" ")
	a=int(u[0])
	b=int(u[1])
	v=a
	if (b>=a):
		m=a+1
	else:
		m=b+1
	h.append(m)
for i in h:
    print(i)


t = int(input())
ans = []
for _ in range(t):
	u , v = list(map(int,input().split()))
	ans.append(min(u,v)+1)
for i in ans:
	print(i)

def main():
	t=int(input())
	while t>0:
		v,w=map(int,input().split())
		i=v
		j=0
		count=0
		while i>=0 and j<=w:
			i-=1
			j+=1
			count+=1
		print(count)
		t-=1
main()

t = int(input().strip())
for _ in range(t):
	v, w = tuple(map(int, input().strip().split()))
	print(min(w+1,v+1))

nb_tests = int(input())
for _ in range(nb_tests):
    a, b = [int(x) for x in input().split()]
    if a <= b:
        print(a + 1)
    else:
    	print(b+1)    

for _ in range(int(input())):
	v,w=list(map(int,input().split()))
	print(min(w,v)+1)


for _ in range(int(input())):
  v,w=map(int,input().split())
  print(min(v,w)+1)

for _ in range(int(input())):
    v,w = map(int,input().split())
    if v is w :
        print(w+1)
    elif w>v:
        print(v+1)
    else:
        print(w+1)

a=int(input())
for i in range(a):
	b=[int(x) for x in input().split()]
	c=0
	if b[0]>=b[1]:
		print(b[1]+1)
	if b[0]<b[1]:
		print(b[0]+1)
	


for _ in range(int(input())):
    v, w = map(int, input().split())
    print(min(v, w) + 1)

t=int(input())
while(t>0):
    v,w=list(map(int,input().split()))
    if(w<v):
        print(w+1)
    else:
        print(v+1)
    t=t-1


try:
    t = int(input())
    while(t):
        a,b = map(int,input().split())
        if (a>b):
            res = b+1
        elif (a<=b):
            res = a+1
        print(res)
        t-=1
except:
    pass

t=int(input())
for i in range(t):
    v,w=map(int,input().strip().split())
    count=1
    if(w>v):
        w=v
    count=count+w
    print(count)

t=int(input())
for _ in range(t):
    v,w=map(int,input().split())
    max_p=v+1
    if w<v:
        max_p=max_p-(v-w)
    print(max_p)

t = int(input())
for _ in range(t):
    v,w = map(int,input().split())
    ans = min(v,w)
    print(ans+1)

for _ in range(int(input())):
    v,w=list(map(int,input().split()))
    print(min(v,w)+1)


t=int(input())
for _ in range(t):
	v,w=list(map(int,input().split()))
	print(min(v,w)+1)


t=int(input())
for _ in range(t):
    v,w=list(map(int,input().split()))
    if w>=v:
        print(v+1)
    else:
        print(w+1)
            


t=int(input())
for z in range (t):
	v,w=map(int,input().split())
	
	if(w>=v):
		print(v+1)

	else:
		print(w+1)

for _ in range(int(input())):
    a , b = list(map(int, input().split()))
    if b > a:
        b = a
    print(b + 1)


for t in range(int(input())):
    v,w=map(int,input().split())
    if v<w:
        print(1+v)
    else:
        print(1+w)