A Cappella Recording
시간 제한1초메모리 제한2048 MB
n개의 음높이와 허용 차이 d가 주어질 때, 각 묶음의 최대 최소 차이가 d 이하가 되도록 모든 음을 덮는 최소 묶음 수를 구한다.
문제
Geoffry is preparing an a cappella composition where he sings the entire song by himself.
Each note of the song has a pitch between and . Because of the varying pitches in the song, Geoffry will record himself singing multiple times. In a single recording, he will pick some subset of the notes to sing and he will sing exactly those notes. To avoid straining his voice too much, within a single recording, there is a limit to the difference between the maximum pitch and the minimum pitch among the notes he sings.
Compute the minimum number of times that Geoffry can record himself singing the song and each note is sung in at least one of the recordings.
입력
The first line contains two integers and (), where is the number of notes in Geoffry's song, and is the largest difference between the minimum pitch and the maximum pitch that Geoffry can handle.
Each of the next lines contains a single integer (). These are the pitches of the notes in Geoffry's song, in the order that they are to be sung.
출력
Output a single integer, which is the minimum number of times that Geoffry can record himself singing the song and each note is sung in at least one of the recordings.