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::io;
use std::collections::HashMap;


fn main() {
    const MOD: usize = 1_000_000_007;
    let n = read_one::<usize>();

    let mut hm = HashMap::new();
    for i in 1..n + 1 {
        let mut x = i;
        while let Some(f) = divide(x) {
            x /= f;
            *hm.entry(f).or_insert(0) += 1;
        }
        *hm.entry(x).or_insert(0) += 1;
    }

    let mut ans: usize = 1;
    for (k, v) in hm.iter() {
        if k == &1 { continue; }
        ans = ans * (*v + 1);
        ans = ans % MOD;
    }
    println!("{}", ans);

}

fn divide(n: usize) -> Option<usize> {
    for i in 2..(n as f64).sqrt().ceil() as usize + 2 {
        if n % i == 0 {
            return Some(i);
        }
    } 
    return None;
}

#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}