Project Team

3.2

16 votes
Easy
Problem

A Professor of Physics gave projects to the students of his class. The students have to form a team of two for doing the project. The professor left the students to decide the teams. The number of students in a class will be even.

Each student has a knowledge level. It tells how much knowledge each student has. The knowledge level of a team is the sum of the knowledge levels of both the students.

The students decide to form groups such that the difference between the team with highest knowledge and the one with lowest knowledge is minimum.

Input

First line of the input will contain number of test cases t; In the next t lines the first number is n the number of students in the class followed by n integers denoting the knowledge levels of the n students

Output

Your output should be a single line containing the lowest possible difference between the team with highest knowledge and the one with lowest knowledge.

Sample Input
2
4 2 6 4 3
6 1 1 1 1 1 1
Sample Output
1
0
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Input Constraints are

1 <= t <= 100 1 <= n <= 100 1 <= knowledge level <= 10000

Editor Image

?