QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#22678. Moo University — selezione della squadra

İstatistikler

Quest’anno $N$ ($1 \le N \le 1{,}000$) vitelli provano per la ginnastica di Moo $U$, ciascuno con altezza intera positiva e peso sotto 100,000. Scegline più possibile. Unico vincolo: altezza $H$ e peso $W$ di ciascuno soddisfano:

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

$h$, $w$ sono altezza e peso minimi di tutta la squadra; $A$, $B$, $C$ costanti intere positive date sotto 10,000. Calcola il massimo numero di vitelli.

Input

  • Riga 1: un intero $N$.

  • Riga 2: tre interi $A$, $B$, $C$ separati da spazi.

  • Righe $3..N+2$: due interi separati da spazio, altezza e peso rispettivamente.

Output

  • Riga 1: un intero, massimo di vitelli nella squadra.

Esempi

Input 1

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

Output 1

5

Note

Dettagli dell’output

Per esempio 1,2,3,4,7 formano squadra valida. Una maggiore è impossibile.

Autore del problema: 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.