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;
using System.Linq;
using System.Text;

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            //入力
            UInt64 mod = 1000000007;
            UInt64 N = UInt64.Parse(Console.ReadLine());
            Dictionary<UInt64, UInt64> dic = new Dictionary<UInt64, UInt64>();
            for (UInt64 i = 2; i <= N; i++) 
            {
                func(i, ref dic);
            }

            //結果を出力
            UInt64 count = 1;
            foreach (var key in dic.Keys) {
                count *= (dic[key] + 1);
                count %= mod;
            }
            Console.WriteLine(count.ToString());
            Console.ReadLine();
        }

        static void func(UInt64 n, ref Dictionary<UInt64,UInt64> dic)
        {
            UInt64 i = 2;
            while (i * i <= n)
            {
                if (n % i == 0)
                {
                    n /= i;
                    if (dic.ContainsKey(i)) dic[i]++;
                    else dic.Add(i, 1);
                }
                else
                {
                    i++;
                }
            }
            if (n != 1) 
            {
                if (dic.ContainsKey(n)) dic[n]++;
                else dic.Add(n, 1);
            }
        }
    }
}