fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define pb push_back
  5. #define yes cout<<"YES\n";
  6. #define no cout<<"NO\n";
  7. const int N=3e5+7;
  8. ll T=1, x;
  9. ll rec(ll n)
  10. {
  11. if(n == 1)
  12. return 0;
  13. if(n == 2)
  14. return 1;
  15.  
  16. return rec(n - 1) + rec(n - 2);
  17. }
  18. int main()
  19. {
  20. cin >> x;
  21. cout << rec(x);
  22. return 0;
  23. }
Success #stdin #stdout 0s 5320KB
stdin
5
stdout
3