问题2915--Chocolate, ice cream or kiskatom

2915: Chocolate, ice cream or kiskatom

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

NaNa is a lovely girl, and she has three favourite food: Chocolate, ice cream and kiskatom. She is not very happy these days. So oooccc1 want to make her happy by giving her gifts. Getting into the shop,oooccc1 finds there are so many kinds of foods. But he know that one piece of chocolate sold A yuan will make NaNa x points happier, and the ice cream sold B yuan will make NaNa y points happier, kiskatom sold C yuan will make NaNa z points happier. oooccc1 have N yuan, and he wants to make NaNa the most happy. Would you tell him how many points he can get the most ?

输入

There are multiple tst cases. Each test case is in one line . Eash Test case contains 7 integer A,x,B,y,C,z,N. All the numbers are between 1 and 10000.

输出

One Line for each test case. The most points he can get.

样例输入 Copy

2 3 3 4 5 7 19

样例输出 Copy

28

提示

7 chocolate and 1 kiskatom can get 28 point.

来源/分类

tyh