Logo
(追記) (追記ここまで)

16304번 - A Prize No One Can Win 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1.5 초 512 MB38524221365.138%

문제

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.

입력

  • On the first line two integers, 1 ≤ n ≤ 105, the number of items for sale in your store, and 1 ≤ X ≤ 109, the minimum cost specified in the statement.
  • On the second line n positive integers, each at most 109. These are the prices of the items in the store.

출력

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

제한

예제 입력 1

5 6
1 2 3 4 5

예제 출력 1

3

예제 입력 2

5 10
4 8 1 9 7

예제 출력 2

2

예제 입력 3

4 10
1 3 1 7

예제 출력 3

4

예제 입력 4

1 5
6

예제 출력 4

1

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2018 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /