루미 알고리즘

#1592골드Illuminated City

PO 2024 온라인 예선코딩출제 John Hedin영어 원문이 문제가 어렵다면 — 배우는 순서 보기

영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)

Problem

To make the city more pleasant, the municipality of Lund has decided to install light strips over the streets. The municipality prefers to have lighting in as many places as possible. There are many locations where light strips could be installed, and since the city council is busy, you have been asked to figure out where the light strips should be placed.

(그림은 원문 저장소에서 볼 수 있습니다)

Light strips in Lund, used with permission

The streets in Lund vary in width, which means that the light strips will need to be custom ordered. It is possible to custom order light strips in lengths of whole meters, which cost x SEK per meter. To avoid appearing wasteful, the municipality demands that the average cost for each light strip ordered is at most y SEK per light strip.

The municipality has now provided you with a list of how long the light strips need to be in order to be installed in N different locations in the city. Can you help them set up as many as possible?

Input

The first line of the input contains the integer N (1 ≤ N ≤ 10^5), the number of spots where we might install a light strip.

The second line contains the integer x (1 ≤ x ≤ 30), the cost in SEK of buying one whole meter of light strip.

The third line contains the integer y (1 ≤ y ≤ 1000), the highest average cost per light strip the municipality is willing to pay for.

Afterwards, there will be a line with N integers L_1, L_2, …, L_n (1<=L_i<=20), where L_i means that a light strip must be exactly L_i meters to illuminate the i:th location.

Output

Print an integer: the largest number of locations that can be illuminated by light strips within the municipalitys budget.

Points

Your solution will be tested on several test case groups. To get the points for a group, it must pass all the test cases in the group.

GroupPoint valueConstraints
120L_i=10 for all i
220L_i=10 or 20 for all i
320N ≤ 500
440No additional constraints.

Explanation of sample 1

It is possible to buy the first 3 light strips. The average cost will then be (6+9+12)/3=9 SEK, which barely fits within the budget of at most 9 SEK per light strip on average.

예제

예제 1

입력
4
3
9
2 3 4 5
출력
3

예제 2

입력
2
4
50
10 10
출력
2

예제 3

입력
3
4
60
20 20 10
출력
2

출처 표기

출처: Programmeringsolympiaden 2024년 온라인 예선 · 원문 페이지 · 이용 조건 CC BY-SA · LaTeX 원문을 화면용 글로 옮겼습니다(수식·표의 모양이 다를 수 있습니다). 내용은 고치지 않았습니다.

크리에이티브 커먼즈 저작자표시-동일조건변경허락.

문제 출처: 한국정보올림피아드(KOI) (CC BY-NC-SA 4.0) · International Olympiad in Informatics (IOI) (CC BY) · Centre for Education in Mathematics and Computing (CEMC), University of Waterloo (CC BY-NC 4.0) · Programmeringsolympiaden (CC BY-SA) · CSES Problem Set (Antti Laaksonen) (CC BY-NC-SA 4.0). 루미 알고리즘은 위 단체들과 관계없는 별도의 서비스이며, 자료는 원문 그대로 싣습니다. 문제마다 출처와 이용 조건을 따로 표기합니다.