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::str::FromStr;


fn divisor(n : u64) -> Vec<u64> {
    let mut x = n;
    let mut v = Vec::new();
    let mut i : u64= 2;
    while i.pow(2) <= n {
        while x % i == 0 {
            v.push(i);
            x = x / i;
        }
        i+=1;
    }
    if x != 1 {
        v.push(x);
    }
    return v;
}

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

fn get_vec<T : FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
}

fn main() {
    let n : u64 = get_one();
    let mut v : Vec<u64> = vec!(0;(n+1) as usize);
    for i in 2..(n+1) {
        let w = divisor(i);
        for x in w {
            v[x as usize] += 1;
        }
    }
    let ans = v.iter().fold(1, |pr, x| (pr * (x+1)) % 1000000007);
    println!("{}", ans);
}