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 (Python):
N = int(input())

prime_list = [0 for i in range(N+1)]
for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            prime_list[j] += 1
            cur //= j
            
def num(m):
    return len(list(filter(lambda x: x >= m-1, prime_list)))

print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)
    + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

Solution (Python):
answer = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 8, 8, 11, 11, 11, 11, 14, 14, 32, 32, 35, 35, 35, 35, 42, 42, 42, 42, 49, 49, 49, 49, 49, 49, 75, 75, 86, 86, 86, 86, 86, 86, 123, 123, 131, 131, 131, 131, 148, 148, 153, 153, 170, 170, 170, 170, 170, 170, 227, 227, 227, 227, 227, 227, 250, 250, 323, 323, 324, 324, 324, 324, 354, 354, 354, 354, 384, 384, 384, 384, 384, 391, 491, 491, 529, 529, 529, 529, 529, 529, 543]
N = int(input())
print(answer[N])

Solution (Python):
def slove():
    import sys
    import collections
    input = sys.stdin.readline

    n = int(input().rstrip('\n'))
    ls = []

    for i in range(1, n + 1):
        t = i
        for j in range(2, int(t ** 0.5) + 1):
            while True:
                if t % j == 0:
                    t //= j
                    ls.append(j)
                else:
                    break
        if t > 1:
            ls.append(t)

    ls = collections.Counter(ls)
    ls2 = []

    for k, v in ls.items():
        if v >= 74:
            ls2.append(75)
        if v >= 24:
            ls2.append(25)
        if v >= 14:
            ls2.append(15)
        if v >= 4:
            ls2.append(5)
        if v >= 2:
            ls2.append(3)

    ls2 = collections.Counter(ls2)
    cnt = 0
    cnt += (ls2[75])
    cnt += (ls2[25] * max(ls2[3]-1, 0))
    cnt += (ls2[15] * max(ls2[5]-1, 0))
    cnt += (ls2[5] * max(ls2[5]-1, 0) * max(ls2[3]-2, 0) // 2)
    print(cnt)


if __name__ == '__main__':
    slove()

Solution (Python):
N = int(input())

prime_list = [0 for i in range(N+1)]
for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            prime_list[j] += 1
            cur //= j
            
def num(m):
    return len(list(filter(lambda x: x >= m-1, prime_list)))

print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)
    + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

Solution (Python):
n = int(input())

e = [0] * 101

for x in range(2, n + 1):
    d = 2
    while x > 1:
        c = 0
        while x % d == 0:
            x //= d
            c += 1
        e[d] += c
        d += 1







def f(n, e=e):
    return len(tuple(filter(lambda x: x >= n - 1, e)))


ans = f(75) + f(25) * (f(3) - 1) + f(15) * (f(5) - 1) + f(5) * (f(5) - 1) // 2 * (f(3) - 2)
print(ans)

Solution (Python):
def f(p,N):
    res=0
    while N>=p:
        N//=p
        res+=N
    return res

N=int(input())
ps=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
A=[len([p for p in ps if f(p,N)>=k]) for k in [2,4,14,24,74]]

a,b,c,d,e=A[0],A[1],A[2],A[3],A[4]

ans=0

ans+=b*(b-1)//2*(a-2)

ans+=d*(a-1)

ans+=c*(b-1)

ans+=e

print(ans)

Solution (Python):
import sys
n=int(input())
data=[0]*(n+1)
for i in range(2,n+1):
    for j in range(2,int(i**(1/2))+1):
        if i%j==0:
            break
    else:
        count=0
        for j in range(i,n+1):
            k=j
            while k%i==0:
                k//=i
                data[i]+=1
if n==1:
    print(0)
    sys.exit()
if data[2]>=74:
    ans=1
else:
    ans=0
count3=0
count5=0
count15=0
count25=0
for i in range(n+1):
    if data[i]>=2:
        count3+=1
for i in range(n+1):
    if data[i]>=4:
        count5+=1
