#include<bits/stdc++.h>
using namespace std;
#define DEBUG 1
#define MEGA 1000000
#define KILO 1000

inline void iteration(){
    int x, y;
    cin>>x>>y;

    cout<<max(x,y) + (x == y ? x : max(x,y) - 1)<<endl;
}

void test(){
    int t;
    cin>>t;
    while(t--){
        iteration();
    }

}


int main(){
    test();

    return 0;
}
