//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
// kuch ni ho rha to kya pta binary search ho
// Be carefull while sorting 1 based indexing array or vector
// #define long long ll
// during inclusion and exclusion the sign is decided by the count of set bits
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PI 3.14159265358979323846264338327950L
#define MOD 1000000007
#define sz 100005
ll inf = 1e18;
ll power(ll x, ll n, ll mod)
{
  ll res = 1;
  x %= mod;
  while (n)
  {
    if (n & 1)
      res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res%mod;
}
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("error.txt", "w", stderr); 
  freopen("output.txt", "w", stdout);
  #endif
  ll t;
  cin>>t;
  while(t--)
  {
    ll x,y;
    cin>>x>>y;
    ll k=0;
    if(abs(y-x)>=1)
      k=abs(y-x)-1;
    cout<<(x+y+k)<<'\n';
  }
  return 0;
}