fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin>> t;
  7. while(t--){
  8. int n;
  9. int i=1;
  10. cin>>n;
  11. int sum=0,y;
  12. while(n--){
  13. if(i<=n/2){
  14. y=n/i;
  15. sum+=(i*y);
  16. i++;
  17. }
  18. else{
  19. sum+=i;
  20. i++;
  21. }
  22. }
  23. cout<<(sum%1000000007)<<endl;
  24. }
  25. return 0;
  26. }
Time limit exceeded #stdin #stdout 5s 3140KB
stdin
1
1000000000
stdout
Standard output is empty