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.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const char White = '.';
    const char Black = '#';
    const long Mod = 1000000007;

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static Dictionary<int, int> dic;

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());

        dic = new Dictionary<int ,int>();
        //dic.Add(1,1);

        for(int i=2; i<=n; i++) {
            PrimeFact(i);
        }

        long y = 1;
        foreach(var x in dic) {
            y *= (x.Value+1);
            y %= Mod;
        }

        return y;

        //6 5 4 3 2 1
        // 3 2  5  2 2  3  2  1
    }

    static long ModPow(long x1, long x2) {
        long ans = 1;
        while (x2 > 0) {
            if (x2 % 2 == 1) {
                ans = (ans * x1) % Mod;
            }
            x1 = (x1 * x1) % Mod;
            x2 /= 2;
        }
        return ans % Mod;
    }

    static long ModDiv(long x1, long x2) {
        long bb = ModPow(x2, Mod - 2);
        return (x1 * bb) % Mod;
    }

    static long ModCombination(long m, long n) {
        var a = 1L;
        var b = 1L;
        for (long i = 1; i <= n; i++) {
            a = (a * (m - i + 1)) % Mod;
            b = (b * i) % Mod;
        }

        return ModDiv(a, b) % Mod;
    }

    static List<long> PrimeFact(long n) {
        //var list = new List<long>();

        for (long i = 2; i <= Math.Sqrt(n); i++) {
            if (n % i == 0) {
                //list.Add(i);
                int c = 0;
                while (n % i == 0) {
                    n /= i;
                    c++;
                }
                Add((int)i, c);
            }
        }
        //if (n > 1) list.Add(n);
        if (n > 1) Add((int)n, 1);
        return null;
    }

    static void Add(int i, int c) {
        if(dic.ContainsKey(i)) dic[i]+=c;
        else dic[i] = c;
    }

    static int[] ToIntArray(string strs, int n) {
        var ret = new int[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = int.Parse(spl[i]);
        return ret;
    }
}