Problem Statement

Class name: ReverseFibonacci
Method name: getKthNumber
Parameters: int,int,int,int
Returns: int

Implement a class ReverseFibonacci, which contains a method getKthNumber.
getKthNumber returns the kth number of a sequence in which for all i > 2, t[i]
= t[i - 1] + t[i - 2].

The method receives the four parameters a, b, i, k:

*a is ith term of the sequence.
*b the (i + 1)th term of the sequence.
*i is the index of a in the sequence.
*k is the index of the term to be retrieved.

The method signature is:
public int getKthNumber(int a, int b, int i, int k);

*a must satisfy -1000 <= a <= 1000
*b must satisfy -1000 <= b <= 1000
*i must satisfy 1 <= i <= 25
*k must satisfy 1 <= k <= 25

Examples:
-If a=1, b=1, i=1, k=5, then t = 1, t = 1, t = 2, t = 3, t = 5,
and the method should return 5.
-If a=4, b=4, i=4, k=1, then t = -4, t = 4, t = 0, t = 4, t = 4,
and the method should return -4.
-If a=2, b=5, i=2, k=2, then t = 2, t = 5, and the method should return 2.

Definition

 Class: ReverseFibonacci Method: getKthNumber Parameters: int, int, int, int Returns: int Method signature: int getKthNumber(int param0, int param1, int param2, int param3) (be sure your method is public)

Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=129

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=3018&pm=129

doeth