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)

#[allow(dead_code)]
pub const M: u64 = 1_000_000_007;

#[allow(unused_macros)]
macro_rules ! for_ { ( $ init : stmt ; $ cond : expr ; $ incr : expr , $ body : block ) => ( { $ init ; while $ cond { $ body $ incr ; } } ) ; }

fn main() {
    use std::io::Read;
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    
    let n: usize = iter.next().unwrap().parse::<usize>().unwrap();
    let mut hmap = HashMap::new();

    for i in 1..(n+1) {
        let tmp = prime_factors(i as u64);
        for (key, value) in tmp.iter() {
            *hmap.entry(key.clone()).or_insert(0) += value.clone();
            *hmap.entry(key.clone()).or_insert(0) %= M;
        }
    }

    let mut ret = 1u64;
    for (_, value) in hmap.iter() {
        ret *= value + 1;
        ret %= M;
    }

    println!("{}", ret);
}

#[doc = " n>=1"]
#[allow(dead_code)]
fn is_prime(n: u64) -> bool {
    for_ ! ( let mut i = 2 ; i * i <= n ; i += 1 , { if n % i == 0 { return false ; } } );
    n != 1
}
#[doc = " n>=1"]
#[allow(dead_code)]
fn divisors(n: u64) -> Vec<u64> {
    let mut ret = vec![];
    for_ ! ( let mut i = 1 ; i * i <= n ; i += 1 , { if n % i == 0 { ret . push ( i ) ; if i != n / i { ret . push ( n / i ) ; } } } );
    ret
}
#[allow(dead_code)]
use std::collections::HashMap;
#[doc = " n>=1"]
#[allow(dead_code)]
fn prime_factors(mut n: u64) -> HashMap<u64, u64> {
    let mut ret = HashMap::new();
    for_ ! ( let mut i = 2 ; i * i <= n ; i += 1 , { while n % i == 0 { * ret . entry ( i ) . or_insert ( 0 ) += 1 ; n /= i ; } } );
    if n != 1 {
        ret.insert(n, 1);
    }
    ret
}
#[doc = " return: (primes, is_prime)"]
#[allow(dead_code)]
fn sieve(n: usize) -> (Vec<usize>, Vec<bool>) {
    let mut primes = vec![];
    let mut is_prime = vec![true; n + 1];
    is_prime[0] = false;
    is_prime[1] = false;
    for i in 2..n + 1 {
        if is_prime[i] {
            primes.push(i);
            for_ ! ( let mut j = 2 * i ; j <= n ; j += i , { is_prime [ j ] = false ; } )
        }
    }
    (primes, is_prime)
}