题目描述
Exciting offer….!!! It’s World Cup time…. :) Here is an offer awaiting for you i.e… you will get a ticket to watch world cup finals @ Australia. Your task is so simple. You will be given a function . In order to win the prize, you need to reduce the time complexity of that function.
fun( n)
{
if (n==0)
return 1;
if (n==1)
return 2;
return fun(n-1) + fun(n-1);
}
Come on….!!! Hurry up. Solve it and get your ticket for #WC_Finals.
Input
Single integer is given as input which is n value to be used as an argument for the function.
Output
Return the output generated by the function for given n
Constraints
1 ≤ n ≤ 100
Example
Input:
2
Output:
4
输入格式
见题面
输出格式
见题面