#K57817. Maximum Absolute Difference After Zeroing Operation

    ID: 30505 Type: Default 1000ms 256MiB

Maximum Absolute Difference After Zeroing Operation

Maximum Absolute Difference After Zeroing Operation

You are given an array of integers. You must perform exactly one operation: choose exactly one element in the array and set its value to 0. After performing the operation, determine the maximum absolute difference between any two adjacent elements of the resulting array.

Formally, let the array be \(a_1, a_2, \dots, a_n\). You choose an index \(i\) (\(1 \le i \le n\)) and set \(a_i = 0\). Then, you must compute the maximum value of \(|a_j - a_{j+1}|\) for \(1 \leq j < n\) in the new array.

Note: If the array contains only one element, the answer is the absolute value of that element.

inputFormat

The input is read from standard input (stdin) and has the following format:

n
a1 a2 ... an

Here, n is the number of elements in the array, and the next line contains n integers separated by spaces.

outputFormat

Output the maximum absolute difference between any two adjacent elements after performing exactly one operation (setting one element to 0), written to standard output (stdout).

## sample
5
2 4 8 6 10
10