#C6950. Minimum Number of Street Lights

    ID: 50767 Type: Default 1000ms 256MiB

Minimum Number of Street Lights

Minimum Number of Street Lights

You are given ( n ) houses located along a number line and a street light that can illuminate at most ( k ) houses. Although the positions of the houses are provided, the illumination capacity of a street light is based solely on the count of houses it can cover, regardless of the distances between them. In other words, if you sort the house positions, you can cover any ( k ) consecutive houses using one street light. Your task is to determine the minimum number of street lights required to ensure that every house is illuminated.

For example, if ( n = 10 ) and ( k = 2 ), then you can cover the houses by grouping them into 5 groups, each with 2 houses, resulting in 5 street lights. Note that when ( k = 1 ), each house requires its own street light. Solve this problem by reading from standard input and writing the result to standard output.

inputFormat

The first line contains two integers ( n ) and ( k ), representing the number of houses and the maximum number of houses that one street light can illuminate, respectively. The second line contains ( n ) space-separated integers representing the positions of the houses on a number line.

outputFormat

Output a single integer representing the minimum number of street lights required to illuminate all houses.## sample

10 2
1 3 5 7 9 11 13 15 17 19
5