luogu#P1926. 小书童——刷题大军
小书童——刷题大军
Background
Math is fire, lighting the lamp of physics; physics is a lamp, illuminating the road of chemistry; chemistry is a road, leading to the pit of biology; biology is a pit, burying those who study science. Classical Chinese is fire, lighting the palace lamps of history; history is a lamp, illuminating the road of society; society is a road, leading to the big pit of philosophy; philosophy is a pit, burying liberal arts students. — Xiao A.
Problem Description
Xiao A is wildly “grinding problems”, blatantly “grinding problems”. He has found kinds of “problems” he likes in Xiao Shutong, and each “problem” has a required time. The teacher has assigned homework tasks, each with its required time and score, and the teacher stipulates that points or more is passing. Xiao A has only units of time left, and he wants to “grind” as many “problems” as possible on the basis of passing.
Input Format
The first line contains four integers .
The second line has numbers, representing the required time for each “problem”.
The third line has numbers, representing the required time for each homework task.
The fourth line has numbers, representing the score of each homework task.
Output Format
A single number, representing how many “problems” Xiao A can grind.
3 4 20 100
15 20 50
10 15 40 40
5 5 10 15
2
Hint
Constraints and Agreements
For of the testdata, , , , . It is guaranteed that passing is always possible.
Translated by ChatGPT 5