"A fight? Count me in!"
"Everyone, get in here!"
The Grim Patron is saddened by the nerf to Warsong Commander and decides to commemorate her with a math problem.
Let $\{u_i\}$ be a sequence defined by:
\begin{equation} u_i = a + \frac{b}{u_{i-1}} + \frac{c}{u_{i-1}u_{i-2}} \quad (i \geq 2) \end{equation}
Given $u_0, u_1, a, b, c, n$. It is guaranteed that $x^3 = a x^2 + b x + c$ has $3$ distinct positive integer roots.
Find $u_n$.
Input
The input consists of a single line containing $6$ integers: $u_0, u_1, a, b, c, n$.
Output
Output a single line containing $1$ integer (or decimal), with at least 8 and at most 15 decimal places. Your answer is considered correct if the absolute difference between your answer and our answer is no more than $10^{-6}$. Considering the inherent errors in floating-point arithmetic, you are guaranteed to be correct if your answer differs from the true answer by no more than $10^{-6} - 10^{-8}$.
Examples
Input 1
-7 29 31 -311 1001 100
Output 1
11.00000000
Constraints
For 100% of the data, $c \leq 100000$, $|u_0| \leq 1000$, $|u_1| \leq 1000$, $0 \leq n \leq 10^9$.
For 40% of the data, $n \leq 20$.
Note
You may ignore this section.
Because floating-point numbers are stored using significant digits, most decimal numbers already contain errors from the moment they are read. Subtraction operations used to determine absolute error also produce truncation errors at the end when the exponents of the two numbers differ.
Let $\delta_1$ be the error generated during the process of comparing your answer with the reference answer. In most cases, we can only treat this value as a random variable and estimate its upper bound $\epsilon_1$. For example, in this problem, we can prove $\epsilon_1 \leq 10^{-8}$, i.e., $|\delta_1| \leq 10^{-8}$.
Let the tolerance range be $\epsilon_2$, which is the parameter we use in practice to judge equality; in this problem, $\epsilon_2 = 10^{-6}$. If the absolute difference between your answer and the true answer does not exceed $\epsilon_2 - \epsilon_1$, we guarantee that you will receive points. If the absolute difference exceeds $\epsilon_2 + \epsilon_1$, you will definitely not receive points. If the difference falls between these two values, we cannot guarantee whether you will receive points; you can only hope that the machine-generated error and your own error are close enough to allow you to pass.