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):
import bisect
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
def main():
    N = int(input())
    l = [0] * (N+1)
    for i in range(1, N+1):
        a = prime_factorize(i)
        for j in a:
            l[j] += 1
    l = l[2:]
    l.sort()
    r = 0
    a = bisect.bisect_left(l, 2)
    b = bisect.bisect_left(l, 4)
    c = bisect.bisect_left(l, 14)
    d = bisect.bisect_left(l, 24)
    e = bisect.bisect_left(l, 74)
    if e < N-1:
        r += N - e - 1
    if d < N-1:
        r += (N - d - 1) * (N - a - 2)
    if c < N-1:
        r += (N - c - 1) * (N - b - 2)
    if b < N-2:
        r += (N - a - 3) * (N - b - 1) * (N - b - 2) // 2
    print(r)
main()

Solution (Python):
def wareru(n,k):
    res = 0
    for i in range(1,n):
        plus = n//(k**i)
        res+= plus
        if plus == 0:break
    return res
n = int(input())
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
a = []
for p in prime :
    if wareru(n,p) > 1:
        a.append(wareru(n,p))
    else:break
cnt = [0]*5
for num in a:
    if num >= 74:
        cnt[0]+=1
    if num >= 24:
        cnt[1] +=1
    if num >= 14:
        cnt[2] += 1
    if num >= 4:
        cnt[3] += 1
    cnt[4]+= 1
ans = cnt[0]
ans += cnt[1]*(cnt[4]-1)
ans += cnt[2]*(cnt[3]-1)
ans += cnt[3]*(cnt[3]-1)*(cnt[4]-2)//2
print(ans)

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

def fact_factors(n):
    f = []

    x = 2
    c = 0
    while x <= n:
        c += n // x
        x *= 2
    if c > 0:
        f.append((2, c))

    sv = [1] * (n + 1)
    lim = int(n**0.5) + 1
    for i in range(3, lim + 1, 2):
        if sv[i]:
            for j in range(i + i, n + 1, i):
                sv[j] = 0

    for i in range(3, n + 1, 2):
        if sv[i]:
            x = i
            c = 0
            while x <= n:
                c += n // x
                x *= i
            f.append((i, c))

    return f

import sys

def D(*a, **kwa):
    print(*a, file=sys.stderr, **kwa)



x_list_list = [[74], [24, 2], [14, 4], [4, 4, 2]]
div = [1, 1, 1, 2]

N = int(input())

f = fact_factors(N)


fx = [0] * (N+1)
afx = [0] * (N+1)
for f in fact_factors(N):
    fx[f[1]] += 1
for i in range(N, -1, -1):
    afx[i] = fx[i] if i == N else fx[i] + afx[i+1]



ans = 0
for i, x_list in enumerate(x_list_list):
    c = []
    for j, x in enumerate(x_list):
        if x > N:
            break
        c.append(afx[x]-j)
    if len(c):
        ans += reduce(mul, c) // div[i]

print(ans)

Solution (Python):
def main():
    N = int(input())
    def fact(x):
        r = []
        i = 0
        while x % 2 == 0:
            x //= 2
            i += 1
        if i:
            r.append((2, i))
        t = 3
        i = 0
        while t * t <= x:
            if x % t == 0:
                x //= t
                i += 1
            else:
                if i:
                    r.append((t, i))
                    i = 0
                t += 2
        if i:
            r.append((t, i))
        if x != 1:
            r.append((x, 1))
        return r
    f = {}
    for i in range(2, N + 1):
        for j, k in fact(i):
            f[j] = f.get(j, 0) + k
    f75, f25, f15, f5, f3 = 0, 0, 0, 0, 0
    for j, k in f.items():
        if k >= 74:
            f75 += 1
        if k >= 24:
            f25 += 1
        if k >= 14:
            f15 += 1
        if k >= 4:
            f5 += 1
        if k >= 2:
            f3 += 1
    return f75 + f25 * (f3 - 1) + f15 * (f5 - 1) + f5 * (f5 - 1) * (f3 - 2) // 2

