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 Common Lisp (SBCL 1.1.14) (judge verdict: Accepted)

(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 2))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (progn (ql:quickload '(:cl-debug-print :fiveam))
                 (shadow :run)
                 (use-package :fiveam)))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)

;; BEGIN_INSERTED_CONTENTS
(defmacro define-int-types (&rest bits)
  `(progn
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "UINT~A" b)) () '(unsigned-byte ,b))) bits)
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "INT~A" b)) () '(signed-byte ,b))) bits)))
(define-int-types 4 7 8 15 16 31 32 62 63 64)

(defmacro println (obj &optional (stream '*standard-output*))
  `(let ((*read-default-float-format* 'double-float))
     (prog1 (princ ,obj ,stream) (terpri ,stream))))

;; Hauptteil

(defun decompose (n prime-table)
  (map 'vector
       (lambda (p)
         (loop for i from 0
               do (multiple-value-bind (quot rem) (floor n p)
                    (if (zerop rem)
                        (setf n quot)
                        (return i)))))
       prime-table))

(defun count-4-4-2 (table)
  (let ((num2~3 (loop for i across table count (<= 2 i 3)))
        (num4~ (loop for i across table count (<= 4 i))))
    (+ (floor (* num2~3 num4~ (- num4~ 1)) 2)
       (floor (* num4~ (- num4~ 1) (- num4~ 2)) 2))))

(defun count-14-4 (table)
  (let ((num4~13 (loop for i across table count (<= 4 i 13)))
        (num14~ (loop for i across table count (<= 14 i))))
    (+ (* num14~ (- num14~ 1))
       (* num14~ num4~13))))

(defun count-24-2 (table)
  (let ((num2~23 (loop for i across table count (<= 2 i 23)))
        (num24~ (loop for i across table count (<= 24 i))))
    (+ (* num24~ (- num24~ 1))
       (* num24~ num2~23))))

(defun count-74 (table)
  (loop for i across table count (<= 74 i)))

(defun main ()
  (let* ((n (read))
         (prime-table (coerce (loop for x from 2 to n
                                    when (sb-impl::positive-primep x)
                                    collect x)
                              'vector))
         (factor-table (make-array (length prime-table) :element-type 'uint16)))
    (loop for k from 1 to n
          do (map-into factor-table #'+ factor-table (decompose k prime-table)))
    (println (+ (count-4-4-2 factor-table)
                (count-14-4 factor-table)
                (count-24-2 factor-table)
                (count-74 factor-table)))))

#-swank(main)