#include <bits/stdc++.h>
using namespace std;


int main() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int  t;
	cin >> t;
	while(t--) {
		int x, y;
		cin >> x >> y;
		int max_ = max(x, y);
		if (x == y) cout << 2*x << endl;
		else cout << 2* max_ - 1 << endl;
	}

}
