Ordered Problem Set
시간 제한1초메모리 제한2048 MB
문제 난이도 순열이 주어질 때, n을 k로 나눈 각 구간이 다음 구간보다 모두 쉬운 조건을 만족하는 k>1의 약수를 모두 구한다.
문제
You are running a programming contest that features problems of distinct difficulties. You wish to announce ahead of time that the problems are ordered in such a way that, if the problems are divided into sections numbered through , each with exactly problems, and problem is assigned to section , then for every pair of sections and with , every problem in section is easier than every problem in section . Note that must be greater than and be a factor of .
However, you have just sent your problems to the printer so the order cannot be changed. For what values of would this claim be true?
입력
The first line of input contains a single integer (), which is the number of problems.
Each of the next lines contains a single integer (). These are the difficulties for the problems in the order that they appear in the problem set. The difficulties are distinct. The problem with difficulty is the easiest problem and the problem with difficulty is the hardest problem.
출력
Output a list of integers, one per line. The integers are all valid values of in increasing order. If no such values exist, output .