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.42.0) (judge verdict: Accepted)

#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    unused_imports,
    dead_code
)]
//use proconio::fastout;
use proconio::input;
use proconio::marker::*;
//use std::collections::HashSet;
// use std::cmp::*;
//use std::collections::VecDeque;

fn main() {
    input! {
       N:i64
    }
    for i in N..=N {
        //print!("{}:", i);
        main2(i);
    }
    let ts = getNumbersInN(N);
    //    println!("{:?}", ts);
}
fn main2(N: i64) {
    // 約数の個数は素因数分解して、各素因数の個数+1をかけたもの。
    // Ex: 12= 2^2*3^1なので、(2+1)*(1+1)=6個。1,2,3,4,6,12
    // 75=(2+1)*(4+1)*(4+1);
    // 100以下の素数は97までの25個。
    // 素数a,b,cについて、a<b<cとする。
    // N < c*2なら、cは N! に高々1個しか含まれないので、不可。
    // 同様に、N < b*4 も成立しない。
    // cの可能性があるのはN/2以下、a,bの可能性があるのはN/4
    let p = getPrimes(N as usize);
    let mut ans = 0;
    // 2個,4個,4個の場合
    let ts = getNumbersInN(N);
    for i in 0..p.len() {
        let t = ts[p[i]];
        if t < 4 {
            break;
        }
        for j in (i + 1)..p.len() {
            let t2 = ts[p[j]];
            if t2 < 4 {
                break;
            }
            for k in (j + 1)..p.len() {
                let t3 = ts[p[k]];
                if t3 < 2 {
                    break;
                }
                if t3 < 4 {
                    ans += 1;
                } else {
                    ans += 3;
                }
            }
        }
    }
    //print!("{} ", ans);

    // 14,4の場合
    for i in 0..p.len() {
        let t = ts[p[i]];
        if t < 14 {
            break;
        }
        for j in (i + 1)..p.len() {
            let b = p[j];
            let t2 = ts[p[j]];
            if t2 < 4 {
                break;
            }
            if t2 < 14 {
                ans += 1;
            } else {
                ans += 2;
            }
        }
    }
    //print!("{} ", ans);

    // 24,2の場合
    for i in 0..p.len() {
        let t = ts[p[i]];
        if t < 24 {
            break;
        }
        for j in (i + 1)..p.len() {
            let t2 = ts[p[j]];
            if t2 < 2 {
                break;
            }
            if t2 < 24 {
                ans += 1;
            } else {
                ans += 2;
            }
        }
    }
    //print!("{} ", ans);
    // 74の場合
    for i in 0..p.len() {
        let a = p[i];
        let t = ts[a];
        if t < 74 {
            break;
        }
        ans += 1;
    }
    println!("{}", ans);
}
fn getNumbersInN(N: i64) -> Vec<i64> {
    let mut ts = vec![0; N as usize + 1];
    for a in 2..=N {
        ts[a as usize] = getNumInN(a, N, true);
    }
    //println!("{} in {} => {}", a, N, t);
    ts
}
fn getNumInN(a: i64, N: i64, saiki: bool) -> i64 {
    let mut t = N / a;
    let mut j = 2;
    if saiki {
        while a.pow(j) <= N {
            t += getNumInN(a.pow(j), N, false);
            j += 1;
        }
    }
    //println!("{} in {} => {}", a, N, t);
    t
}
fn getPrimes(N: usize) -> Vec<usize> {
    let mut p = vec![true; N as usize + 1];
    let mut q = Vec::with_capacity(100);
    p[0] = false;
    p[1] = false;
    for i in 2..=N as usize {
        if p[i as usize] {
            q.push(i);
        }
        let mut j = 2;
        while i * j <= N {
            p[(i * j) as usize] = false;
            j += 1;
        }
    }
    q
}