////////////////////////    W H I T E C L O U D    ////////////////////////
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int main()
{
    FAST();
    ll t,a,b,ans;
    cin>>t;
    while(t--)
    {
        cin>>a>>b;
        if(a==b)ans=a+b;
        else ans=max(a,b)+max(a,b)-1;
        cout<<ans<<endl;

    }




    return 0;
}








