#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n, m;
cin >> n >> m;
n = min(n, m);
if(n % 2)
cout << (n / 2) * 4 << endl;
else
cout << (n / 2) * 4 - 2 << endl;
}
return 0;
}
/*
*/
# |
결과 |
실행 시간 |
메모리 |
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 |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
44 ms |
524 KB |
Output is correct |
7 |
Correct |
65 ms |
596 KB |
Output is correct |
8 |
Correct |
45 ms |
596 KB |
Output is correct |
9 |
Correct |
70 ms |
596 KB |
Output is correct |
10 |
Correct |
45 ms |
592 KB |
Output is correct |