SOLVE
LATER
John loves fruits. He eats one apple, banana or pear literally every hour.
John came to fruit shop to buy some fruits. He has m coins that he is going to spend to buy as many fruits as he can. He counted the number of apples, bananas and pears, and he also knows the price of a single apple, the price of a single banana and the price of a single pear in this shop.
Help John to buy the maximum number of fruits.
First line contains three integers a, b and p — the number of coins needed to be spend to buy one apple, one banana and one pear (\(1 \le a, b, p \le 100\)).
Second line contains three integers \(c_a\), \(c_b\) and \(c_p\) — the number of apples, the number of bananas and the number of pears available in the store (\(1 \le c_a, c_b, c_p \le 100\)).
Third line contains integer m — the number of coins John owns (\(1 \le m \le 30 000\)).
Output single integer — the maximum number of fruits John can buy.
John buys two apples and two bananas, spending 12 coins.