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.