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: Wrong Answer)

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val map = mutableMapOf<Int, Map<Int, Int>>()
    for (i in 2..100) {
        map[i] = calcFactors(i)
    }

    val countMap = mutableMapOf<Int, Int>()
    map.filter { it.key <= n }.forEach {tit->
        tit.value.forEach { vit ->
            if (countMap.containsKey(vit.key)) {
                countMap[vit.key] = countMap[vit.key]!! + vit.value
            } else {
                countMap[vit.key] = vit.value
            }
        }
    }

    val count2 = countMap.count { it.value >= 2 }
    val count4 = countMap.count { it.value >= 4 }
    val count14 = countMap.count { it.value >= 14 }
    val count24 = countMap.count { it.value >= 24 }
    val count74 = countMap.count { it.value >= 74 }

    val temp74 = count74
    val temp24 = count24 * count2 - count24
    val temp14 = count14 * count4 - count14
    val temp4 = calcCombination(count4.toLong(), 3) * 3
    val temp2 = calcCombination(count4.toLong(), 2) * (count2 - count4)
    print(temp2 + temp4 + temp14 + temp24 + temp74)
}


fun calcFactors(n: Int): Map<Int, Int> {//素因数分解
    val factors = mutableMapOf<Int, Int>()
    var tmp = n
    var i = 2
    while (i * i <= tmp) {
        while (tmp % i == 0) {
            factors[i] = factors.getOrElse(i) { 0 } + 1
            tmp /= i
        }
        i++
    }
    if (tmp > 1) factors[tmp] = 1
    return factors
}

//nCrを計算する
fun calcCombination(n: Long, r: Long): Long {
    var temp = 1.0
    for (i in 0..(r - 1)) {
        temp = temp * (n - i) / (r - i)
    }
    return temp.toLong()
}