#include <bits/stdc++.h>
using namespace std;
int k;
int main(){
cin >> k;
while(k--){
int n, m;
cin >> n >> m;
cout << min(n - 1, m - 1) * 2<< '\n';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
90 ms |
1004 KB |
Output is correct |
7 |
Correct |
138 ms |
1260 KB |
Output is correct |
8 |
Correct |
96 ms |
1004 KB |
Output is correct |
9 |
Correct |
135 ms |
1516 KB |
Output is correct |
10 |
Correct |
94 ms |
1004 KB |
Output is correct |