#include<bits/stdc++.h>
#define x first
#define y second
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mem(x,val) memset(x,val,sizeof x)
#define pii pair<int,int>
#define pb emplace_back
#define ar array
#define int long long
#define wopen(x) freopen((x),"w",stdout)
#define ropen(x) freopen((x),"r",stdin)
using namespace std;
bitset<10005> s;
int n, c0, c1, h, o, z;
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int T, x, y;
    cin>>T;
    while(T--){
        cin>>x>>y;
        if(abs(x-y) <= 1)
            cout<<x+y<<'\n';
        else {
            int t = x + y + abs(x - y) - 1;
            cout<<t<<'\n';
        }
    }
}
