Janggi
Time limit0.3sMemory limit1024 MB
Given each side's remaining janggi pieces, decide which player has the higher score, with Han receiving a 1.5-point bonus, and print that player's name.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Janggi
DGIST is far from the center of Daegu, so there are not many things to do nearby. Bored, Cheoki and Eun-gyu decided to play janggi, an old board game from East Asia.
Janggi is a strategy game in which the Chu and Han sides, each with 16 pieces, take turns trying to capture the opponent's general. The pieces are the general (gung), chariot (cha), cannon (po), horse (ma), elephant (sang), guard (sa), and soldier (jol, also called byeong). Cheoki and Eun-gyu assign a score to each piece so they can check their position numerically during a game. The starting piece counts and the scoring rules are as follows.
- General (1 total): no points
- Chariot (2 total): 13 points each
- Cannon (2 total): 7 points each
- Horse (2 total): 5 points each
- Elephant (2 total): 3 points each
- Guard (2 total): 3 points each
- Soldier (5 total): 2 points each
At the start, each side has points. To prevent a draw, Han, the second player, gets an extra 1.5 points, so Han counts 73.5 points.
Cheoki plays Chu, the first player, and Eun-gyu plays Han, the second player. Given the number of pieces each player has left during a game, print the name of the player with the higher current score.
Input
The first line contains the number of Cheoki's remaining chariots, cannons, horses, elephants, guards, and soldiers, separated by spaces.
The second line contains the number of Eun-gyu's remaining chariots, cannons, horses, elephants, guards, and soldiers (written as byeong in the source), separated by spaces.
All values are integers greater than or equal to 0. The count of each piece is guaranteed to be less than or equal to its starting count.
Output
If Chu has the higher score, print cocjr0208. If Han has the higher score, print ekwoo.