for i in range(n+1):
    if data[i]>=14:
        count15+=1
for i in range(n+1):
    if data[i]>=24:
        count25+=1
ans+=count25*(count3-1)
ans+=count15*(count5-1)
ans+=(count3-2)*count5*(count5-1)//2
print(ans)

Solution (Python):

from collections import defaultdict


def prime_factorization(x: int) -> dict:
    max_prime, ret = 0, {}
    cnt = 0
    while x % 2 == 0:  
        x //= 2
        cnt += 1
    if cnt > 0:
        max_prime = 2
        ret[max_prime] = cnt

    cnt = 0
    for i in range(3, int(x ** 0.5) + 1, 2):
        cnt = 0
        while x % i == 0:
            x //= i
            max_prime = i
            cnt += 1
        if cnt > 0:
            ret[max_prime] = cnt

    if x > 2:  
        max_prime = x
        ret[max_prime] = 1
    return ret


def count(n: int) -> int:
    return sum(i >= n - 1 for i in prime_factors.values())


def main():
    global prime_factors
    N = int(input())
    prime_factors = defaultdict(int)
    for i in range(2, N + 1):
        for k, v in prime_factorization(i).items():
            prime_factors[k] += v
    ans = (
        count(75)
        + count(25) * (count(3) - 1)
        + count(15) * (count(5) - 1)
        + count(5) * (count(5) - 1) * (count(3) - 2) // 2
    )
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
f=list()

for i in range(1,n+1):
  b=2
  while b*b <= i:
    while i%b==0:
      i //= b
      f.append(b)
    b += 1
  if i > 1:
    f.append(i)

o2=o3=o4=o14=o24=o74=0

for i in range(2,n+1):
  d=f.count(i)
  if d>=2:
    o2 += 1
  if d>=4:
    o4 += 1
  if d>=14:
    o14 += 1
  if d>=24:
    o24 += 1
  if d>=74:
    o74 += 1

