[ABC485C] 最近的异色邻居 (Different Neighbor)
Score : points
Problem Statement
There is one point at each of the coordinates on a number line, and the point at coordinate is called point .
Each point has a color, and the color of point is . Here, at least two distinct values appear in .
For each , find the distance from point to the nearest point whose color is different from that of point .
Constraints
-
-
-
At least two distinct values appear in .
-
All input values are integers.
Input
The input is given from Standard Input in the following format:
$N$
$C_1$ $C_2$ $\ldots$ $C_N$
Output
Print the answers for in this order, separated by spaces.
Sample Input 1
6
1 1 2 3 3 3
Sample Output 1
2 1 1 1 2 3
Among the points whose color is different from that of point , the nearest to point is point , and its distance from point is .
Among the points whose color is different from that of point , the nearest to point is point , and its distance from point is .
Among the points whose color is different from that of point , the nearest to point are points and , and their distance from point is .
Among the points whose color is different from that of point , the nearest to point is point , and its distance from point is .
Among the points whose color is different from that of point , the nearest to point is point , and its distance from point is .
Among the points whose color is different from that of point , the nearest to point is point , and its distance from point is .
Thus, print in this order, separated by spaces.
Sample Input 2
7
4 2 3 3 3 4 4
Sample Output 2
1 1 1 2 1 1 2