fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int f(int n){
  5. if (n<=1) return 1;
  6. else if (n%2!=0) return 5*n+f(n-1)+f(2);
  7. else if(n%2==0) return 3*f(n-1);
  8. }
  9.  
  10. int main() {
  11. cout << f(23);
  12. return 0;
  13. }
Success #stdin #stdout 0s 5540KB
stdin
Standard input is empty
stdout
2214271