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

}
return 0;
} 
