포럼
문제 ICPC00309

A. A Prize No One Can Win

설명

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

제약
입력 형식
  • 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.
출력 형식

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
출력
3
예제 2
입력
5 10
4 8 1 9 7
출력
2
예제 3
입력
4 10
1 3 1 7
출력
4
예제 4
입력
1 5
6
출력
1
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC BAPC 2018

평가 및 의견

A. A Prize No One Can Win

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

A. A Prize No One Can Win

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8