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 ll long long
#define ii pair<ll, ll>
#define MAX 1000
#define MOD 1000000007

using namespace std;

bitset<1010> bs;

vector<ll> primes;

void gera(){
  bs.set();
  bs[0] = bs[1] = 0;
  for(ll i = 2; i <= MAX; ++i){
    if(bs[i]){
      primes.push_back(i);
      for(ll j = i * i; j <= MAX; j += i) bs[j] = 0;
    }
  }
}

int main(){
  gera();

  ll N;
  cin >> N;
  vector<ll> v(primes.size(), 0);

  ll res = 1;
  for(ll j = 2; j <= N; ++j){
    for(ll i = 0; primes[i] <= j && i < (ll) primes.size(); ++i){
      if(j % primes[i] == 0){
        // printf("Divide por %lld (%lld)\n", primes[i], res);
        ll tot = 0, num = j;
        while(num % primes[i] == 0){
          tot++;
          num /= primes[i];
        }

        v[i] += tot;
        // res = (res * (tot + 1))%MOD;
      }
    }
  }

  for(ll i = 0; i < (ll) primes.size(); ++i){
    res = (res * (v[i] + 1))%MOD;
  }

  cout << res << endl;



	return 0;
}