fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. main()
  5. {
  6. ios_base::sync_with_stdio(false);
  7. cin.tie(0); cout.tie(0);
  8. int n;
  9. cin >> n;
  10. if (n%2 != 0) cout << (n/2)*(n/2+1);
  11. else if (n%2 == 0 and n%4 != 0) cout << (n/2-2)*(n/2+2);
  12. else cout << (n/2-1)*(n/2+1);
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
7299345643830412287