-->
当前位置:首页 > 题库

PROGRAMMING:monitor

Luz5年前 (2021-05-10)题库416
The Security Department of a certain country monitors the data flow of the whole country. The programmer of the department receives a task. The terrorist organization will send a number sequence a to its subordinates, which is composed of n positive integers, and any two values AI and AJ can find their remainder
X = AI mod AJ, (where 1 < = I, J < = n, AI > = AJ).
Of all x, the biggest x is the secret key to decipher the secret. The task of the programmer is to find the largest X.
###Input format:
The first line is a positive integer n, and the second line consists of n positive integers less than or equal to $$10 ^ 6 $
1 ≤ n ≤ 2·$$10^5$$
###Output format:
Output the maximum value found.
###Input example:
```in
three
1 3 10
```
###Output example:
```out
one
```






answer:If there is no answer, please comment