PROGRAMMING:Least moves (Cixi, 2007)
There are n piles of candy (2 ≤ n ≤ 200) in a row, numbered 1, 2,... N respectively.
It is known that each pile of candy has a certain number of pieces, and the sum of the number of pieces is a multiple of n. Move any candy in each pile, so that the number of each pile reaches the same, and the number of moves is the least.
Move rules:
Each time can move any number of candy, the first pile can move to the second pile, the second pile can move to the first pile or the third pile,...... Heap n can only be moved to heap n - 1.
For example, when n = 4:
Pile number 1 2 3 4
9 8 17 6
There are many ways to move, one of which is the following
① The third pile moves 4 pieces to the fourth pile to become: 9 8 13 10
② The third pile moves 3 to the second pile to become: 9 11 10 10
③ The second pile moves one to the first pile to become: 10
After three moves, each pile becomes 10.
###Input format:
There are two lines of input.
The first line is an integer n.
The second line contains n integers separated by spaces.
###Output format:
Output, an integer (representing the minimum number of moves).
###Input example:
```in
four
9 8 17 6
```
###Output example:
```out
three
```
answer:If there is no answer, please comment
It is known that each pile of candy has a certain number of pieces, and the sum of the number of pieces is a multiple of n. Move any candy in each pile, so that the number of each pile reaches the same, and the number of moves is the least.
Move rules:
Each time can move any number of candy, the first pile can move to the second pile, the second pile can move to the first pile or the third pile,...... Heap n can only be moved to heap n - 1.
For example, when n = 4:
Pile number 1 2 3 4
9 8 17 6
There are many ways to move, one of which is the following
① The third pile moves 4 pieces to the fourth pile to become: 9 8 13 10
② The third pile moves 3 to the second pile to become: 9 11 10 10
③ The second pile moves one to the first pile to become: 10
After three moves, each pile becomes 10.
###Input format:
There are two lines of input.
The first line is an integer n.
The second line contains n integers separated by spaces.
###Output format:
Output, an integer (representing the minimum number of moves).
###Input example:
```in
four
9 8 17 6
```
###Output example:
```out
three
```
answer:If there is no answer, please comment