Game with Dominoes

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

문제

There are nn dominoes of equal height hh (h_minhh_maxh\_{\min} \le h \le h\_{\max}) that are placed in a straight row. The ii-th of them is placed in position a_ia\_i.

Lobster and Mobster play the following game. The players take turns dropping dominoes. On each turn, the current player picks one of the dominoes and then drops it either to the left, or to the right. The domino falls and possibly drops some other dominoes.

One domino may drop another one if and only if distance between them (difference of positions) is strictly less than hh. For example, if a domino ii has position a_ia\_i and a domino jj located right from domino ii has position a_ja\_j, and a_ja_i<ha\_j - a\_i < h, then dropped rigth domino ii also drops domino jj. Then, domino jj may drop the following domino and so on, until the last domino in the dropping chain cannot touch the next one.

The game ends when all dominoes are fallen. A player wins if he drops the last domino, and a player loses if on his turn he cannot drop a domino because there are no dominoes to be dropped.

Lobster makes a move first, and it gives him an advantage. So, before the start of the game Mobster is allowed to cast a magic spell which changes heights of all dominoes from hh to an arbitrary number hh' chosen by Mobster from range \[h_min,h_max]\[h\_{\min}, h\_{\max}] (inclusive).

Players play optimally. Find the minimal height of dominoes hh' which brings Mobster a victory, or determine that any hh' leads to Mobster's loss.

입력

The first line contains integers nn, h_minh\_{\min}, and h_maxh\_{\max} (1n1051 \le n \le 10^5, 1h_minh_max1091 \le h\_{\min} \le h\_{\max} \le 10^9).

The second line contains nn integers. The ii-th of them is a position a_ia\_i of the ii-th domino (109a_i109-10^9 \le a\_i \le 10^9). It is guaranteed that positions of all dominoes are pairwise distinct.

출력

Output the minimal height hh' which brings Mobster a victory, or output "-1" if for any value hh' from range \[h_min,h_max]\[h\_{\min}, h\_{\max}] Mobster loses.