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 <bits/stdc++.h>
using namespace std;
#define  ll long long

const int mod = 1e9+7;

 
int p[1005], c[1005]; 
ll cnt;//因子个数 
const ll N = 1e6+10; 
ll prime[N] = {0},num_prime = 0;  //prime存放着小于N的素数   
int isNotPrime[N] = {1, 1};        // isNotPrime[i]如果i不是素数，则为1 
int Prime()    
{     
     	for(ll  i = 2 ; i < N ; i ++)       
       	{            
		if(! isNotPrime[i])               
	 		prime[num_prime ++]=i;  
	   //无论是否为素数都会下来     
		for(ll  j = 0 ; j < num_prime && i * prime[j] <  N ; j ++)
    		{               
		      	isNotPrime[i * prime[j]] = 1;  
	  		if( !(i % prime[j] ) )  //遇到i最小的素数因子
	  			//关键处1                  
				break;           
		}        
	}        
	return 0;   
}  
///与素数筛选一起用的质数分解
///将x分解为式n=（p1^α1）*（p2^α2）*（p3^α3）* ....... *（pk^αk）
///数组p和c求解保存底数p1或者指数α1
set<int> sett; 
void Dec(ll x)
{
	cnt = 0;
    for(int i=0; prime[i]*prime[i]<=x&&i<num_prime; i++)
    {
        if(x%prime[i]==0)
        {
             int num=0;
            while(x%prime[i]==0)
              {
              	num++;
              	 x /= prime[i];
              } 
				p[cnt]=prime[i];
				sett.insert(prime[i]);
				c[prime[i]]+=num;
        }
        if(x==1) break;
    }
    if(x > 1) {
		   p[cnt]=x;
		   sett.insert(x);
	       c[x]+=1;   
    }
      
}


int main()
{
	Prime();
	ll n;
	scanf("%lld",&n);
	for(int i=2;i<=n;i++) 
		Dec(i);
	ll ans=1;
	set<int>::iterator it;              
    for(it=sett.begin();it!=sett.end();it++)   
    {  
		ans=(ans%mod*(c[*it]+1)%mod)%mod;
    }  
    cout<<ans<<endl;
    return 0;
}