mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-27 07:31:58 +00:00
16 lines
243 B
C++
16 lines
243 B
C++
|
#include <bits/stdc++.h>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int t, n, m, ans;
|
||
|
|
||
|
int main() {
|
||
|
cin >> t;
|
||
|
while (t--) {
|
||
|
cin >> n >> m;
|
||
|
ans = (n * m) / 3;
|
||
|
cout << ans + !(n % 3 == 0 || m % 3 == 0) << endl;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|