As the deer finds cold spring water, so do I find the money on top of the mountains! - Jany MooRANDy
Itβs been so long since your favorite bomber Jany MooRANDy has been in the Himalayan Mountains and his enemies started questioning his abilities to make money. But have no worries, heβs back to the Himalayas to once again prove his claim: "Let the wind and rain blow, I make money in the Himalayas too! Where I make money packages, the enemies only collect stones!". After getting his PhD in physics proving that he has TDI brain he got to rename "the law of conservation of energy"to "the law of conservation of value".
It reads like this: the kinetic value of an object is equal to (where is the mass of the object and is its velocity) and the potential value of an object is equal to (where is the mass of the object, is the gravitational acceleration which we will consider to be , and is the difference of elevation between it and a reference point).
As we all know, the Himalayas are made up of peaks placed in a line, the peak having an elevation of . Now Jany MooRANDy wants to collect the money which the previously built stop points for the Himalayas cable car have made (there is a cable car stop in every peak). Starting from a peak he will only go to the right (i.e. ).
Having loads of value, he will be on his journey with a kinetic value equal to right from the beginning. When jumping from the ith peak to the peak he will either lose or gain value. If then he will gain value, otherwise he will lose value. Over the course of the journey, his value cannot drop below . Now, because he wants to make money packets he is wondering for every starting peak which is the farthest peak that he can go to?
Input
The first line contains three integers: and β the number of peaks, Jany MooRANDyβs mass and speed respectively.
The second line contains integers, representing the array - the height of each peak. .
For tests worth points, (), () and () hold.
For tests worth extra points, (), () and () hold.
Note that previous knowledge of the physics concepts presented is not required and the task is solvable using the given assumptions and definitions from the statement.
Output
The output will consist of one line, having integers, separated by a space: where is the index of the farthest peak Jany MooRANDy can reach starting from peak .
Example
stdin
9 2 7
3 2 1 5 3 3 8 2 1
stdout
6 3 3 6 6 6 9 9 9
Explanation
Letβs see why
He starts from the first peak with kinetic value of , so his current value is .
From peak to peak , his value increases by , so his current value becomes 69.
From peak to peak , his value increases by , so his current value becomes 89.
From peak to peak , his value decreases by , so his current value becomes 9.
From peak to peak , his value increases by , so his current value becomes 49.
From peak to peak , his value decreases by , so his current value stays the same.
From peak to peak , his value decreases by , so his current value would drop to which is below so he canβt go to peak .
The farthest peak he can reach from peak is peak .