Today is rose day, batch mates of Kabir and Tara decided to celebrate this day by exchanging roses with each other. 
Note:$Note:$ exchanging means both the boy and the girl will give rose to each other. 
In the class there are B$B$ boys and G$G$ girls. 
Exchange of rose will take place if and only if at least one of them hasn't received a rose from anyone else and a rose can be exchanged only once.
Tara has to bring maximum sufficient roses for everyone and is confused as she don't know how many roses to buy.You are a friend of Kabir, so help him to solve the problem so that he can impress Tara by helping her. 

-----Input:-----
- First line will contain T$T$, number of test cases. 
- Each test case contains two space separated integers B$B$ (Number of boys) and  G$G$ (Number of Girls).

-----Output:-----
For each test case, output in a single line the total number of roses exchanged.

-----Constraints:-----
- 1≤T≤105$1 \leq T \leq 10^5$
- 1≤B≤109$1 \leq B \leq 10^{9}$
- 1≤G≤109$1 \leq G \leq 10^{9}$

-----Sample Input:-----
1
2 3

-----Sample Output:-----
8

Difficulty: interview

Starter code:

Solutions:
for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

# cook your dish here
t=int(input())
while(t>0):
    b,g=input().split()
    b=int(b)
    g=int(g)
    ans=(abs(b+g)-1)*2
    print(ans)
    
    t=t-1

nn=int(input())
for i in range(nn):
    l=list(map(int,input().split()))
    b=l[0]
    g=l[1]
    m=max(g,b)
    mi=min(g,b)
    s=0
    s+=m*2
    s+=(mi-1)*2
    print(s)

for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))


for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))


# cook your dish here
t=int(input())
i=0
while(i!=t):
    lst=list(map(int,input().split()))
    B=lst[0]
    G=lst[1]
    result=max(B,G)*2 + (min(B,G)-1)*2
    print(result)
    i+=1



# cook your dish here
for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

# cook your dish here
for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

# cook your dish here
for j in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

s = 0
for m in range(int(input())):
	s = s + 1
	print(2*(sum(list(map(int, input().split())))-1))

# cook your dish here
t=int(input())
while(t>0):
    b,g=input().split()
    b=int(b)
    g=int(g)
    ans=(abs(b+g)-1)*2
    print(ans)
    
    t=t-1

n=int(input())
for i in range(n):
    l1=list(map(int,input().split()))
    b=min(l1[0],l1[1])
    g=max(l1[0],l1[1])
    sum1=g*2+(b-1)*2
    print(sum1)
    
    


# cook your dish here
def __starting_point():
    for _ in range(int(input())):
        b, g = map(int, input().split())
        print(2*(g+b-1))
__starting_point()

# cook your dish here
for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

t = int(input())
roses = 0
for i in range(t):
    B,G= list(map(int,input().split()))
    roses = 2*G + 2*(B -1)
    print(roses)



# cook your dish here
for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

# cook your dish here
# cook your dish here
for i in range(int(input())):
    a,b=list(map(int,input().split()))
    if a==b:
        print(a*b)
    else:
        print((a+b-1)*2)


for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))


for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

t=int(input())
for _ in range(t):
	x,y=list(map(int,input().split()))
	pos=y*2
	pos1=(x-1)*2
	print(pos+pos1)


import math
for _ in range(int(input())):
    a,b=map(int,input().split())
    if a==b:
        print(a*a)
    else:
        
        print((a+b-1)*2)

# cook your dish here
for i in range(int(input())):
    print(2*(sum(list(map(int, input().split())))-1))

import math
for _ in range(int(input())):
    a,b=map(int,input().split())
    if a==b:
        print(a*a)
    else:
        
        print((a+b-1)*2)

# cook your dish here
import math
for _ in range(int(input())):
    n,m=map(int,input().split())
    print((n+m-1)*2)