9080 - Closet Value   

Description

 Given a sequence S = {X1, X2, X3,..., Xn | Xi is an integer}. For all Xi, you should count a number Ci such that Ci = min1<=j{ |XXj| }. Let C1 = 0.

 

Input

 The input includes multiple test cases. In each test case, the first line contains one integer N. The following line contains N integers.

 

1 <= N <= 105

Output

 The one line contains C1, C2,..., Cn. They are separated by single space.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss