{"raw_statement":[{"iden":"problem statement","content":"Takahashi turned on a computer at time $0$ and clicked the mouse $N$ times. The $i$\\-th $(1 \\le i \\le N)$ click was at time $T_i$.\nIf he consecutively clicked the mouse at time $x_1$ and time $x_2$ (where $x_1 < x_2$), a double click is said to be fired at time $x_2$ if and only if $x_2 - x_1 \\le D$.\nWhat time was a double click fired for the first time? If no double click was fired, print `-1` instead."},{"iden":"constraints","content":"*   $1 \\le N \\le 100$\n*   $1 \\le D \\le 10^9$\n*   $1 \\le T_i \\le 10^9(1 \\le i \\le N)$\n*   $T_i < T_{i+1}(1 \\le i \\le N-1)$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $D$\n$T_1$ $T_2$ $\\dots$ $T_N$"},{"iden":"sample input 1","content":"4 500\n300 900 1300 1700"},{"iden":"sample output 1","content":"1300\n\nTakahashi clicked the mouse at time $900$ and $1300$. Since $1300 - 900 \\le 500$, a double click was fired at time $1300$.\nA double click had not been fired before time $1300$, so $1300$ should be printed."},{"iden":"sample input 2","content":"5 99\n100 200 300 400 500"},{"iden":"sample output 2","content":"\\-1\n\nNo double click was fired, so print `-1`."},{"iden":"sample input 3","content":"4 500\n100 600 1100 1600"},{"iden":"sample output 3","content":"600\n\nIf multiple double clicks were fired, be sure to print only the first such event."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}