Time limit
2s
Memory limit
128 MB
There are N mines placed at equal intervals on a straight line. The impact strength of the i-th mine is P_i.
When a mine explodes, it applies force equal to its own impact strength to the nearest unexploded mine on each side. A mine that receives force explodes only if the force is strictly greater than its impact strength, and then it applies its own impact strength to its neighbors in the same way. If the received force is less than or equal to the mine's impact strength, the chain reaction stops in that direction.
You may directly detonate several mines. Find the numbers of the mines that must be directly detonated when the number of direct detonations is minimized while still exploding every mine.
The first line contains the number of mines N. Each of the next N lines contains the impact strength P_i of one mine, in order from mine 1 to mine N.
Print the numbers of the mines that must be directly detonated in increasing order, one per line.