#C967. Minimize Skill Difference

    ID: 53788 Type: Default 1000ms 256MiB

Minimize Skill Difference

Minimize Skill Difference

You are given the skill levels of participants in one or more contests. For each contest, your task is to compute the minimum difference between the skills of any two consecutive participants after sorting the skill levels.

More formally, given an array \(a_1, a_2, \dots, a_n\) representing the skill levels, you need to find:

[ \min_{1 \le i < n} (a_{i+1} - a_i) ]

This measure can be used to ensure teams are as evenly matched as possible by minimizing the discrepancy in skills.

inputFormat

The first line of the input contains an integer \(T\) representing the number of test cases. For each test case:

  • The first line contains an integer \(N\) denoting the number of participants.
  • The following \(N\) lines each contain an integer representing the skill level of a participant.

All input is provided via standard input (stdin).

outputFormat

For each test case, output a single line containing the minimum difference between consecutive skill levels after sorting them. The results for different test cases should be printed on separate lines via standard output (stdout).

## sample
2
4
1
4
6
8
5
10
20
30
40
50
2

10

</p>