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: Wrong Answer)

#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;

using namespace std;

template <typename T> void output(T, int);
int gcd(int a, int b);

void solve(int n, map<int, int> &m) {
    while (n != 1) {
        repd(i, 2, n + 1) {
            if (n % i == 0) {
                if (m[i] == 0) {
                    m[i] = 1;
                } else {
                    m[i]++;
                }
                n /= i;
                break;
            }
        }
    }
    return;
}

int main() {
    // source
    int n;
    map<int, int> m;
    cin >> n;
    if (n == 1) {
        cout << 1 << endl;
    }

    rep(i, n) { solve(i + 1, m); }

    ll ans = 1;
    ll mod = pow(10, 9) + 7;
    for (auto iter = m.begin(); iter != m.end(); iter++) {
        ans *= iter->second + 1;
        if (ans > mod) {
            ans %= mod;
        }
    }

    cout << ans << endl;
    return 0;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}