OTHS Coding Competition 2 P2 - Ghoul Investigators

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Python 2.0s
Memory limit: 512M

Authors:
Problem type

Kaneki is being pursued by N ghoul investigators, with the i^{th} investigator having a maximum speed of s_i. Since he doesn't want to fight, Kaneki will simply run away if he is strictly faster than all investigators. Otherwise, he will have to fight them.

Given that Kaneki's maximum speed is K, determine whether Kaneki can run away or if he will have to fight the ghoul investigators.

Constraints

1 \le N, K, s_i \le 100

Subtask 1 [40%]

N = 1

Subtask 2 [60%]

No additional constraints.

Input Specification

The first line contains an integer K, Kaneki's maximum speed.

The second line contains an integer N, the number of ghoul investigators.

The next N lines contain 1 integer each, the speed of the i^{th} investigator.

Output Specification

Output run away if Kaneki is strictly faster than all ghoul investigators pursuing him, and fight otherwise.

Sample Input 1

50
4
50
14
10
34

Sample Output 1

fight

Explanation for Sample Output 1

Kaneki will have to fight as he is not strictly faster than the 1^{st} investigator.

Sample Input 2

10
1
9

Sample Output 2

run away

Explanation for Sample Output 2

The only investigator pursuing Kaneki is slower than him so he can run away.


Comments

There are no comments at the moment.