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 ith investigator having a maximum speed of si. 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

1N,K,si100

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 ith investigator.

Output Specification

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

Sample Input 1

Copy
50
4
50
14
10
34

Sample Output 1

Copy
fight

Explanation for Sample Output 1

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

Sample Input 2

Copy
10
1
9

Sample Output 2

Copy
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.