G. Exhausting Training
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

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 can train his coding speed for 4·Tp minutes instead of Tp — in this case, he will feel an increase in his coding skill by Dp after just one day.
  • Similarly, Aidar can train his idea generation speed for 4·Tm minutes instead of Tm — in this case, he will feel an increase in his idea generation skill by Dm after just one day.
  • Aidar can conduct "intensive" training for both indicators at the same time if he considers it necessary.

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 minimum number of days in which Aidar can achieve a sufficient level of preparedness;
  • the minimum total number of minutes he can spend on preparation (given the achievement of the minimum number of days).
Input

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.

Output

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).

Examples
Input
1 3 2 1 3 10 18
Output
15
672
Input
3 1 1 2 1000 1 3
Output
1
1004
Note

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:

  • Spend 3 days on intensive training — this way he can increase his skill by 3·2 = 6, spending 3·4·3 = 36 minutes;
  • Spend the remaining 12 days on regular training — this way he will increase his skill by another , 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 2 days of intensive training, he will gain 2·2 = 4 skill points;
  • In the remaining 13 days of regular training, Aidar will increase his skill by another .

In total, he will have 1 + 4 + 12 = 17 skill points, which will not be enough for a sufficient level of readiness.