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):
def factorization(n):
    ans = {}
    i = 2
    while n > 1:
        count = 0
        while n % i == 0:
            n = n // i
            count += 1
        if count != 0:
            ans[i] = count
        i += 1
    return ans


N = int(input())
primes = {}
for n in range(2, N + 1):
    factors = factorization(n)
    for f in factors:
        if f in primes:
            primes[f] += factors[f]
        else:
            primes[f] = factors[f]

ans = 0

for p in primes:
    if primes[p] >= 74:
        ans += 1


for p in primes:
    for q in primes:
        if p == q:
            continue
        if primes[p] >= 24 and primes[q] >= 2:
            ans += 1
        if primes[p] >= 14 and primes[q] >= 4:
            ans += 1


for p in primes:
    if primes[p] >= 2:
        for q in primes:
            if p != q and primes[q] >= 4:
                for r in primes:
                    if p != r and q != r and primes[r] >= 4 and q < r:
                        ans += 1
print(ans)

Solution (Python):
data = int(input())
e = [0] * (data+1)
for i in range(2, data+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 sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def pm(X):
    res = {}
    for i in range(2, int(X ** 0.5) + 1):
        if X % i == 0:
            res[i] = 0
            while X % i == 0:
                X //= i
                res[i] += 1
    if X > 1:
        res[X] = 1
    return res


def solve():
    N = Scanner.int()

    
    M = defaultdict(int)
    for i in range(2, N + 1):
        tmp = i
        for j in range(2, int(i ** 0.5) + 1):
            while tmp % j == 0:
                M[j] += 1
                tmp //= j
        if tmp > 1:
            M[tmp] += 1

    ans = 0

    
    for p in range(2, N+1):
        if M[p] >= 74:
            ans += 1

    
    
    for p in range(2, N + 1):
        for q in range(2, N+1):
            if p == q:
                continue
            if M[p] >= 2 and M[q] >= 24:
                ans += 1
            if M[p] >= 4 and M[q] >= 14:
                ans += 1

    
    for p in range(2, N+1):
        for q in range(p + 1, N + 1):
            for r in range(2, N + 1):
                if p == r:
                    continue
                if q == r:
                    continue
                if M[p] >= 4 and M[q] >= 4 and M[r] >= 2:
                    ans += 1
    print(ans)


def main():
    
    solve()


if __name__ == "__main__":
    main()

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def pm(X):
    res = {}
    for i in range(2, int(X ** 0.5) + 1):
        if X % i == 0:
            res[i] = 0
            while X % i == 0:
                X //= i
                res[i] += 1
    if X > 1:
        res[X] = 1
    return res


def solve():
    N = Scanner.int()
    M = defaultdict(int)
    for i in range(2, N + 1):
        d = pm(i)
        for k, v in d.items():
            M[k] += v

    ans = 0
    for r in range(2, N + 1):
        for p in range(2, N+1):
            for q in range(p + 1, N + 1):
                if p == r:
                    continue
                if q == r:
                    continue
                if M[r] >= 2 and M[p] >= 4 and M[q] >= 4:
                    ans += 1

    for p in range(2, N + 1):
        if M[p] >= 74:
            ans += 1

    for p in range(2, N + 1):
        for q in range(2, N+1):
            if p == q:
                continue
            if M[p] >= 14 and M[q] >= 4:
                ans += 1
            if M[p] >= 24 and M[q] >= 2:
                ans += 1
    print(ans)


def main():
    
    solve()


if __name__ == "__main__":
    main()

Solution (Python):
import math

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

def DictAppend(n,d):
    if n in d:
        d[n]+=1
    else:
        d[n]=1

for i in range(1,n+1):
    if i==1:
        continue
    now=i
    while now%2==0:
        now//=2
        DictAppend(2,D)
    p=3
    while p<=math.sqrt(i):
        while now%p==0:
            now//=p
            DictAppend(p,D)
        p+=2
        if now==1:
            break
    if now>math.sqrt(i):
        DictAppend(now,D)

P=[74,24,14,4,2]
C=[0,0,0,0,0]
for d in D:
    for i in range(5):
        if D[d]>=P[i]:
            C[i]+=1

ans=0
ans+=C[0] 
if C[4]>1:
    ans+=C[1]*(C[4]-1) 
if C[3]>1:
    ans+=C[2]*(C[3]-1) 
if C[4]>2:
    ans+=C[3]*(C[3]-1)//2*(C[4]-2) 
print(ans)

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


e = [0] * (n + 1)
for i in range(2, n + 1):
	tmp = i
	for j in range(2, i + 1):
		while tmp % j == 0:
			e[j] += 1
			tmp //= 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 sys
import math

input = sys.stdin.readline


def prime_factorization(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors


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

    ef = [0] * (N + 1)
    ans = 0
    for i in range(2, N + 1):
        x = prime_factorization(i)
        for xx in x:
            ef[xx] += 1

    a, b, c, d, e = 0, 0, 0, 0, 0
    for ee in ef:
        if ee >= 74:
            a += 1
            b += 1
            c += 1
            d += 1
            e += 1
        elif ee >= 24:
            a += 1
            b += 1
            c += 1
            d += 1
        elif ee >= 14:
            a += 1
            b += 1
            c += 1
        elif ee >= 4:
            a += 1
            b += 1
        elif ee >= 2:
            a += 1

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from functools import reduce

def comb(n, r):
    if n < 0 or r < 0 or r > n:
        return 0
    r = min(r, n - r)
    if r == 0: return 1

    numer = [n - r + i + 1 for i in range(r)]
    denom = [i + 1 for i in range(r)]

    for i in range(1, r):
        divisor = denom[i]
        if divisor > 1:
            offset = (n - r) % (i + 1)
            for j in range(i, r, i+1):
                numer[j - offset] //= divisor
                denom[j] //= divisor

    return reduce(lambda x, y: x*y if y > 1 else x, numer)

def sieve(n):
    a = [1] * (n + 1)
    a[0] = a[1] = False
    for i in range(4, n+1, 2):
        a[i] = False
    lim = int(n**0.5) + 1
    for i in range(3, lim + 1, 2):
        if a[i]:
            for j in range(i + i, n + 1, i):
                a[j] = False
    return a

N = int(input())

factors = []
sv = sieve(N)
for p in range(2, N+1):
    if sv[p]:
        n = N
        x = 0
        while n // p > 0:
            n //= p
            x += n
        if x > 0:
            factors.append([p, x])


ans = 0
for xx in [[[4,2],[2,1]],[[14,1],[4,1]],[[24,1],[2,1]],[[74,1]]]:
    c = 1
    done = 0
    for i, x in enumerate(xx):
        s = sum(f[1] >= x[0] for f in factors)
        s = max(0, s - done)
        if s < x[1]:
            c = 0
            break
        else:
            c *= comb(s, x[1])
            done += x[1]
    ans += c

print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from collections import Counter
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


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(readline())
table = []
for i in range(1, n + 1):
    table += prime_decomposition(i)
counter = list(Counter(table).values())
ans = [0, 0, 0, 0, 0]
for v in counter:
    if v >= 2:
        ans[0] += 1
        if v >= 4:
            ans[1] += 1
            if v >= 14:
                ans[2] += 1
                if v >= 24:
                    ans[3] += 1
                    if v >= 74:
                        ans[4] += 1
if n < 10:
    print(0)
    exit()
print(ans[4] + ans[3] * (ans[0] - 1) + ans[2] * (ans[1] - 1) + (ans[0] - 2) * cmb(ans[1], 2))

Solution (Python):
import math

def decompose(d, n):
    limit = (int)(math.sqrt(n)) + 1
    for i in range(2, limit):
        while n % i == 0:
            if i not in d:
                d[i] = 0
            d[i] += 1
            n //= i
    if n != 1:
        if n not in d:
            d[n] = 0
        d[n] += 1

def main():
    N = int(input())
    D = {}
    for i in range(2, N + 1):
        decompose(D, i)
    f2, f4, f14, f24, f74 = 0, 0, 0, 0, 0
    for d in D:
        n = D[d]
        if n >= 74:
            f74 += 1
        if n >= 24:
            f24 += 1
        if n >= 14:
            f14 += 1
        if n >= 4:
            f4 += 1
        if n >= 2:
            f2 += 1
    
    if f2 == 0 or f4 < 2:
        print(0)
        return
    
    ans = f74
    
    ans += f24 * (f2 - 1)
    
    ans += f14 * (f4 - 1)
    
    ans += f4 * (f4 - 1) // 2 * (f2 - 2)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter

n=int(input())

def soinsu(n):
    S = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            n //= i
            S.append(i)
    if S == []:
        S.append(n)
    else:
        if n != 1:
            S.append(n)
    return S
L=[]
if n >= 2:
    for i in range(2, n + 1):
        L = L + soinsu(i)
LC = Counter(L)

C2 = 0
C4 = 0
C14 = 0
C24 = 0
C74 = 0

for v in LC.values():
    if v >= 2:
        C2 += 1
        if v >= 4:
            C4 += 1
            if v >= 14:
                C14 += 1
                if v >= 24:
                    C24 += 1
                    if v >= 74:
                        C74 += 1

r = C4 * (C4 - 1) // 2 * (C2 - 2) + C14 * (C4 - 1) + C24 * (C2 - 1) + C74

print(r)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

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(n):
    return len(list(filter(lambda x: x >= n-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())
def is_p(k):
  for i in range(2,int(k**0.5)+1):
    if k%i == 0:
      return False
  return True
p = []
for i in range(2,n+1):
  if is_p(i):
    p.append(i)
l = len(p)
q =[0]*l
for i in range(2,n+1):
  for j in range(l):
    if i == 1:
      break
    while i%p[j] == 0:
      q[j] += 1
      i /= p[j]
c = 0
for qi in q:
  if qi >= 74:
    c += 1
o2 = 0
o4 = 0
o14 = 0
o24 = 0
for qi in q:
  if qi >= 24:
    o24 += 1
  elif qi >= 14:
    o14 += 1
  elif qi >= 4:
    o4 += 1
  elif qi >= 2:
    o2 += 1
c += o24*(o2+o4+o14+o24-1)
c += (o14+o24)*(o4+o14+o24-1)
c += (o2+o4+o14+o24-2)*(o4+o14+o24)*(o4+o14+o24-1)//2  
print(c)

Solution (Python):

import math


def prime_factorization(x):
    if x == 1:
        return {1: 1}

    notprime = {}
    pf = {}
    for y in range(2, math.ceil(math.sqrt(x)) + 1):
        if y not in notprime.keys():
            if x % y == 0:
                pf[y] = 0
                while x % y == 0:
                    x //= y
                    pf[y] += 1
            
            coef = 2
            while coef * y < x:
                notprime[coef * y] = True
                coef += 1
    if x > 1:
        pf[x] = 1    
    return pf


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

    
    pf_all = {}
    for x in range(2, n + 1):
        pf = prime_factorization(x)
        for k, v in pf.items():
            if k not in pf_all.keys():
                pf_all[k] = v
            else:
                pf_all[k] += v

    pf_cand = [v for k, v in pf_all.items() if v > 1]
    pf_cand.sort()
    possible_divisors = [1, 3, 5, 15, 25, 75]
    
    def dfs(curr, rest, cnt):
        if curr > 75:
            return cnt
        if not rest:
            if curr == 75:
                return cnt + 1
            else:
                return cnt
        
        l = rest[-1]
        new_rest = rest[:-1]
        for p in possible_divisors:
            if p - 1 <= l:
                cnt = dfs(curr * p, new_rest, cnt)
            else:
                break
        return cnt
            
    print(dfs(1, pf_cand, 0))


if __name__ == "__main__":
    submit()

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

for i in range(2, n+1):
    now = i
    for j in range(2, i+1):
        while now % j == 0:
            p[j] += 1
            now //= j


def cnt(m):
    return len(list(filter(lambda x: x >= m, p)))


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

Solution (Python):
from math import sqrt, ceil
from collections import defaultdict
def prime(N):
    temp = [True]*(N+1)
    temp[0] = temp[1] = False
    for i in range(2, ceil(sqrt(N+1))):
        if temp[i]:
            temp[i+i::i] = [False]*(len(temp[i+i::i]))                            
    primes = [ n for n in range(N+1) if temp[n] ]
    return primes
n = int(input())
dic = defaultdict(lambda:0)
p = prime(n)
for i in range(1,n+1):
    for j in p:
        while i % j == 0:
            i //= j
            dic[j] += 1
        if i == 1:
            break
a = 0 
b = 0 
c = 0 
d = 0 
e = 0 
for i in dic.keys():
    if dic[i] >= 74:
        a += 1
    if dic[i] >= 24:
        b += 1
    if dic[i] >= 14:
        c += 1
    if dic[i] >= 4:
        d += 1
    if dic[i] >= 2:
        e += 1
ans = 0
ans += a
ans += b*(e-1)
ans += c*(d-1)
ans += d*(d-1)*(e-2)//2
print(ans)

Solution (Python):
N = int(input())
P = [1]*(N+1)
for i in range(1,N+1):
    n = i
    for j in range(2,N+1):
        while n%j==0:
            P[j]+=1
            n//=j
P = [p for p in P if p>1]
N = len(P)-1
cnt = 0
B = [1,3,5,15,25,75]
def f(k,d):
    global N,P,cnt,B
    if d==75:
        cnt += 1
        return
    elif d>75 or k>N:
        return
    for i in range(1,P[k]+1):
        if i in B:
            f(k+1,d*i)
f(0,1)
print(cnt)

Solution (Python):
import numpy as np
n = int(input())
ans = 0

prime = [1]*100
prime = np.array(prime)
for i in range(2,n+1):
    temp = 1
    for j in range(2,100):
        while i%j == 0:
            i //= j
            prime[j] += 1
    
p75 = prime//75
p25 = prime//25
p15 = prime//15
p5 = prime//5
p3 = prime//3
for i in range(100):
    if p75[i] >= 1:
        ans += 1
    if p25[i] >= 1:
        for j in range(i+1,100):
            if p3[j] >= 1:
                ans += 1
                
    if p15[i] >= 1:
        for j in range(i+1,100):
            if p5[j] >= 1:
                ans += 1
    if p5[i] >= 1:
        for j in range(i+1,100):
            if p15[j] >= 1:
                ans += 1
            if p5[j] >= 1:
                for k in range(j+1,100):
                    if p3[k] >= 1:
                        ans += 1
                        
            if p3[j] >= 1:
                for k in range(j+1,100):
                    if p5[k] >= 1:
                        ans += 1 
    if p3[i] >= 1:
        for j in range(i+1,100):
            if p25[j] >= 1:
                ans += 1
            if p5[j] >= 1:
                for k in range(j+1,100):
                    if p5[k] >= 1:
                        ans += 1 


print(ans)

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

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

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

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
N=int(input())
pl=[2]
for i in range(3,N+1):
  if all(i%p!=0 for p in pl):
    pl.append(i)
pd={}
Nf=math.factorial(N)
for i in range(len(pl)):
  if Nf%pl[i]==0:
    pd[pl[i]]=1
    Nf//=pl[i]
    while Nf%pl[i]==0:
      pd[pl[i]]+=1
      Nf//=pl[i]
l74=[]
l24=[]
l14=[]
l4=[]
l2=[]
for i in range(len(pd)):
  if pd[pl[i]]>=74:
    l74.append(pl[i])
  if pd[pl[i]]>=24:
    l24.append(pl[i])
  if pd[pl[i]]>=14:
    l14.append(pl[i])
  if pd[pl[i]]>=4:
    l4.append(pl[i])
  if pd[pl[i]]>=2:
    l2.append(pl[i])
ans1=len(l74)
ans2=len(l24)*(len(l2)-1) if len(l2)>=1 else 0
ans3=len(l14)*(len(l4)-1) if len(l4)>=1 else 0
ans4=(len(l4)-1)*len(l4)*(len(l2)-2)//2 if len(l2)>=2 else 0
print(ans1+ans2+ans3+ans4)

Solution (Python):
n = int(input())
e = [0 for _ 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)))

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    n = int(input())
    
    prime_list = [0]*100
    
    def prime_decomp(n):
        i = 2
        res = []
        while i ** 2 <= n:
            while n % i==0:
                n //= i
                res.append(i)
            i += 1
        if n > 1:
            res.append(n)
        return res
    for i in range(1, n+1):
        l = prime_decomp(i)
        for j in l:
            prime_list[j] += 1
    
    a,b,c,d,e = 0,0,0,0,0
    for i in prime_list:
        if i >= 74:
            a += 1
        if i >= 24:
            b += 1
        if i >= 14:
            c += 1
        if i >= 4:
            d += 1
        if i >= 2:
            e += 1
    
    res = a + b*(e-1) + c*(d-1) + d*(d-1)*(e-2)//2
    print(res)

if __name__ == '__main__':
    main()

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

prime=[]
for n in range(2, N+1):
    for i in range(2, n):
        if n % i == 0:
            break
    else:
        prime.append(n)


bucket=[0]*(N+1)
for i in range(2, N+1):
    for p in prime:
        while i % p == 0:
            i //= p
            bucket[p] += 1


cnt = 0
for i in range(2, N+1):
    if bucket[i] >= 74:
        cnt += 1
    if bucket[i] >= 24:
        cnt += len([bucket[j] for j in range(2, N+1) \
             if j != i and bucket[j] >= 2])
    if bucket[i] >= 14:
        cnt += len([bucket[j] for j in range(2, N + 1) \
                    if j != i and bucket[j] >= 4])
    if bucket[i] >= 4:
        for j in range(i+1, N+1):
            if j != i:
                if bucket[j] >= 4:
                    
                    cnt += len([bucket[k] for k in range(2, N + 1)\
                    if k != i and k != j and bucket[k] >= 2])
print(cnt)

Solution (Python):
N=int(input())
D=[0]*(N+1)
for i in range(2,N+1):
  a=i
  for j in range(2,i+1):
    while a%j==0:
      D[j]+=1
      a//=j
def num(x):
  cnt=0
  for i in D:
    if i>=x-1:
      cnt+=1
  return cnt

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

def dfs(i, c):
    key = (i, c)
    if key in memo:
        return memo[key]
    if c == 75:
        return 1
    if i == m:
        return 0
    k, v = p[i]
    r = 0
    for j in range(v + 1):
        if c * (j + 1) <= 75:
            r += dfs(i + 1, c * (j + 1))
    memo[key] = r
    return r

n = int(input())
index = defaultdict(int)

for x in range(2, n + 1):
    y = 2
    while y ** 2 <= x:
        while x % y == 0:
            x //= y
            index[y] += 1
        y += 1
    if x > 1:
        index[x] += 1

*p, = index.items()
m = len(p)
memo = {}

print(dfs(0, 1))

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


def prime_factorization(divs, n):
    while n % 2 == 0:
        divs[2] += 1
        n //= 2

    i = 3
    while i <= int(n ** .5) + 1:
        while n % i == 0:
            divs[i] += 1
            n //= i
        i += 2
    if n != 1:
        divs[n] += 1

    return divs


def num(m):
    return sum([value if key >= m else 0 for key, value in cnt_divs.items()])


N = int(input())
divs = defaultdict(int)
for n in range(2, N + 1):
    divs = prime_factorization(divs, n)

cnt_divs = Counter(divs.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 = int(input())

d = [0]* 101
for i in range(n+1):
    i0 = i + 0
    for j in range(2, i0+1):
        while i % j == 0:
            d[j] += 1
            i = i //j

d.sort()
d1 = [i for i in d if i >=2]

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

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())
cnt=[0]*(n+1)
s=set([2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,91,97])
for k in range(1,n+1):
  for i in range(2,k+1):
    if k%i==0 and i in s:
      m=k
      while m%i==0:
        cnt[i]+=1
        m//=i
cnt2,cnt4,cnt14,cnt24,cnt74=0,0,0,0,0
for i in range(2,n+1):
  if cnt[i]>=2:
    cnt2+=1
  if cnt[i]>=4:
    cnt4+=1
  if cnt[i]>=14:
    cnt14+=1
  if cnt[i]>=24:
    cnt24+=1
  if cnt[i]>=74:
    cnt74+=1
ans=cnt74+cnt14*(cnt4-1)+cnt24*(cnt2-1)+(cnt2-2)*cnt4*(cnt4-1)//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):
from collections import Counter
from operator import mul
from functools import reduce
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())
    factors = [1]
    for i in range(1, N+1):
        factors += prime_factorize(i)
    cnt = Counter(factors)
    cntlst = list(cnt.values())
    
    count74 = sum([1 for val in cntlst if val>=74])
    count24 = sum([1 for val in cntlst if val>=24])
    count14 = sum([1 for val in cntlst if val>=14])
    count4  = sum([1 for val in cntlst if val>=4])
    count2  = sum([1 for val in cntlst if val>=2])
    
    ans = count74 + count24*(count2-1) + count14*(count4-1) \
                + (count4*(count4-1)*(count2-2))//2
    print(ans)

main()

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

if n == 1:
    print(0)
    exit()

import math
def div(m):
  d = {}
  temp = int(math.sqrt(m))+1
  for i in range(2, temp):
    while m%i== 0:
      m //= i
      if i in d:
        d[i] += 1
      else:
        d[i] = 1
  if d == {}:
    d[m] = 1
  else:
    if m in d:
      d[m] += 1
    elif m != 1:
      d[m] =1
  return d

D = {}
for i in range(2, n+1):
    d = div(i)
    for k, v in d.items():
        if k in D:
            D[k] += v
        else:
            D[k] = v


A = set()
B = set()
P = set()
Q = set()
R = set()
for k, v in D.items():
    if v >= 74:
        R.add(k)
    if v >= 24:
        P.add(k)
    if v >= 14:
        Q.add(k)
    if v >= 4:
        B.add(k)
    if v >= 2:
        A.add(k)

ans = 0
b = len(B)
for a in A:
    if a not in B:
        ans += b*(b-1)//2
    else:
        ans += (b-1)*(b-2)//2

p = len(P)
for a in A:
    if  a not in P:
        ans += p
    else:
        ans += p-1

q = len(Q)
for b in B:
    if b not in Q:
        ans += q
    else:
        ans += q-1

ans += len(R)
print(ans)

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

if n == 1:
    print(0)
    exit()

import math
def div(m):
  d = {}
  temp = int(math.sqrt(m))+1
  for i in range(2, temp):
    while m%i== 0:
      m //= i
      if i in d:
        d[i] += 1
      else:
        d[i] = 1
  if d == {}:
    d[m] = 1
  else:
    if m in d:
      d[m] += 1
    elif m != 1:
      d[m] =1
  return d

D = {}
for i in range(2, n+1):
    d = div(i)
    for k, v in d.items():
        if k in D:
            D[k] += v
        else:
            D[k] = v


A = set()
B = set()
P = set()
Q = set()
R = set()
for k, v in D.items():
    if v >= 74:
        R.add(k)
    if v >= 24:
        P.add(k)
    if v >= 14:
        Q.add(k)
    if v >= 4:
        B.add(k)
    if v >= 2:
        A.add(k)

ans = 0
b = len(B)
for a in A:
    if a not in B:
        ans += b*(b-1)//2
    else:
        ans += (b-1)*(b-2)//2

p = len(P)
for a in A:
    if  a not in P:
        ans += p
    else:
        ans += p-1

q = len(Q)
for b in B:
    if b not in Q:
        ans += q
    else:
        ans += q-1

ans += len(R)
print(ans)

Solution (Python):
N = int(input())
S = [0] * 100
c74, c24, c14, c4, c2 = 0, 0, 0, 0, 0
for i in range(2, N + 1):
    a = i
    for j in range(2, i + 1):
        while a % j == 0:
            a //= j 
            S[j] += 1
            if S[j] == 74:
                c74 += 1
            if S[j] == 24:
                c24 += 1
            if S[j] == 14:
                c14 += 1
            if S[j] == 4:
                c4 += 1
            if S[j] == 2:
                c2 += 1
        if a == 1:
            break
ans = c74 + c24 * (c2 - 1) + c14 * (c4 - 1) + c4 * (c4 - 1) * (c2 - 2)  // 2
print(ans)