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>
 using namespace std;

#define  int  long long
#define  endl  '\n'
const int mod = 1e9 + 7;

map<int, int> cnt;

void primeFactors(int x)
{

   for(int i = 2; i * i <= x; i++)
   {
      int tot = 0;
      while(x % i == 0)
      {
         tot++;
         x /= i;
      }
      if(tot)
        cnt[i] += tot;
   }

   if(x > 1)
      cnt[x]++;
}

int power(int b, int p)
{
   if(p == 0)
     return 1;
   int x = power(b, p / 2);
   x = (x * x) % mod;
   if(p & 1)
     x = (x * b) % mod;

   return x;
}

int32_t main()
{ 
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);  
  int n;
  cin >> n;


  for(int i = 1; i <= n; i++)
    primeFactors(i);

  int ans = 1;

  for(auto it : cnt)
  {
     int x = it.second;
     ans *= (x + 1);
     ans %= mod;
  }

  cout << ans;
  
  return 0;
}