FIB1 - Fibonacci number 1
Dữ liệu vào: Standard input
Dữ liệu ra: Standard output
Giới hạn thời gian: 1.0 giây
Giới hạn bộ nhớ: 128 megabyte

You're given three numbers: A, B, and N, and all you have to do is to find the number FN where:

\(F_0=A,F_1=B, F_i=F_{i-1}+F_{i-2},\forall i\geq2\)

Input:

- First line contains a single integer T - the number of tests. 

- T lines follow, each containing three integers: A, B and N .

Output:

- For each test case output a single integer \(F_N\) .

Constraints

\(T =1;\)
\(A=1,B=1,N \leq 70\)
 

Ví dụ

  • input
    1
    1 1 3
    output
    3

 

 
Back to Top