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 <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include<vector>
#include<iomanip>
#include<map>
#include <queue>
#include<cmath>
#include<cstdio>
#include<iomanip>
#include<set>
#include <bits/stdc++.h>
 
using namespace std;
using ll = long long int;
 
#define REP(i,n) for(ll i=0;i<(ll)(n);i++) //REP(i, 5) cout<<i;
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define MOD 1000000007 //10^9+7
//#define MOD 1
 
ll gcd(ll a, ll b) {
  ll tmp;
  if ( b > a) {
    tmp = a;
    a = b;
    b = tmp;
  }
  while (a % b !=0) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return b;
}
 
const int MAX = 1000;
 
ll table[MAX][MAX];
 
// テーブルを作る前処理
void COMinit() {
    table[0][0] = table[0][1] = 1;
    FOR(i, 1, MAX-1){
      FOR(j, 0, i+1){
        if(j==0) table[i][j] = 1;
        else if(j == i+1) table[i][j] = 1;
        else table[i][j] = table[i-1][j-1]+table[i-1][j];
      }
    }
}
 
// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return table[n-1][k];
}

void sosuu(ll n, vector<ll> &v){

  vector<ll> num(n, 0);

  FOR(i, 1, sqrt(n)){
    if(num[i]==0){
      FOR(j, 0, n/i){
        num[i+(j*i)] = 1;
      }
    }
  }
  REP(i, n){
    if(num[i]==0) v.push_back(i+1);
  }
}


int main(void){
 
  ll n;
  cin>>n;

  vector<ll> so;    //素数を格納
  vector<ll> num(n+1, 0);

  FOR(i, 2, n+1){

    if(num[i]==0){
      ll count = 2;
      while(1){
        if(i*count>n) break;
        num[i*count] = 1;
        count++;
      }
    }
  }
 
  FOR(i, 2, n+1){
    if(num[i]==0) so.push_back(i);
  }
  

  map<ll, ll> m;

  

  FOR(i, 2, n){
    ll count = 0;
    ll x = i;
    //cout<<"i"<<endl;

    while(1){
      if(x==1) break;
      else{
        if(x%so[count]==0){
          x /= so[count];
          m[so[count]]++;
          //cout<<so[count]<<endl;;
        }else count++; 
      }
    }
  }
  //cout<<"c"<<endl;

  ll ans = 1;
  for(auto i=m.begin(); i!=m.end() ;i++){
    //cout<<i->first<<" "<<i->second<<" ";
    ans *= (1+ i->second)%MOD;
    ans = ans%MOD;
    //cout<<ans<<endl;;
  }
  //cout<<endl;

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