High Octane League of Legends Gameplay

View as PDF

Submit solution

Points: 3
Time limit: 0.5s
Memory limit: 10M

Author:
Problem type

David loves playing League of Legends™. In the game League of Legends™, you must obtain a number by adding up the previous two numbers in the series. This series is called the League of Legends™ Series. The series begins with A and B. To help David win, tell him the N^{th} (1 \le N \le 42) term in the League of Legends™ Series.

Input Specification

The first line contains two integers A and B (1 \le A, B \le 10)

The second line contains a single integer N which is the index (1 indexed) of the number in the sequence you must output.

Output Specification

Output a single integer that is the number located at the given index.

Sample Input

1 1
6

Sample Ouput

8
David Bunny Suit

Comments

There are no comments at the moment.