A thermostat controller picks two of its n sensor readings and adds them to estimate a setpoint. Given a target setpoint t, choose two distinct readings whose sum is as close to t as possible, and report how far off the best pair is — that is, the minimum value of |reading[i] + reading[j] - t| over all pairs i < j. The readings are not sorted.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the sensor readings.
Line 3: an integer t, the target setpoint.
Output format
A single integer: the minimum achievable |reading[i] + reading[j] - t|.
Constraints
- 2 ≤ n ≤ 100000
- -1000000000 ≤ each reading ≤ 1000000000
- -2000000000 ≤ t ≤ 2000000000