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):
from collections import defaultdict


def is_prime(n: int)-> bool:
    if n == 2:
        return True
    if n < 2 or n % 2 == 0:
        return False
    
    
    return pow(2, (n-1), n) == 1


def prime_factorize(n: int):
    prime_factors = []
    range_max = int(n //2) + 1

    for i in range(2, range_max):
        if not is_prime(i):
            continue
        while True:
            div, mod = divmod(n, i)
            if mod == 0:
                prime_factors.append(i)
                n = div
            else:
                break
        if n == 1:
            break
    prime_factors.append(n)
    return prime_factors


prime_factors_dict = {0: {}}

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

    for i in range(1,n+1):
        prime_factors = prime_factorize(i)
        this_prime_factors = defaultdict(int)
        for pm in prime_factors:
            this_prime_factors[pm] += 1

        for k, v in prime_factors_dict[i-1].items():
            this_prime_factors[k] += v
        prime_factors_dict[i] = this_prime_factors

    this_prime_factors = prime_factors_dict[n]

    prime_factors_list = sorted(list(filter(lambda x:x[0] != 1, this_prime_factors.items())))

    cnt_mt_74times = len(list(filter(lambda x: x[1] >= 74, prime_factors_list)))
    cnt_mt_24times = len(list(filter(lambda x: x[1] >= 24, prime_factors_list)))
    cnt_mt_14times = len(list(filter(lambda x: x[1] >= 14, prime_factors_list)))
    cnt_mt_4times  = len(list(filter(lambda x: x[1] >= 4, prime_factors_list)))
    cnt_mt_2times  = len(list(filter(lambda x: x[1] >= 2, prime_factors_list)))

    ans_cnt = 0

    
    ans_cnt += cnt_mt_74times

    
    ans_cnt += cnt_mt_24times * (cnt_mt_2times - 1)

    
    ans_cnt += cnt_mt_14times * (cnt_mt_4times - 1)

    
    ans_cnt += cnt_mt_4times * (cnt_mt_4times - 1) // 2 * (cnt_mt_2times - 2)

    print(ans_cnt)

    return



main()

Solution (Python):

from collections import Counter
import math
def com(n,r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
fac_list = []
def factoring(n):
    for i in range(2,n+1):
        if n % i == 0:
            fac_list.append(i)
            n = n // i
            break
    if n == 1:
        return fac_list
    else:
        return factoring(n)

n = int(input())
c = list(Counter(factoring(math.factorial(n))).values())

l = [0]*5 
for e in c:
    if e >= 74:
        index = 4
    elif e >= 24:
        index = 3
    elif e >= 14:
        index = 2
    elif e >= 4:
        index = 1
    elif e >= 2:
        index = 0
    else:
        continue
    l[index] += 1
sum_l = sum(l)
num_74 = l[4]
if sum_l - l[0] - 1 > 0:
    num_4_14 = (l[2] + l[3] + l[4])*(sum_l - l[0] - 1)
else:
    num_4_14 = 0
if sum_l - 1 > 0:
    num_2_24 = (l[3] + l[4])*(sum_l - 1)
else:
    num_2_24 = 0
if sum_l - l[0] >= 2:
    num_2_4_4 = com(sum_l-l[0],2)*(sum_l - 2)
else:
    num_2_4_4 = 0
ans = num_74 + num_4_14 + num_2_24 + num_2_4_4
print(ans)

Solution (Python):
from copy import deepcopy
fact = []
def init():
  fact.append(0)
  for i in range(1,101):
    fact.append(0)

def solve(n):
  cnt = 0
  for i in range(1,n+1):
    tp = i
    di = 2
    while tp != 1:
      if tp % di == 0:
        fact[di] += 1
        cnt += 1
        tp /= di
      else:
        di += 1
  sf = []
  tf = [] 
  ft = []
  f = []
  t = []
  for i in range(1,101):
    if fact[i] >= 74:
      sf.append(i)
    if fact[i] >= 24:
      tf.append(i)
    if fact[i] >= 14:
      ft.append(i)
    if fact[i] >= 4:
      f.append(i)
    if fact[i] >= 2:
      t.append(i)
  ans = len(sf)
  for i in tf:
    for j in t:
      if i != j:
        ans += 1
  for i in ft:
    for j in f:
      if i != j:
        ans += 1
  for i in f:
    for j in f:
      if i < j:
        for k in t:
          if i != k and j != k:
            ans += 1  
  return ans

n = int(input())
init()
print(solve(n))

Solution (Python):
import copy
def getPrimes(n):
    res = {}
    for i in range(2, n+1):
        if n % i == 0:
            res[i] = 0
            while n % i == 0:
                res[i] = res[i] + 1
                n = n // i
        if i * i > n:
            break;
        
    if n != 1:
        res[n] = 1
    return res

def add(a, b):
    res = copy.deepcopy(a)
    for i in b:
        if i in res:
            res[i] = res[i] + b[i]
        else:
            res[i] = b[i]
    return res

N = int(input())
cnt = {}
for i in range(1, N+1):
    cnt = add(cnt, getPrimes(i))

num = []
for i in cnt:
    num.append(cnt[i])
num.sort()
ans  = 0
for i in range(len(num)):
    for j in range(len(num)):
        for k in range(j + 1, len(num)):
            if i == j or i == k:
                continue
            if num[i] >= 2 and num[j] >= 4 and num[k] >= 4:
                ans = ans + 1
                
for i in range(len(num)):
    for j in range(len(num)):
        if i != j and num[i] >= 2 and num[j] >= 24:
            ans = ans + 1
            
for i in range(len(num)):
    for j in range(len(num)):
        if i != j and num[i] >= 4 and num[j] >= 14:
            ans = ans + 1
            
for i in range(len(num)):
    if num[i] >= 74:

        
        ans = ans + 1
print(ans)

Solution (Python):
def prime(n):
    for i in range(2,n):
        if n%i == 0:
            return False
    return True

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

    f = 1
    for i in range(1,n+1):
        f *= i

    p = []
    for i in range(2,n):
        if prime(i):
            p.append(i)
    P = len(p)

    ans = set()
    for i in range(P):
        x = p[i]**74
        if f%x == 0:
            ans.add(x)

        for j in range(P):
            if i == j:
                continue

            x = p[i]**24 * p[j]**2
            if f%x == 0:
                ans.add(x)

            x = p[i]**14 * p[j]**4
            if f%x == 0:
                ans.add(x)

            for k in range(P):
                if i == k or j == k:
                    continue

                x = p[i]**4 * p[j]**4 * p[k]**2
                if f%x == 0:
                    ans.add(x)

    print(len(ans))

if __name__ == "__main__":
    main()

Solution (Python):
from math import factorial as f

N = int(input())

primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
divs = []
for i in range(1,101):
    tmp = [0 for _ in range(len(primes))]
    for j in range(len(primes)):
        p = primes[j]
        tmp[j] = 0
        while(i//p==i/p):
            i = i//p
            tmp[j] += 1
    divs.append(tmp)


divsum = [0 for _ in range(len(primes))]
for i in range(1, N+1):
    for j in range(len(primes)):
        divsum[j] += divs[i-1][j]


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

ans = 0


ans += num(75)


ans += num(15)*(num(5)-1)


ans += num(25)*(num(3)-1)


ans += num(5) * (num(5)-1) * (num(3)-2) // 2 
print(int(ans))

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

e=[0]*(N+1)

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

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

Solution (Python):
N = int(input())
numset = [0]*100
for i in range(N):
  i +=1
  for p in range(2, N+1):
    while i%p == 0:
      numset[p] += 1
      i = i//p
    
niijo = 0
yonijo = 0
juuyonijo =0
nijuuyonijo = 0
nanajuuyonijo =0
for numbers in numset:
  if numbers >= 2: niijo+=1
  if numbers >= 4: yonijo +=1
  if numbers >= 14: juuyonijo +=1
  if numbers >= 24: nijuuyonijo +=1
  if numbers >= 74: nanajuuyonijo+=1
    
count = 0
count += max(0, yonijo*( yonijo-1)*(niijo - 2)//2)
count += max(0, nanajuuyonijo)
count += max(0, (niijo-1)*nijuuyonijo)
count += max(0, (yonijo-1)* juuyonijo)
print(count)

Solution (Python):

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table


N = int(input())
if N<=9:
    print(0)
    exit()

from collections import defaultdict
P = defaultdict(int)

for i in range(2, N+1):
    for p in prime_decomposition(i):
        P[p] += 1

c4 = len([k for k, v in P.items() if v >= 4])
c2 = len([k for k, v in P.items() if v >= 2])
c14 = len([k for k, v in P.items() if v >= 14])
c24 = len([k for k, v in P.items() if v >= 24])
c2 = len([k for k, v in P.items() if v >= 2])
c74 = len([k for k, v in P.items() if v >= 74])


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

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):
n = int(input())
kz = [0]*100
for i in range(n):
    
    t = i + 1
    while True:
        for j in range(2, 11):
            if t % j == 0:
                kz[j] += 1
                t = t // j
                break
        else:
            if t != 1:
                kz[t] += 1
            break
a = 0
for i in range(74):
    a += kz.count(i)
ans = 100 - a
a = 0
for i in range(4):
    a += kz.count(i)
b = 0
for i in range(4, 14):
    b += kz.count(i)
c = 100 - a - b
ans += (c * (c - 1)) + c * b
a = 0
for i in range(2):
    a += kz.count(i)
b = 0
for i in range(2, 24):
    b += kz.count(i)
c = 100 - a - b
ans += (c * (c - 1)) + c * b
a = 0
for i in range(2):
    a += kz.count(i)
b = 0
for i in range(2, 4):
    b += kz.count(i)
c = 100 - a - b
ans += (c * (c - 1) * (c - 2))//2 + (b * c * (c - 1))//2
print(ans)

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

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):
import numpy as np

def main():
	n = int(input())
	sosuu = []
	sosuucount = []
	
	for i in range(2, n+1):
		num = i
		sosuuf = 1
		
		for j in range(len(sosuu)):
			if(num % sosuu[j] == 0):
				sosuuf = 0
				while(num % sosuu[j] == 0):
					num /= sosuu[j]
					sosuucount[j] += 1
		if (sosuuf == 1):
			sosuu.append(num)
			sosuucount.append(1)
	num75 = 0
	num25 = 0
	num15 = 0
	num5 = 0
	num3 = 0
	for i in range(len(sosuu)):
		if(sosuucount[i]+1 >= 75):
			num75 += 1
		if(sosuucount[i]+1 >= 25):
			num25 += 1
		if(sosuucount[i]+1 >= 15):
			num15 += 1
		if(sosuucount[i]+1 >= 5):
			num5 += 1
		if(sosuucount[i]+1 >= 3):
			num3 += 1
	r = num75 + num25*(num3-1)+num15*(num5-1) + num5*(num5-1)*(num3-2)/2
	
	print(int(r))
	
	
	
	
main()

Solution (Python):
def d_756(N):
    def exponential_list(n):
        
        ret = [0] * (n + 1)
        for j in range(2, n + 1):
            current = j
            for k in range(2, j + 1):
                while current % k == 0:
                    ret[k] += 1
                    current //= k
        return ret

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

    e = exponential_list(N)
    
    
    ans = num(75)
    
    
    
    
    ans += num(25) * (num(3) - 1)
    ans += num(15) * (num(5) - 1)  
    
    ans += num(5) * (num(5) - 1) * (num(3) - 2) // 2
    return ans

N = int(input())
print(d_756(N))

Solution (Python):
import numpy as np

primes = np.array([2,3,5,7,11,13,17,19,23,29,
                   31,37,41,43,47,53,59,61,67,71,73,79,83,97
                  ],dtype=np.int)

def pw(N,p):
    ans = 0
    while N > 0:
        N = N // p
        ans = ans + N
    return ans

N = int(input())
powers = np.vectorize(lambda p: pw(N,p))(primes)

n75 = len(np.where(powers >= 74)[0])
n25 = len(np.where(powers >= 24)[0])
n15 = len(np.where(powers >= 14)[0])
n5 = len(np.where(powers >= 4)[0])
n3 = len(np.where(powers >= 2)[0])

ans75 = n75
ans253 = n25 * (n3-1)
ans553 = ((n5*(n5-1))//2) * (n3-2)
ans515 = n15 * (n5-1)

print(ans75 + ans253 + ans553 + ans515)

Solution (Python):


N = int(input())

a_list = [0]*100

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

answer = 0

count_2 = len(list(filter(lambda x: x >= 2, a_list)))
count_4 = len(list(filter(lambda x: x >= 4, a_list)))
count_14 = len(list(filter(lambda x: x >= 14, a_list)))
count_24 = len(list(filter(lambda x: x >= 24, a_list)))
count_74 = len(list(filter(lambda x: x >= 74, a_list)))

answer = count_74 + (count_24 * (count_2-1)) + (count_14 * (count_4-1)) + (count_4 * (count_4-1) * (count_2-2))/2

answer = int(answer)
print(answer)

Solution (Python):


def prime_factors(n):
    i = 2
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            yield i
    if n > 1:
        yield n

from collections import Counter
from bisect import bisect

N = int(input())
pn = Counter()
for n in range(1,N+1):
    pn.update(prime_factors(n))

pn = sorted(pn.values())

N = len(pn)
cnt = 0

i3 = bisect(pn, 1)
i5 = bisect(pn, 3)
if i5+2 <= N and i3+3 <= N:
    cnt += (N-i3-2) * (N-i5) * (N-i5-1) // 2



i15 = bisect(pn, 13)
if i15+1 <= N and i5+2 <= N:
    cnt += (N-i15) * (N-i5-1)

    

i25 = bisect(pn, 23)
if i25+1 <= N and i3+2 <= N:
    cnt += (N-i25) * (N-i3-1)



i75 = bisect(pn, 73)
if i75+1 <= N:
    cnt += (N-i75)

print(cnt)

Solution (Python):
N = int(input())
e = [0]*101

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

ans = 0
ov74, ov24, ov14, ov4, ov2 = 0,0,0,0,0
for ei in e:
    if ei>=2: ov2 += 1
    if ei>=4: ov4 += 1
    if ei>=14: ov14 += 1
    if ei>=24: ov24 += 1
    if ei>=74: ov74 += 1

ans += ov24*(ov2-1)
ans += ov4*(ov4-1)*(ov2-2)//2
ans += ov14*(ov4-1)
ans += ov74

print(ans)

Solution (Python):
import math
import itertools
from collections import defaultdict

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


N = int(input())

anslist = []

primelist = primes(N)

for p in primelist:
    tmp = 0
    i = 1
    while True:
        tmp2 = math.floor(N/(p**i))
        if tmp2 == 0:
            break
        else:
            tmp += tmp2
            i += 1
    anslist.append(tmp)





ans = []

pqrlist = [[4,4,2],[14,4,0],[24,2,0],[74,0,0]]

combs = list(itertools.permutations(range(len(anslist)), 3))
for pqr in pqrlist:
    for c in combs:
        pp,qq,rr = anslist[c[0]], anslist[c[1]], anslist[c[2]]
        if pp >= pqr[0] and qq >= pqr[1] and rr >= pqr[2]:
            p,q,r = primelist[c[0]], primelist[c[1]], primelist[c[2]]
            product = (p**pqr[0])*(q**pqr[1])*(r**pqr[2])
            if product not in ans:
                ans.append(product)

print(len(ans))

Solution (Python):
def cmb(n, r):
    if n - r < r: r = n - r
    if n <= 0: return 0
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p;
            for k in range(p-1,r,p):
                numerator[k - offset] //= pivot
                denominator[k] //= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

a = int(input())

b = [0 for i in range(15)]
j = 0
c = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
d = [0 for i in range(101)]
p = 0
pp = 0
g = 0
gg = 0
ggg = 0
co = 0
for i in range(1,101):
  k = i
  while True:
    if k % c[j] == 0 and k >= c[j]:
      b[j] += 1
      k //= c[j]
    else:
      j += 1
      if j == 15:
        j = 0
        break
  for k in range(15):
    if b[k] >= 74:
      g += 1
    if b[k] >= 24:
      gg += 1
    if b[k] >= 14:
      ggg += 1
    if b[k] >= 4:
      p += 1
    if b[k] >= 2:
      pp += 1
  if i >= 10:
    d[i] = cmb(p, 2)*cmb((pp-2), 1) + cmb(g, 1) + cmb(gg, 1)*cmb((pp-1), 1) + cmb(ggg, 1)*cmb((p-1), 1)
  p = 0
  pp = 0
  g = 0
  gg = 0
  ggg = 0
print(d[a])

Solution (Python):
def comb(n, k):
    k = min(k, n - k)
    ans = 1
    for i in range(n, n - k, -1):
        ans *= i
    for i in range(1, k + 1):
        ans //= i 
    return ans

def getNum(n,t) :
    s=0
    I=n
    R=n

    count = 1

    while s==0:
        for i in range(2,R+1):
            if I%i==0:
                I=I/i
                if I==1:
                    s=1
                if i in t:
                    t[i] = t[i] + 1
                else : 
                    t[i] = 1                
                count += 1
                break
    return count    

n = int(input())
t = {}

yaku = 1
for i in range(2,n+1):
    yaku = yaku + getNum(i,t)



ans = 0
n5 = 0
n3 = 0
for v in t.values():
    if v >= 4:
        n5 += 1
    if v >= 2:
        n3 += 1

if(n5 >= 2 and n3 >= 3):
    ans += comb(n5,2)*comb(n3-2,1)

n5 = 0
n3 = 0
for v in t.values():
    if v >= 14:
        n5 += 1
    if v >= 4:
        n3 += 1

ans += n5*(n3-1)

n5 = 0
n3 = 0
for v in t.values():
    if v >= 24:
        n5 += 1
    if v >= 2:
        n3 += 1

ans += n5*(n3-1)

n5 = 0
n3 = 0
for v in t.values():
    if v >= 74:
        n5 += 1

ans += n5

print(ans)

Solution (Python):
from operator import mul
from functools import reduce

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


a = int(input())

b = [0 for i in range(15)]
j = 0
c = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
d = [0 for i in range(101)]
p = 0
pp = 0
g = 0
gg = 0
ggg = 0
co = 0
for i in range(1,101):
  k = i
  while True:
    if k % c[j] == 0 and k >= c[j]:
      b[j] += 1
      k //= c[j]
    else:
      j += 1
      if j == 15:
        j = 0
        break
  for k in range(15):
    if b[k] >= 74:
      g += 1
    if b[k] >= 24:
      gg += 1
    if b[k] >= 14:
      ggg += 1
    if b[k] >= 4:
      p += 1
    if b[k] >= 2:
      pp += 1
  if i >= 10:
    d[i] = cmb(p, 2)*cmb((pp-2), 1) + cmb(g, 1) + cmb(gg, 1)*cmb((pp-1), 1) + cmb(ggg, 1)*cmb((p-1), 1)
  p = 0
  pp = 0
  g = 0
  gg = 0
  ggg = 0
print(d[a])

Solution (Python):
from math import factorial as f

N = int(input())

primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
divs = []
for i in range(1,101):
    tmp = [0 for _ in range(len(primes))]
    for j in range(len(primes)):
        p = primes[j]
        tmp[j] = 0
        while(i//p==i/p):
            i = i//p
            tmp[j] += 1
    divs.append(tmp)


divsum = [0 for _ in range(len(primes))]
for i in range(1, N+1):
    for j in range(len(primes)):
        divsum[j] += divs[i-1][j]


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

ans = 0


ans += num(75)


ans += num(15)*(num(5)-1)


ans += num(25)*(num(3)-1)


ans += num(5) * (num(5)-1) * (num(3)-2) // 2 
print(int(ans))

Solution (Python):
n=int(input())
primes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
pcnt = [0]*len(primes)
for x in range(1,n+1):
  for pidx in range(len(primes)):
    p=primes[pidx]
    while x % p ==0:
      x//=p
      pcnt[pidx]+=1
      
ret=0

for i in range(len(pcnt)):
  for j in range(i+1,len(pcnt)):
    for k in range(len(pcnt)):
      if pcnt[i]>=4 and pcnt[j]>=4 and pcnt[k]>=2 and i!=k and j!=k:
        ret+=1

for i in range(len(pcnt)):
  for j in range(len(pcnt)):
    if pcnt[i]>=24 and pcnt[j]>=2 and i!=j:
      ret+=1

for i in range(len(pcnt)):
  for j in range(len(pcnt)):
    if pcnt[i]>=14 and pcnt[j]>=4 and i!=j:
      ret+=1

for i in range(len(pcnt)):
  if pcnt[i]>=74:
    ret+=1

print(ret)

Solution (Python):
k = [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]
a = int(input())
print(k[a])

Solution (Python):
n=int(input())
primes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
pcnt = [0]*len(primes)
for x in range(1,n+1):
  for pidx in range(len(primes)):
    p=primes[pidx]
    while x % p ==0:
      x//=p
      pcnt[pidx]+=1

primes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
pcnt = [0]*len(primes)
for x in range(1,n+1):
  for pidx in range(len(primes)):
    p=primes[pidx]
    while x % p ==0:
      x//=p
      pcnt[pidx]+=1
      
ret=0

for i in range(len(pcnt)):
  for j in range(i+1,len(pcnt)):
    for k in range(len(pcnt)):
      if pcnt[i]>=4 and pcnt[j]>=4 and pcnt[k]>=2 and i!=k and j!=k:
        ret+=1

for i in range(len(pcnt)):
  for j in range(len(pcnt)):
    if pcnt[i]>=24 and pcnt[j]>=2 and i!=j:
      ret+=1

for i in range(len(pcnt)):
  for j in range(len(pcnt)):
    if pcnt[i]>=14 and pcnt[j]>=4 and i!=j:
      ret+=1

for i in range(len(pcnt)):
  if pcnt[i]>=74:
    ret+=1

print(ret)

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

prime = [0] * 101

for i in range(2, N + 1):
    temp = i

    for j in range(2, N + 1):
        while temp % j == 0:
            prime[j] += 1
            temp //= j

        if temp == 1:
            break

ans = 0

for i in range(2, N + 1):
    temp1 = prime[i]

    if temp1 == 0:
        continue
    
    if temp1 >= 74:
        ans += 1
    
    for j in range(i + 1, N + 1):
        temp2 = prime[j]

        if temp2 == 0:
            continue
        
        temp_list = [temp1, temp2]

        order1 = [0, 1]
        order2 = [1, 0]

        for h in range(2):
            if temp_list[order1[h]] >= 4 and temp_list[order2[h]] >= 14:
                ans += 1

            if temp_list[order1[h]] >= 2 and temp_list[order2[h]] >= 24:
                ans += 1
        
        for k in range(j + 1, N + 1):
            temp3 = prime[k]

            if temp3 == 0:
                continue
            
            temp_list = [temp1, temp2, temp3]

            order1 = [0, 1, 2]
            order2 = [1, 2, 0]
            order3 = [2, 0, 1]

            for h in range(3):
                if temp_list[order1[h]] >= 2 and temp_list[order2[h]] >= 4 and temp_list[order3[h]] >= 4:
                    ans += 1

print(ans)