2018-11-10 10:00 UTC

Bergen Open 2018


2018-11-10 15:00 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -196 days 3:10:50

Time elapsed


Time remaining


Problem L
License to Launch

Birk has made a new shiny rocket and just received his licence from the Bluesky Global Order (BGO) to launch anytime within the next $n$ days. He is, however, worried that the rocket will hit space junk on its way. In order minimize the risk of a collision, Birk has made a model of how many pieces of space junk there will be for each of the next $n$ days. He decided that he will launch his rocket on the day with the least space junk, and if there are multiple days with the same amount of space junk he of course wants to send his rocket up as early as possible.

Can you help Birk find out how many days he has to wait until he sends up his rocket?


On the first line there is a single integer $n$ ($1 \le n \le 100\, 000$) the number of days for which the launch license is valid. On the second line follows $n$ integers between $0$ and $10^9$ where the $i$’th integer is the amount of space junk on the $i$’th day. The first day is day $i=0$.


Output a single integer, the number of days Birk needs to wait before he launches his rocket.

Sample Input 1 Sample Output 1
3 4 1 7 2