Skiing at "Three - Five Springs"
Greece, besides being a famous summer destination, is also a place for winter tourism. Snow-covered mountains, wild rivers, and a continuous change of scenery can satisfy every related expectation. Our country boasts ski resorts, some of which, like the ski resort at "3 - 5 Springs" (Vermio Imathia), offer entertainment all year round. The center features artificial snowfall and the downhill slope from m to m. On this large slope amid the fir trees, the speed contest's finals are held with individual timing. Each skier descends the course, and based on their time, the electronic boards display their position in the overall ranking. The first, for example, will inevitably have position . The second, or , and the th any position from to .
Problem:
Develop a program in one of the IOI languages that, after reading the position of each skier in the overall ranking up to that moment, calculates the final position of each skier after the end of the race.
Input Files:
The input files named snow_run.in are text files with the following structure: The first line contains an integer , the number of skiers participating in the race . The next lines each contain an integer, the position in the overall ranking the respective skier has up to that moment.
Output Files:
The output files named snow_run.out are text files with the following structure: They have lines, one for each skier. Each line contains exactly one number, the position the respective skier has in the final ranking.
Examples of Input - Output Files:
1st
STDIN (snow_run.in)
10
1
1
1
1
1
1
1
1
1
1
STDOUT (snow_run.out)
10
9
8
7
6
5
4
3
2
1
2nd
STDIN (snow_run.in)
10
1
2
3
4
5
6
7
8
9
10
STDOUT (snow_run.out)
1
2
3
4
5
6
7
8
9
10
3d
STDIN (snow_run.in)
10
1
2
3
4
5
5
4
3
2
1
STDOUT (snow_run.out)
2
4
6
8
10
9
7
5
3
1
Notes:
- There are no skiers with the same time.
- All lines terminate with a
newline
character. - Maximum execution time: 5 sec.
- Maximum available memory: 64MB.
- The committee, in addition to the main files with a size , can use (for additional scoring) in case of a tie, two additional files with a size .
Comments