Problem:
Score : 300 points

Problem Statement

You are given an integer N.
Find the number of the positive divisors of N!, modulo 10^9+7.

Constraints

1≤N≤10^3

Input

The input is given from Standard Input in the following format:

N

Output

Print the number of the positive divisors of N!, modulo 10^9+7.

Sample Input 1

3

Sample Output 1

4

There are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.

Sample Input 2

6

Sample Output 2

30

Sample Input 3

1000

Sample Output 3

972926972

Solution in C (GCC 5.4.1) (judge verdict: Accepted)

#include <stdio.h>
#include <memory.h>
#define N 1000
const long long MOD=((1e+9)+7);
int p[N+1];
void era(void){
  int i,j;
  for(i=2;i<N;i++)
    p[i]=1;
  for(i=2;i*i<N;i++){
    if(p[i]){
      for(j=2*i;j<=N;j=j+i){
	p[j]=0;
      }
    }
  }
}
int main(void){
  int n,t[N+1],i,j,tmp;
  long long ans=1;
  era();
  scanf("%d",&n);
  memset(t,0,sizeof(t));
  for(i=2;i<=n;i++){
    for(j=2;j<=n;j++){
      if(p[j]&&i%j==0){
	for(tmp=i;!(tmp%j);tmp/=j)
	  t[j]++;
      }
    }
  }
  for(i=2;i<=n;i++)
    ans=(ans*(t[i]+1))%MOD;
  printf("%lld\n",ans);
  return 0;
}