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)

use proconio::input;
use std::collections::HashMap;

fn main() {
    input! {
        n: usize,
    }

    let mut reduce_map = HashMap::new();

    for i in 1..=n {
        let v = prime_factorize(i);
        for (key, value) in v {
            let entry = reduce_map.entry(key).or_insert(0);
            *entry += value;
        }
    }

    let mut greater_2 = 0;
    let mut greater_4 = 0;
    let mut greater_14 = 0;
    let mut greater_24 = 0;
    let mut greater_74 = 0;

    for (_, &value) in &reduce_map {
        if value >= 74 {
            greater_2 += 1;
            greater_4 += 1;
            greater_14 += 1;
            greater_24 += 1;
            greater_74 += 1;
        } else if value >= 24 {
            greater_2 += 1;
            greater_4 += 1;
            greater_14 += 1;
            greater_24 += 1;
        } else if value >= 14 {
            greater_2 += 1;
            greater_4 += 1;
            greater_14 += 1;
        } else if value >= 4 {
            greater_2 += 1;
            greater_4 += 1;
        } else if value >= 2 {
            greater_2 += 1;
        }
    }
    //println!("4 or more {}", greater_4);
    //println!("2 or more {}", greater_2);
    let mut ans = 0;
    // a^4 * b^4 * c^2
    ans += (greater_4 * (greater_4 - 1)) / 2 * (greater_2 - 2);
    //println!("1 {}", ans);
    // a^24 * b^2
    ans += greater_24 * (greater_2 - 1);
    //println!("2 {}", ans);
    // a^14 * b^4
    ans += greater_14 * (greater_4 - 1);
    //println!("3 {}", ans);
    // a^74
    ans += greater_74;
    //println!("4 {}", ans);

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

fn prime_factorize(mut n: usize) -> Vec<(usize, usize)> {
    let mut res = vec![];
    let mut a = 2;
    while a * a <= n {
        if n % a != 0 {
            a += 1;
            continue;
        }
        let mut ex = 0;

        while n % a == 0 {
            ex += 1;
            n /= a;
        }

        res.push((a, ex));
        a += 1;
    }
    if n != 1 {
        res.push((n, 1));
    }

    res
}