Robots
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
A colony of robots exists for such laws:
In one year M robot collect new A robots, and N robot collect new B robots.
Robots are always trying to gather as much new robots.
At the time when the colony was to K robots. How much will the robot through the Т years? (All input values do not exceed 100, the result does not exceed 2000000000).
Input
In one line set of М, А, N, B, K, T through the gap.
Output
Display only the desired number.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 5%