#P10730. [NOISG 2023 Qualification] Burgers
[NOISG 2023 Qualification] Burgers
Problem Description
Lobster Kai runs a burger shop. Making one burger requires kinds of ingredients, and for the -th ingredient he has portions.
He has two burger recipes. For the -th ingredient, these two recipes require portions and portions respectively.
Compute the maximum number of burgers Kai can make with these ingredients.
Input Format
The first line contains a positive integer .
The second line contains integers, representing .
The third line contains integers, representing .
The fourth line contains integers, representing .
Output Format
Output one integer per line, representing the maximum number of burgers that can be made.
3
14 10 100
3 1 1
2 3 1
5
2
83 72
1 3
1 3
24
Hint
Sample #1 Explanation
Kai can make burgers of the first type and burgers of the second type.
Sample #2 Explanation
Kai can make burgers of the first type, or burgers of the second type.
Constraints
| Score | Special Property | |
|---|---|---|
| Samples | ||
| For all , . | ||
| . | ||
| . | ||
| None. | ||
For of the testdata, , .
Translated by ChatGPT 5