| Author: | Pavel Mesenev | Time limit: | 2 sec | |
| Input file: | Standard input | Memory limit: | 256 Mb | |
| Output file: | Standard output |
There are n stalls at distinct integer positions a0, a1, …, an − 1 on a line, and C cows. Place the cows into C distinct stalls so that the minimum distance between any two cows is as large as possible.
Output that largest possible minimum distance.
The first line contains two integers n and C. The second line contains n distinct integers a0… an − 1 — the stall positions, in arbitrary order.
Print one integer — the maximum achievable minimum distance between two cows.
2 ≤ C ≤ n ≤ 105
0 ≤ ai ≤ 109, all ai distinct
| No. | Standard input | Standard output |
|---|---|---|
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|