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)

use std::fs;
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident) => {
        $it.next().unwrap().parse().unwrap()
    };
    ($it: ident,2) => {
        (parse!($it), parse!($it))
    };
    ($it: ident,3) => {
        (parse!($it), parse!($it), parse!($it))
    };
    ($it: ident,4) => {
        (parse!($it), parse!($it), parse!($it), parse!($it))
    };
    ($it: ident, $n: expr) => {
        (&mut $it).take($n).map(|e| e.parse().unwrap()).collect();
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    let n: usize = parse!(it);
    let mut primes = vec![0; n + 1];
    for i in 1..(n + 1) {
        let mut i = i;
        let mut p = 2;
        while p <= i {
            while i % p == 0 {
                primes[p] += 1;
                i /= p;
            }
            p += 1;
        }
    }
    let mut ret = 0;
    for i in 0..(n + 1) {
        for j in (i + 1)..(n + 1) {
            for k in (j + 1)..(n + 1) {
                match (primes[i], primes[j], primes[k]) {
                    (x, y, z) if x >= 4 && y >= 4 && z >= 4 => ret += 3,
                    (x, y, z) if x >= 4 && y >= 4 && z >= 2 => ret += 1,
                    (x, y, z) if x >= 4 && y >= 2 && z >= 4 => ret += 1,
                    (x, y, z) if x >= 2 && y >= 4 && z >= 4 => ret += 1,
                    _ => (),
                }
            }
        }
    }
    for i in 0..(n + 1) {
        for j in (i + 1)..(n + 1) {
            if primes[i] >= 2 && primes[j] >= 24 {
                ret += 1;
            }
            if primes[j] >= 2 && primes[i] >= 24 {
                ret += 1;
            }
            if primes[j] >= 4 && primes[i] >= 14 {
                ret += 1;
            }
            if primes[j] >= 14 && primes[i] >= 4 {
                ret += 1;
            }
        }
    }
    for i in 0..(n + 1) {
        if primes[i] >= 74 {
            ret += 1;
        }
    }
    println!("{}", ret);
}

fn test() {
    let mut f = fs::File::open("foo.txt").unwrap();
    let mut s = String::new();
    f.read_to_string(&mut s).unwrap();
    solve(&s);
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_main() {
        test();
    }
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}