#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int x,y;
		cin>>x>>y;
		int mx = max(x,y);
		int my = min(x,y);
		if(mx == my)
		cout<<mx+my<<endl;
		else{
			int sum = 0;
			sum = 2*my + 2*(mx - my) - 1; 
			cout<<sum<<endl;
		}
	}
	return 0;
}