Burgers
문제
Kai the lobster is starting a burger chain selling burgers. He has ingredients to work with, which are labelled from to . For each ingredient , he has portions of ingredient .
He has two recipes for burgers. For each ingredient , the first recipe requires portions of ingredient and the second recipe requires portions of ingredients .
Can you help Kai compute the maximum total number of burgers he can make?
입력
The first line of input consists of one integer , the number of different ingredients.
The second line consists of spaced integers , the total number of portions Kai has of each ingredient.
The third line consists of spaced integers , the number of portions of each ingredient for the first recipe.
The fourth line consists of spaced integers , 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
3 14 10 100 3 1 1 2 3 1
5
예제 2
2 83 72 1 3 1 3
24