Fibonacci (Recursion)

HardGrade 12

Complete the recursive Fibonacci(n) function, where fib(0)=0, fib(1)=1, and fib(n) = fib(n-1) + fib(n-2) for n ≥ 2.

Input / Output

Input: a non-negative integer n (the position in the sequence, 0-indexed). Output: the nth Fibonacci number.

Examples

Input

6

Expected Output

8

Input

0

Expected Output

0

+ 2 hidden tests checked on Submit.

Files

Main.pas is the entry point. Add extra units for OOP exercises — they compile together.

Main.pas
Loading...

Run your code to see test results here.