#include<bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define PI 2*acos(0.0)
#define mod 1e09+7
typedef long long lld;
using namespace std;

int main()
{
    fastIO
    int t,in,i;
    cin>>t;
    for(in=0;in<t;in++)
    {
        int a,b;
        cin>>a>>b;
        if(a==b)
            cout<<2*a<<endl;
        else
            cout<<(2*max(a,b))-1<<endl;
    }
    return 0;
}
