Problem list
Log in
#icpc00309 · ICPC BAPC 2018

A Prize No One Can Win

Silver V 1.5 s 2048 MB

-3mm

-10mm

After the festive opening of your new store, the Boutique store for Alternative Paramedicine and Cwakhsahlvereigh, to your disappointment you find out that you are not making as many sales as you had hoped. To remedy this, you decide to run a special offer: you will mark some subset of the $n$ items for sale in your store as participating in the offer, and if people buy exactly two of these items, and the cost of these items is strictly more than $X$ euros, you will give them a free complimentary unicorn horn!

Since you recently found out all your unicorn horns are really narwahl tusks, you decide to rig the offer by picking the participating items in such a way that no one can earn a horn anyway.

To make sure no one becomes suspicious, you want to mark as many items as possible as participating in the offer.

Input

  • On the first line two integers, $1 \leq n \leq 10^5$, the number of items for sale in your store, and $1\leq X \leq 10^9$, the minimum cost specified in the statement.
  • On the second line $n$ positive integers, each at most $10^9$. These are the prices of the items in the store.

Output

Print the maximum number of items you can mark as part of your special offer, without anyone actually being able to receive a horn.

Example 1

Input
5 6
1 2 3 4 5
Output
3

Example 2

Input
5 10
4 8 1 9 7
Output
2

Example 3

Input
4 10
1 3 1 7
Output
4

Example 4

Input
1 5
6
Output
1
Source
ICPC BAPC 2018
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