QOJ.ac

QOJ

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

#6254. 折断树枝

Statistics

你的父母决定在奈梅亨附近的 Mookerheide 度过一个“有趣”的周日。

CC-BY 2.0 By DymphieH on Flickr

虽然你可以在脑海中通过解决编程问题来打发时间,但你的兄弟姐妹却没有这种奢侈。过了一会儿,你的妹妹 Alice 和哥哥 Bob 感到非常无聊。他们一起想办法打发时间(这个问题后来被称为“Bob 和 Alice 的消遣难题”)。最终,他们想出了下面这个简单的游戏。

他们找到了一根长度为 $n$ 的树枝,作为游戏的主要道具。Alice 和 Bob 轮流选择一根树枝并将其折成两部分,要求两部分的长度均为整数。最后能够折断树枝的玩家获胜。Alice 因为年纪较小,所以先手。

当然,你已经在脑海中想通了这个游戏。假设 Bob 采取最优策略,Alice 能赢吗?如果能,她第一步应该怎么走?

输入格式

  • 一行包含一个整数 $2 \le n \le 10^9$,表示树枝的长度。

输出格式

  • 第一行输出获胜者的名字,Alice 或 Bob。
  • 如果 Alice 能赢,输出 Alice 作为获胜的一步所能折下的树枝长度。这应该是一个 $1$ 到 $n - 1$ 之间的整数(包含 $1$ 和 $n - 1$)。

如果有多种有效的解决方案,你可以输出其中任意一种。

样例

输入格式 1

2

输出格式 1

Alice
1

输入格式 2

3

输出格式 2

Bob

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.