# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

## Byang and Kochuripana Trouble

Byang is the chief software engineer at Toad Incorporated. His grandmother is planning to give him a visit. But his grandmother is old and weak. She walks very slowly and cannot take long footsteps anymore. And most importantly, she hates “Kochuripana”.

Byang discovered that the only road to his house has some “Kochuripana”. He took notes on where the “Kochuripanas” are located. Then he passed the notes to you and told you that his grandmother always takes equal sized footsteps. Byang wonders what is the minimum length of footstep his grandmother can take so that she does not have to step on any “Kochuripana”. Now it is your job to find the answer.

Let’s denote positive **X-axis** as the only road to Byang’s house. Byang’s grandmother will start to walk from point **0**. There are **N** “Kochuripanas” at integer points **X _{1}**,

**X**,….,

_{2}**X**. You have to find the minimum length of footstep Byang’s grandmother can take so that she does not step on any “Kochuripana”. Note that, if Byang’s grandmother takes footsteps of size

_{N}**k**, then she will step on these points:

**0**,

**k**,

**2k**,

**3k**,

**4k**… Also note that, Byang’s grandmother always takes footsteps of integer length.

#### Input

On the first line a positive integer **N** **(N <= 10 ^{6})**

On the next **N** lines there will be one integer **X _{i}**

**(1 <= X**.

_{i}<= 10^{7})#### Output

Only one line with one integer, the minimum length of footstep Byang’s grandmother should take to avoid “Kochuripana”.

#### Samples

Input | Output |
---|---|

4 2 3 7 8 | 5 |

#### himuhasib

Hasib is passionate about sport programming and artificial intelligence. He was an IOI participant through years 2013-2015. He qualified to ACM-ICPC World Finals 2016. He studies at North South University. →

Login to submit