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::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let n: i64 = input();
    const MOD: i64 = 1000000007;

    let mut m = std::collections::HashMap::new();
    for i in 2..n + 1 {
        for j in 2..i + 1 {
            if !is_prime(j) {
                continue;
            }
            if i % j != 0 {
                continue;
            }
            let mut c = 0;
            let mut temp = i;
            while temp % j == 0 {
                c += 1;
                temp /= j;
            }
            let e = m.entry(j).or_insert(0);
            *e += c;
        }
    }

    let mut ans = 1i64;
    for (_, c) in m {
        ans *= c + 1;
        ans %= MOD;
    }
    println!("{}", ans);
}

fn is_prime(n: i64) -> bool {
    let mut ok = true;
    for i in 2..n {
        if i * i > n {
            break;
        }
        if n % i == 0 {
            ok = false;
            break;
        }
    }
    ok
}