Call for Problems, Round 3
면접 대비시간 제한1초메모리 제한2048 MB
n개의 난이도 값이 주어질 때, 고른 값들 사이의 차이가 모두 t 이상이 되도록 최대 개수의 부분집합을 고른다.
문제
The Call for Problems for the Pacific Northwest Regional has finished, and a number of problems were proposed. The judges voted on the difficulty of each problem. The Pacific Northwest Regional this year will feature some number of problems, and one of the goals is for no two problems to be too similar in difficulty.
Specifically, if two different problems have difficulty ratings and , then the difference between the two must be at least .
Given the problems proposed, compute the maximum number of problems that can be put on the Pacific Northwest Regional.
입력
The first line contains two integers, and ().
The next line contains integers, the difficulties of the problems proposed. Each difficulty will be between and .
출력
Output a single integer, the maximum number of problems that can be put on the Pacific Northwest Regional.