| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 156 | 47 | 39 | 40.206% |
Kai the lobster is starting a burger chain selling burgers. He has $n$ ingredients to work with, which are labelled from 1ドル$ to $n$. For each ingredient $i,ドル he has $x[i]$ portions of ingredient $i$.
He has two recipes for burgers. For each ingredient $i,ドル the first recipe requires $a[i]$ portions of ingredient $i$ and the second recipe requires $b[i]$ portions of ingredients $i$.
Can you help Kai compute the maximum total number of burgers he can make?
The first line of input consists of one integer $n,ドル the number of different ingredients.
The second line consists of $n$ spaced integers $x[1], x[2], \dots , x[n - 1], x[n],ドル the total number of portions Kai has of each ingredient.
The third line consists of $n$ spaced integers $a[1], a[2], \dots , a[n - 1], a[n],ドル the number of portions of each ingredient for the first recipe.
The fourth line consists of $n$ spaced integers $b[1], b[2], \dots , b[n - 1], b[n],ドル the number of portions of each ingredient for the second recipe.
The output should contain a single integer on a single line, the largest number of burgers Kai can make.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 9 | $a[i] = b[i]$ (i.e. the two recipes are the same) |
| 2 | 17 | $n, x[i] ≤ 100$ |
| 3 | 25 | $n, x[i] ≤ 1500$ |
| 4 | 49 | No additional restrictions |
3 14 10 100 3 1 1 2 3 1
5
He can make 3ドル$ burgers using the first recipe and 2ドル$ burgers using the second recipe for a total of 5ドル$ burgers.
2 83 72 1 3 1 3
24
He can make 24ドル$ burgers of either type, since both recipes are the same.
Olympiad > National Olympiad in Informatics (Singapore) > Qualification > NOI 2023 Qualification 4번