III Olympiad in Informatics 1995/1996
|
Task: KUL
|
Author: Krzysztof Diks
|
III stage contest |
There are n boxes on the circle. The boxes are numbered from 1 to n (1<=N<=1000) in clock wise order. There are balls in the boxes, and the number of all the balls in the boxes is not greater than n.
The balls should be displaced in such a way that in each box there remains no more than one ball. In one move we can shift a ball from one box to one of it's neighboring boxes.
Your program should look for the file KUL.IN in the current directory and produce the output file KUL.OUT in the current directory too. The file containing the source code of your program should have a name KUL.???, whereas you should put three-letter abbreviation of the used programming language name instead of ???. The same program in executable form should be written in file KUL.EXE