Highest Hill

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Sweden may not have a particularly impressive mountain range compared to other NCPC countries such as Norway and Iceland, but at least it beats the flatlands of Denmark. The situation is not so clear when comparing other member countries though. For example, is Estonia more mountainous than Lithuania? To settle this question, you want to determine which of the two countries has the most impressive mountain peak.

A mountain range is defined by sampling the heights h_ih\_i of nn equidistant points. Within a mountain range, we call a triple of indices 1i<j<kn1 \le i < j < k \le n a peak if h_ih_jh_kh\_i \leq \cdots \leq h\_j \geq \cdots \geq h\_k. The height of a peak is defined as the smaller of h_jh_ih\_j - h\_i and h_jh_kh\_j-h\_k.

Given a mountain range, can you find the height of its highest peak?

입력

The first line contains a single integer NN (3n200,0003 \le n \le 200\\,000), the number of sampled points of the mountain range.

The second and final line contains the heights h_1,,h_Nh\_1, \dots, h\_N (0h_i3181090 \le h\_i \le 318 \cdot 10^9) of the sampled points, in nanometers above sea level.

It is guaranteed that the mountain range contains at least one peak.

출력

Output a single integer: the height of the highest peak.