eolymp
bolt
Try our new interface for solving problems
Problems

Robots

Robots

A colony of robots exists for such laws: \begin{enumerate} \item In one year \textbf{M} robot collect new \textbf{A} robots, and \textbf{N} robot collect new \textbf{B} robots. \item Robots are always trying to gather as much new robots. \end{enumerate} At the time when the colony was to \textbf{K} robots. How much will the robot through the \textbf{Т} years? (All input values do not exceed 100, the result does not exceed \textbf{2000000000}). \InputFile In one line set of \textbf{М, А, N, B, K, T} through the gap. \OutputFile Display only the desired number.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3 5 5 9 15 1
Output example #1
42
Source II этап Всеукраинской олимпиады школьников 2008-2009, г. Бердичев