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)

Could anyone help me?

I got a 9/15 in my submissions testing, but I can't seem to find the errors (there were 2). I've tried different combinations to try and find an error, but there are a huge number of combinations. So is there a problem with my underlying logic, or is it some 'silly' error?

When you say that if the height of the upcoming rock - current height is greater than your normal jump, your only choice would be to consume 1 energy. This is very likely a "silly" error, so I would consider carefully reading the problem statement. Does a super jump ALWAYS guarantee that you can make it to the next rock?

Ex. if H = 999999999 , and your current height is 3, and your jump is 5. Consider your options from here, based on the details given in the problem statement. You should AC keeping in mind this possibility.

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?