ADOMINO - Arranging Dominoes
Dominoes have long entertained both game enthusiasts and programmers for quite some time. Many games can be played with dominoes, including multiplayer and single player games. Hari Khan has come up with a single player game. He takes N boxes and arranges them in a row at positions N1, N2 ... NN. Now he has to place D dominoes (D <= N) in the boxes such that the minimum distance between any two filled boxes is maximized.
The first line of the input contains an integer t, the number of test cases. t test cases follow.
The first line of each test case consists of two integers, N <= 100000 and D <= N, separated by a single space.
N lines follow, each containing a single integer Ni <= 1000000000, indicating the location of the ith box.
For each test case, output a single line containing a single integer denoting the largest minimum distance achievable between any two boxes with dominoes.
Input: 1 5 3 1 2 3 4 5 Output: 2
remember two boxes can be at same position !!
? <= t <= ?
Same Problems: AGGRCOW