khba Loves to Sleep!
From Codeforces. Geometry. Solve the geometry problem "khba Loves to Sleep!".
Examples
Input: [2,10,0,3,7,10]
Output: 2
Input: [1,10,0,10]
Output: 5
Hints
Maximize min distance = binary search on answer m. Check: can k teleports cover all friends within distance m? Each teleport covers a contiguous interval.
Sort friends. Greedy: place teleport at friend_pos + m, skip all friends within m of it. Count teleports needed; if ≤ k, m is feasible.
Friends at 0 and x limit teleport placement. Gaps between consecutive friends after sorting — available positions for teleports in each gap is max(0, gap_width - 2m + 1).
Related Problems
khba Loves to Sleep!
**From Codeforces.** Geometry. Solve the geometry problem "khba Loves to Sleep!".