Kyrylo Kozhumyaka
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Once upon a time, a dreadful Dragon settled near Lviv. And every year the Dragon collected a tribute: he took one young man or woman. The brave young man Kyrylo Kozhumyaka could not tolerate this and went to the Dragon to save his people.
– Did you come to fight me? — said the Dragon.
– Of course not. Am I foolish to fight you! — Kyrylo confidently replied.
So they decided to play a game: if the young man wins, the Dragon will no longer take his tribute. In total, the Dragon has \(n\) sticks, and the \(i\)-th stick has a length of \(a_i\). Kyrylo and the Dragon take turns drawing sticks. Kyrylo draws first, then the Dragon, and then Kyrylo again, meaning they draw a total of 3 sticks. Kyrylo wins this difficult game if a non-degenerate triangle cannot be formed from these 3 sticks.
Now Kyrylo is wondering if he can win this game if on his first move he takes the \(i\)-th stick, and the Dragon acts optimally.
Input
The first line contains a single integer \(n\). The next line contains \(n\) integers \(a_i\).
Output
Output \(n\) lines. In the \(i\)-th line, output
Good job, Kyrylo! if Kyrylo can defeat the Dragon by taking
the \(i\)-th stick on his first move,
and Bon appetit, Dragon! if the evil Dragon wins.
Constraints
28% of tests: \(3 \le n \le 100, 1 \le a_i \le 10^9\),
32% of tests: \(3 \le n \le 2\cdot10^3, 1 \le a_i \le 10^9\),
40% of tests: \(3 \le n \le 10^5, 1 \le a_i \le 10^9\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 7 4 2 7 4 5 7 9 | Good job, Kyrylo! Good job, Kyrylo! Bon appetit, Dragon! Good job, Kyrylo! Good job, Kyrylo! Bon appetit, Dragon! Good job, Kyrylo! |
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|