class Solution { public: Solution(int n=40) { fib[1]=fib[2]=1; for(int i=3;i<=n;++i) { fib[i]=fib[i-1]+fib[i-2]; } } int Fibonacci(int n) { return fib[n]; } private: long long fib[41]; };