#P1249A. Yet Another Dividing into Teams
Yet Another Dividing into Teams
No submission language available for this problem.
Description
You are a coach of a group consisting of students. The -th student has programming skill . All students have distinct programming skills. You want to divide them into teams in such a way that:
- No two students and such that belong to the same team (i.e. skills of each pair of students in the same team have the difference strictly greater than );
- the number of teams is the minimum possible.
You have to answer independent queries.
The first line of the input contains one integer () — the number of queries. Then queries follow.
The first line of the query contains one integer () — the number of students in the query. The second line of the query contains integers (, all are distinct), where is the programming skill of the -th student.
For each query, print the answer on it — the minimum number of teams you can form if no two students and such that may belong to the same team (i.e. skills of each pair of students in the same team has the difference strictly greater than )
Input
The first line of the input contains one integer () — the number of queries. Then queries follow.
The first line of the query contains one integer () — the number of students in the query. The second line of the query contains integers (, all are distinct), where is the programming skill of the -th student.
Output
For each query, print the answer on it — the minimum number of teams you can form if no two students and such that may belong to the same team (i.e. skills of each pair of students in the same team has the difference strictly greater than )
Samples
Note
In the first query of the example, there are students with the skills . There is only one restriction here: the -st and the -th students can't be in the same team (because of ). It is possible to divide them into teams: for example, students , and are in the first team and the student in the second team.
In the second query of the example, there are students with the skills . It is possible to compose just a single team containing both students.