# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
143031 | Azert | Košnja (COCI17_kosnja) | C++14 | 23 ms | 1272 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int Q, m, n, res;
int main() {
scanf("%d", &Q);
while (Q--) {
scanf("%d%d", &m, &n);
int circle = min(m, n) / 2 + (min(m, n) % 2 != 0);
if (circle >= 2) res = (circle - 2) * 4 + ((min(n, m) % 2 == 0)? 3 : 1) + 3;
else {
res = (min(m, n) == 2)? 3 : 0;
}
printf("%d\n", res);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |