POJ-2484 A Funny Game

Source: Internet
Author: User

Description

Alice and Bob decide to play a funny game. At the beginning of the game they pick N (1 <= n <= 106) Coins in a circle, as Figure 1 shows. A move consists in removing one or both adjacent coins, leaving all other coins untouched. At least one coin must is removed. Players alternate moves with Alice starting. The player is removes the last coin wins. (The last player to move wins.) If you can ' t move, you lose.)

Figure 1
Note: For n > 3, we use C1, c2, ..., cn to denote the coins clockwise and if Alice remove C2, then C1 and C3 is not adjace Nt! (Because there is a empty place between C1 and C3.)

Suppose that both Alice and Bob does their best in the game.
You is to write a program to determine who'll finally win the game.

Input

There is several test cases. The which contains a positive integer n (1 <= n <= 106). There is no blank lines between cases. A line with a single 0 terminates the input.

Output

For each test case, if Alice win the Game,output "Alice", otherwise output "Bob".

Sample Input

1230

Sample Output

Alicealicebob
#include <cstdio>int main () {int n;while (scanf ("%d", &n) && N) {if (n <= 2) puts ("Alice"); else puts ( "Bob"); return 0;}


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

POJ-2484 A Funny Game

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.