VISTA STALLS

Problem Statement

There are some stalls m in VISTA EVENT 2k23. In those m stalls, only n were available for auction. Each stall contains a Stall Number, and each stall is placed based on its stall number in increasing order. There are k groups interested in buying the stalls, but they don’t want other group members who came for the auction with them to get nearby stalls.

Your task is to assign k stalls to the k groups such that the minimum distance between any two of the stalls is maximized. The distance between two stalls is the difference between the two stall numbers.

Input Format

  • The first line contains the number of test cases (T). Each testcase contains two lines:
    • The first line contains two integers N (number of stalls available) and k (number of groups interested to buy stalls).
    • The second line contains an array A of size n which contains Stall Numbers.

Output Format

  • Print the maximum possible minimum distance.

Constraints

  • 1 ≤ T ≤ 10^3
  • 1 ≤ k ≤ N ≤ 10^6
Sample Input
Sample Output

Solution

Solution Not Available

Comments

Load Comments