Problem:
Score : 400 points

Problem Statement

You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many Shichi-Go numbers (literally "Seven-Five numbers") are there?

Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Note

When a positive integer A divides a positive integer B, A is said to a divisor of B.
For example, 6 has four divisors: 1, 2, 3 and 6.

Constraints

1 \leq N \leq 100

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the number of the Shichi-Go numbers that are divisors of N!.

Sample Input 1

9

Sample Output 1

0

There are no Shichi-Go numbers among the divisors of 9! = 1 \times 2 \times ... \times 9 = 362880.

Sample Input 2

10

Sample Output 2

1

There is one Shichi-Go number among the divisors of 10! = 3628800: 32400.

Sample Input 3

100

Sample Output 3

543

Solution in Rust (1.15.1) (judge verdict: Accepted)



#[allow(dead_code)]
pub struct Scanner<'a> {
    _buf: &'a str,
    iter: ::std::str::SplitWhitespace<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    pub fn new(buf: &'a str) -> Self {
        Scanner {
            _buf: buf,
            iter: buf.split_whitespace(),
        }
    }

    pub fn array<T>(&mut self, n: usize) -> Vec<T>
        where T: ::std::str::FromStr,
              T::Err: ::std::fmt::Debug,
    {
        let mut res = Vec::with_capacity(n);
        for _ in 0..n {
            res.push(self.value());
        }
        res
    }

    pub fn value<T>(&mut self) -> T
        where T: ::std::str::FromStr,
              T::Err: ::std::fmt::Debug,
    {
        self.next().parse().unwrap()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.next().chars().collect()
    }

    fn next(&mut self) -> &str {
        self.iter.next().unwrap()
    }
}

fn count_divisors(cnt: &mut [i64], mut x: i64) {
    for d in 2.. {
        if x == 1 { break; }
        while x % d == 0 {
            cnt[d as usize] += 1;
            x /= d;
        }
    }
}

fn main() {
    let mut _input = String::new();
    {
        use ::std::io::Read;
        ::std::io::stdin().read_to_string(&mut _input).unwrap();
    }
    let mut sc = Scanner::new(&_input);

    let n = sc.value::<i64>();

    let mut cnt = vec![0_i64; 100];
    for i in 2..n+1 {
        count_divisors(&mut cnt, i);
    }
    //eprintln!("{:?}", cnt);

    let mut ans = 0_i64;

    // a^74
    let m = cnt.iter().filter(|&&e| 74 <= e).count() as i64;
    ans += m;

    // a^24 * b^2
    let ma = cnt.iter().filter(|&&e| 24 <= e).count() as i64;
    let mb = cnt.iter().filter(|&&e|  2 <= e && e < 24).count() as i64;
    ans += ma * (ma-1);
    ans += ma * mb;

    // a^14 * b^4
    let ma = cnt.iter().filter(|&&e| 14 <= e).count() as i64;
    let mb = cnt.iter().filter(|&&e|  4 <= e && e < 14).count() as i64;
    ans += ma * (ma-1);
    ans += ma * mb;

    // a^4 * b^4 * c^2
    let ma = cnt.iter().filter(|&&e| 4 <= e).count() as i64;
    let mb = cnt.iter().filter(|&&e| 2 <= e && e < 4).count() as i64;
    ans += ma * (ma-1) * (ma-2) / 2;
    ans += ma * (ma-1) / 2 * mb;

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