QOJ.ac

QOJ

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

#22678. Moo University — Teamauswahl

Statistics

Dieses Jahr bewerben sich $N$ ($1 \le N \le 1{,}000$) Kälber für das Turnteam von Moo $U$, mit positiver ganzzahliger Höhe und Gewicht unter 100,000. Wähle möglichst viele. Einzige Bedingung: Höhe $H$ und Gewicht $W$ jedes Kalbs erfüllen:

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

$h$, $w$ sind minimale Höhe und Gewicht aller Teamkälber; $A$, $B$, $C$ gegebene positive ganzzahlige Konstanten unter 10,000. Berechne die größte Teamgröße.

Eingabe

  • Zeile 1: eine ganze Zahl $N$.

  • Zeile 2: drei durch Leerzeichen getrennte ganze Zahlen $A$, $B$, $C$.

  • Zeilen $3..N+2$: zwei durch Leerzeichen getrennte ganze Zahlen, Höhe und Gewicht eines Kalbs in dieser Reihenfolge.

Ausgabe

  • Zeile 1: eine ganze Zahl, größte Kälberzahl im Team.

Beispiele

Eingabe 1

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

Ausgabe 1

5

Hinweis

Ausgabedetails

Zum Beispiel Kälber 1,2,3,4,7 bilden ein zulässiges Team. Ein größeres ist unmöglich.

Aufgabenautor: 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.