#K48912. Smallest Absolute Difference

    ID: 28526 Type: Default 1000ms 256MiB

Smallest Absolute Difference

Smallest Absolute Difference

You are given an array of n integers. Your task is to find the smallest absolute difference between any two distinct elements in the array. The absolute difference between two numbers \(x\) and \(y\) is given by \(|x-y|\). It is guaranteed that the array contains at least two numbers.

Example: For the array [1, 3, 6, 10, 15], the smallest absolute difference is 2, which is the difference between 1 and 3.

You need to read the input from stdin and output the result to stdout as specified.

inputFormat

The first line of input contains a single integer \(n\) (\(n \geq 2\)) representing the number of elements in the array. The second line contains \(n\) space-separated integers.

outputFormat

Output a single integer denoting the smallest absolute difference between any two distinct elements in the array.

## sample
5
1 3 6 10 15
2

</p>