0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 02:08:48 +00:00

B - Coloring Rectangles

https://codeforces.com/contest/1589/submission/135364208
This commit is contained in:
Baoshuo Ren 2021-11-14 14:48:58 +08:00 committed by Baoshuo Ren
parent 483d7ddd61
commit 0580173eee
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

15
CodeForces/1589/B/B.cpp Normal file
View File

@ -0,0 +1,15 @@
#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;
}