Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Limits
1s, 512 MB

Alice and Bob are two best friends. They have a board of N tiles, which they need to paint.

Initially the tiles are all unpainted. They think that painting them in a normal way feels kind of boring. That’s why they came up with a game in order to paint the board.

During the game they will play in turns. In each turn, the current player may select any number of unpainted cells in the range 2-5 inclusive, and paint all of them. In other words they can select 2, 3, 4 or 5 unpainted cells, and paint them all. The person who can’t paint anymore cells, loses.

Whoever wins gets a bowl of boiled eggs.

Alice is so excited to play the game that she always makes the first move. She really doesn’t want to lose (after all boiled eggs are at stake). Given the size of the board, your task is to find out whether Alice will win or lose, provided that they both play optimally.

The first line of each input contains a single integer **T** (1 ≤ T ≤ 105), which denotes the number of test cases.

The next T lines each contain a single integer **N** (0 ≤ N ≤ 1018), which denotes the size of the board, i.e., the number of unpainted tiles.

For each test case, output the case number as "Case X:", followed by the string “No eggs for you! :D” or “Oh no, my eggs! :(” without quotes, if Alice will win, or lose respectively.

Input | Output |
---|---|

2 2 8 | Case 1: No eggs for you! :D Case 2: Oh no, my eggs! :( |

In the first sample test case, Alice can win by painting both the tiles. In the second sample test case, no matter how Alice plays, Bob will always win.

This problem was authored for Inter Department Programming Contest 2016 at Jahangirnagar University and is being hosted on Toph per author's request.

82% Solution Ratio

rubabredwanEarliest,

Deshi_TouristFastest, 0.0s

rubabredwanLightest, 262 kB

mdvirusShortest, 127B

Login to submit