mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 00:08:47 +00:00
B - Coloring Rectangles
https://codeforces.com/contest/1589/submission/135364208
This commit is contained in:
parent
483d7ddd61
commit
0580173eee
15
CodeForces/1589/B/B.cpp
Normal file
15
CodeForces/1589/B/B.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user