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 <bits/stdc++.h>
using namespace std;
typedef long long ll;

bool IsPrime(int num){
  if (num < 2) return false;
  else if (num == 2) return true;
  else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2)
  {
    if (num % i == 0)
    {
      // 素数ではない
      return false;
    }
  }

  // 素数である
  return true;
}

int main(){

  int n;
  cin >> n;
  vector<int> v;
  ll p = 1;

  for (int i = 1; i <= n; i++) {
    if (IsPrime(i)) {
      v.push_back(i);
    }
  }

  vector<ll> ans(v.size());
  for (int i = 0; i < v.size(); i++) {
    //cout << v.at(i) << endl;
    int t = v.at(i);
    for (int j = 1; j < n; j++) {
      if (t>n) {
        break;
      } else {
        ans.at(i) += n/t;
        t *= t;
      }
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    p *= (ans.at(i)+1) % (int)(1e9+7);

    //cout << i <<endl;
    //cout << p <<endl;
  }

  cout << p << endl;

}