Problem Statement
There are $N$ people, Person $1$ through Person $N$, standing on a number line. Person $i$ is now at coordinate $A_i$ on the number line.
Here, $A_1 < A_2 < A_3 < \dots < A_N$ and all $A_i$ are even numbers.
We will now hold a party for $k$ seconds.
During the party, each person can freely move on the number line at a speed of at most $1$ per second. (It is also allowed to move in the negative direction within the speed limit.)
The people request that the following condition be satisfied for every integer $i$ such that $1 \le i \lt N$:
- there is at least one moment during the party (including the moment it ends) when Person
$i$and Person$i + 1$are at the same coordinate.
Find the minimum $k$ for which there is a strategy that the people can take to satisfy all the conditions.
We can prove that the answer is an integer under the Constraints of this problem.
Constraints
$2 \le N \le 2 \times 10^5$$0 \le A_i \le 10^9$$A_1 < A_2 < A_3 < \dots < A_N$$A_i$is an even number.
Input
Input is given from Standard Input in the following format:
N
A_1 A_2 A_3 \dots A_N
Output
Print the answer as an integer.
样例
3
0 6 10
5
5
0 2 4 6 8
3
10
0 2 4 6 8 92 94 96 98 100
44
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。