fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t; cin>>t;
  6.  
  7.  
  8. for(int i(0);i<t; i++)
  9. {
  10.  
  11. long long int suma(0);
  12. int n; cin>>n;
  13. for(int l(1);l<=n; l++)
  14. {
  15. suma+=(l*l);
  16. }
  17.  
  18. cout<<suma<<endl;
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 15240KB
stdin
1
6
stdout
91