This page is still under construction.

Parts of this page are still being built. What you see may change.

Standing Long Jump

Interview

Time limit1sMemory limit128 MB

Summary
Remove exactly m of n interior stones so the smallest gap between consecutive stepping points from 0 to d is as large as possible.
Level

Medium6 of 10

Topics
Binary search, Greedy, Array, Sorting
Solved
No attempts yet

Problem

Students train for the standing long jump. The training ground is filled with boiling lava, so a student must cross to the exit on the far side by stepping on stone islands placed over the lava.

The student starts on the island at position 00, and the exit is at position dd. Between the start island and the exit there are nn small stone islands; the position of each island is given as its distance from the start island.

The teacher removes exactly mm of these nn small islands. The student then steps on every one of the remaining n−mn-m small islands, jumping in order of position from the start island to the exit. (No matter how far apart two islands are, the jump always succeeds — the student never falls into the lava.)

The length of a single jump is the distance between two consecutive stepping points. That is, lay out the start island, the remaining small islands, and the exit in order of position; the distances between adjacent points are the jump lengths.

Choose which mm islands to remove so as to maximize the minimum jump length. Output that maximum possible value.

Input

The first line contains the distance dd from the start island to the exit (1≤d≤1091 \le d \le 10^9), the number of small islands nn (0≤n≤500000 \le n \le 50000), and the number of islands to remove mm (0≤m≤n0 \le m \le n), separated by spaces.

Each of the next nn lines contains one integer: the position of a small island (its distance from the start island). All island positions are distinct.

Output

Print the maximum achievable value of the minimum jump length after removing mm islands.

Examples3

  1. Example 1

    Input
    25 5 2
    2
    14
    11
    21
    17
    
    Expected output
    4
    
  2. Example 2

    Input
    10 3 0
    2
    5
    8
    
    Expected output
    2
    
  3. Example 3

    Input
    10 2 1
    3
    7
    
    Expected output
    3