print(main())

Solution (Python):













def factorization(n: int):
    if n == 1:
        return []  
    
    arr = []
    temp = n
    for i in range(2, int(n**0.5) + 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


def make_divisors(n: int, sort=False):
    
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    if sort:
        divisors.sort()
    return divisors


def combination_mod(n, r, mod):
    if r > n:
        return 0  
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod


from collections import defaultdict

N = int(input())
fact = defaultdict(lambda: 0)
for n in range(1, N + 1):
    tmp = factorization(n)
    for k, v in tmp:
        fact[k] += v


A, B, C, D, E, F, G, H = 0, 0, 0, 0, 0, 0, 0, 0
for k, v in fact.items():
    if v >= 74:
        A += 1

    if v >= 4:
        C += 1
    if 2 <= v < 4:
        B += 1

    if v >= 24:
        F += 1
    if 24 > v >= 2:
        E += 1

    if v >= 14:
        G += 1
    if 14 > v >= 4:
        H += 1



MOD = 10**9 + 7
ans = A
ans += combination_mod(C, 2, MOD) * B + combination_mod(C, 3, MOD) * 3
ans += E * F + combination_mod(F, 2, MOD) * 2
ans += G * H + combination_mod(G, 2, MOD) * 2

print(ans)

Solution (Python):

from collections import Counter
c = Counter()
N = int(input())


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

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)


def is_prime(n):
    import math
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


N = int(read())

primes = []

for i in range(1, N + 1):
    if is_prime(i):
        primes.append(i)

p_cnt = [0] * len(primes)

for i in range(1, N + 1):
    num = i
    for idx, p in enumerate(primes):
        while num % p == 0:
            p_cnt[idx] += 1
            num //= p
ans = 0

for _, v in zip(primes, p_cnt):
    if v >= 74:
        ans += 1

for p, v in zip(primes, p_cnt):
    for q, v_ in zip(primes, p_cnt):
        if p == q:
            continue
        if v >= 2 and v_ >= 24:
            ans += 1
        if v >= 4 and v_ >= 14:
            ans += 1

for p, v1 in zip(primes, p_cnt):
    for q, v2 in zip(primes, p_cnt):
        for r, v3 in zip(primes, p_cnt):
            if r <= q or p == q or r == p:
                continue
            if v1 >= 2 and v2 >= 4 and v3 >= 4:
                ans += 1

print(ans)

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())
from collections import defaultdict
dic=defaultdict(int)
for i in range(1,N+1):
  arr=factorization(i)
  for a in arr:
    dic[a[0]]+=a[1]
    






items=dic.items()

def c(items,p):
  return len(list(filter(lambda x:x[1]>=p,items)))

ans=0
ans+=c(items,74)
ans+=(c(items,4)*(c(items,4)-1)*(c(items,2)-2))//2
ans+=c(items,24)*(c(items,2)-1)
ans+=c(items,14)*(c(items,4)-1)
print(ans)

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






prime=[]
is_prime=[True]*(N+1)
is_prime[0]=is_prime[1]=False
for i in range(2,N+1):
    if is_prime[i]==False: continue
    prime.append(i)
    for j in range(i*i,N+1,i):
        is_prime[j]=False


import collections
pfac=collections.defaultdict(int)
for n in range(1,N+1):
    while n>1:
        for p in prime:
            if n%p==0:
                pfac[p]+=1
                n//=p

pfac2=sum([1 for n in pfac.values() if n>=2])
pfac4=sum([1 for n in pfac.values() if n>=4])
pfac14=sum([1 for n in pfac.values() if n>=14])
pfac24=sum([1 for n in pfac.values() if n>=24])
pfac74=sum([1 for n in pfac.values() if n>=74])


ans=pfac4*(pfac4-1)*(pfac2-2)//2

ans+=pfac14*(pfac4-1)

ans+=pfac24*(pfac2-1)

ans+=pfac74

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

