time
Ever since they appeared humans have measured time in the most various of ways. They invented solar devices, used water, sand, stones and G-d knows how many other innovations. The ball watch works
in the following way: |
![]() |
Task
Knowing the initial number of n balls used determine after how many days, at the beginning of the day, the first repetition of the initial configuration of balls, the one before the clock was started, appears. Initially the row of balls contains, in order, balls numbered from 1 to n-1 and the clock contains only one ball, ball number n, the ball located in the hour box.
Input Data
The program reads no input data.
Output Data
Output file 0-time.out will contain
101 lines, one line for each value from 27 to 127, value that represents the
number of balls initially located in the row. The value on line 1 represents
the number of days (24 hour time periods) after which the initial configuration
of the 27 ball row reappears. The value on line 2 represents the number of days
(24 hour time periods) after which the initial configuration of the 28 ball
row reappears a.s.o, the value on line i
represents the number of days (24 hour time periods) after which the initial
configuration of the 26+i ball
row appears.
You won't upload the problem solution on the website; you will upload the file 0-time.out containing the results.
Examples
0-time.out | Explanations |
6 |
On line 1: the initial
configuration of the 27 balls reappears after 6 days On line 4: the initial
configuration of the 30 balls reappears after 60 days |
Time limit - N/A.
Marinel
Serban
Computer Science High School "Gr. C. Moisil" Iasi
marinel_serban@yahoo.com