#K48292. Minimum Absolute Difference

    ID: 28388 Type: Default 1000ms 256MiB

Minimum Absolute Difference

Minimum Absolute Difference

Given a list of positive integers, your task is to determine the minimum absolute difference between any two consecutive elements after sorting the list in non-decreasing order.

Let the sorted array be (a_1 \le a_2 \le \dots \le a_n). You need to find (\min_{2 \le i \le n} (a_i - a_{i-1})).

inputFormat

The first line contains an integer \(T\), the number of test cases.

Each test case consists of two lines:
1. The first line contains an integer \(N\), the number of positive integers.
2. The second line contains \(N\) space-separated positive integers.

outputFormat

For each test case, output a single line containing the minimum absolute difference between any two consecutive elements in the sorted list.

## sample
3
4
4 2 1 3
3
10 20 30
5
5 3 1 4 2
1

10 1

</p>