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;

fn factors(hm: &mut HashMap<u64, u64>, mut x: u64) {
    let n = x;
    for i in 2..n + 1 {
        let c = hm.entry(i).or_insert(1);
        while x % i == 0 {
            *c += 1;
            x /= i;
        }
        if n == 1 {
            break;
        }
    }
}

fn main() {
    let n = read::<u64>();
    let mut hm = HashMap::new();
    for i in 1..n + 1 {
        factors(&mut hm, i);
    }

    //println!("{:?}", hm);

    let mut count = 1;
    for &v in hm.values() {
        count *= v;
        count %= 1000000007;
    }

    println!("{}", count);
}

#[allow(dead_code)]
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()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}