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. for(int i=0;i<inp;i++){
  11. int inp1=sc.nextInt();
  12. long ans=0;
  13. long n=inp1/2;
  14. for(int j=1;j<=n;j++){
  15. ans+=(inp1-(inp1%j));
  16. ans=ans%1000000007;
  17. }
  18. long f=0;
  19. f=(long)Math.ceil(inp1/2);
  20. long ans2=((n*(2*(f+1)+(n-1)))/2)%1000000007;
  21. System.out.println((ans+ans2)%1000000007);
  22. }
  23.  
  24. }
  25. }
Success #stdin #stdout 0.12s 54728KB
stdin
3
2
4
6
stdout
4
15
33