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 <cmath>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>

using namespace std;

#define ll long long int
#define pii pair<int,int>
#define ti3 tuple<ll,ll,ll>

map<int, int> primes(int k)
{
    map<int,int> v;
    for(int i = 2;i <= k;i++)
    {
        while(k % i == 0)
        {
            v[i]++;
            k /= i;
        }
        if(k == 1)
        {
            return v;
        }
    }
    return v;
}

int main()
{
    int n;
    cin >> n;
    map<int,int> m;
    for(int i = 2;i <= n;i++)
    {
        auto v = primes(i);
        for(auto e : v)
        {
            m[e.first] += e.second;
        }
    }
    ll a = 1;
    const ll mod = (ll)(1e9+7);
    for(auto e : m)
    {
        a *= (e.second + 1);
        a %= mod;
    }
    cout << a << endl;
    
    return 0;
}