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())
s_list = [[5, 5, 3], [25, 3], [15, 5], [75]]

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

def div_c(n):
    return len(list(filter(lambda x: x >= n-1, a))) 
    
ans=0
for s in s_list:
    i=0
    c=1
    for t in s:
        c*=(div_c(t)-i)
        i+=1
    ans+=int(c/(len(s)-len(set(s))+1))

       
print(ans)

Solution (Python):
N = int(input())
prime = [2]
for i in range(3, 100):
    flag = 0
    for j in prime:
        if i % j == 0:
            flag = 1
    if flag == 0:
        prime.append(i)

factorization = [0 for i in range(101)]

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

ans = 0
factorization.sort(reverse = True)
for i in range(N):
    if factorization[i] >= 74:
        ans += 1
    else:
        break
for i in range(N):
    if factorization[i] >= 24:
        for j in range(N):
            if i != j:
                if factorization[j] >= 2:
                    ans += 1
                else:
                    break
    else:
        break

for i in range(N):
    if factorization[i] >= 14:
        for j in range(N):
            if j != i:
                if factorization[j] >= 4:
                    ans += 1
                else:
                    break
    else:
        break

for i in range(N):
    if factorization[i] >= 4:
        for j in range(i+1, N):
            if factorization[j] >= 4:
                for k in range(N):
                    if k != i and k != j:
                        if factorization[k] >= 2:
                            ans += 1
                        else:
                            break
            else:
                break
    else:
        break
print(ans)

Solution (Python):
import copy

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


n=int(input())
s=[0]*(n+1)
for i in range(2,n+1):
    a=copy.deepcopy(i)
    for j in range(2,a+1):
        while a%j==0:
            s[j]+=1
            a//=j

