Skip to content

Commit 24687bd

Browse files
authored
[20251111] BOJ / P2 / 아인타 게임 / 권혁준
1 parent 342c766 commit 24687bd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```cpp
2+
#include <bits/stdc++.h>
3+
using namespace std;
4+
5+
int main() {
6+
cin.tie(0)->sync_with_stdio(0);
7+
8+
long long T, N, M, K;
9+
for (cin >> T; T--;) {
10+
cin >> K >> N >> M;
11+
N--, M--;
12+
if (K == 1) {
13+
cout << (((N & 1LL) | (M & 1LL)) ? "koosaga\n" : "cubelover\n");
14+
continue;
15+
}
16+
long long z = min(N, M) / (K + 1), zz = z * (K + 1);
17+
N -= zz, M -= zz;
18+
long long g = (N < K || M < K) ? ((N & 1LL) ^ (M & 1LL) ^ (z & 1LL)) : (((N & 1LL) ^ (M & 1LL)) | 2LL);
19+
cout << (g ? "koosaga\n" : "cubelover\n");
20+
}
21+
22+
}
23+
```

0 commit comments

Comments
 (0)