Jumping Jack

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

문제

For as long as he could remember, Jack has loved to jump. His goal is to become an Olympic athlete someday, so he spends lots of time practicing his jumping skills. Jack has set up a course of checkpoints along a straight line from his starting point. To go through this course, Jack picks a jumping level, which defines how far he can travel along these checkpoints. Specifically, if Jack is at a checkpoint located at position ii and has picked jumping level jj, he will jump to the furthest checkpoint that is at or before position i+ji + j. If there is no checkpoint in the range \[i+1,i+j]\[i + 1, i + j], then Jack will fail to finish the course because he cannot make a jump.

Jack wants to know how he should pick his jumping level so that he can make it through the course. Additionally, in order to get in enough practice without overexercising, Jack wants to finish the course in exactly kk jumps. Given the positions of all the checkpoints, find the maximum jump level that Jack should pick to make it through the course with exactly kk jumps or determine if it is impossible to do so.

입력

The first line of input is 22 integers separated by spaces nn and kk such that 3n1063 \leq n \leq 10^6 and 2k<n2 \leq k < n. The next line is nn distinct integers in sorted order that represent the checkpoint positions, c_ic\_i, that Jack jumps to. You are guaranteed that c_1=0c\_1 = 0 and c_i106c\_i \leq 10^6

출력

Output a single integer representing the maximum possible jump size such that Jack takes exactly kk jumps through the checkpoints given that jump size. If no such jump size exists, output 1-1.