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.Linq;
using System.Collections.Generic;
using System.Numerics;
using static System.Console;

class Solver {
    Scanner sc = new Scanner();

    public void Solve() {
        int N = sc.nextInt();

        if (N == 1) {
            WriteLine(1);
            return;
        }

        var prime = GeneratePrime(N);
        var n = new List<int>();
        for (int i = 1; i <= N; i++) {
            n.Add(i);
        }

        var cnt = new int[prime.Count];
        for (int i = 0; i < prime.Count; i++) {
            cnt[i] = 1;
        }
        for (int i = 0; i < prime.Count; i++) {
            for (int j = 0; j < n.Count; j++) {
                var hoge = n[j];
                while (hoge % prime[i] == 0) {
                    cnt[i]++;
                    hoge /= prime[i];
                }
            }
        }

        long ans = 1;
        for (int i = 0; i < cnt.Length; i++) {
            ans = ans * cnt[i] % 1000000007;
        }

        WriteLine(ans);
    }

    public static List<int> GeneratePrime(int max) {
        int prime;
        double sqrtMax = Math.Sqrt(max);
        var primeList = new List<int>();

        var searchList = Enumerable.Range(2, max - 1).ToList();

        do {
            prime = searchList.First();
            primeList.Add(prime);
            searchList.RemoveAll(n => n % prime == 0);
        } while (prime < sqrtMax);

        primeList.AddRange(searchList);
        return primeList;
    }
}



class Scanner {
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt() {


        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble() {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0) {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Program {
    static void Main(string[] args) {
        Solver s = new Solver();
        s.Solve();
    }
}