#include <iostream>
#include <bits/stdc++.h>

using namespace std;

#define ll long long int
#define ld long double
#define MAX 105
#define MOD 998244353
#define INF 1e15
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi 3.14159265358979323846
#define Q ll MAXTEST; cin >> MAXTEST; for(ll TEST=1;TEST<=MAXTEST;TEST++)
#define endl "\n"
#define coutyes cout << "Yes\n";
#define coutno cout << "No\n";
#define flush fflush(stdout);
#define fixedprec cout << fixed << setprecision(18);

int main(){

    fast

    Q{
        ll a,b;
        cin >> a >> b;
        if(a==b){
            cout << a+b << endl;
        }
        else{
            cout << max(a,b)*2 - 1 << endl;
        }
    }

}
