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 Kotlin (1.0.0) (judge verdict: Accepted)

val primeToIndex =
    mapOf(2 to 0, 3 to 1, 5 to 2, 7 to 3, 11 to 4, 13 to 5,
          17 to 6, 19 to 7, 23 to 8, 29 to 9, 31 to 10, 37 to 11,
          41 to 12, 43 to 13, 47 to 14)

val nonUsePrimes =
    listOf(53, 59, 61, 67, 71, 73, 79, 83, 89, 97)

val primeArr = primeToIndex.keys.toIntArray()

fun main(args: Array<String>) {
    val n = readInputLine().toInt()

    val primes = Array(n + 1, {IntArray(15)})
    
    for (i in 2..n) {
        if (primeToIndex.containsKey(i)) {
            primes[i][primeToIndex.get(i)!!] = 1
            continue
        }
        
        if (nonUsePrimes.contains(i)) {
            continue
        }
        
        for (p in primeToIndex.keys) {
            if (i % p == 0) {
                for (j in 0..14) {
                    primes[i][j] = primes[i / p][j]
                }
                primes[i][primeToIndex.get(p)!!]++
                break
            }
        }
    }
    
    val totalPrimes = IntArray(15)
    for (p in primes) {
        for (i in 0..14) {
            totalPrimes[i] += p[i]
        }
    }

    // 指数とインデックスの関係:
    // 2 -> 0
    // 4 -> 1
    // 14 -> 2
    // 24 -> 3
    // 74 -> 4
    val cnt = IntArray(5)
    for (p in totalPrimes) {
        if (p >= 2) {
            cnt[0]++
        }
        if (p >= 4) {
            cnt[1]++
        }
        if (p >= 14) {
            cnt[2]++
        }
        if (p >= 24) {
            cnt[3]++
        }
        if (p >= 74) {
            cnt[4]++
        }
    }

    var ans = 0
    
    // 同じものは使えないため、複数組み合わせの場合は使える素数の数から減算する処理をする
    // p^4q^4r^2のケースはpとqのパターン数分2で除算する必要がある
    ans += cnt[4]
    ans += cnt[3] * (cnt[0] - 1)
    ans += cnt[2] * (cnt[1] - 1)
    ans += cnt[1] * (cnt[1] - 1) * (cnt[0] - 2) / 2
    
    println(ans)
}
 
fun readInputLine(): String {
    return readLine()!!
}