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++14 (GCC 5.4.1) (judge verdict: Accepted)

#include<bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
long long INF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

int main(){
    vector<pair<int,int>> prime;
    int n,a=2;
    long long ans=1;
    scanf("%d",&n);

    while(a<=n){
        int k=a;
        for(int i=0;k!=1&&i<prime.size();){
            if(k%prime[i].first){
                ++i;
                continue;
            }else{
                if(prime[i].first==0) printf("#%d!\n",i);
                k/=prime[i].first;
                ++prime[i].second;
            }
        }
        if(k!=1) prime.push_back(make_pair(k,1));
        ++a;
    }

    REP(i,prime.size()) ans = ans*(prime[i].second+1)%MOD;

    printf("%lld\n",ans);
    return 0;
}