#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int x,y;
        cin>>x>>y;
        
        int count =0;
        while(x>0&&y>0)
        {
            x--;
            y--;
            count+=2;
        }
        if(x!=0||y!=0)
        count =count+2*max(x,y)-1;
        cout<<count<<'\n';
    }
}