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

static MOD : i64 = 1e9 as i64 + 7;

fn main(){
    let n : usize = input();
    let mut ans : i64 = 1;
    let mut cnt : Vec<i64> = vec![1; n + 1];
    for i in 2..n + 1{
        let mut x = i;
        for j in 2..i + 1 {
            while x > 1 && x % j == 0{
                x /= j;
                cnt[j] += 1;
            }
        }
    }
    for i in 2..n + 1 {
        ans *= cnt[i];
        ans %= MOD;
    }
    println!("{}", ans);
}

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()
}