fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. long long int call(long long int x)
  5. {
  6. if(x==1)return 1;
  7. else if(x==2)return 40;
  8. else if(x>=3)return call(x-1)/(1+call(x-2))*(call(x-1)+1);
  9. }
  10.  
  11. int main() {
  12. long long int x;
  13. cin>>x;
  14. cout<<call(x)<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 4388KB
stdin
16
stdout
-6526344715890838044