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# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;

namespace kozaiyApp
{
    public class FactorsOfFactorial
    {
        static void Main()
        {
            long N = int.Parse(Console.ReadLine());
            Dictionary<long, long> count = new Dictionary<long, long>(); // 素数xが何個あるか
            long mod = 1000000007;

            for (long i = 2; i <= N; i++) // N!... 1*2*3*4*...N
            {
                List<long> factorList = PrimeFactor(i); // 素因数分解
                foreach (var f in factorList) // 素数をカウント
                {
                    // Dictionaryに記録
                    if (count.ContainsKey(f))
                    {
                        count[f] += 1;
                    }
                    else
                    {
                        count.Add(f, 1);
                    }
                }
            }

            long ans = 1;
            foreach (var c in count)
            {
                ans *= (c.Value + 1) % mod;
                ans %= mod;
            }

            Console.WriteLine(ans);
        }

        // 素因数分解
        static List<long> PrimeFactor(long n)
        {
            List<long> result = new List<long>();
            for (long i = 2; i * i <= n; i++)
            {
                while (n % i == 0)
                {
                    result.Add(i);
                    n /= i;
                }
            }
            if (n != 1) result.Add(n);
            return result;
        }
    }
}