#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mk make_pair
using namespace std;
const int N=1e5+100;


int main(){
    int t;
    cin >> t;
    while(t--){
        int x,y;
        cin >> x >> y;
        int b=min(x,y);
        int a=max(x,y);
        int c = x+y;
        int e = max((a-b-1) , 0);
        cout << e+c << "\n";

    }
}
