Skip to content

Instantly share code, notes, and snippets.

Created September 5, 2017 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0693c205d3e13ddb17d96eb8a6808687 to your computer and use it in GitHub Desktop.
Save anonymous/0693c205d3e13ddb17d96eb8a6808687 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void)
{
int T,i;
unsigned long long Sum,N,k;
scanf("%d",&T);
for(i=1;i<=T;i++)
{Sum=0;
scanf("%llu",&N);
for(k=1;k<=N/2;k++)
Sum+=((N/k)*k);
for(k;k<=N;k++)
Sum+=k;
Sum%=1000000007;
printf("%llu\n",Sum);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment