Menu Close

Number of unique patches of rectangular land that he can grow….[Cprogm]

Samba can be grown in rectangular patches of any side lengths. However, The owner only has a limited amount of land. Consider the entire town to be consisting of cells in a rectangular grid of positive coordinates.
The owner own all cells (x,y) that satisfy x ∗ y ≤ N

As an example if N=4, The owner owns the following cells:
(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(3,1),(4,1)

The owner can only grow samba in rectangular patches consisting only of cells which belong to him. 
Also, if he uses a cell, he must use it entirely. He cannot use only a portion of it.

Input:
The first line of the input contains T, the number of test cases.
The next T lines of input contains one integer N.


Output:
Print the output the number of unique patches of rectangular land that he can grow samba in! 

Since this number can be very large, output it modulo 1000000007.

#include <stdio.h>
#define M 1000000007
#define data long  int
int find(int num)
{ int i,j,sum=0;
  for(i=1;i<=num;i++)
  {
    for(j=1;j<=num;j++)
    {if(i*j<=num)
      {
        sum+=(i*j);}
    }
  }
return sum;
}
int main()
{
  int t,num,sum;
  scanf("%d",&t);
  while(t--)
  {
    scanf("%d",&num);
    sum=find(num);
    printf("%d\n",sum);}
return 0;
}

INPUT_1:
5
11
7
10
4
19

OUTPUT:
192
71
170
23
666


INPUT_2:
8
17
41
3
15
10
21
33
16

OUTPUT:
520
3719
11
406
170
870
2335
486