标签:space tin include code ace pac nbsp tick namespace
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long int main() { int T, r, c; scanf("%d", &T); while (T--) { scanf("%d %d", &r, &c); if (min(r, c) == 1) { ull result = (max(r, c) + 1) / 2; printf("%I64d\n", result); continue; } ull x = min(r, c), y = max(r, c); if (y % 2) printf("%I64d\n", (y + 1) / 2 * x); else printf("%I64d\n", (y / 2) * x + (x / 2)); } }
标签:space tin include code ace pac nbsp tick namespace
原文地址:https://www.cnblogs.com/lv-anchoret/p/9382329.html