PROGRAMMING:Has the stock gone up
Mark Twain once said: "October is the most dangerous month for stock speculation; Other dangerous months were July, January, September, April, November, may, March, June, December, August and February“ However, the stock is so charming, there are always chives after another to join, and there are countless chives conceited, want to capture some interesting information from the elusive market.
Leek small CC in the observation of a shares for many days, finally started to buy a good trend, the boss next week's return to the stock - LETV (300104. SZ). After starting, the stock price went up and down, but the boss didn't return home. The stock rose with difficulty, but fell again. It went back to a few days ago. There was no profit during this period. Now, little CC wants to know the days closest to today and the stock price is not lower than today, and see how much time they have wasted.
Give the stock price of $$n $$days. For each day, output the day whose previous price is not lower than that of that day and is closest to that day (serial number starts from 0). If it does not exist, output - 1.
For example, the stock prices for six consecutive days are $$4, 3, 10, 8, 8, 9 $$.
There is no information before $$0 $, so $$- 1 $$is output;
The price of day $$1 $$is $$3 $, while the price of day $$0 $$is $$4 $, which is not lower than it and closest to it, so $$0 $$is output;
The price of day $$2 $$is $$10 $, which is not lower than its price before, so the output is $$- 1 $;
The price on day $$5 $$is $$9 $, the price on day $$4 $$is $$8 $, which is lower than it, so continue to look forward. The price on day $$3 $$is $$8 $, which is also lower than it. Continue to look forward until the price on day $$2 $$is $$10 $, which is not lower than it, so output $$2 $.
To sum up, the serial numbers of the days that are not lower than the current day and closest to the current day are $$- 1,0, - 1,2,3,2 $.
###Input format:
The first line is a positive integer $$n / leq10 ^ 5 $, which means the stock price has $$n $$days.
The second line is the $$n $$non negative integers separated by spaces in the range of $$[0,2 ^ {31} - 1] $, which are the daily stock prices.
###Output format:
There is only one line, with a total of $$n $$numbers, which are the serial numbers of the days before the price is not lower than that of the day and closest to that day, separated by spaces, and no extra spaces at the end of the line. End with a new line.
###Input example:
```in
six
4 3 10 8 8 9
```
###Output example:
```out
-1 0 -1 2 3 2
```
answer:If there is no answer, please comment
Leek small CC in the observation of a shares for many days, finally started to buy a good trend, the boss next week's return to the stock - LETV (300104. SZ). After starting, the stock price went up and down, but the boss didn't return home. The stock rose with difficulty, but fell again. It went back to a few days ago. There was no profit during this period. Now, little CC wants to know the days closest to today and the stock price is not lower than today, and see how much time they have wasted.
Give the stock price of $$n $$days. For each day, output the day whose previous price is not lower than that of that day and is closest to that day (serial number starts from 0). If it does not exist, output - 1.
For example, the stock prices for six consecutive days are $$4, 3, 10, 8, 8, 9 $$.
There is no information before $$0 $, so $$- 1 $$is output;
The price of day $$1 $$is $$3 $, while the price of day $$0 $$is $$4 $, which is not lower than it and closest to it, so $$0 $$is output;
The price of day $$2 $$is $$10 $, which is not lower than its price before, so the output is $$- 1 $;
The price on day $$5 $$is $$9 $, the price on day $$4 $$is $$8 $, which is lower than it, so continue to look forward. The price on day $$3 $$is $$8 $, which is also lower than it. Continue to look forward until the price on day $$2 $$is $$10 $, which is not lower than it, so output $$2 $.
To sum up, the serial numbers of the days that are not lower than the current day and closest to the current day are $$- 1,0, - 1,2,3,2 $.
###Input format:
The first line is a positive integer $$n / leq10 ^ 5 $, which means the stock price has $$n $$days.
The second line is the $$n $$non negative integers separated by spaces in the range of $$[0,2 ^ {31} - 1] $, which are the daily stock prices.
###Output format:
There is only one line, with a total of $$n $$numbers, which are the serial numbers of the days before the price is not lower than that of the day and closest to that day, separated by spaces, and no extra spaces at the end of the line. End with a new line.
###Input example:
```in
six
4 3 10 8 8 9
```
###Output example:
```out
-1 0 -1 2 3 2
```
answer:If there is no answer, please comment