#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
  
 ll t;
 cin>>t;
 while(t--)
 {
    ll x,y;
    cin>>x>>y;
    if(x==y)
    {
        cout<<x+y<<"\n";
    }
    else
    {
        cout<<2*max(x,y)-1<<"\n";
    }
 }
	return 0;
}
