#K6206. Smallest Absolute Difference
Smallest Absolute Difference
Smallest Absolute Difference
You are given an integer \(N\) and an array of \(N\) integers. Your task is to find the smallest absolute difference between any two distinct elements in the array. In other words, find the minimum value of \(|a_i - a_j|\) for all \(1 \le i < j \le N\).
Note: If there are less than two elements, the output should be 0.
inputFormat
The input is given in two lines:
- The first line contains an integer \(N\), representing the number of elements in the array.
- The second line contains \(N\) space-separated integers.
You should read the input from standard input (stdin).
outputFormat
Output a single integer: the smallest absolute difference between any two elements in the array, i.e., \(\min_{1\le i<j\le N} |a_i - a_j|\).
The output should be written to standard output (stdout).
## sample5
3 8 15 17 9
1