print(o4*(o4-1)//2*(o2-2)+o14*(o4-1)+o24*(o2-1)+o74)

Solution (Python):
prime=[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]
lists=[[0 for i in range(101)] for i in range(101)]
for p in prime:
    for n in range(1,101):
        if n==1:
            lists[p][n]=0
        else:
            if n%p!=0:
                lists[p][n]= lists[p][n-1]
        
            elif n%p==0:
                count=1
                order=0
                OK=True
                while OK:
                    if n%(p**count)==0:
                        order=count
                        count+=1
                    else:
                        OK=False
                lists[p][n]=lists[p][n-1]+(count-1)
       


n=int(input())
uselist=[]
for p in prime:
    uselist.append(lists[p][n])


dictio={}
for i in range(len(prime)):
    dictio[prime[i]]=uselist[i]

ans=0


larger_74=0
larger_24=0
larger_14=0
larger_2=0
larger_4=0

for  i in dictio.values():
    if i>=74:
        ans+=1
    if i>=24:
        larger_24+=1
    if i>=14:
        larger_14+=1
    if i>=4:
        larger_4+=1
    if i>=2:
        larger_2+=1

if larger_74>=1:
    answer+=1
if larger_14>=1 and larger_4>=2:
    ans+=(larger_14)*(larger_4-1)
if larger_24>=1 and larger_2>=2:
    ans+=(larger_24)*(larger_2-1)
if larger_4>=2 and larger_2>=3:
    ans+=((larger_4)*(larger_4-1)//2)*(larger_2-2)
print(ans)

Solution (Python):
import collections

def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a

N = int(input())
if N == 1:
  print(0)
  exit()
PD = {}
for i in range(2,N+1):
  c = collections.Counter(prime_factorize(i))
  
  for k,v in c.items():
    if k in PD:
      PD[k] += v
    else:
      PD[k] = v

o74 = 0
o24 = 0
o14 = 0
o4 = 0
o2 = 0
for v in PD.values():
  if v >= 74:
    o74 += 1
  if v >= 24:
    o24 += 1
  if v >= 14:
    o14 += 1
  if v >= 4:
    o4 += 1
  if v >= 2:
    o2 += 1

ans = o74
if o24 > 0 and o2 > 1:
  ans += o24*(o2-1)
if o14 > 0 and o4 > 1:
  ans += o14*(o4-1)
if o4 > 1 and o2 > 2:
  ans += o4*(o4-1)//2*(o2-2)
print(ans)

Solution (Python):
from sys import stdin

N = int(stdin.readline().rstrip())
A = [0] * 100

for n in range(1, N + 1):
    i = 2
    while n > 1:
        if n % i == 0:
            n //= i
            A[i] += 1
        else:
            i += 1

x = len([x for x in A if x >= 4])
y = len([x for x in A if x >= 2])
z = len([x for x in A if x >= 14])
w = len([x for x in A if x >= 4])
a = len([x for x in A if x >= 24])
b = len([x for x in A if x >= 2])

print(((x * (x - 1)) // 2) * (y - 2) + z * (w - 1) + a * (b - 1) + len([x for x in A if x >= 74]))

Solution (Python):
n=int(input());c=[1]*101
for i in range(2,n+1):
    for j in range(2,n+1):
        while i%j==0:i/=j;c[j]+=1
def N(M):return len([0 for x in c if x>=M])
print(N(75)+N(25)*~-N(3)+N(15)*~-N(5)+N(5)*~-N(5)//2*~-~-N(3))

Solution (Python):
n = int(input())
cnt = [1] * 101
for i in range(2, n+1):
    for j in range(2, n+1):
        while i % j == 0:
            i /= j
            cnt[j] += 1

san = 0; go = 0; jugo = 0; nijugo = 0; shitigo = 0
for i in range(2, 101):
    if cnt[i] >= 3: san += 1
    if cnt[i] >= 5: go += 1
    if cnt[i] >= 15: jugo += 1
    if cnt[i] >= 25: nijugo += 1
    if cnt[i] >= 75: shitigo += 1

print(shitigo + nijugo*(san-1) + jugo*(go-1) + go*(go-1)//2*(san-2))

Solution (Python):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i == 0:
            cnt = 0
            while temp%i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    if temp != 1:
        arr.append([temp, 1])
    if arr == []:
        arr.append([n, 1])
    return arr

n = int(input())
exponent = [[0]*(n+1) for i in range(n+1)]

for i in range(2,n+1):
  for j in range(n+1):
    exponent[i][j] += exponent[i-1][j]
  Fi = factorization(i)
  for f in Fi:
    exponent[i][f[0]] += f[1]

c75,c25,c15,c5,c3 = 0,0,0,0,0
for e in exponent[n]:
  if e >= 74:
    c75 += 1
  if e >= 24:
    c25 += 1
  if e >= 14:
    c15 += 1
  if e >= 4:
    c5 += 1
  if e >= 2:
    c3 += 1
print(
  c75 + c25*(c3-c25)+c25*(c25-1) + c15*(c5-c15)+c15*(c15-1) + (c5*(c5-1))//2*(c5-2)+(c5*(c5-1))//2*(c3-c5)
    )

Solution (Python):
n = int(input())
prime = [2,3,5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]


def yakusuu(n,p):
    res = 0
    while n > 0:
        n //= p
        res += n
    return res

l2 = 0
l4 = 0
l14 = 0
l24 = 0
l74 = 0

for p in prime:
    y = yakusuu(n,p)
    if y >= 2:
        l2 += 1
    if y >= 4:
        l4 += 1
    if y >= 14:
        l14 += 1
    if y >= 24:
        l24 += 1
    if y >= 74:
        l74 += 1

print(l4*(l4-1)*(l2-2)//2+l14*(l4-1)+l24*(l2-1)+l74)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
if N == 1:
	print(0)
	sys.exit()

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

e = [0] * (N+1)
for i in range(2, N+1):
	for x in factorization(i):
		e[x[0]] += x[1]



ans = 0

def num(m):
	return len([x for x in e if x >= m-1])


print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)

Solution (Python):
import collections
N = int(input())

def make_divisors(n):
    divisors_set=set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divisors_set.add(i)
            divisors_set.add(n//i)
    divisors_list=list(divisors_set)
    divisors_list.sort()
    return divisors_list

def make_primes(n):
    primes_list=[]
    while n % 2 == 0:
        primes_list.append(2)
        n = n//2
    f = 3
    while f * f <= n:
        if n % f == 0:
            primes_list.append(f)
            n = n//f
        else:
            f += 2
    if n != 1:
        primes_list.append(n)
    return primes_list

def cnt75(d):
    ans = 0
    for key in d.keys():
        if d[key] >= 75-1:
            ans += 1
    return ans

def cnt25_3(d):
    ans25 = 0
    ans3 = 0
    for key in d.keys():
        if d[key] >= 25-1:
            ans25 += 1
        elif d[key] >= 3-1:
            ans3 += 1
    
    return ans25 * (ans25+ans3-1)

def cnt15_5(d):
    ans15 = 0
    ans5 = 0
    for key in d.keys():
        if d[key] >= 15-1:
            ans15 += 1
        elif d[key] >= 5-1:
            ans5 += 1
    
    return ans15*(ans15+ans5-1)


def frac(n):
    if n == 1:
        return 1
    else:
        return n*frac(n-1)

def cnt5_5_3(d):
    ans5 = 0
    ans3 = 0
    for key in d.keys():
        if d[key] >= 5-1:
            ans5 += 1
        elif d[key] >= 3-1:
            ans3 += 1
    
    return ans5*(ans5-1)*(ans5+ans3-2)//2 





primes=[]
for i in range(1,N+1):
    
    primes.extend(make_primes(i))
    
    


c=collections.Counter(primes)

print(cnt75(c)+cnt25_3(c)+cnt15_5(c)+cnt5_5_3(c) )

Solution (Python):
def factorize_factorial(n):
    
    e = [0] * 101
    for k in range(2, n + 1):
        divisor = 2
        cnt = 0
        while k % divisor == 0:
            k //= divisor
            cnt += 1
        if cnt > 0:
            e[divisor] += cnt

        divisor = 3
        while k > 1:
            cnt = 0
            while k % divisor == 0:
                k //= divisor
                cnt += 1
            if cnt > 0:
                e[divisor] += cnt
            divisor += 2
    return e


def count(k, e):
    
    return len(tuple(filter(lambda x: x >= k, e)))


def main():
    n = int(input())
    e = factorize_factorial(n)

    ans = 0
    ans += count(75 - 1, e)
    ans += count(25 - 1, e) * (count(3 - 1, e) - 1)
    ans += count(15 - 1, e) * (count(5 - 1, e) - 1)
    ans += count(5 - 1, e) * (count(5 - 1, e) - 1) * (count(3 - 1, e) - 2) // 2

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a=[0]*(n+1)
for i in range(2,n+1):
    x=i
    for j in range(2,n+1):
        while x%j==0:
            a[j]+=1
            x//=j
def num(n):
    return len(list(filter(lambda x: x>=n-1,a)))

print(num(75) + num(25) * (num(3)-1) + num(15)*(num(5)-1) + num(5)*(num(5)-1)*(num(3)-2)//2)

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
n=int(input())
sosu=[0]*(n+1)
for i in range(2,n+1):
    tmp=i
    for j in range(2,i+1):
        while tmp%j==0:
            sosu[j]+=1
            tmp//=j

def num(n):
    return len(list(filter(lambda x: x>=n-1, sosu)))

print(num(75) + num(25)*(num(3)-1) + num(15)*(num(5)-1) 
+ num(5)*(num(5)-1)*(num(3)-2)//2)

Solution (Python):
N = int(input())

def p_f(n):
    L = []
    c = 2
    while c <= n:
        if n%c == 0:
            L.append(c)
            n /= c
        else:
            c += 1
    return L


if N == 1:
    print(0)
else:
    dic = {}
    for i in range(2, N+1):
        L = p_f(i)
        for j in range(len(L)):
            if L[j] in dic:
                dic[L[j]] += 1
            else:
                dic[L[j]] = 1
    num3 = 0
    num5 = 0
    num15 = 0
    num25 = 0
    num75 = 0
    for key in dic:
        if dic[key] >= 2:
            num3 += 1
            if dic[key] >= 4:
                num5 += 1
                if dic[key] >= 14:
                    num15 += 1
                    if dic[key] >= 24:
                        num25 += 1
                        if dic[key] >= 74:
                            num75 += 1
    ans = num75 + num25*(num3-1) + num15*(num5-1) + num5*(num5-1)//2*(num3-2)
    print(ans)

Solution (Python):

n=int(input())
a=[0]*100
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
for i in range(n):
	for j in range(len(factorize(i+1))):
		a[factorize(i+1)[j]]+=1
def comb(a,b):
	p=1
	for i in range(b):
		p*=a-i
	for j in range(b):
		p//=j+1
	return p
cnt_74=cnt_24=cnt_14=cnt_4=cnt_2=0
for i in range(100):
	if a[i]>=74:
		cnt_74+=1
	elif a[i]>=24:
		cnt_24+=1
	elif a[i]>=14:
		cnt_14+=1
	elif a[i]>=4:
		cnt_4+=1
	elif a[i]>=2:
		cnt_2+=1
cnt_24+=cnt_74
cnt_14+=cnt_24
cnt_4+=cnt_14
cnt_2+=cnt_4
ans=0

ans+=max(comb(cnt_4,2)*(cnt_2-2),0)

ans+=(cnt_24)*(cnt_2-1)

ans+=(cnt_4-1)*cnt_14

ans+=cnt_74
print(ans)

Solution (Python):
import sys
import numpy as np
input = sys.stdin.readline

def factorization(num):
    import math
    
    
    MAX_PRIME = int(math.sqrt(num)) + 1
    primes = []
    is_prime = [True] * (MAX_PRIME+1)
    for i in range(2, MAX_PRIME+1):
        if is_prime[i]:
            primes.append(i)
            for j in range(2*i, MAX_PRIME+1, i):
                is_prime[j] = False
    insu = []
    tmp = num
    max_count = 0
    for i in range(len(primes)):
        count = 0
        while tmp%primes[i] == 0:
            tmp //= primes[i]
            count += 1
        if count > 0:
            insu.append((primes[i], count))
            max_count = max(max_count, count)
        if tmp == 1:
            break
    if tmp != 1:
        insu.append((tmp, 1))
    return insu

def main():
    N = int(input())

    dic = {}
    for i in range(1, N+1):
        insu = factorization(i)
        for p, count in insu:
            if p in dic:
                dic[p] += count
            else:
                dic[p] = count
    dic = np.array(sorted(dic.values()))
    
    def cc(num):
        return np.count_nonzero(dic >= num-1)
    
    print(cc(75) + cc(25) * (cc(3) - 1) + cc(15) * (cc(5) - 1) + cc(5) * (cc(5) - 1) * (cc(3) - 2) // 2)


if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict


L = [1 for i in range(101)]
L[0] = 0
L[1] = 0
plist = []
for i in range(101):
	if L[i] == 1:
		plist.append(i)
		c = 2
		while True:
			if i * c <= 100:
				L[i * c] = 0
				c += 1
			else:
				break


N = int(input())
if N <= 9:
	print(0)
else:
	D = defaultdict(int)
	for i in range(1, N + 1):
		m = i
		while m != 1:
			for j in plist:
				if m % j == 0:
					D[j] += 1
					m = m // j
					break

	data = []
	for i in D:
		data.append(D[i])
	ans = 0
	n = len(data)
	for i in range(n):
		if data[i] >= 74:
			ans += 1
	for i in range(n):
		for j in range(n):
			if i != j:
				if data[i] >= 2 and data[j] >= 24:
					ans += 1
				if data[i] >= 4 and data[j] >= 14:
					ans += 1
	for i in range(n):
		for j in range(n):
			for k in range(j + 1, n):
				if i != j and j != k and k != i:
					if data[i] >= 2 and data[j] >= 4 and data[k] >= 4:
						ans += 1
	print(ans)

Solution (Python):
N = int(input())
e = [0] * (N+1)
for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
         while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m):
    return len(list(filter(lambda x: x >= m-1, e)))

print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)+ num(5) * (num(5) - 1) * (num(3) - 2) // 2)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    n = II()
    a = [7,5,3]
    if n in a:
        print("YES")
    else:
        print("NO")
    return


def B():
    s = S()
    ans = inf
    for i in range(len(s) - 2):
        ans = min(ans, abs(753-int("".join(s[i:i + 3]))))
    print(ans)
    return


def C():
    s = II()
    n = len(str(s))
    ans = 0
    for i in range(3,n+1):
        c = itertools.product(["3", "5", "7"], repeat=i)
        for ci in c:
            if len(set(ci)) < 3:
                continue
            if int("".join(ci)) <= s:
                ans += 1
    print(ans)

        
    return

def primes(n):
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    """ 6以上の数であれば p (素数) <= n のlistを返す """
    n, correction = n - n % 6 + 6, 2 - (n % 6 > 1)
    sieve = [True] * (n // 3)
    for i in range(1, int(n ** 0.5) // 3 + 1):
        if sieve[i]:
            k = 3 * i + 1 | 1
            sieve[k * k                     // 3::2 * k] = [False] * ((n // 6 - k * k                     // 6 - 1) // k + 1)
            sieve[k * (k - 2 * (i & 1) + 4) // 3::2 * k] = [False] * ((n // 6 - k * (k - 2 * (i & 1) + 4) // 6 - 1) // k + 1)
    return [2, 3] + [3 * i + 1 | 1 for i in range(1, n // 3 - correction) if sieve[i]]

def D():
    n = II()
    primelis = primes(100)
    d = {2: 0, 4: 0, 14: 0, 24: 0, 74: 0}
    for i in primelis:
        b = n
        tmp = 0
        while b // i:
            tmp += (b // i)
            b = (b // i)
        for x in d.keys():
            d[x] += (tmp >= x)
    ans = 0
    ans += (d[2] - 1) * d[24]
    ans += (d[4] - 1) * d[14]
    ans += d[74]
    ans += (d[2] - 2) * (d[4] - 1) * d[4] // 2
    print(ans)
    return


if __name__ == '__main__':
    D()

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def prime(n,is_prime=True):
    """
    n: positive integer
    if is_prime: return n is prime
    else: return list of prime <= n
    """
    if n<=1: return False if is_prime else []
    S=[1]*(n+1)
    S[0]=0; S[1]=0
    for i in range(2,n):
        if S[i]==0: continue
        for j in range(2*i,n+1,i):
            S[j]=0
    if is_prime: return bool(S[n])
    else: return [p for p in range(n+1) if S[p]]
def resolve():
    """
    p^74,p^24q^2,p^14q^4,p^4q^4r^2
    """
    n=int(input())
    P=prime(n,False)
    bin=[0]*48
    for p in P:
        if p>47: continue 
        q=p
        while(q<=n):
            bin[p]+=n//q
            q*=p
    c2=len([0 for i in bin if i>=2])
    c4=len([0 for i in bin if i>=4])
    c14=len([0 for i in bin if i>=14])
    c24=len([0 for i in bin if i>=24])
    c74=len([0 for i in bin if i>=74])
    ans=0
    ans+=c74
    ans+=c24*(c2-1)
    ans+=c14*(c4-1)
    ans+=c4*(c4-1)//2*(c2-2)
    print(ans)
resolve()

Solution (Python):
import collections


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False
    if n > 1:
        _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n = int(input())
sieve = eratosthenes(n)
primes = [i for i in range(n + 1) if sieve[i]]
counter = collections.Counter()
for i in range(2, n + 1):
    for p in primes:
        while i % p == 0:
            counter[p] += 1
            i //= p
        if i == 1:
            break

counter2 = collections.Counter()
for i in [2, 4, 14, 24, 74]:
    for p in primes:
        if counter[p] >= i:
            counter2[i] += 1

c0 = counter2[74]
c1 = counter2[24] * (counter2[2] - 1)
c2 = counter2[14] * (counter2[4] - 1)
c3 = (counter2[4] * (counter2[4] - 1) * (counter2[2] - 2)) // 2
print(c0 + c1 + c2 + c3)

Solution (Python):
N = int(input())

prime = []
prime.append(2)
k = 0
for i in range(3, N+1):
    if prime[k]*prime[k] < i:
         k += 1
    for j in range(0, k+1):
        if i%prime[j] == 0:
            break
    else:
        prime.append(i)

count = []
for p in prime:
    i = 0
    q = p
    while q < N:
        i += N//q
        q *= p
    count.append(i)

ans = 0

for c in count:
    if 74 <= c:
        ans += 1

for i, ci in enumerate(count):
    if ci < 24:
        break
    for j, cj in enumerate(count):
        if cj < 2:
            break
        if i != j:
             ans += 1

for i, ci in enumerate(count):
    if ci < 14:
        break
    for j, cj in enumerate(count):
        if cj < 4:
            break
        if i != j:
             ans += 1

for i, ci in enumerate(count):
    if ci < 4:
        break
    M = len(count)
    for j in range(i+1, M):
        if count[j] < 4:
            break
        for k, ck in enumerate(count):
            if ck < 2:
                break
            if k != i and k != j:
                ans += 1

print(ans)

Solution (Python):










import itertools

def main():
    N = int(input())
    d = [0] * (N+1)

    for i in range(2,N+1):
        cur = i
        for j in range(2, i+1):
            while cur % j == 0:
                d[j] += 1
                cur = cur // j

    ans = 0
    for i in d:
        if i >= 74:
            ans += 1
    for (x, y, z) in itertools.combinations(d,3):
        for a, b, c in [[4, 4, 2],[4, 2, 4],[2, 4, 4]]:
            if x >= a and y >= b and z >= c:
                ans += 1

    for (x, y) in itertools.combinations(d,2):
        for a, b in [[24,2],[14,4],[4,14],[2,24]]:
            if x >= a and y >= b:
                ans += 1

    print(ans)


    

main()

Solution (Python):
from math import factorial
from itertools import combinations
N = int(input())
LIM = factorial(N)
pls = [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]
ans = 0
for x, y, z in combinations(pls, 3):
  if LIM%((x**4)*(y**4)*(z**2))==0:
    ans += 1
  if LIM%((y**4)*(z**4)*(x**2))==0:
    ans += 1
  if LIM%((z**4)*(x**4)*(y**2))==0:
    ans += 1
for x, y in combinations(pls,2):
  if LIM%((x**14)*(y**4))==0:
    ans += 1
  if LIM%((y**14)*(x**4))==0:
    ans += 1
  if LIM%((x**24)*(y**2))==0:
    ans += 1
  if LIM%((y**24)*(x**2))==0:
    ans += 1
for x in pls:
  if LIM%(x**74)==0:
    ans += 1
print(ans)

Solution (Python):
P = [1 for _ in range(100)]
P[0]=0
P[1]=0
for i in range(2,11):
    for j in range(i*i,100,i):
        P[j]=0
Q = []
for i in range(100):
    if P[i]==1:
        Q.append(i)
N = int(input())
G = {p:0 for p in Q}
for n in range(2,N+1):
    k = n
    i = 0
    while k>1 and i<len(Q):
        if k%Q[i]==0:
            k = k//Q[i]
            G[Q[i]] += 1
        else:
            i += 1
C2 = 0
C4 = 0
C14 = 0
C24 = 0
C74 = 0
for x in G:
    if G[x]>=2:
        C2 += 1
    if G[x]>=4:
        C4 += 1
    if G[x]>=14:
        C14 += 1
    if G[x]>=24:
        C24 += 1
    if G[x]>=74:
        C74 += 1
cnt = 0
cnt += C24*(C2-1)
cnt += C14*(C4-1)
cnt += (C4*(C4-1))//2*(C2-2)
cnt += C74
print(cnt)

Solution (Python):
from collections import Counter

N = int(input())

def factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def factor_factorize(n, d):
    if n == 1:
        return d
    d.extend(factorize(n))
    return factor_factorize(n-1, d)

F = Counter(factor_factorize(N, []))


cases = []

n1 = [True for v in F.values() if v >= 4].count(True)
m1 = [True for v in F.values() if 4 > v >= 2].count(True)
cases.append(n1 * (n1-1) // 2 * max(0, m1+n1-2))

n2 = [True for v in F.values() if v >= 14].count(True)
m2 = [True for v in F.values() if 14 > v >= 4].count(True)
cases.append(n2 * max(0, m2+n2-1))

n3 = [True for v in F.values() if v >= 24].count(True)
m3 = [True for v in F.values() if 24 > v >= 2].count(True)
cases.append(n3 * max(0, m3+n3-1))

n4 = [True for v in F.values() if v >= 74].count(True)
cases.append(n4)

print(sum(cases))

Solution (Python):

'''
[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
 0 1 2 3  4  5  6  7  8  9 10 11 12 13 14
'''
n = int(input())
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
fact = [0,0,0,0,0]
check = []
for i in range(15):
  p = prime[i]
  d = n
  tmp = 0
  while d != 0:
    d //= p
    tmp += d
  check.append(tmp)
  if tmp >= 74:
    fact[0] += 1
  if tmp >= 24:
    fact[1] += 1
  if tmp >= 14:
    fact[2] += 1
  if tmp >= 4:
    fact[3] += 1
  if tmp >= 2:
    fact[4] += 1


ans = 0
ans += fact[0]
ans += fact[1] * (fact[4]-1)
ans += fact[2] * (fact[3]-1)
ans += fact[3] * (fact[3]-1) * (fact[4]-2) // 2
print(ans)

Solution (Python):

import math
N = int(input())

prime = []
for i in range(2,N+1):
    n = math.ceil(math.log2(i))
    flag = 0
    for j in range(2,n+1):
        if i%j == 0:
            flag = 1
            break
    if flag == 0:
        if i != 49:
            prime.append(i)

count = 0
plen = len(prime)

for i in range(plen):
    p = prime[i]
    pc = 0
    while p <= N:
        pc+=(N//p)
        p*=prime[i]
    if pc >= 74:
        count+=1
        

for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=prime[i]
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=prime[j]
        if pc1 >= 2 and pc2 >= 24:
            count+=1
            

for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=prime[i]
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=prime[j]
        if pc1 >= 4 and pc2 >= 14:
            count+=1
            

for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        for k in range(plen):
            if i == k or j == k or j < k:
                continue
            p1 = prime[i]
            p2 = prime[j]
            p3 = prime[k]
            pc1 = 0
            while p1 <= N:
                pc1+=(N//p1)
                p1*=prime[i]
            pc2 = 0
            while p2 <= N:
                pc2+=(N//p2)
                p2*=prime[j]
            pc3 = 0
            while p3 <= N:
                pc3+=(N//p3)
                p3*=prime[k]
            if pc1 >= 2 and pc2 >= 4 and pc3 >= 4:
                count+=1
                

print(count)