fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long int n;
  6. cin >> n;
  7. long int result;
  8. result = n*(n + 1)*(2*n + 1)/6;
  9. cout << result;
  10. return 0;
  11. }
Success #stdin #stdout 0s 4492KB
stdin
10000
stdout
333383335000