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行目:空白区切り3整数 $A$、$B$、$C$。

  • $3..N+2$ 行目:空白区切り2整数、順に子牛の高さ、重さ。

出力

  • 1行目:チームの最大頭数を整数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.