AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

BAPC18-069.A Prize No One Can Win

Medium · 1 s · 256 MB

  • icpc
  • bapc
  • 2018

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 nnn 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 XXX 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.

Giriş formatı

• On the first line two integers, 1≤n≤1051 \leq n \leq 10^51≤n≤105, the number of items for sale in your store, and 1≤X≤1091\leq X \leq 10^91≤X≤109, the minimum cost specified in the statement.

• On the second line nnn positive integers, each at most 10910^9109. These are the prices of the items in the store.

Çıxış formatı

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

Qeyd

Source: Benelux Algorithm Programming Contest 2018 · Author: <author name> · License: CC BY-SA 4.0 · Original: https://bapc.eu · Statement adapted for AlgoLens and shared under the same license. · 12 of the 45 original test cases (the largest) are omitted here to keep the problem lightweight.

Nümunələr

Giriş #1

5 6
1 2 3 4 5

Çıxış #1

3

Giriş #2

5 10
4 8 1 9 7

Çıxış #2

2

Giriş #3

4 10
1 3 1 7

Çıxış #3

4

Giriş #4

1 5
6

Çıxış #4

1