QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22678. Moo University — 팀 선발

Statistics

올해 $N$마리($1 \le N \le 1{,}000$) 송아지가 Moo $U$ 체조팀에 지원하며 키는 양의 정수, 몸무게는100,000미만입니다. 최대한 많이 뽑으세요. 유일한 조건은 각 키 $H$, 몸무게 $W$가 다음을 만족하는 것입니다.

$A(H-h)+B(W-w) \le C$

$h$, $w$는 팀 전체의 최소 키와 최소 몸무게이며 $A$, $B$, $C$는 주어진10,000미만의 양의 정수 상수입니다. 팀의 최대 수를 구하세요.

입력

  • 1번 줄: 정수 하나 $N$.

  • 2번 줄: 공백으로 구분한 세 정수 $A$, $B$, $C$.

  • $3..N+2$번 줄: 공백으로 구분한 두 정수, 순서대로 키와 몸무게.

출력

  • 1번 줄: 팀 송아지의 최대 수를 정수 하나로 출력합니다.

예제

입력 1

8
1 2 4
5 1
3 2
2 3
2 1
7 2
6 4
5 1
4 3

출력 1

5

참고

출력 상세

예를 들어1,2,3,4,7은 유효한 팀입니다. 더 큰 팀은 불가능합니다.

문제 작성: Brian Dean, 2001

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.