| 2025 USP Try-outs |
|---|
| Закончено |
After his last mission, Lian, the spy, returns to Shanghai. In an ancient stone chest, he finds a sequence of numbers that protect an ancestral secret: the Seals of Shanghai.
To unlock the seals, Lian must follow a precise ritual. Initially, he chooses a fixed integer $$$M$$$ such that $$$1 \lt M \leq 10^9$$$. Then, he must perform a sequence of magical rounds. In each round, he chooses an integer $$$x$$$ with which he unlocks all the seals whose number $$$A_i$$$ satisfies $$$A_i \bmod M = x$$$.
Each round requires concentration and energy. Therefore, Lian wants to minimize the number of rounds to unlock all the seals. Additionally, he wants to know how many distinct values of $$$M$$$ allow him to achieve this minimum number of rounds.
The first line contains an integer $$$N$$$ ($$$1 \leq N \leq 10^5$$$), the number of seals.
The second line contains $$$N$$$ integers $$$A_1, A_2, \dots, A_N$$$ ($$$1 \leq A_i \leq 10^9$$$), representing the numbers of the seals.
Print two integers: the minimum number of rounds required to unlock all the seals and the number of distinct values of $$$M$$$ with which it is possible to achieve this minimum number of rounds.
513 23 33 53 103
1 3
22 4
1 1
| Название |
|---|


