Two warehouses each keep a sorted (non-decreasing) log of shipment values: log A has n values and log B has m values. You must pick exactly one value from A and one value from B; among all such cross pairs, find the minimum possible absolute difference between the pair's sum and a target T.
Input format
Line 1: three integers n, m, and T.
Line 2: n space-separated integers, sorted non-decreasing — log A.
Line 3: m space-separated integers, sorted non-decreasing — log B.
Output format
A single integer: the minimum value of |a + b - T| over all a in A and b in B.
Constraints
- 1 ≤ n, m ≤ 100000
- -1000000000 ≤ each value, T ≤ 1000000000
- Both logs are individually sorted in non-decreasing order.