#include<iostream>
#include<stdio.h>
using namespace std;
 int main()
{long int max,x,y,t;
cin>>t;

 while(t--)
{   cin>>x>>y;
    if(x==y)
    {cout<<2*x<<endl;
    continue;
           
        
    }
    max=x;
    
    if(x<y)
    {
        max=y;
    }
    cout<<2*max-1<<endl;
    
}
    return 0;

}