Fibonacci sequence
A sequence of numbers (a_1, a_2, ...) is defined as a Fibonacci sequence if for any (i 3), the following holds:
[ a_i = a_i-1 + a_i-2. ]
You are given two elements of this sequence with indices (i) and (j). Your task is to find the (k)-th element of the sequence.
For example, in the second case, the Fibonacci sequence is (3, -1, 2, 1, 3, 4, ...).
Input
You are provided with the numbers (i, j, k, a_i, a_j). The constraints are as follows: (i, j, k) are natural numbers not exceeding (10^6), and (i) and (j) are always distinct. The values (a_i) and (a_j) are integers with absolute values not exceeding (2 10^9).
Output
Output the value of (a_k). It is guaranteed that the input data ensures all elements of the sequence are integers, and (a_k) does not exceed (2 10^9) in absolute value.