Skip to main content
LIVE CONTEST: ALGOR Contest: Round #4 (Special Challenge) is live now!

~/algor $ cat problems/minmax-26-qoshnilar-farqi-eng-kattasi

Largest difference of neighbours

Easy 1000 ms 128 MB 32%
Share

A positive integer $N$ and $N$ integers are given. Find the largest value of the absolute difference of adjacent elements $|A_{i + 1} - A_{i}|$ ($1 \le i \lt N$).

Choosing the largest of the differences of adjacent elements

Input

The first line contains a positive integer $N$. The next line contains $N$ integers $A_{i}$.

Output

One integer.

Note

$2 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$

Examples

Input #1
5
4 9 7 1 6
Output #1
6
Input #2
2
-3 -3
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.