Problem3019--最短路

3019: 最短路

Time Limit: 1.000 Sec  Memory Limit: 256 MB
Submit: 20  Solved: 4
[Submit] [Status] [Web Board] [Creator:]

Description


Input


Output


Sample Input

5
1 5 6 7 8

Sample Output

0 6 17 8 -1

HINT


Source/Category

 

[Submit] [Status]