#C2311. Maximum Number of Smoothies
Maximum Number of Smoothies
Maximum Number of Smoothies
You are given T types of fruits. For each fruit type, you are provided with its available stock and the amount required to produce one smoothie. Your task is to compute the maximum number of smoothies that can be prepared without running out of any fruit.
Let stock[i] be the available quantity of the ith fruit and required[i] be the amount needed for one smoothie. The maximum number of smoothies that can be produced is given by:
$$ \min_{0 \le i < T} \left\lfloor \frac{stock[i]}{required[i]} \right\rfloor $$
You must read the input from stdin and write the output to stdout.
inputFormat
The input is read from standard input (stdin) and consists of three lines:
- The first line contains an integer
T
representing the number of fruit types. - The second line contains
T
space-separated integers representing the available stock for each fruit. - The third line contains
T
space-separated integers representing the required amounts of each fruit to make one smoothie.
outputFormat
Output a single integer to standard output (stdout), which is the maximum number of smoothies that can be prepared.## sample
3
100 200 300
10 20 30
10