#include <bits/stdc++.h>
using namespace std;
void solve(){
int n, m;
cin >> n >> m;
if (min(n, m) % 2)
cout << 4 * (min(n, m) / 2) << endl;
else
cout << 4 * (min(n, m) / 2) - 2 << endl;
}
int main(){
int t;
cin >> t;
while (t--)
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
43 ms |
468 KB |
Output is correct |
7 |
Correct |
66 ms |
608 KB |
Output is correct |
8 |
Correct |
46 ms |
592 KB |
Output is correct |
9 |
Correct |
67 ms |
592 KB |
Output is correct |
10 |
Correct |
60 ms |
592 KB |
Output is correct |