fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Scanner sc=new Scanner(System.in);
  9. int inp=sc.nextInt();
  10. long m=1000000007;
  11. for(int i=0;i<inp;i++){
  12. int inp1=sc.nextInt();
  13. long ans=0;
  14. for(int j=1;j*j<=inp1;j++){
  15. ans+=(inp1-(inp1%j))%m;
  16. }
  17. for(int j=1;j<Math.sqrt(inp1);j++){
  18. long end=(inp1%m)/j;
  19. long start=(inp1%m)/(j+1);
  20. ans+=j*(((end*(end+1)/2)-(start*(start+1)/2)));
  21. ans=ans%m;
  22. }
  23. System.out.println(ans);
  24. }
  25. }
  26. }
Success #stdin #stdout 0.15s 56740KB
stdin
1
1000000000
stdout
355091432