Aidar is preparing for another international olympiad.
In Aidar's opinion, the success of his performance depends on two indicators — the speed of coding and the speed of generating ideas.
Aidar knows that at the moment his coding speed is Sp, and his idea generation speed is Sm.
Every day, Aidar will spend Tp minutes training his coding speed, which will increase his coding speed by Dp every two days.
Similarly, every day Aidar will spend Tm minutes training his idea generation speed, which will increase his idea generation speed by Dm every two days.
Note that the transition from "quantity to quality" is not instantaneous, so after one day of training, Aidar will not feel an increase of
.
Aidar can also conduct "intensive" training:
Aidar will consider himself sufficiently prepared if both speeds (coding and idea generation) are not lower than the value E.
Aidar wants to reach a sufficient level of preparedness as soon as possible (but at the same time does not want to expend excessive effort), so he asks you to determine:
The first line contains integers Sp, Sm, Dp, Dm, Tp, Tm, E (1 ≤ Sp, Sm, E ≤ 108, 1 ≤ Dp, Dm ≤ 105, 1 ≤ Tp, Tm ≤ 108) — the initial values of Aidar's skills, the indicators of skill change, the required number of minutes for regular training, and the sufficient level of preparedness, respectively.
In the first line, output an integer — the minimum number of days in which Aidar can achieve a sufficient level of preparedness.
In the second line, output an integer — the minimum total number of minutes he can spend on preparation (given the achievement of the minimum number of days).
1 3 2 1 3 10 18
15
672
3 1 1 2 1000 1 3
1
1004
First test case
It is easy to notice that in the optimal solution Aidar will have to undergo intensive training for creativity every day.
In total, there will be
days of intensive creativity training — a total of 15·4·10 = 600 minutes.
For typing practice, Aidar can apply the following resource distribution:
, spending 12·3 = 36 minutes. In total, Aidar will spend 600 + 72 = 672 minutes in this case.
Note that Aidar will not be able to complete his training in 15 days if he only does two intensive typing sessions:
. In total, he will have 1 + 4 + 12 = 17 skill points, which will not be enough for a sufficient level of readiness.
| Name |
|---|


