Morning light hits the cedar groves of Balmcrest as Quartermaster unrolls the day's manifest of segments. The tally will decide the next shipment. Task: Print the number of index pairs (i,j), i<j, with a[i]+a[j] <= k. Input format: First line: n and k. Second line: n integers. Output format: Print the pair count (fits 64-bit). Constraints: 2 <= n <= 3532; 1 <= a[i],k <= 1000000.
Example 1:
Example 2:
Example 3:
Constraints:
2 <= n <= 3532; 1 <= a[i],k <= 1000000.
