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)

require 'prime'

PN = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97].freeze

# 素因数分解の結果pns から、指数が expo 以上の因数をカウントする
def count_pn(pns, expo)
  cnt = 0
  pns.count do |k, v|
    cnt += 1 if expo <= v
  end
  cnt
end

def main
  n = gets.chomp.to_i

  # 75数とは以下p,q,rの数式で表現できる数
  # ※以下、p, q, r は任意の素数を表す。
  #
  # 5*5*3 -> p^4 * q^4 * r^2
  # 15*5  -> p^14 * q^4
  # 25*3  -> p^24 * q^2
  # 75*1  -> p^74

  # n! を素因数分解
  pns = Hash.new(0)
  2.upto(n) do |x|
    a = Prime.prime_division(x) #=> [[5, 1], [197, 1], [461, 1]]
    # pp "#{x}: #{a}"
    pns.merge!(a.to_h) do |k, old_val, new_val|
      old_val + new_val
    end
  end
  # pp "#{n}: #{pns}"

  # 4通りのパターンいずれかに当てはまる n! の約数を数える
  # p^74 -> 74以上の指数を持つ素因数を数える
  # p^24 * q^2 -> 24以上の指数を持つ素因数の数 + (2以上の指数をもつ素因数の数 - 1)
  #               ※末尾 -1 は24以上の指数を持つ素因数の数を除くため
  # p^14 * q^4      -> 同上
  # p^4 * q^4 * r^2 -> 同上 / 2 ★pとqを入れ替えても同じ数になるので2で割っておく
  c74 = count_pn(pns, 74)

  c24 = count_pn(pns, 24)
  c2 = count_pn(pns, 2)

  c14 = count_pn(pns, 14)
  c4 = count_pn(pns, 4)

  # puts "75: #{c74}"
  # puts "25*3: #{c24} * #{c2-1}"
  # puts "15*5: #{c14} * #{c4-1}"
  # puts "5*5*3: #{c4} * #{c4-1} * #{c2-2}" / 2

  puts c74 + (c24 * (c2-1)) + (c14 * (c4-1)) + (c4 * (c4-1) * (c2-2) / 2)
end

if __FILE__ == $0
  main
end