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)

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).expect("error");
    let n: i64 = s.trim().parse().unwrap();
    let mut a = [1; 1000];
    let mut m;

    for j in 2..(n + 1) {
        m = j;
        for i in 2..(j + 1) {
            while m % i == 0 {
                m /= i;
                a[(i - 1) as usize] += 1;
            }
            if n == 1 {
                break;
            }
            //println!("{}", i);
        }
    }

    //println!("{}", ans);
    let mut ans: i64 = 1;
    for i in 0..n {
        ans *= a[i as usize] % 1000000007;
        ans %= 1000000007;
    }
    println!("{}", ans);
}