#include <iostream>
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    int t; cin >> t;
    while(t--)
    {
        int x,y;
        cin >> x >> y;
        cout << 2*max(x,y) - (min(x,y) != max(x,y)) << "\n";
    }
    return 0;
}
