Rock Climbing

Capba J. Cloath has scoped out a vertical rock climbing wall with N (1 ≤ N ≤ 106) climbing holds positioned on it. The holds are all in a vertical line, and are numbered from 1 to N in order, with 1 being the lowest and N being the highest. Hold i is Hi (1 ≤ Hi ≤ 109) metres above the ground. Capba wants to figure out whether or not he reach the highest hold.

However, since he's so cool, he will do this with no hands.

Starting on the ground, Capba can repeatedly perform a slightly physics-defying leap to any hold no more than M (1 ≤ M ≤ 109) metres above his current location. Alternatively, he can choose to perform an extremely physics-defying leap, to a hold no more than 2M above him — however, he only has enough energy to do this E (0 ≤ E ≤ 106) times throughout the climb.

Given the layout of the wall and Capba's statistics, determine whether or not he can reach the top hold with a series of leaps.

Input Format

Line 1: N, M, E.

Next N lines: Values of H1, ..., HN

All values are integers.

Output Format

Output "Too easy!" if Capba can reach the highest hold, or "Unfair!" otherwise.

Sample Input

5 10 1
10
19
30
31
36

Sample Output

Too easy!

Explanation

Capba can just barely leap up to hold 1, and from there to hold 2. At this point, he must perform his one allowable extremely physics-defying leap to hold 3, as it is more than 10 metres away from his current location. He can then leap straight to hold 5. Because he's that cool.

All Submissions
Best Solutions


Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Feb 22, 2011

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

I've tried submitting my code quite a few times, tweaking it slightly each time, but for some reason I just can't seem to get the very last test case of the last batch case. Help, please?

Standard error:
 
a.out:5: DeprecationWarning: integer argument expected, got float
for i in range(n):
Traceback (most recent call last):
File "a.out", line 5, in <module>
for i in range(n):
MemoryError

Read this. Basically, you should always be using xrange because range is too slow. Also, why are you reading floats when everything is an int?