#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int k, n, m;
cin >> k;
for (int i = 1; i <= k; ++i){
cin >> n;
cin >> m;
cout << (min(n, m) - 1) * 2 << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
504 KB |
Output is correct |
2 |
Correct |
2 ms |
504 KB |
Output is correct |
3 |
Correct |
2 ms |
708 KB |
Output is correct |
4 |
Correct |
2 ms |
708 KB |
Output is correct |
5 |
Correct |
2 ms |
708 KB |
Output is correct |
6 |
Correct |
58 ms |
1168 KB |
Output is correct |
7 |
Correct |
83 ms |
2104 KB |
Output is correct |
8 |
Correct |
62 ms |
2412 KB |
Output is correct |
9 |
Correct |
87 ms |
3172 KB |
Output is correct |
10 |
Correct |
57 ms |
3520 KB |
Output is correct |