#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t, x, y,ans;
    cin>>t;
    for(int i=0; i<t; i++){
        cin>>x>>y;
        if(x != y){
            if(x > y){
                ans = 2*x - 1;
            }
            else {
                ans = 2*y - 1;
            }
        }
        if(x == y)ans = x+y;
        cout<<ans<<endl;
    }
    return 0;
}