fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // Input
  6. int n; cin >> n;
  7.  
  8. // Process -> Output
  9. if (n % 2 == 0) --n;
  10. cout << ((long long)n + 1)*((n - 1)/2 + 1) / 2;
  11.  
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5320KB
stdin
100
stdout
2500