#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t,x,y,z,a,b,c,s;
    cin>>t;
    while(t--)
    {
        cin>>x>>y;
        if(x==y)
        {
            cout<<x*2<<endl;
        }
        else if(x==0&&y==0)
        {
            cout<<"0"<<endl;
        }
        else
        {
            if(x<y) {a=y;}
            else {a=x;}
            s=(a*2)-1;
            cout<<s<<endl;
        }
    }
    return 0;

}
