There are $N$ candy bundles. Count the unordered pairs of distinct bundles whose candy totals sum to at most $K$.
Input
Line 1: $N$ $K$. Next $N$ lines: the candy count of each bundle.
Output
Print the number of valid pairs.
Example 1
Input
4 6 3 5 2 1
Output
4
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.