#include<bits/stdc++.h>
using namespace std;
signed main() {
//freopen("a.in", "r", stdin);
//freopen("a.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0);
int K;
cin >> K;
for(int i = 0; i < K; i++) {
int N, M;
cin >> N >> M;
cout << (min(N-1, M-1))*2<<'\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
320 KB |
Output is correct |
6 |
Correct |
20 ms |
976 KB |
Output is correct |
7 |
Correct |
12 ms |
1232 KB |
Output is correct |
8 |
Correct |
9 ms |
852 KB |
Output is correct |
9 |
Correct |
19 ms |
1260 KB |
Output is correct |
10 |
Correct |
32 ms |
852 KB |
Output is correct |