시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB151413100.000%

문제

For your next summer holidays, you are planning an exciting road trip covering the full length of the famous M6 motorway.

You have your route planned out to balance travel time between stops, but time is a little short so you will have to strike one of the stops from your itinerary and continue straight past it to the next one.

To make the longest drive between stops as short as possible, which stop should you eliminate from your itinerary?

입력

  • The first line of input contains the number of stops, $n$ ($3 \le n \le 200,000$).
  • The second line of input contains $n$ integers in strictly-increasing order, $s_1 \ldots s_n$ ($0 \le s \le 10^9$) giving the cumulative distances of stops on your original route.

The first stop and last stop denote your start and end point respectively and cannot be skipped.

출력

Output the smallest integer distance between stops you can have, if you remove exactly one stop from the itinerary and it is not the first or last.

예제 입력 1

5
0 50 125 175 236

예제 출력 1

111

예제 입력 2

4
100 300 600 10000

예제 출력 2

9400