GO Solution For UVa 10518 - How Many Calls?. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

The fibonacci number is defined by the following recurrence:

• fib(0) = 0

• fib(1) = 1

• fib(n) = fib(n− 1) + fib(n− 2)

But we’re not interested in the fibonacci numbers here. We would like to know how many calls does it take to evaluate the n-th fibonacci number if we follow the given recurrenc

...

You can find the full details of the problem How Many Calls? at UVa Online Judge

Sample Input

0 100
1 100
2 100
3 100
10 10
0 0

Sample Output

Case 1: 0 100 1
Case 2: 1 100 1
Case 3: 2 100 3
Case 4: 3 100 5
Case 5: 10 10 7

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985