#P1632D. New Year Concert
New Year Concert
No submission language available for this problem.
Description
New Year is just around the corner, which means that in School 179, preparations for the concert are in full swing.
There are classes in the school, numbered from to , the -th class has prepared a scene of length minutes.
As the main one responsible for holding the concert, Idnar knows that if a concert has scenes of lengths , , , minutes, then the audience will get bored if there exist two integers and such that and , where is equal to the greatest common divisor (GCD) of the numbers , , , , .
To avoid boring the audience, Idnar can ask any number of times (possibly zero) for the -th class () to make a new scene minutes in length, where can be any positive integer. Thus, after this operation, is equal to . Note that and can be different for each operation.
For a sequence of scene lengths , , , , let be the minimum number of classes Idnar has to ask to change their scene if he wants to avoid boring the audience.
Idnar hasn't decided which scenes will be allowed for the concert, so he wants to know the value of for each non-empty prefix of . In other words, Idnar wants to know the values of , ,, , ,,,.
The first line contains a single integer () — the number of classes in the school.
The second line contains positive integers , , , () — the lengths of the class scenes.
Print a sequence of integers in a single line — , ,, , ,,,.
Input
The first line contains a single integer () — the number of classes in the school.
The second line contains positive integers , , , () — the lengths of the class scenes.
Output
Print a sequence of integers in a single line — , ,, , ,,,.
Samples
Note
In the first test we can change to , so the answer is .
In the second test:
- can be changed into ,
- can be changed into ,
- can be changed into .