Tornjevi
시간 제한2초메모리 제한2048 MB
각 탑마다 자신의 높이가 그 구간 전체의 최대공약수와 같은 가장 긴 연속 구간의 길이를 구한다.
문제
On a certain street, there are towers, numbered consecutively from to . Each tower has its own height , expressed in meters.
For a consecutive subsequence of towers numbered , we say that the tower with number () is good in that subsequence if it holds that , where denotes the greatest common divisor of the set of positive integers .
Your task is to determine, for each , the size of the largest consecutive subsequence in which the tower with number is good, where the size of a consecutive subsequence is defined as the number of towers in that subsequence.
입력
In the first line, there is an integer (), the number of towers.
In the second line, there are integers, in order, ().
출력
In a single line, print the answer to the above-mentioned question for each , in order.
힌트
Clarification of the first example: In the first four towers, tower number is good. Towers with numbers , , and are good in the subsequence they form themselves. Tower will be good in any arbitrary subsequence that contains it, so the answer will be (the entire sequence).