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 Ruby (2.3.3) (judge verdict: Accepted)

class ModComb
  def initialize(max, mod)
    @mod = mod
    @fac = Array.new(max + 1)
    @finv = Array.new(max + 1)
    @inv = Array.new(max + 1)
    @fac[0] = @fac[1] = 1
    @finv[0] = @finv[1] = 1
    @inv[1] = 1
    (2..max).each do |i|
      @fac[i] = @fac[i - 1] * i % @mod
      @inv[i] = @mod - @inv[@mod % i] * (@mod / i) % @mod
      @finv[i] = @finv[i - 1] * @inv[i] % @mod
    end
  end

  def comb(n, k)
    return 0 if n < k
    return 0 if n < 0 || k < 0
    @fac[n] * (@finv[k] * @finv[n - k] % @mod) % @mod
  end
end

require 'prime'

N = gets.to_i

n = (1..N).reduce(:*)
# [3, 5, 5], [15, 5], [3, 25], [75]
es = n.prime_division.map { |_, e| e }
count3 = es.count { |e| e >= 3 - 1 }
count5 = es.count { |e| e >= 5 - 1 }
count15 = es.count { |e| e >= 15 - 1 }
count25 = es.count { |e| e >= 25 - 1 }
count75 = es.count { |e| e >= 75 - 1 }
ans = 0
comb = ModComb.new(1000, 10 ** 9 + 7)
ans += comb.comb(count5, 2) * comb.comb(count3 - 2, 1)
ans += comb.comb(count15, 1) * comb.comb(count5 - 1, 1)
ans += comb.comb(count25, 1) * comb.comb(count3 - 1, 1)
ans += comb.comb(count75, 1)
puts ans