#P7191. [COCI 2007/2008 #6] GRANICA
[COCI 2007/2008 #6] GRANICA
Problem Description
Luka first wrote the numbers from license plates onto a piece of paper. Then, he tried to find an integer such that all the numbers on the paper leave the same remainder when divided by .
Luka wants to find as many different values of as possible.
Write a program that, given Luka’s integers, determines all such .
Note that you must ensure is a positive integer, i.e., .
Input Format
The first line contains a positive integer , the number of integers.
In the next lines, each line contains an integer , representing a number on the paper, and all are guaranteed to be distinct.
The testdata guarantees that there exists at least one that satisfies the requirement.
Output Format
Output all values of that satisfy the requirement in any order on the first line.
3
6
34
38
2 4
5
5
17
23
14
83
3
Hint
Sample #1 Explanation
All integers leave remainder when divided by , and remainder when divided by .
Constraints
- For of the testdata, , .
- For of the testdata, , .
Notes
- The full score for this problem is points.
- This problem enables the O2 optimization switch by default.
- Translated from COCI2007-2008 CONTEST #6 T3 GRANICA. Translator: https://www.luogu.com.cn/user/219791
- Thanks to https://www.luogu.com.cn/user/60864ing the checker, which you can download from the attachments.
Translated by ChatGPT 5