b=fact(5,s)
print(max(0,fact(75,s)+fact(25,s)*(fact(3,s)-1)+fact(15,s)*(fact(5,s)-1)+b*(b-1)*(fact(3,s)-2)//2))

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

def divisor_pl(num):
    l = []
    i = 2
    while num > 1:
        if num%i == 0:
            l.append(i)
            num = int(num/i)
        else:
            i += 1
    if num != 1:
        l.append(num)
    return l

l = []
for i in range(2,N+1):
    l.append(divisor_pl(i))
l = sum(l,[])
l.sort()

fac_dict = {}
fac_list = []
for key, value in itertools.groupby(l):
    fac_dict[str(key)] = len(list(value))
    fac_list.append(key)

count = 0

for l in itertools.combinations(fac_list,3):
    for i in range(3):
        if fac_dict[str(l[i%3])] >= 4 and fac_dict[str(l[(i+1)%3])] >= 4 and fac_dict[str(l[(i+2)%3])] >= 2:
            count+=1


for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 14 and fac_dict[str(l[(i+1)%2])] >= 4:
            count+=1


for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 24 and fac_dict[str(l[(i+1)%2])] >= 2:
            count+=1


for l in fac_list:
    if fac_dict[str(l)] >= 74:
        count += 1

print(count)

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

def divisor_pl(num):
    l = []
    i = 2
    while num > 1:
        if num%i == 0:
            l.append(i)
            num = int(num/i)
            i = 2
        else:
            i += 1
    if num != 1:
        l.append(num)
    return l

l = []
for i in range(2,N+1):
    l.append(divisor_pl(i))
l = sum(l,[])
l.sort()

fac_dict = {}
fac_list = []
for key, value in itertools.groupby(l):
    fac_dict[str(key)] = len(list(value))
    fac_list.append(key)

count = 0

for l in itertools.combinations(fac_list,3):
    for i in range(3):
        if fac_dict[str(l[i%3])] >= 4 and fac_dict[str(l[(i+1)%3])] >= 4 and fac_dict[str(l[(i+2)%3])] >= 2:
            count+=1


for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 14 and fac_dict[str(l[(i+1)%2])] >= 4:
            count+=1


for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 24 and fac_dict[str(l[(i+1)%2])] >= 2:
            count+=1


for l in fac_list:
    if fac_dict[str(l)] >= 74:
        count += 1

print(count)

Solution (Python):

from sys import stdin

d_in = lambda: int(stdin.readline())  

N = d_in()


def factorize(n):
    """
    素因数分解

    Return
    ------
    fct : list
        [[素因数, 指数], ...] のリスト
            [[a_1, n_1], ..., [a_i, n_i], ...]
        n = a_1**n_1 * a_2**n_2 * ...
    """
    if n == 1:
        return [(1, 1)]
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n //= b
            e += 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def Sieve_of_Eratosthenes(x):
    """
    エラトステネスの篩を用いて素数列を返す
    2以上x未満の素数列を返す
    参考URL:
    https://qiita.com/peria/items/a4ff4ddb3336f7b81d50
    """
    primes = [2*i + 1 for i in range((x + 1) // 2)]
    primes[0] = 2
    n_primes = len(primes)
    sqrt_x = int((x + 0.1) ** 0.5)
    for i in range(1, (sqrt_x + 1) // 2):
        if not primes[i]:
            continue
        p = 2 * i + 1
        for j in range(2 * i * (i + 1), n_primes, p):
            primes[j] = False
    return list(filter(lambda x: x, primes))


primes = Sieve_of_Eratosthenes(100)
factor_dict = {i: 0 for i in primes}
for i in range(2, N+1):
    fct = factorize(i)
    for f in fct:
        factor_dict[f[0]] += f[1]


factor_num_list = list(factor_dict.values())
ans = 0

over_74 = len(list(filter(lambda x: x >= 74, factor_num_list)))
ans += over_74

over_24 = len(list(filter(lambda x: x >= 24, factor_num_list)))
over_2 = len(list(filter(lambda x: x >= 2, factor_num_list)))
ans += over_24 * (over_24 - 1)
ans += over_24 * (over_2 - over_24)

over_14 = len(list(filter(lambda x: x >= 14, factor_num_list)))
over_4 = len(list(filter(lambda x: x >= 4, factor_num_list)))
ans += over_14 * (over_14 - 1)
ans += over_14 * (over_4 - over_14)

over_4 = len(list(filter(lambda x: x >= 4, factor_num_list)))
over_2 = len(list(filter(lambda x: x >= 2, factor_num_list)))
between_2_4 = over_2 - over_4
ans += over_4 * (over_4 - 1) * (over_4 - 2) // 2
ans += over_4 * (over_4 - 1) * between_2_4 // 2

print(ans)

Solution (Python):
n = int(input())
prime_list = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
d = []
e = [0,0,0,0,0]
f = [74,24,14,4,2]
for i in prime_list:
  a = n
  b = 0
  c = 1
  while a // (i**c) > 0:
    b += a // (i**c)
    c += 1
  else:
    d.append(b)
count = 0
len_d = len(d)-1
for k in f:
  for i,j in enumerate(d):
    if j < k:
      e[count] = i
      count += 1
      break
    elif i == len_d:
      e[count] = i+1
      count += 1
      break



print(e[0]+e[1]*(e[4]-1)+e[2]*(e[3]-1)+(e[3]*(e[3]-1)//2)*(e[4]-2))

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

e = [0] * (N+1)

for i in range(2, N+1):
    j = i
    k = 2
    while(j > 1):
        if j % k == 0:
            j //= k
            e[k] += 1
            k = 2
            continue
        k += 1

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(3)-2)*num(5)*(num(5)-1)//2
)

Solution (Python):
N = int(input())
T = [1 for k in range(101)]

for M in range(2,N+1):
    k = 2
    while k*k <= M:
        if M%k == 0:
            M //= k
            T[k] += 1
        else:
            k += 1
    if M > 1:
        T[M] += 1

C = [0 for k in range(101)]
for k in range(101):
    if T[k] >= 3:
        C[3] += 1
    if T[k] >= 5:
        C[5] += 1
    if T[k] >= 15:
        C[15] += 1
    if T[k] >= 25:
        C[25] += 1
    if T[k] >= 75:
        C[75] += 1

print(C[75] + C[25]*(C[3]-1) + C[15]*(C[5]-1) + (C[5]*(C[5]-1)*(C[3]-2))//2)

Solution (Python):
def get_primes(n):
    primes = []
    for i in range(2, n+1):
        flag = True
        for j in range(2, i+1):
            if i % j == 0 and i != j:
                flag = False
                break
        if flag:
            primes += [i]
    return primes

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

    primes = get_primes(n)
    cnt = len(primes)

    exps = [0] * cnt
    for i in range(2, n+1):
        k = i
        for j in range(cnt):
            while k % primes[j] == 0:
                exps[j] += 1
                k /= primes[j]

    ans = 0

    for i in range(cnt):
        if exps[i] >= 74:
            ans += 1

    for i in range(cnt):
        for j in range(cnt):
            if i == j:
                continue
            if exps[i] >= 2 and exps[j] >= 24:
                ans += 1
            if exps[i] >= 4 and exps[j] >= 14:
                ans += 1

    for i in range(cnt):
        for j in range(cnt):
            for k in range(j+1, cnt):

                if i == j or i == k or j == k:
                    continue
                if exps[i] >= 2 and exps[j] >= 4 and exps[k] >= 4:
                     ans += 1

    print(ans)

main()

Solution (Python):
N = int(input())
p = [
    sum(N // (i**k) for k in range(1, 8))
    for i in range(2, 97 + 1)
    if all(i % j != 0 for j in range(2, i))
]
def f(m):
  return len([i for i in p if i >= m])
ans = f(74) + f(24) * (f(2) - 1) + f(14) * (f(4) - 1) + f(4) * (f(4) - 1) * (f(2) - 2) // 2
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):
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())
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):
def prime_factorization(num):
    f = 2
    factor = []
    while num > 1:
        if num % f == 0:
            factor.append(f)
            num //= f
            f = 2
        else:
            f += 1
    return {d: factor.count(d) for d in set(factor)}
N = int(input())
pff = {}
while N > 1:
    pf = prime_factorization(N)
    for k in iter(pf.keys()):
        if k in pff:
            pff[k] += pf[k]
        else:
            pff[k] = pf[k]
    N -= 1
threshold = [74, 24, 14, 4, 2]
count = [0] * len(threshold)
for i in iter(pff.values()):
    for j in range(len(threshold)):
        if i >= threshold[j]:
            count[j] += 1
ans = count[0] \
    + count[1] * (count[4] - 1) \
    + count[2] * (count[3] - 1) \
    + (count[3] * (count[3] - 1) // 2 * (count[4] - 2))
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 and cur != 1:
            e[j] += 1
            cur //= j

def num(n):
    count = 0
    for i in range(len(e)):
        if e[i]>=n-1 :
            count += 1
    
    return count

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] * (n+1)
for i in range(2, n+1):
    cur=i
    for j in range(2, n+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())


e = [0] * (N+1)

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


nums = set()

for p in range(2, N+1):
    for q in range(2, N+1):
        for r in range(2, N+1):
            if (e[p] >= 4 and e[q] >= 4 and e[r] >= 2
                    and p != q and q != r and r != p):
                nums.add(pow(p, 4) * pow(q, 4) * pow(r, 2))

for p in range(2, N+1):
    for q in range(2, N+1):
        if e[p] >= 14 and e[q] >= 4 and p != q:
            nums.add(pow(p, 14) * pow(q, 4))
        if e[p] >= 24 and e[q] >= 2 and p != q:
            nums.add(pow(p, 24) * pow(q, 2))

for p in range(2, N+1):
    if e[p] >= 74:
        nums.add(pow(p, 74))  

print(len(nums))

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):
import math

SO=[0 for i in range(101)]

N=int(input())
for i in range(2,N+1):
    NUM=i
    for j in range(2,100):
        while NUM%j==0:
            SO[j]+=1
            NUM=NUM/j
A74=0
A24=0
A14=0
A04=0
A02=0
for j in range(len(SO)):
    if SO[j]>=74:
        A74+=1
    if SO[j]>=24:
        A24+=1
    if SO[j]>=14:
        A14+=1
    if SO[j]>=4:
        A04+=1
    if SO[j]>=2:
        A02+=1

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


ans=A74

if A04>=2:
    ans+=(A02-2)*combinations_count(A04,2)

ans+=(A02-1)*A24

ans+=(A04-1)*A14


print(ans)

Solution (Python):
from itertools import combinations
N = int(input())
if N == 1:
    print(0)
    exit(0)
def get_sieve_of_eratosthenes(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return prime
prime = get_sieve_of_eratosthenes(N)
n = len(prime)
ans = 0
divNum = [0] + [ N//i for i in range(1,N+1) ]
for p in prime:
    ip = p * p
    while ip <= N:
        divNum[p] += divNum[ip]
        ip *= p

for i in range(n):
    if 74 <= divNum[prime[i]]:
        ans += 1
    for j in range(n):
        if i != j and 4 <= divNum[prime[i]] and 14 <= divNum[prime[j]]:
            ans += 1
        if i != j and 2 <= divNum[prime[i]] and 24 <= divNum[prime[j]]:
            ans += 1
        for k in range(j+1,n):
            if i != j and i != k:
                if 2 <= divNum[prime[i]] and 4 <= divNum[prime[j]] and 4 <= divNum[prime[k]]:
                    ans += 1
            
print(ans)

Solution (Python):
n = int(input())
e = [0] * (n+1)

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

c1 = f(75)
c2 = f(25) * (f(3) - 1)
c3 = f(15) * (f(5) - 1)
c4 = f(5) * (f(5) - 1) * (f(3) - 2) // 2

print(c1 + c2 + c3 + c4)

Solution (Python):
primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
c = {3:0, 5:0, 15:0, 25:0, 75:0}
n = int(input())
for p in primes:
  r = n//p
  a = 0
  while r>0:
    a += r
    r //= p
  for x in c.keys():
    if x-1 <= a:
      c[x] += 1
print(c[75]+c[25]*(c[3]-1)+c[15]*(c[5]-1)+c[5]*(c[5]-1)*(c[3]-2)//2)

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
N = int(input())
D = defaultdict(int)



def prime_factorization(n):
    table = []
    for x in range(2, int(n**0.5)+2):
        while n % x == 0:
            table.append(x)
            n //= x
    if n > 1:
        table.append(n)
    return table


for n in range(2, N + 1):
    T = prime_factorization(n)
    for t in T:
        D[t] += 1


def num(m):
    return len([i for i in D.values() if i >= m - 1])


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

Solution (Python):
import itertools

N = int(input())


primes = []
for n in range(2,N+1):
    if 0 not in map(lambda m: n%m, range(2,n)):
        primes.append(n)


factors = [0]*len(primes)
for n in range(2,N+1):
    for i in range(len(primes)):
        p = primes[i]
        while n % p == 0 :
            n /= p
            factors[i] += 1

def count(fs):
    num = 0
    for v in itertools.permutations(factors, len(fs)):
        if False not in map(lambda i: fs[i]<=v[i]+1, range(len(v))):
            num +=1
    return num
                                    

num = 0
num += count([75])
num += count([3,25])
num += count([5,15])
num += int(count([3,5,5])/2)
print(num)

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

N = int(input())
cnt = []

for i in range(2, N+1):
    if not isPrime(i):
        continue
    c = 0
    x = i
    while N // x > 0:
        c += N // x
        x *= i
    cnt.append(c)

ans = 0
for x in cnt:
    if x >= 74:
        ans += 1

for i in range(len(cnt)):
    for j in range(i+1, len(cnt)):
        if cnt[i]>=2 and cnt[j]>=24:
            ans += 1
        if cnt[i]>=24 and cnt[j]>=2:
            ans += 1
        if cnt[i]>=4 and cnt[j]>=14:
            ans += 1
        if cnt[i]>= 14 and cnt[j]>=4:
            ans += 1

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

print(ans)

Solution (Python):
import math

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

C3 = 0
C5 = 0
C15 = 0
C25 = 0
C75 = 0

for i in pn:
    if math.factorial(N) % pow(i,2) == 0:
        C3 += 1
    if math.factorial(N) % pow(i,4) == 0:
        C5 += 1
    if math.factorial(N) % pow(i,14) == 0:
        C15 += 1
    if math.factorial(N) % pow(i,24) == 0:
        C25 += 1
    if math.factorial(N) % pow(i,74) == 0:
        C75 += 1

ans = (C3-2)*C5*(C5-1)//2 + (C5-1)*C15 + (C3-1)*C25 + C75 
print(ans)

Solution (Python):
import itertools
import math

N = int(input())
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]
ans = []

for ar in itertools.permutations(pn,3):
    if math.factorial(N) > (ar[0]**2*ar[1]**4*ar[2]**4) and\
    math.factorial(N) % (ar[0]**2*ar[1]**4*ar[2]**4) == 0:
        ans.append(ar[0]**2*ar[1]**4*ar[2]**4)

for ar in itertools.permutations(pn,2):
    if math.factorial(N) > (ar[0]**4*ar[1]**14) and\
    math.factorial(N) % (ar[0]**4*ar[1]**14) == 0:
        ans.append(ar[0]**4*ar[1]**14)

for ar in itertools.permutations(pn,2):
    if math.factorial(N) > (ar[0]**2*ar[1]**24) and\
    math.factorial(N) % (ar[0]**2*ar[1]**24) == 0:
        ans.append(ar[0]**2*ar[1]**24)

for ar in pn:
    if math.factorial(N) > ar**74 and\
    math.factorial(N) % ar**74 == 0:
        ans.append(ar**74)

ans = set(ans)
print(len(ans))

Solution (Python):
import itertools
import math

N = int(input())
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]
ans = []
cnt = 0


for ar in itertools.permutations(pn,3):
    if math.factorial(N) > (ar[0]**2*ar[1]**4*ar[2]**4) and\
    math.factorial(N) % (ar[0]**2*ar[1]**4*ar[2]**4) == 0:
        ans.append(ar[0]**2*ar[1]**4*ar[2]**4)

for ar in itertools.permutations(pn,2):
    if math.factorial(N) > (ar[0]**4*ar[1]**14) and\
    math.factorial(N) % (ar[0]**4*ar[1]**14) == 0:
        ans.append(ar[0]**4*ar[1]**14)

for ar in itertools.permutations(pn,2):
    if math.factorial(N) > (ar[0]**2*ar[1]**24) and\
    math.factorial(N) % (ar[0]**2*ar[1]**24) == 0:
        ans.append(ar[0]**2*ar[1]**24)

for ar in pn:
    if math.factorial(N) > ar**74 and\
    math.factorial(N) % ar**74 == 0:
        ans.append(ar**74)

ans = set(ans)
print(len(ans))

Solution (Python):



import sys
import collections

sys.setrecursionlimit(10 ** 6)


read_single_int = lambda: int(sys.stdin.readline().strip())


def add_power(n: int, ps: list):
    i = 2
    while n != 1:
        if n % i == 0:
            n = n // i
            ps[i] += 1
        else:
            i += 1


def solution(n: int):
    ps = [0 for _ in range(n+1)]

    for i in range(2, n+1):
        add_power(i, ps)

    powers = collections.defaultdict(lambda: 0)

    for p in range(2, n+1):
        powers[p] = len(list(filter(lambda x: x >= p, ps)))

    return powers[74] + powers[24] * (powers[2]-1) + powers[14] * (powers[4]-1) + powers[4] * (powers[4]-1) * (powers[2]-2)//2


def main():
    n = read_single_int()
    print(solution(n))


if __name__ == '__main__':
    main()

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

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

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 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:
            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())

nums = list(range(1, N+1))
factors = []
for i, n in enumerate(nums):
    if n > 1:
        count = 0
        for j in range(i, len(nums)):
            while nums[j] % n == 0:
                nums[j] //= n
                count += 1
        factors.append((n, count))

f74 = len([True for n, k in factors if k >= 74])
f24 = len([True for n, k in factors if k >= 24])
f14 = len([True for n, k in factors if k >= 14])
f4 = len([True for n, k in factors if k >= 4])
f2 = len([True for n, k in factors if k >= 2])
print(f74 + f24 * (f2 - 1) + f14 * (f4 - 1) + f4 * (f4 - 1) // 2 * (f2 - 2))

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

PRIMES = 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

xs = {}

for n in range(2, N+1):
    for p in PRIMES:
        while n % p == 0:
            n //= p
            xs[p] = xs.get(p, 0) + 1
        if n == 1:
            break

vs = xs.values()

u74 = sum(v >= 74 for v in vs)
u24 = sum(v >= 24 for v in vs)
u14 = sum(v >= 14 for v in vs)
u4 = sum(v >= 4 for v in vs)
u2 = sum(v >= 2 for v in vs)

result = 0


if u74 >= 1:
    result += u74


if u24 >= 1 and u2 - 1 >= 1:
    result += u24 * (u2 - 1)


if u14 >= 1 and u4 - 1 >= 1:
    result += u14 * (u4 - 1)


if u4 >= 2 and u2 - 2 >= 1:
    result += u4 * (u4 - 1) // 2 * (u2 - 2)

print(result)

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

PRIMES = 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

xs = {}

for n in range(2, N+1):
    for p in PRIMES:
        while n % p == 0:
            n //= p
            xs[p] = xs.get(p, 0) + 1
        if n == 1:
            break

vs = sorted(xs.values())

u74 = sum(v >= 74 for v in vs)
u24 = sum(v >= 24 for v in vs)
u14 = sum(v >= 14 for v in vs)
u4 = sum(v >= 4 for v in vs)
u2 = sum(v >= 2 for v in vs)



def nCr(n, r):
    result = 1
    for i in range(n - r + 1, n + 1):
        result *= i
    for i in range(1, r + 1):
        result //= i
    
    return result

result = 0


result += u74


if u24 >= 1 and u2 - u24 >= 1:
    result += nCr(u24, 1) * nCr(u2 - 1, 1)


if u14 >= 1 and u4 - u14 >= 1:
    result += nCr(u14, 1) * nCr(u4 - 1, 1)


if u4 >= 2 and u2 - u4 >= 1:
    result += nCr(u4, 2) * nCr(u2 - 2, 1)

print(result)

Solution (Python):

N = int(input())
sosu = [2]
import math

for i in range(3,101):
    fl = True
    for j in sosu:
        if j > math.sqrt(i):
            break
        if i % j == 0:
            fl = False
            break
    if fl:
        sosu.append(i)


def getpow(n, x):
    if n >= x:
        return 1 + getpow(n/x, x) if n % x == 0 else 0
    else:
        return 0

has = {}
powlist = []


for i in range(1,N+1):
    for p in sosu:
        if p > i:
            break
        if i % p == 0:
            has[p] = 2 if not p in has else has[p] + getpow(i,p)
            





def f(primes, num):
    if num == 1:
        
        return 1
    else:
        sum = 0
        for e,p in enumerate(primes.keys()):
            for i in range(3, primes[p]+1):
                if num // i >= 1 and num % i == 0:
                    prime2 = primes.copy()
                    try:
                        
                        prime2[p] = 0
                    except:
                        print(prime2,e,p)
                        exit(1)
                    
                    sum += f(prime2, num//i)
        return sum
            

num75 = 0
num25 = 0
num15 = 0
num5  = 0
num3 = 0

primes = []
for p in has:
    primes.append(has[p])
def num(m):
    return len(
        list(
            filter(
                lambda x: 
                    x >=  m, primes
            )
        )
    )
    



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

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())

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

cnt = 0

for i in range(2, N+1):
    for j in range(i+1, N+1):
        for k in range(2, N+1):
            if i == j or j == k or k == i:
                continue
            if e[i] >= 4 and e[j] >= 4 and e[k] >= 2:
                cnt += 1

for i in range(2, N+1):
    for j in range(2, N+1):
        if i == j or j == k or k == i:
            continue
        if e[i] >= 14 and e[j] >= 4:
            cnt += 1

for i in range(2, N+1):
    for j in range(2, N+1):
        if i == j or j == k or k == i:
            continue
        if e[i] >= 24 and e[j] >= 2:
            cnt += 1

for i in range(2, N+1):
    if e[i] >= 74:
        cnt += 1

print(cnt)

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

primes = []
def prime():
    global primes
    primes = []
    for i in range(2,100):
        p = True
        for j in primes:
            if i % j == 0:
                p = False
                break
        if p:
            primes.append(i)

hash = {}
prime()

for i in range(1, n+1):
    k = i
    for j in primes:
        if k % j == 0:
            while k % j == 0:
                if j in hash:
                    hash[j] += 1
                else:
                    hash[j] = 1
                k = k // j
a = 0
b = 0
c = 0
d = 0
e = 0
for k, v in hash.items():
    if v >= 4:
        a += 1
    if v >= 2:
        b += 1
    if v >=14:
        c += 1
    if v >= 24:
        d += 1
    if v >= 74:
        e += 1

total = 0
if a<2 or b<3:
    print(0)
else:
    total = a*(a-1)*(b-2) // 2 + c *  (a-1) + d * (b-1) + e
    print(total)

Solution (Python):
n=int(input())
d=dict()
for m in range(1,n+1):
    while m>1:
        for i in range(2,int(m**0.5)+1):
            if m%i==0:break
        else:i=m
        d[i]=d.get(i,0)+1
        m/=i
def num(n):
    return len(list(filter(lambda x:x>=n,d.values())))

print(num(74)+ num(24)*(num(2)-1)+ num(14)*(num(4)-1)+ num(4)*(num(4)-1)*(num(2)-2)//2)

Solution (Python):
N, = map(int, raw_input().split())
p = {}
for i in range(2, N+1):
  ii = i
  for j in range(2, i+1):
    while(ii%j==0):
      p[j] = p.get(j, 0)+1
      ii //= j
m = [3,5,15,25,75]
x = {}
for l in m:
  x[l-1] = 0
for k in p:
  for l in m:
    if p[k]>=l-1:
      x[l-1] += 1
r = 0
if x[4]>=2 and x[2]-2>=1:
  r += x[4]*(x[4]-1)*(x[2]-2)//2
if x[14]>=1 and x[4]-1>=1:
  r += x[14]*(x[4]-1)
if x[24]>=1 and x[2]-1>=1:
  r += x[24]*(x[2]-1)
if x[74]>=1:
  r += x[74]
print r

Solution (Python):
import math

prime = [2,3,5,7,11]
for i in range(13,53,2):
    for j in [3,5,7]:
        if i%j == 0:
            break
    else:
        prime.append(i)

num75 = [2**74]
for i in [2,3,5]:
    tmp = i**24
    for j in prime:
        if i==j:
            continue
        num75.append(tmp*j*j)

for i in [2,3,5,7]:
    tmp = i**14
    for j in prime:
        if i==j:
            continue
        num75.append(tmp*(j**4))

for i in [2,3,5,7,11,13,17,19,23]:
    for j in [2,3,5,7,11,13,17,19,23]:
        if j<=i:
            continue
        for k in prime:
            if (i==k)or(j==k):
                continue
            num75.append((i**4)*(j**4)*(k**2))


N = int(input())
f = math.factorial(N)
ans = 0
for i in num75:
    if f%i == 0:
        ans += 1
print(ans)

Solution (Python):


import sys
from collections import defaultdict

input = sys.stdin.readline
INF = float('inf')
MOD = 10 ** 9 + 7


def inpl(): return list(map(int, input().split()))


N = int(input())

prime_cnt = defaultdict(int)
for n in range(N):
    n += 1
    i = 2
    while i * i <= n:
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            prime_cnt[i] += cnt
        i += 1

    if n != 1:
        
        prime_cnt[n] += 1


def num(n):
    cnt = 0
    for key in prime_cnt.keys():
        if prime_cnt[key] >= n - 1:
            cnt += 1

    return cnt




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