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>

//-----------------------------------------------------
/// SOL
///
///
//-----------------------------------------------------

#define up(i , a , b) for(int i = a ; i <= b; ++i)
#define up2(i , a , b , c) for(int i = a ; i <= b; i += c)
#define down(i , a , b) for (int i = a; i >= b; --i)
#define down2(i , a , b , c) for (int i = a; i >= b; i -= c)

#define II pair <int, int>
#define III pair<int, pair<int, int> >

#define pb push_back
#define mp make_pair

#define endl '\n'
#define TITLE "FACT"

#define gc getchar
#define pc putchar
#define length Len

//-----------------------------------------------------

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

const int N = 1000006;
const int oo = 1000000007;
bool DEBUG = 1;
ll n, Prime[N], Temp[N], cnt = 0, c[N];

struct T
{

};

void Eratos()
{
    up(i , 1 , N) Temp[i] = 1;
    Temp[0] = Temp[1] = 0;

    up(i , 2 , N) {
        if(Temp[i])
            up2(j , i * 2 , N , i)
                Temp[j] = 0;
    }

    up(j , 1 , N) if(Temp[j]) Prime[++cnt] = j;//, cout << j << " ";
}

void Init()
{
    cin >> n;

    up(i , 1, N) c[i] = 0;

    up(i , 1 , n) {
        ll j = 1, cur = i;
        //cout << cur << " " << Prime[j] << endl;
        while(Prime[j] * Prime[j] <= (cur))
        {
            if(cur % Prime[j] == 0)
            {
                c[Prime[j]]++;
                cur /= Prime[j];
            }
            else j++;
   //         cout << j << " ";
        }
 //       cout << cur << " ";
        c[cur]++;
    }

    up(i , 1 , n) {
        //cout << c[Prime[i]] << " ";
    }
}

void Solve()
{
    ll res = 1;
    up(i , 1 , n) {
        res = (res * (c[Prime[i]] + 1)) % oo;
    }
    cout << res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    //freopen(TITLE".INP", "r", stdin);
  //  freopen(TITLE".OUT", "w", stdout);

    int Test = 1;
//    cin >> Test;
    up(i , 1 , Test) {
        Eratos();
        Init();
        Solve();
    }
}














/*
/// ***************************** FAST I/O *****************************
inline void read(long long &x)
{
    register int c = gc();
    x = 0;
    int neg = 0;
    for (;((c<48 || c>57) && c != '-') ;c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}

inline void writeln(long long x)
{
     char buffor[21];
     register int i=0;
     int neg=0; if (x<0) {neg=1; x= -x;}
     do{
           buffor[i++]=(x%10)+'0';
           x/=10;
        } while(x);
       i--;
       if (neg) pc('-');
       while(i>=0) pc(buffor[i--]);
       pc('\n');
}
/// ***************************** FAST I/O *****************************
*/