#include<bits/stdc++.h>
#define ll long long
#define ms(x,a) memset(x,a,sizeof(x))
using namespace std;

int main()
{
    int t;
    scanf("%d",&t);
    for(int ca = 1;ca <= t; ++ca){
        int x,y;
        scanf("%d%d",&x,&y);
        if(x < y)swap(x,y);
        int ans;
        if(x == y){
            ans = x + y;
        }
        else {
            ans = x * 2 - 1;
        }
        printf("%d\n",ans);
    }
    return 0;
}