The cook
Source of the task: The original collection of tasks on Petlja
Task statement
For one portion the cook needs m grams of meat for the main course, and for the salad either k grams of cabbage or c grams of beetroot.
There are M grams of meat, K grams of cabbage and C grams of beetroot available (and there is much more of all the other ingredients).
Write a program that reads the amounts needed for one portion m, k, c, and then the available amounts M, K, C, and prints for how many whole portions (main course and salad) the cook has enough ingredients.
Input
Standard input contains, in order, the numbers m, k, c, M, K, C, each on a separate line. All the numbers are whole, positive and less than 50000.
Output
Print to standard output only one non-negative whole number: the number of whole portions that can be prepared.
Example 1
Input
200
250
150
2200
1400
890
Output
10
Example 2
Input
150
200
100
6100
5100
1000
Output
35
In the original text, the labels for the available amounts were not fully given in the sentence. Here they are written as M, K and C, following the order of the numbers in the input.
