fork download
  1. t=int(raw_input())
  2. while t:
  3. z=int(0)
  4. n=int(raw_input())
  5. if n==0 or n==1:
  6. print("0")
  7. continue
  8. sum=int(n)-1
  9. m=int(n**0.5)
  10. k=2
  11.  
  12. while k<=m:
  13. z=(n/k)-k
  14. sum+=(k*(z+1)+z*(2*(k+1)+(z-1))/2)
  15. k=k+1
  16. print(sum)
  17. t=t-1
Success #stdin #stdout 0.01s 7900KB
stdin
3
3
4
5
stdout
2
5
6