Problems
There are
The buildings are numbered from
The buildings are located on the
If
Write a program to find the nearest visible building to the right of each building.
Input
The first line of input contains
From the next line,
Output
Output will be on a total of
If there are no visible buildings, output
Example
6
3
2
6
1
1
2
3
3
0
6
6
0
Tag