Problem list
Log in
#r03122 · Online Judge > GoldOJ

Candy Bundle Pairs

Silver II 2.0 s 1024 MB

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
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code