#include<bits/stdc++.h>
using namespace std;


void solve(){
	int x,y  ;
	cin>>x>>y  ;
	int x1 = x , y1 = y ;
	int cnt = 0 ;
	cnt += min(x,y)*2 ;
	int mina = min(x,y);
	x -= mina ; 
	y -= mina ;
	
	if(x !=0)
		cnt += (x*2 - 1);
	else if(y!=0)
		cnt += (y*2 - 1);
	cout<<cnt<<endl;
    		
}


int main()
{
    int t;
    cin>>t;
    while(t--)
    {
    	solve();
    }
    return 0;
}