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.15.1) (judge verdict: Accepted)

use std::collections::HashMap;

const MOD: i64 = 1000000007;


fn main() {
    let n: i64 = read();

    let mut prime_count: HashMap<i64, i64> = HashMap::new();
    for mut t in 2..(n + 1) {
        let limit = t;
 
        for i in (2..).take_while(|&x| x * x <= limit) {
            let mut count = 0;
            while t % i == 0 {
                count += 1;
                t /= i;
            }
            if count > 0 {
                let c = prime_count.entry(i).or_insert(0);
                *c += count;
            }
        }

        if t != 1 {
            let c = prime_count.entry(t).or_insert(0);
            *c += 1;
        }
    }

    let mut res = 1; 
    for c in prime_count.values() {
        res *= c + 1;
        res %= MOD;
    }

    println!("{:?}", res);
}


fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}