#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
//#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5+5;
const int inf = 0x3f3f3f3f;
const ll INF = 1e18;
const ll mod = 998244353;

#define for1(i,n) for(int i=1;i<=n;i++)
#define forn(i,n) for(int i=0;i<n;i++)
#define m_p(x,y) make_pair(x,y)

inline int read(){//ll??
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}

int main(){
	int t=read(); while(t--){
		int x=read(), y=read();
		if(abs(x-y)<=1) cout << x+y << endl;
		else cout << x+y+abs(x-y)-1 << endl;
	}
    return 0;
}
