#include<bits/stdc++.h>
#define int long long
#define rep(i, a, b) for(int i = a; i <= b ; ++i)
#define per(i, a, b) for(int i = b ; i >= a  ; --i)

using namespace std;

signed main()
{
	int t;cin>>t;
	while(t--)
	{
		int x,y;cin>>x>>y;
		int ans=min(x,y)*2;
		if(max(x,y)>min(x,y))ans+=2*(max(x,y)-min(x,y))-1;
		cout<<ans<<endl;
	}
	
	return 0;
}