Pongdang Pongdang 2
Time limit1sMemory limit256 MB
Decide whether Hwisu raises an arm on turn T of a circular drinking game where the number of arms per turn cycles up and down between 1 and 2N.
- Level
Easy3 of 10
- Topics
- Math, Implementation, Simulation
- Solved
- No attempts yet
Problem
Pongdang Pongdang is a staple drinking game at MT retreats, and it depends more on teamwork than any other drinking game. Each turn, the players must raise a designated number of arms at the same time. If they fail, both the people who were supposed to raise an arm and the people who raised one by mistake have to drink, by collective punishment. The rules of Pongdang Pongdang are as follows.
- A total of N people, numbered 1 through N, sit in a circle in counterclockwise order. Everyone faces the center of the circle.
- The game starts with the left arm of person 1 and proceeds from left to right as seen from outside the circle.
- After the first turn, each turn continues from the arm right after the last arm raised by the rightmost person, and the players raise the designated number of arms in order.
- The number of arms to raise at the start of the game is 1. As turns go by, the number of arms to raise increases by 1 each turn.
- Once the number of arms to raise reaches 2 × N, it decreases by 1 each turn from the next turn.
- Once the number of arms to raise reaches 1, it increases by 1 each turn again from the next turn.
That is, the number of arms to raise in each turn stays between 1 and 2 × N.
Hwisu was playing Pongdang Pongdang at an MT and got bored because his friends were too good at it. To make as many people as possible drink, he plans to deliberately not raise his arm on the turn that applies to him. Hwisu wants to know, for each turn, whether he can troll and make everyone drink together. Help Hwisu!
Input
The first line gives the number of people in the game, N, as an integer. (2 ≤ N ≤ 1,000)
The second line gives Hwisu's position P and the turn T as integers. (1 ≤ P ≤ N, 1 ≤ T ≤ 10,000,000)
Output
If Hwisu has to raise an arm on turn T, so that he can succeed at trolling, print “Dehet YeonJwaJe ^~^”. If he is in a position where he cannot troll, print “Hing...NoJam”.