Because Gabriel got an early offer from UOIT, his overjoyed parents gave him a lot of Rubik's Cubes as a reward. However, he soon developed Carpal Tunnel Syndrome, and now has to sell some of his cubes at half of their original price to pay for his medical bills.
Gabriel is a very unique person; the cubes that he got each have a distinct value , and are placed in a straight line. He wants to know if he has a total of at least dollars after he sells all of his cubes inclusively between the one valued at and the one valued at (in the line). He specifically wants to ask questions in the form to know if he has enough money after selling all of the cubes in that range. Both cubes are guaranteed to exist in the sequence.
Note: it may be helpful to use unsigned 64-bit variables (e.g. unsigned long long
in C++).
Constraints
Subtask 1 [10%]
Subtask 2 [90%]
Input Specification
The first line of input will consist of 3 space-separated integers , , and . The next line will contain space-separated integers, where the integer represents the value. For the next lines, each line will contain 2 space separated integers and .
Output Specification
For each question, output Enough
if Gabriel can afford his bills or Not enough
if he cannot.
Sample Input
5 10 2
10 1 4 3 7
1 3
10 7
Sample Output
Not enough
Enough
Comments
This problem is extremely similar to DMOPC '14 Contest 2 P4 - Deforestation. Just for the record.
It's a coincidence and there is a slight difference.
Are the prices multiples of 2?
Not necessarily. If the total price after halving isn't exactly or greater, then it's
Not enough
.