## COCI '07 Contest 6 #3 Granica

View as PDF

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 32M

Problem type

Luka started driving international routes with his truck. His biggest problem is the border with Slovenia. The border is a point of entrance into the European Union, so every truck is thoroughly examined. Because of this, Luka always has to wait several hours there. To kill the time, he comes up with various logic and math games.

In one of them, Luka first reads the numbers off of license plates and writes them down on a piece of paper. Then he tries to find an integer greater than such that all integers on the paper give the same remainder when divided by . Luka tries to find as many such integers as possible. Write a program that, given Luka's integers, determines all such integers .

#### Input Specification

The first line contains the integer , the number of integers on paper.

Each of the following lines contains one integer between and (one billion). All these integers will be distinct.

The input data will guarantee that at least one integer will always exist.

#### Output Specification

Output all integers separated by spaces, in any order.

#### Scoring

In test cases worth points, each of the numbers will be at most .

#### Sample Input 1

3
6
34
38

#### Sample Output 1

2 4

#### Sample Input 2

5
5
17
23
14
83

#### Sample Output 2

3

In the first example, all integers give a remainder of when divided by and the remainder when divided by .

For this problem, you must not have any trailing spaces in your output and each line must terminate with a newline (\n).