fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. long long s = 0;
  8. cin >> n >> s;
  9. for(long long i = 1; i <= n; i++)
  10. {
  11. s += i * i;
  12. }
  13. cout << s;
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
3558294863109