#1098. Function

    ID: 1098 传统题 1000ms 128MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>竞赛洛谷递推数学规律找循环节高精度

Function

Function

题目描述

Define a function f(n)=(f(n-1)+1)/f(n-2). You already got f(1) and f(2). Now, give you a number m, please find the value of f(m).

输入说明

There are several test cases. Each case contains three integers indicating f(1), f(2) and m ( 1 <= f(1), f(2), m <= 1000,000,000).

输出说明

For each case, please output the value of f(m), rounded to 6 decimal places.

样例

输入

1 1 3

输出

2.000000