/Power-Girls

determine maximum number of Power Girls with given curent quantity of ingredients.

Primary LanguageCOtherNOASSERTION

Description

Professor does not have much time as villains will reach the laboratory soon. He is starting the process but does not know the number of Powerpuff Girls which will be created. He needs your help in determining the maximum number of Powerpuff Girls which will be created with the current quantity of ingredients.

Example:

Professor Utonium requires 3 ingredients to make Powerpuff Girls. The 3 ingredients are present in the laboratory in the given quantity: To make a Powerpuff Girl, Professor Utonium requires:

3 units of Ingredient A

6 units of Ingredient B

10 units of Ingredient C

The maximum number of Powerpuff Girls which can be created are 3 as after 3, Professor will run out of Ingredient C.

Can you determine the maximum number?

Input Format

The first line of input consists of the number of ingredients, N

The second line of input consists of the N space-separated integers representing the quantity of each ingredient required to create a Powerpuff Girl.

The third line of input consists of the N space-separated integers representing the quantity of each ingredient present in the laboratory.

Constraints

1<= N <=10000000 (1e7)

0<= Quantity_of_ingredient <= LLONG_MAX

Output Format

Print the required output in a separate line.

Sample TestCase 1

Input

4 2 5 6 3 20 40 90 50

Output

8

Purpose :

In all my respective repositories, I, just shared my works that I worked as the learning path and practiced, with designed, developed, implemented, simulated and tested, including some projects, assignments, documentations and all other related files and some programming that might not being implement, not being completed, lacks some features or have some bugs. Purpose of all my repositories, if used, can be used for EDUCATIONAL PURPOSE ONLY. It can be used as the open source and freeware. Kindly read the LICENSE.txt for license, terms and conditions about the use of source codes, binaries, documentation and all other files, located in all my repositories.