Solve Linear Recurrence

Computer Mathematics Hard 2 views
Back to Questions

Problem Description

Given f0,f1 and f(n)=f(n-1)+2f(n-2), compute f(n).

Input Format

f0 f1 n.

Output Format

One integer.

Sample Test Case

Input:
0 1 5
Output:
21

Constraints

0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev