QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#11985. 宝塔

Statistics

在牛首山和云台山之间的弘觉寺,原本矗立着 $n$ 座宝塔,编号从 $1$ 到 $n$。然而,只有两座宝塔(编号分别为 $a$ 和 $b$,其中 $1 \le a \neq b \le n$)经受住了时间的考验。

两位僧人 Yuwgna 和 Iaka 决定重现往日的辉煌。他们轮流重建宝塔,由 Yuwgna 先手。在每一轮中,如果存在两座已矗立的宝塔(编号分别为 $j$ 和 $k$),使得 $i = j + k$ 或 $i = j - k$,那么玩家就可以重建一座编号为 $i$ 的新宝塔(其中 $i \notin \{a, b\}$ 且 $1 \le i \le n$)。每座宝塔只能被重建一次。

这是一个博弈游戏。无法重建新宝塔的僧人将输掉比赛。

输入格式

第一行包含一个整数 $t$ ($1 \le t \le 500$),表示测试用例的数量。对于每个测试用例,第一行提供一个正整数 $n$ ($2 \le n \le 20000$) 以及两个不同的整数 $a$ 和 $b$。

输出格式

对于每个测试用例,输出获胜者的名字(“Yuwgna” 或 “Iaka”)。双方在每一步都会做出最优决策。

样例

输入 1

16
2 1 2
3 1 3
67 1 2
100 1 2
8 6 8
9 6 8
10 6 8
11 6 8
12 6 8
13 6 8
14 6 8
15 6 8
16 6 8
1314 6 8
1994 1 13
1994 7 12

输出 1

Case #1: Iaka
Case #2: Yuwgna
Case #3: Yuwgna
Case #4: Iaka
Case #5: Iaka
Case #6: Iaka
Case #7: Yuwgna
Case #8: Yuwgna
Case #9: Iaka
Case #10: Iaka
Case #11: Yuwgna
Case #12: Yuwgna
Case #13: Iaka
Case #14: Yuwgna
Case #15: Iaka
Case #16: Iaka

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.