fork(4) download
  1. #include<stdio.h>
  2. #include<math.h>
  3. #include<stdint.h>
  4. int main(){
  5. uint64_t n,ans;int t;
  6. scanf("%d",&t);
  7. while(t--){
  8. scanf("%llu",&n);
  9. ans=(n*(14*(n*n)+9*n+2))/4;
  10. printf("%llu\n",ans);
  11. }return 0;
  12. }
  13.  
Success #stdin #stdout 0s 3300KB
stdin
2
1
1000000
stdout
6
3500002250000500000