Class Assignment TLE

Ques link :https://hack.codingblocks.com/contests/c/452/875
code: https://ide.codingblocks.com/#/s/18504
Please look how to resolve TLE in my code.

Hi ,u are using recursion and your algo is 2^n and n is given to be 44 so yes the is obvious .therefore try thinking in terms of Fibonacci sequence it is similar to that