## LCC '18 Contest 2 J5 - Tall People 2

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 128M

Author:
Problem type

You are the teacher for a class of students, and you have decided to do an activity with them. The students are lined up in a single file line, facing forward. Each student has a height , and can see all students that are in front of them , up to the first student who has a height . Each student reports the number of students they can see. That is, they report . Note the first student can see students, because there are no students in front of them.

However, you notice that some students are not reporting the actual number of students they can see. Knowing each student's height, and wanting to punish the students who are reporting fake numbers. you want to know how many students the student can see.

#### Input Specification

The first line contains the integer, , the number of students in the class.

The second line contains the heights of each student, .

#### Output Specification

On the first and only line, print integers separated by spaces, the integer being the number of students the student can see.

##### Subtask 2 [70%]

No further constraints.

#### Sample Input

8
3 8 1000000 1000000 1 9 3 10

#### Sample Output

0 1 2 1 1 2 1 4