def make_prime_list(k):
    p = [True] * (k+1)
    p[0] = False
    p[1] = False
    for i in range(2, k+1):
        if p[i]:
            for j in range(i*2, k+1, i):
                p[j] = False
    return [i for i in range(k + 1) if p[i]]



def get_prime_fact_dict(num):
    ps = make_prime_list(num//2)
    i = num
    prime_and_count = []

    for p in ps:
        count = 0
        while i % p == 0:
            i //= p
            count += 1
        if count > 0:
            prime_and_count.append([p, count])

    prime_and_count.append([num, 1])

    return prime_and_count


def solve(n):
    div_fact_count = [0] * (n+1)

    for i in range(2, n+1):
        xss = get_prime_fact_dict(i)
        for k, v in xss:
            div_fact_count[k] += v

    a = len([i for i in div_fact_count if i >= 74])
    b = len([i for i in div_fact_count if i >= 24])
    c = len([i for i in div_fact_count if i >= 14])
    d = len([i for i in div_fact_count if i >= 4])
    e = len([i for i in div_fact_count if i >= 2])

    
    c1 = a
    
    c2 = b*(e-1)
    
    c3 = c * (d-1)
    
    
    c4 = (d * (d-1) * (e-2))//2

    return c1+c2+c3+c4


if __name__ == '__main__':
    n = int(input())
    print(solve(n))

Solution (Python):
from collections import defaultdict

n = int(input())

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

def factorize(x, primes):
    res = []
    for p in primes:
        if p ** 2 > x: break
        cnt = 0
        while not x % p:
            x //= p
            cnt += 1
        if cnt: res.append((p, cnt))
    if x > 1: res.append((x, 1))
    return res

p = get_primes(100)
ff = defaultdict(int)

for i in range(2, n+1):
    for x, num in factorize(i, p):
        ff[x] += num

ans = 0

for i in range(len(p)):
    if 74 <= ff[p[i]]: ans += 1
    for j in range(len(p)):
        if i == j: continue
        if 4 <= ff[p[i]] and 14 <= ff[p[j]]: ans += 1
        if 2 <= ff[p[i]] and 24 <= ff[p[j]]: ans += 1
        for k in range(j, len(p)):
            if j == k or i == k: continue
            if 2 <= ff[p[i]] and 4 <= ff[p[j]] and 4 <= ff[p[k]]:
                ans += 1

print(ans)

Solution (Python):
n=int(input())
div=[0]*(n+10)
for i in range(1,n+1):
  k=i
  for j in range(1,int(i**0.5)+1):
    cnt=0
    while k%(j+1)==0:
      k//=(j+1)
      cnt+=1
    div[j+1]+=cnt
  if k>1:
    div[k]+=1
ans=0
d=dict()
for i,j,k in [[4,4,2],[24,2,1000],[14,4,1000],[74,1000,1000]]:
  cnti,cntj,cntk=0,0,0
  for l in range(2,n+1):
    if j==1000 and k==1000:
      if div[l]>=i:
        ans+=1
    for m in range(2,n+1):
      if l!=m and j!=1000 and k==1000:
        if div[l]>=i and div[m]>=j:
            ans+=1
      for o in range(2,n+1):
        if (m,l) not in d:
          if l!=o and l!=m and m!=o:
            if i!=1000 and j!=1000 and k!=1000:
              if div[l]>=i and div[m]>=j and div[o]>=k:
                ans+=1
                d[(l,m)]=0
print(ans)

Solution (Python):
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True  and False
BIG = 999999999
R = 10**9 + 7
import math

def ddprint(x):
  if DBG:
    print(x)

def prime_division2(x):
    q = int(math.sqrt(x))
    h = {}
    for i in range(2,q+1):
        ex = 0
        while x%i == 0:
            ex += 1
            x //= i
        if ex>0:
            h[i] = ex
    if x>q:
        h[x] = 1
    return h

n = inn()
facc = {}
for i in range(1,n+1):
    f = prime_division2(i)
    ddprint("prdiv i {} f:".format(i))
    ddprint(f)
    for p in f:
        if p in facc:
            facc[p] += f[p]
        else:
            facc[p] = f[p]

ddprint(facc)
n74plus = len([x for x in facc if facc[x]>=74])
n24plus = len([x for x in facc if facc[x]>=24])
n14plus = len([x for x in facc if facc[x]>=14])
n4plus = len([x for x in facc if facc[x]>=4])
n2plus = len([x for x in facc if facc[x]>=2])
sm = n74plus
sm += n24plus*(n2plus-1)
sm += n14plus*(n4plus-1)
sm += n4plus*(n4plus-1)*(n2plus-2)//2
print(sm)

Solution (Python):
import math
import copy

def ord(N,n):
    if n%N!=0:
        return 0
    else:
        return 1+ord(N,n//N)

def primenubertable(N):
    import math
    X=[1]*N
    X[0]=0
    X[1]=0
    i=2
    P=[]
    while math.sqrt(N)>=i:
        if X[i]==1:
            for j in range(i+1,N):
                if j%i==0:
                    X[j]=0
        i=i+1
    for i in range(0,N):
        if X[i]==1:
            P.append(i)
    return P

def factor(n):
    if n==0 or n==1:
        return 1
    else:
        return n*factor(n-1)

A=int(input())

N=factor(A)
P=primenubertable(100)
order=[]

for i in range(0,len(P)):
    x=ord(P[i],N)
    order.append(x)
a=0
b=0
c=0
d=0
e=0
for i in range(0,len(order)):
    if order[i]>=2:
        a=a+1
    if order[i]>=4:
        b=b+1
    if order[i]>=14:
        c=c+1
    if order[i]>=24:
        d=d+1
    if order[i]>=74:
        e=e+1
D=b*(b-1)//2
answer=D*(a-2)+c*(b-1)+d*(a-1)+e
print(answer)

Solution (Python):
def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


P = [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]
def count(n):
    t = {}
    while n != 1:
        for p in P:
            while n % p == 0:
                t[p] = t.setdefault(p, 0) + 1
                n //= p
    return t


def p_count(N):
    T = {}
    for n in range(1, N + 1):
        if n in P:
            T[n] = T.setdefault(n, 0) + 1
            continue
        
        t = count(n)
        for k, v in t.items():
            T[k] = T.setdefault(k, 0) + v
    return T


def main():
    N = int(input())
    T = p_count(N)
    L = sorted([t for t in T.keys() if T[t] >= 2])
    res = 0
    q = set()
    for i1, t1 in enumerate(L):
        for i2, t2 in enumerate(L[i1 + 1:]):
            for i3, t3 in enumerate(L[i1 + i2 + 2:]):
                if T[t2] >= 4 and T[t3] >= 4:
                    q.add((t1 ** 2) * (t2 ** 4) * (t3 ** 4))
                    res += 1
                if T[t1] >= 4 and T[t3] >= 4:
                    q.add(t1 ** 4 * t2 ** 2 * t3 ** 4)
                    res += 1
                if T[t1] >= 4 and T[t2] >= 4:
                    q.add(t1 ** 4 * t2 ** 4 * t3 ** 2)
                    res += 1

    for p, c1 in T.items():
        for q, c2 in T.items():
            if p == q:
                continue

            if c1 >= 2 and c2 >= 24:
                res += 1

            if c1 >= 4 and c2 >= 14:
                res += 1

    res += len([t for t in T.keys() if T[t] >= 74])

    print(res)


if __name__ == "__main__":
    main()

Solution (Python):
N = [int(_) for _ in input().split()][0]

e = [0] * (N + 1)

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

dp = [[0] * 76 for _ in range(N + 1)]

dp[0][1] = 1
for i in range(1, N + 1):
    for j in range(e[i] + 1):  
        for k in range(75 + 1):
            if k * (j + 1) > 75: break
            if dp[i - 1][k] > 0:
                dp[i][k * (j + 1)] += dp[i - 1][k]



print(dp[N][75])

Solution (Python):



n = int(input())


is_prime = [True]*(n+1)
is_prime[0] = False

for i in range(2, n+1):
    if is_prime[i-1]:
        j = 2 * i
        while j <= n:
            is_prime[j-1] = False
            j += i

table = [ i for i in range(1, n+1) if is_prime[i-1]]


hist=[0]*len(table)


def p_fact(a):
    for i in range(len(table)):
        while a%table[i]==0:
            hist[i]+=1
            a=a//table[i]
            
for i in range(2,n+1):
    p_fact(i)

over2=0
over4=0
over14=0
over24=0
over74=0
for i in range(len(hist)):
    if hist[i]>=2:
        over2+=1
        if hist[i]>=4:
            over4+=1
            if hist[i]>=14:
                over14+=1
                if hist[i]>=24:
                    over24+=1
                    if hist[i]>=74:
                        over74+=1
                    
        
ans=0

for i in range(len(hist)):
    if hist[i]>=2:
        a=over4
        if hist[i]>=4:
            a-=1
        ans+=(a*(a-1))//2
        
    if hist[i]>=14:
        ans+=over4-1
    
    if hist[i]>=24:
        ans+=over2-1

if over74==1:
    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
n=int(input())
sosu_list=[2]
for i in range(3, 101, 2):
    flag=0
    for j in range(2, int(i**0.5)+2):
        if i%j==0:
            flag=1
    if flag==0:
        sosu_list.append(i)
soinsu=defaultdict(int)
for i in sosu_list:
    temp=n
    while temp>=i:
        temp//=i
        soinsu[i]+=temp
kouho=soinsu.values()
cnt3=0
cnt5=0
cnt15=0
cnt25=0
cnt75=0
for a in kouho:
    if a>=2:
        cnt3+=1
    if a>=4:
        cnt5+=1
    if a>=14:
        cnt15+=1
    if a>=24:
        cnt25+=1
    if a>=74:
        cnt75+=1
ans=0
ans+=cnt75
ans+=cnt15*(cnt5-1)
ans+=cnt25*(cnt3-1)
if cnt3>=2:
    ans+=cnt5*(cnt5-1)*(cnt3-2)//2
        
print(ans)

Solution (Python):

from bisect import *
from collections import *
from heapq import *





mod=10**9+7
mod
ferumaC=10000
fac=[0 for i in range(ferumaC)]
fac[0]=1
ifac=[0 for i in range(ferumaC)]
ifac[0]=1
def mpow(x,n):
    num=1
    while n > 0:
        if n&1:
            num=num*x%mod
        x=x*x%mod
        n=n>>1
    return(num)

for i in range(0,ferumaC-1):
    fac[i+1]=(fac[i]*(i+1))%mod
    ifac[i+1]=ifac[i]*mpow(i+1,mod-2)%mod
def comb(a,b):
    if a==0 and b==0:return(1)
    if a<b or a<0:return(0)
    tmp=ifac[a-b]*ifac[b]%mod
    return(tmp*fac[a]%mod)



sosuulst={}
def soinsuu(i):
    for s in sosuulst:
        while i%s==0:
            sosuulst[s]+=1
            i//=s
    if i>1 and  not i in sosuulst :
        sosuulst.update({i:1})


N=int(input())
for i in range(2,N+1):
    soinsuu(i)


data=[sosuulst[i] for i in sosuulst]

count=0
for lst in [[2,4,4],[2,24],[4,14],[74]]:
    lst.reverse()
    flag=0
    temp=1
    if len(lst)<=2:
        for m,l in enumerate(lst):
            A=len([i for i in data if i>=l])-m
            if A<=0:
                flag=1
                break
            temp*=A


    else:
        A=len([i for i in data if i>=4])
        if A<=1:
            continue
        A=comb(A,2)
        temp*=A
        A=len([i for i in data if i>=2])-2
        if A<=0:
            continue
        temp*=A
    if not flag:
        
        count+=temp
print(count)

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

so=[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]
log=[1]*len(so)

for num in range(1,(N)+1):
    for index,item in enumerate(so):    
        while num%item==0:
            num/=item
            log[index]+=1
        if num==1:
            break
            

ans=0

ans+=sum([x>=75 for x in log])

ans+=sum([x>=25 for x in log])*(sum([x>=3 for x in log])-1)
ans+=sum([x>=15 for x in log])*(sum([x>=5 for x in log])-1)
ans+=sum([x>=5 for x in log])*(sum([x>=5 for x in log])-1)*(sum([x>=3 for x in log])-2)//2


print(ans)

Solution (Python):
from math import factorial


N = int(input())


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


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


ans = 0
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

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


ans = 0
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

print(ans)

Solution (Python):
from collections import defaultdict

N = int(input())

def getPrimes(N):
    R = N + 10
    isPrime = [True] * (R + 2)
    primes = set()

    for p in range(2, R):
        if not isPrime[p]:
            continue
        primes.add(p)
        for q in range(p * 2, R, p):
            isPrime[q] = False

    return primes

primes = getPrimes(N)

def getFactors(N):
    facts = defaultdict(int)
    for p in primes:
        while N % p == 0:
            facts[p] += 1
            N //= p
    return facts

fracFacts = defaultdict(int)
for i in range(1, N + 1):
    for p, c in getFactors(i).items():
        fracFacts[p] += c

cnt = {
    2 : 0,
    4 : 0,
    14 : 0,
    24 : 0,
    74 : 0,
}

for c in fracFacts.values():
    for k in cnt.keys():
        if c >= k:
            cnt[k] += 1

ans = 0
ans += cnt[4] * (cnt[4] - 1) * (cnt[2] - 2) // 2
ans += cnt[14] * (cnt[4] - 1)
ans += cnt[24] * (cnt[2] - 1)
ans += cnt[74]
print(ans)

Solution (Python):
from collections import Counter
from math import factorial


def factorization(n):
    arr = Counter()
    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[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if len(arr.keys()) == 0:
        arr[n] = 1

    return arr


N = int(input())

primes = Counter()

for i in range(2, N + 1):
    tp = factorization(i)
    primes += tp


V = list(primes.values())


def num(n):
    return len(list(filter(lambda x: x >= n, V)))


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

Solution (Python):

import math
import heapq
import bisect
import numpy as np


N = int(input())

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]
p_cnt = [0]*25

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

ans = 0

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

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

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

print(ans)

Solution (Python):

import numpy as np
N = int(input())
 
pf = np.zeros(N+1, dtype=int)
 
def prime_fact(N):
    for i in range(2, int(N**0.5)+1):
        if N%i == 0:
            cnt = 0
            while N%i==0:
                cnt += 1
                N //= i
            pf[i] += cnt
    if N != 1:
        pf[N] += 1

for n in range(1, N+1):
    prime_fact(n)
pf = pf[np.nonzero(pf)]
 
ans = 0
x74 = np.count_nonzero(pf >= 74)
x24 = np.count_nonzero(pf >= 24)
x14 = np.count_nonzero(pf >= 14)
x4 = np.count_nonzero(pf >= 4)
x2 = np.count_nonzero(pf >= 2)
 
if x74:
    ans += x74
if x24 and x2:
    ans += x24*(x2-1)
if x14 and x4:
    ans += x14*(x4-1)
if x2 and x4>=2:
    tmp = x4*(x4-1)//2
    ans += tmp*(x2-2)

print(ans)

Solution (Python):
import bisect
import math
n = int(input())
if n == 1:
    print(0)
    exit()

def get_primenumber(N):
    
    prime_list = [2]
    
    for num in range(3,N+1,2):
      
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list

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

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

sosuu = get_primenumber(100)

sosuu_list = [0] * len(sosuu)

for i in range(2, n+1):
    a = factorization(i)
    for j in a:
        index = bisect.bisect_left(sosuu, j[0])
        sosuu_list[index] += j[1]
    over_74 = len([x for x in sosuu_list if x >= 74])
    over_24 = len([x for x in sosuu_list if x >= 24])
    over_14 = len([x for x in sosuu_list if x >= 14])
    over_4  = len([x for x in sosuu_list if x >= 4])
    over_2  = len([x for x in sosuu_list if x >= 2])
    ans = over_74 + over_24 * (over_2 - 1) + over_14 * (over_4 - 1)
    if over_4 >= 2:
        ans += combinations_count(over_4, 2) * max(0, (over_2 - 2))

print(ans)

Solution (Python):
import math
def comb(a,b):
    if a < b:
        return 0
    return math.factorial(a)//(math.factorial(a-b)*math.factorial(b))
N = int(input())
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]]
primelist = primes(N)
primes = {}
for i in primelist:
    a = sum(int(N/(i**j)) for j in range(1,8))
    primes[i] = a
