A depot has n parcels, each with an integer weight. A delivery cart can carry exactly two parcels at once, but only if their combined weight does not exceed a limit L. Count how many unordered pairs of distinct parcels (i, j) with i < j satisfy weight[i] + weight[j] <= L. The parcels are not given in any particular order.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the parcel weights.
Line 3: an integer L, the combined-weight limit.
Output format
A single integer: the number of unordered pairs whose weights sum to at most L.
Constraints
- 1 ≤ n ≤ 100000
- -1000000000 ≤ each weight ≤ 1000000000
- -2000000000 ≤ L ≤ 2000000000