//SKD
// 16 32 108
#include<bits/stdc++.h>
#define ll long long int
#define pp push_back
#define pi 2*acos(0.0)
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout<<fixed;
    cout<<setprecision(9);
    ll m,p=2e9,k=-1,l,q,r,j=0,t,n,i;
    cin>>l;
    while(l--)
    {
        cin>>n>>m;
        if(n==m)cout<<n+m<<endl;
        else if(n>=m)cout<<2*n-1<<endl;
        else cout<<2*m-1<<endl;
    }
}