cand = sorted(list(primes.values()))
ans1 = len([i for i in cand if i >= 74])
ans2 = len([i for i in cand if i >= 24])*(len([i for i in cand if i >= 2])-1)
ans3 = len([i for i in cand if i >= 14])*(len([i for i in cand if i >= 4])-1)
ans4 = comb(len([i for i in cand if i >= 4]),2)*(len([i for i in cand if i >= 2])-2)
print(ans1+ans2+ans3+ans4)

Solution (Python):
from collections import Counter


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())
a = [0] * (n + 1)
for i in range(1, n + 1):
  c = prime_factorize(i)
  for i in c:
    a[i] += 1

a3, a5, a15, a25, a75 = 0, 0, 0, 0, 0
for i in a:
  if i >= 74:
    a75 += 1 
  if i >= 24:
    a25 += 1 
  if i >= 14:
    a15 += 1 
  if i >= 4:
    a5 += 1 
  if i >= 2:
    a3 += 1 


ans = a75 + a25 * (a3 - 1) + a15 * (a5 - 1) + a5 * (a5 -1) * (a3 - 2) // 2 
print(ans)

Solution (Python):
def make_divs(n):
    divisors = {}
    d = 2
    while n > 1:
        if n % d == 0:
           divisors[d] = 0
        while n % d == 0:
            divisors[d] += 1
            n //= d
        d += 1
    return divisors

