#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
int n, m;
cin >> n >> m;
cout << (min(n, m) - 1) * 2 << '\n';
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
6 ms |
1000 KB |
Output is correct |
7 |
Correct |
9 ms |
1372 KB |
Output is correct |
8 |
Correct |
7 ms |
860 KB |
Output is correct |
9 |
Correct |
13 ms |
1524 KB |
Output is correct |
10 |
Correct |
6 ms |
860 KB |
Output is correct |