{"raw_statement":[{"iden":"problem statement","content":"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.  \nHere, $A_1 < A_2 < A_3 < \\dots < A_N$ and all $A_i$ are even numbers.\nWe will now hold a party for $k$ seconds.  \nDuring 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.)  \nThe people request that the following condition be satisfied for every integer $i$ such that $1 \\le i \\lt N$:\n\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.\n\nFind the minimum $k$ for which there is a strategy that the people can take to satisfy all the conditions.  \nWe can prove that the answer is an integer under the Constraints of this problem."},{"iden":"constraints","content":"*   $2 \\le N \\le 2 \\times 10^5$\n*   $0 \\le A_i \\le 10^9$\n*   $A_1 < A_2 < A_3 < \\dots < A_N$\n*   $A_i$ is an even number."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $A_3$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"3\n0 6 10"},{"iden":"sample output 1","content":"5\n\nDuring the party lasting $5$ seconds, each person should move as follows:\n\n*   Person $1$: always moves in the positive direction at a speed of $1$.\n*   Person $2$: moves in the positive direction at a speed of $1$ during the first $2$ seconds, then in the negative direction at a speed of $1$ during the remaining $3$ seconds.\n*   Person $3$: always moves in the negative direction at a speed of $1$.\n\nIf they move in this way, Person $2$ and Person $3$ will be at the same coordinate exactly $2$ seconds after the beginning, and Person $1$ and Person $2$ will be at the same coordinate at the end of the party.  \nThus, they can satisfy all the conditions for $k = 5$. For smaller $k$, there is no strategy to satisfy all of them."},{"iden":"sample input 2","content":"5\n0 2 4 6 8"},{"iden":"sample output 2","content":"3\n\nDuring the party lasting $3$ seconds, each person should, for example, move as follows:\n\n*   Person $1$: always moves in the positive direction at a speed of $1$.\n*   Person $2$: moves in the positive direction at a speed of $1$ during the first $2$ seconds, then in the negative direction at a speed of $1$ during the remaining $1$ second.\n*   Person $3$: does not move at all.\n*   Person $4$: moves in the negative direction at a speed of $1$ during the first $2$ seconds, then in the positive direction at a speed of $1$ during the remaining $1$ second.\n*   Person $5$: always moves in the negative direction at a speed of $1$."},{"iden":"sample input 3","content":"10\n0 2 4 6 8 92 94 96 98 100"},{"iden":"sample output 3","content":"44"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}