n = int(input())
nn = 1
for i in range(1,n+1):
    nn *= i
if n < 10:
    print(0)
    exit()
div = make_divs(nn)
cnt = 0
t,f = 0,0
a,b = 0,0
u,s = 0,0
aa = 0
for v in div.values():
    if v >= 74:
        aa += 1
    if v >= 4:
        f += 1
    if 4 > v >= 2:
        t += 1
    if v >= 24:
        a += 1
    if 24 > v >= 2:
        b += 1
    if v >= 14:
        u += 1
    if 14 > v >= 4:
        s += 1

tmp = (f)*(f-1)*(f-2)//2 if f > 2 else 0
tmp2 = (f)*(f-1)*t//2 if f > 1 else 0
tmp3 = a*(a-1) if a > 1 else 0
tmp4 = u*(u-1) if u > 1 else 0
print(tmp + tmp2 + a*b + u*s + tmp3 + tmp4 + aa)

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


def p_d():
    from collections import Counter
    N = int(input())
    li = []
    for i in range(1, N + 1):
        li.extend(prime_factorize(i))
    prime_list = Counter(li).values()

    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)


if __name__ == '__main__':
    p_d()

Solution (Python):
n = int(input())
if 9 >= n:
    print(0)
    exit()

dic = {}
dic[2] = 1
dic[3] = 1

for i in range(4,n+1):
    
    for j in dic.keys():
        
        if i % j == 0:
            while i % j == 0:
                dic[j] += 1
                i //= j
                
    if i != 1:
        dic[i] = 1


ans = {}
ans[2] = 0
ans[4] = 0
ans[14] = 0
ans[24] = 0
ans[74] = 0
for i,j in dic.items():
    for k in ans.keys():
        if j >= k:
            ans[k] +=1


count = 0
count += ans[24]*(ans[2]-1)
count += ans[74]
count += ans[14]*(ans[4]-1)
count += (ans[4]*(ans[4]-1)//2)*(ans[2]-2)
print(count)

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


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

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

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


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



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