Party coolness
Andres is a party organizer who has collected feedback on every event he has organized throughout his career. Attendees rated each event on a scale from 0 to 100.
Party organizers have a "coolness" metrics that, in essence, consists in determining, for each event, how many subsequent events have to pass before one receives a higher rating. In case no such rate exists, say it's 0.
Andres needs your help to develop an algorithm that determines the coolness of a series of party rates.
Input Format
The first line is , the number of event rates The second line contains the array of rates , space-separated
Constraints
Output Format
For every event rate, the number of subsequent events that have to pass before that receives a higher rating
Sample Input 0
8
73 74 75 71 69 72 76 73
Sample Output 0
1 1 4 2 1 1 0 0
Explanation 0
For the first rating of 73, the next higher rating is 74, which occurs in the next event, so the answer is 1. For the second rating of 74, the next higher rating is 75, also occurring in the next event, so the answer is 1. For the next rating of 75, the next higher rating is 76, which is four events later, so the answer is 4. And so on.
Sample Input 1
4
10 20 20 40
Sample Output 1
1 2 1 0
xxxxxxxxxx
with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada;
procedure Solution is
-- Enter your code here. Read input from STDIN. Print output to STDOUT
end Solution