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 Rust (1.42.0) (judge verdict: Accepted)

use proconio::input;

fn factorization(n: usize, v: &mut Vec<usize>) {
    fn factor_sub(n: usize, m: usize) -> (usize, usize) {
        let mut c = 0;
        let mut x = n;
        while x % m == 0 {
            c += 1;
            x /= m;
        }
        (c, x)
    }

    let (c, n) = factor_sub(n, 2);
    if c > 0 {
//		print!("({},{})", 2, c);
		v[2] += c;
	}
    let mut x = 3;
    let mut m = n;
    while x * x <= m {
        let (c, n) = factor_sub(m, x);
        if c > 0 {
//			print!("({},{})", x, c);
			v[x] += c;
		}
        m = n;
        x += 2;
    }
    if m > 1 {
//		print!("({},{})", m, 1);
		v[m] += 1;
	}
//	println!("");
}

fn main() {
	input!(n: usize);

	let mut v: Vec<usize> = vec![0; 1000+1];
	for i in 2..n+1 {
		factorization(i, &mut v);
	}
	let mut ans = 1;
//	println!("{:?}", v);
	for i in 0..1000+1 {
		if v[i] > 0 {
			ans *= v[i] + 1;
			ans %= 1000000007
		}
	}
	println!("{}", ans);
}