#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll unsigned long long int
#define tinput int t; cin>>t; while(t--)
#define rep(i,n,s) for((i)=(s); (i)<(n); (i)++)

template <typename T>
T getmini(T x, T y) { return (x<y)?x:y; }
template <typename T>
T getmaxi(T x, T y) { return (x>y)?x:y; }

int main(){
    #ifndef ONLINE_JUDGE
    freopen("b_input.txt", "r", stdin);  freopen("b_output.txt", "w", stdout);
    #endif
    boost;
    
    tinput {
    	int x, y;
    	cin>>x>>y;
    	int ans = x+y;
    	if(abs(x-y)>1) {
    		ans = ans + abs(x-y) - 1;
    	}
    	cout<<ans<<endl;
    }

    return 0;
}