#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{

    fastIO
    int t;
    cin>>t;
    while(t--)
    {
        int x,y;
        cin>>x>>y;

        if (x==y)
             cout<<x+y<<"\n";
        else 
             cout<<max(x,y)*2-1<<"\n";

    }















}
