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())
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n + 1):
        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]] 
prime = primes(100)
primeCount = [0 for i in range(25)]

def searchSingle():
    res = 0
    for i in range(len(primeCount)):
        if primeCount[i] >= 74:
            res += 1
    return res

def searchDouble():
    res = 0
    for i in range(len(primeCount)):
        for j in range(len(primeCount)):
            cnt_i = primeCount[i]
            cnt_j = primeCount[j]
            if cnt_i >= 14 and cnt_j >= 4 and i != j:
                res += 1
            if cnt_i >= 24 and cnt_j >= 2 and i != j:
                res += 1
    return res

def searchTriple():
  res=0
  for i in range(len(primeCount)):
    for j in range(len(primeCount)):
      for k in range(j+1,len(primeCount)):
        if primeCount[i] >=2 and primeCount[j] >=4 and primeCount[k] >=4 and i!=j and j!=k and i!=k:
          res+=1
  return res

for i in range(2, n+1):
    cnt=i
    for j in range(len(prime)):
        if cnt % prime[j] == 0:
            while cnt % prime[j] == 0:
                cnt//= prime[j]
                primeCount[j] += 1
print(searchSingle() + searchDouble() + searchTriple())

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

def decompose(n):
    prime_exp = [0] * (n+1)
    for i in range(2, n+1):
        exponent = 0
        while(n % i == 0):
            n /= i
            exponent += 1
        if exponent != 0:
            prime_exp[i] = exponent
    return prime_exp

def decompose_fact(n):
    prime_exp = [0] * (n+1)
    for i in range(2, n+1):
        for j, k in enumerate(decompose(i)):
            prime_exp[j] += k
    return prime_exp

def solve(n):
    ans = 0
    dec_f = decompose_fact(n)
    for i in range(n+1):
        if dec_f[i] >= 74:
            ans += 1

    for i in range(n+1):
        for j in range(n+1):
            if i != j and (dec_f[i] >= 2 and dec_f[j] >= 24):
                ans += 1

    for i in range(n+1):
        for j in range(n+1):
            if i != j and (dec_f[i] >= 4 and dec_f[j] >= 14):
                ans += 1

    for i in range(n+1):
        for j in range(n+1):
            for k in range(n+1):
                if i != j and i != k and j != k and j < k and (dec_f[i] >= 2 and dec_f[j] >= 4 and dec_f[k] >= 4):
                    ans += 1
    return ans

print(solve(N))

Solution (Python):
import collections
import itertools

yakusuu = {}
for j in range(2, 101):
    I = j
    s = 0
    R = int(I)
    L = []
    while s == 0:
        for i in range(2, R + 1):
            if I % i == 0:
                I = I / i
                if I == 1:
                    s = 1
                L.append(i)
                break
    if len(L) == 1:
        yakusuu[R] = [R]
    else:
        yakusuu[R] = L

n = int(input())

cnt = 0

for num in range(1, n + 1):
    tmp = []
    if n == 1:
        print(0)
        exit()
    for i in range(2, num + 1):
        tmp += yakusuu[i]

tmp = dict(collections.Counter(tmp))
tmp_array = sorted(list(tmp.keys()))

cnt = 0

for i in tmp_array:
    if tmp[i] >= 74:
        cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif tmp[i] >= 14 and tmp[j] >= 4:
            cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif tmp[i] >= 24 and tmp[j] >= 2:
            cnt += 1

res_array = list(itertools.combinations(tmp_array, 3))
for i in range(len(tmp_array)):
    for j in range(len(tmp_array)):
        for k in range(j+1, len(tmp_array)):
            if (j == i) or (i == k): continue
            if tmp[tmp_array[i]] >= 2 and tmp[tmp_array[j]] >= 4 and tmp[tmp_array[k]] >= 4:
                cnt += 1

print(cnt)

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

factor = [0 for _ in range(N + 1)]

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


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

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):
def main():
    """
    input:
        1 <= N <= 100

    output:
        N! の約数のうち、七五数 は何個
        七五数とは約数をちょうど 75個持つ正の整数
    """
    N = int(input())

    ans = f(N)
    print(ans)


def f(N):
    """素因数分解までは浮かんだ
    """
    factor_all = [[] for _ in range(N + 1)]
    factors = [0] * (N + 1)
    for i in range(2, N + 1):
        
        x = i
        for div in range(2, x + 1):
            while x % div == 0:
                factors[div] += 1
                factor_all[i].append(div)
                x //= div

    
    
    ans1 = editorial(factors)
    ans2 = ref(factors)
    assert ans1 == ans2

    return ans1


def editorial(factors):
    factors = factors

    def a(x):
        n = 0
        for f in factors:
            if f >= x - 1:
                n += 1

        return n

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

    return ans


def ref(factors):
    """https://beta.atcoder.jp/contests/abc114/submissions/3704878
    """
    
    
    nums = [n for n in factors if n >= 2]

    
    divs = [i for i in range(1, 75+1) if 75 % i == 0]

    
    
    
    
    n_nums = len(nums)
    dp = [[0] * (75 + 1) for _ in range(n_nums + 1)]
    dp[0][1] = 1

    
    
    from itertools import product
    div_pairs = [(d1, d2)
                 for d1, d2 in product(divs, repeat=2)
                 if d1 * d2 <= 75]

    for i in range(n_nums):
        for d1, d2 in div_pairs:
            
            if d1 * d2 in (45, 9):
                continue

            
            
            
            

            
            if nums[i] >= d2 - 1:
                
                
                dp[i+1][d1 * d2] += dp[i][d1]

    ans = dp[n_nums][75]
    return ans


if __name__ == '__main__':
    main()

Solution (Python):
def D():
    N = int(input())
    numberlist = [0 for i in range(N + 1)]
    for i in range(1, N + 1):
        tmp = i
        for j in range(2, i + 1):
            while tmp % j == 0:
                numberlist[j] += 1
                tmp /= j
    anslist = []
    for p in range(N + 1):
        if numberlist[p] + 1 >= 75:
            anslist.append(pow(p, 74))
        for q in range(N + 1):
            if p != q and numberlist[p] + 1 >= 15 and numberlist[q] + 1 >= 5:
                anslist.append(pow(p, 14) * pow(q, 4))
            if p != q and numberlist[p] + 1 >= 25 and numberlist[q] + 1 >= 3:
                anslist.append(pow(p, 24) * pow(q, 2))
            for r in range(N + 1):
                if p != q and q != r and r != p and numberlist[p] + 1 >= 5 and numberlist[q] + 1 >= 5 and numberlist[r] + 1 >= 3:
                    anslist.append(pow(p, 4) * pow(q, 4) * pow(r, 2))
    ans = 1
    anslist.sort()
    for i in range(1, len(anslist)):
        if anslist[i] != anslist[i - 1]:
            ans += 1
    if len(anslist) == 0:
        ans = 0
    print(ans)
D()

Solution (Python):
import collections
import itertools

prime = [2]
for i in range(3,100):
    check = True
    for k in range(2,i):
        if i%k == 0:
            check = False
    if check:
        prime.append(i)

def factorial(n):
    ans = []
    start = 0
    while n != 1:
        if n%prime[start] == 0:
            n = n//prime[start]
            ans.append(prime[start])
        else:
            start += 1
    return ans

n = int(input())
factor = [i for i in range(1,n+1)]
a = collections.Counter(factor)

for i in a:
    if i not in prime:
        temp = factorial(i)
        for k in range(len(temp)):
            a[temp[k]] += 1
        a[i] = 0

test = []
for i in a:
    if a[i] >= 2:
        test.append(i)
counter = 0
look2 = list(itertools.permutations(test,2))
look3 = list(itertools.permutations(test,3))

for i in range(len(test)):
    if a[test[i]] >= 74:
        counter += 1

for i in range(len(look2)):
    if a[look2[i][0]] >= 2 and a[look2[i][1]] >= 24:
        counter += 1
    if a[look2[i][0]] >= 4 and a[look2[i][1]] >= 14:
        counter += 1

for i in range(len(look3)):
    if a[look3[i][0]] >= 2 and a[look3[i][1]] >= 4 and a[look3[i][2]] >= 4 and look3[i][1] < look3[i][2]:
        counter += 1

print(counter)

Solution (Python):
import math
n=int(input())
ans=0
tmp=[0 for i in range(n+1)]
for i in range(2,n+1):
    now=i
    for j in range(2,n+1):
        while now%j==0:
            tmp[j]+=1
            now//=j
def solve(x):
    tmp1=len(list(filter(lambda y:y>=x-1,tmp)))
    return tmp1
print(solve(75)+solve(25)*(solve(3)-1)+solve(15)*(solve(5)-1)+
solve(5)*(solve(5)-1)*(solve(3)-2)//2)

Solution (Python):
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]
primeCount = [0 for i in range(25)]

def searchSingle():
    res = 0
    for i in range(len(primeCount)):
        if primeCount[i] >= 74:
            res += 1
    return res

def searchDouble():
    res = 0
    for i in range(len(primeCount)):
        for j in range(len(primeCount)):
            cnt_i = primeCount[i]
            cnt_j = primeCount[j]
            if cnt_i >= 14 and cnt_j >= 4 and i != j:
                res += 1
            if cnt_i >= 24 and cnt_j >= 2 and i != j:
                res += 1
    return res

def searchTriple():
  res=0
  for i in range(len(primeCount)):
    for j in range(len(primeCount)):
      for k in range(j+1,len(primeCount)):
        if primeCount[i] >=2 and primeCount[j] >=4 and primeCount[k] >=4 and i!=j and j!=k and i!=k:
          res+=1
  return res

for i in range(2, n+1):
    cnt=i
    for j in range(len(prime)):
        if cnt % prime[j] == 0:
            while cnt % prime[j] == 0:
                cnt//= prime[j]
                primeCount[j] += 1
print(searchSingle() + searchDouble() + searchTriple())

Solution (Python):
def D():
    N = int(input())
    tmplist = [0 for i in range(N + 1)]
    for i in range(1, N + 1):
        key = i
        for j in range(2, key + 1):
            while i % j == 0:
                tmplist[j] += 1
                i /= j
    ans = 0
    anslist = []
    for p in range(N + 1):
        if tmplist[p] + 1 >= 75:
            anslist.append(pow(p, 74))
        for q in range(N + 1):
            if p != q and tmplist[p] + 1 >= 25 and tmplist[q] + 1 >= 3:
                anslist.append(pow(p, 24) * pow(q, 2))
            if p != q and tmplist[p] + 1 >= 15 and tmplist[q] + 1 >= 5:
                anslist.append(pow(p, 14) * pow(q, 4))
            for r in range(N + 1):
                if p != q and q != r and r != p and tmplist[p] + 1 >= 5 and tmplist[q] + 1 >= 5 and tmplist[r] + 1 >= 3:
                    anslist.append(pow(p, 4) * pow(q, 4) * pow(r, 2))
    anslist.sort()
    ans = 1
    for i in range(1, len(anslist)):
        if anslist[i] != anslist[i - 1]:
            ans += 1
    if len(anslist) == 0:
        ans = 0
    print(ans)

D()

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=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]
primeCount=[0 for i in range(25)]

def searchSingle():
  res=0
  for i in range(len(primeCount)):
    if primeCount[i] >= 74:
      res+=1
  return res

def searchDouble():
  res=0
  for i in range(len(primeCount)):
    for j in range(len(primeCount)):
      cnt_i=primeCount[i]
      cnt_j=primeCount[j]
      if cnt_i >= 14 and cnt_j >= 4 and i != j:
        res+=1
      if cnt_i >=24 and cnt_j >=2 and i!=j:
        res+=1
  return res

def searchTriple():
  res=0
  for i in range(len(primeCount)):
    for j in range(len(primeCount)):
      for k in range(j+1,len(primeCount)):
        if primeCount[i] >=2 and primeCount[j] >=4 and primeCount[k] >=4 and i!=j and j!=k and i!=k:
          res+=1
  return res

for i in range(2,N+1):
  cnt=i
  for j in range(len(prime)):
    if cnt % prime[j] == 0:
      while cnt % prime[j] == 0:
        cnt//=prime[j]
        primeCount[j]+=1
        
print(searchSingle() + searchDouble() + searchTriple())

Solution (Python):
def find_prime(n):
    e = [0] * (n + 1)
    for tmp in range(2, n + 1):
        i = 2
        while(tmp != 1):
            if tmp % i == 0:
                tmp //= i
                e[i] += 1
            else:
                i += 1

    return(e)


def num(i):
    return len(list(filter(lambda x: x >= i, e)))


n = int(input())

e = find_prime(n)


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




def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


divList = [0 for i in range(n + 1)]

for i in range(2, n + 1):
    tmp = factorize(i)
    for j in range(len(tmp)):
        divList[tmp[j][0]] += tmp[j][1]


count = 0








for i in range(len(divList) - 2):
    for j in range(i + 1, len(divList) - 1):
        for k in range(j + 1, len(divList)):
            if divList[i] >= 2 and divList[j] >= 4 and divList[k] >= 4:
                
                count += 1
            if divList[i] >= 4 and divList[j] >= 2 and divList[k] >= 4:
                
                count += 1
            if divList[i] >= 4 and divList[j] >= 4 and divList[k] >= 2:
                
                count += 1
for i in range(len(divList) - 1):
    for j in range(i + 1, len(divList)):
        if (divList[i] >= 2 and divList[j] >= 24):
            
            count += 1
        if (divList[i] >= 24 and divList[j] >= 2):
            
            count += 1
        if (divList[i] >= 14 and divList[j] >= 4):
            
            count += 1
        if divList[i] >= 4 and divList[j] >= 14:
            
            count += 1
for i in range(len(divList)):
    if divList[i] >= 74:
        
        count += 1
print(count)

Solution (Python):
ps = [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]
N = int(input())
if N == 1:
  print(0)
  quit()
l = [0 for _ in range(98)]
def fac(n):
  for k in ps:
   if n == 1:
     break
   if n % k == 0:
    l[k] += 1
    fac(n // k)
    break

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

p = [k for k in l if k > 1]

ans = 0

def num(n):
  r = 0
  for k in p:
    if k >= n:
      r += 1
  return(r)

if p[0] >= 74:
  ans += 1



ans += (num(14) * (num(14) - 1))
ans += (num(14) * (num(4) - num(14)))


ans += (num(24) * (num(24) - 1))
ans += (num(24) * (num(2) - num(24)))


ans += (num(4) * (num(4) - 1) * (num(4) - 2) // 2)
ans += (num(4) * (num(4) - 1) //2) * (num(2) - num(4))

print(ans)

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()
cnt = [1] * 110
for num in range(1, N + 1):
    for i in range(2, 100):
        while num % i == 0:
            cnt[i] += 1
            num /= i

ans = 0
for i in range(N + 1):
    for j in range(N + 1):
        for k in range(N + 1):
            if i == j or j == k or k == i:
                continue
            if cnt[i] >= 3 and cnt[j] >= 5 and cnt[k] >= 5:
                ans += 1

ans /= 2

for i in range(N + 1):
    for j in range(N + 1):
        if i == j:
            continue
        if cnt[i] >= 5 and cnt[j] >= 15:
            ans += 1
        if cnt[i] >= 3 and cnt[j] >= 25:
            ans += 1
    if cnt[i] >= 75:
        ans += 1

print ans

Solution (Python):
import bisect
n = int(input())
if n == 1:
    print(0)
else:
    
    def prime_factor(n):
        ass = []
        for i in range(2,int(n**0.5)+1):
            while n % i==0:
                ass.append(i)
                n = n//i
        if n != 1:
            ass.append(n)
        return ass
    
    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]
    r = [0] * 25 
    
    
    for i in range(2,n+1):
        k = 0
        while i != 1:
            while i%p[k] == 0:
                i = i //p[k]
                r[k] += 1
            k += 1
    
    r.sort()
    c75 = bisect.bisect_left(r,74)
    c25 = bisect.bisect_left(r,24)
    c15 = bisect.bisect_left(r,14)
    c5 = bisect.bisect_left(r,4)
    c3 = bisect.bisect_left(r,2)
    res = (25-c75) + (25-c25)*(25-(c3+1)) +(25 -c15)*(25-(c5+1)) + (25-c5)*(25-(c5+1))*(25-(c3+2))//2
    print(res)

Solution (Python):
from collections import Counter
import math
def P(n, r):
  return math.factorial(n)//math.factorial(n-r)
def C(n, r):
  return P(n, r)//math.factorial(r)
n=int(input())
L=[]
for j in range(2,n+1):
    I=j
    s=0
    R=int(I)
    while s==0:
        for i in range(2,R+1):
            if I%i==0:
                I=I/i
                if I==1:
                    s=1
                L.append(i)
                break
C=Counter(L)
c=[0 for i in range(100)]
for i,j in C.most_common():
  c[j]+=1
 
s=0
s+=sum(c[4:])*(sum(c[4:])-1)*(sum(c[2:])-2)//2
s+=sum(c[14:])*(sum(c[4:])-1)
s+=sum(c[24:])*(sum(c[2:])-1)
s+=sum(c[74:])
print(s)

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):
print(sorted([391,543]+[2,8,14,32,75,123,148,153,250,323,491]*2+[1,3,11,35,42,131,324,354]*4+[384]*5+[49,86,170,227,529]*6+[0]*10)[int(input())])

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

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

def prime_div(n):
    arr = []
    f = 1
    while f:
        state = 0
        for i in range(2,int(n**2)+1):
            if n % i == 0:
                arr.append(i)
                n /= i
                state = 1
                break
        if state == 0:
            f = 0
    return arr
arr = []
for i in range(n):
    arr += prime_div(i+1)
arr.sort()
num_set = set(arr)

counter = []
counter_num = [0,0,0,0,0]
num_lst = [2, 4, 14, 24, 74]
for num in num_set:
    count = arr.count(num)
    counter.append(count)
    for i in range(5):
        if count >= num_lst[i]:
            counter_num[i]+=1


ans = 0

ans += counter_num[4]

if counter_num[3] > 0:
    ans += counter_num[3]*(counter_num[0]-counter_num[3])+counter_num[3]*(counter_num[3]-1)

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

Solution (Python):
n = int(input())
d = {}
for i in range(2, n+1):
    for j in range(2, i+1):
        while i%j == 0:
            i //= j
            d[j] = d.get(j, 0)+1
a = list(d.values())
dp = [[0]*74 + [1] for i in range(len(a)+1)]
for i in reversed(range(len(a))):
    for j in range(74):
        for k in range(a[i]+1):
            v = j+(j+1)*k
            if v > 74:
                break
            dp[i][j] += dp[i+1][v]
print(dp[0][0])

Solution (Python):

"""
Created on Sun Dec  2 21:50:38 2018
ABC114D
@author: maezawa
"""

nmax = int(100)
is_prime = [True]*(nmax+1)

is_prime[0] = False
is_prime[1] = False

for i in range(2, nmax//2):
    if is_prime[i] == True:
        for j in range(2*i,nmax+1,i):
            is_prime[j] = False

prime_numbers = [i for i in range(nmax+1) if is_prime[i]]

n = int(input())

prime_exps = [0]*len(prime_numbers)
for i in range(2,n+1):
    for k, p in enumerate(prime_numbers):
        if i<p:
            break
        while i>=p:
            if i%p == 0:
                i = i // p
                prime_exps[k] += 1
            else:
                break



ans = 0

cnt74 = 0
cnt24 = 0
cnt14 = 0
cnt4 = 0
cnt2 = 0


for i in prime_exps:
    if i>=74:
        cnt74 += 1
    if i>=24:
        cnt24 += 1
    if i>=14:
        cnt14 += 1
    if i>=4:
        cnt4 += 1
    if i>=2:
        cnt2 += 1

cnt = cnt74
if cnt24 > 0 and cnt2 > 1:
    cnt += cnt24*(cnt2-1)
if cnt14 > 0 and cnt4 > 1:
    cnt += cnt14*(cnt4-1)
if cnt4 > 1 and cnt2 > 2:
    cnt += cnt4*(cnt4-1)//2*(cnt2-2)
    
print(cnt)

Solution (Python):
N = int(input())
e = [0 for _ in range(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 num(m):
    return len(tuple(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 copy import deepcopy


def mk_array(init_val, *args):
    args = args[::-1]
    res = [init_val for _ in range(args[0])]
    for arg in args[1:]:
        res = [deepcopy(res) for _ in range(arg)]
    return res


N = int(input())
e = [0 for _ in range(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

counts = list(filter(lambda x: x > 0, e))
prim_count = len(counts)
counts = [0] + counts  
dp = mk_array(0, prim_count + 1, 75 + 1)
dp[0][1] = 1

for i in range(1, prim_count + 1):
    for j in range(1, 75 + 1):
        for k in range(min(counts[i], 75 // j - 1) + 1):
            dp[i][j * (k + 1)] += dp[i - 1][j]

print(dp[prim_count][75])

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

insu = {}
for i in range(2, n + 1):
    count = 0
    for j in insu:
        while i % j == 0:
            count += 1
            if j in insu:
                insu[j] += 1
            else:
                insu[j] = 1
            i //= j
    if count == 0:
        insu[i] = 1

insu = sorted(insu.items(), key=lambda x: -x[1])

count = 0
debug = []
def dfs(now, conb, mst):
    global count, insu
    if len(conb) == len(mst):
        count += 1
        debug.append(conb)
    else:
        for i in range(now, len(insu)):
            if insu[i][1] >= mst[len(conb)]:
                dfs(i + 1, conb + [insu[i][0]], mst)
dfs(0, [], [74])
dfs(0, [], [24, 2])
dfs(0, [], [2, 24])
dfs(0, [], [14, 4])
dfs(0, [], [4, 14])
dfs(0, [], [2, 4, 4])
dfs(0, [], [4, 2, 4])
dfs(0, [], [4, 4, 2])
print(count)

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


def is_prime(n):
    for i in range(2, n):
        if not n % i:
            return False
    return True


def n(m):
    return sum([True for i in p if i >= m])


l = [i for i in range(2, N+1) if is_prime(i)]
for i in range(2, N+1):
    for j in l:
        while not i % j:
            p[j] += 1
            i //= j

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

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

prime = [2]

for i in range(2, 101):
    for j in range(2, i-1):
        if i % j == 0:
            break
    else:
        prime.append(i)

factor = [0] * 101

for i in range(1, N+1):
    for p in prime:
        if i == 1:
            break
        while i % p == 0:
            i /= p
            factor[p] += 1

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

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 math import sqrt
from bisect import bisect_left as bi
n = int(input())
x,z = [0]*98,[]
for i in range(2,n+1):
	m = i
	while 1:
		f = 0
		for j in range(2,int(sqrt(m))+1):
			if m%j==0:
				x[j]+=1
				f = 1
				break
		if f: m//=j
		else:
			x[m]+=1
			break
for i in x[::-1]:
	if i>1: z.append(i)
p = len(z)
print(p-bi(z,74)+max((p-bi(z,24))*(p-bi(z,2)-1),0)+max((p-bi(z,14))*(p-bi(z,4)-1),0)+max((p-bi(z,4))*(p-bi(z,4)-1)*(p-bi(z,2)-2)//2,0))

Solution (Python):
n=int(input())
f=[]
w=[0,0,0,0,0]
for i in range(2,n+1):
    c=0
    r=int(i**0.5)
    for j in range(2,r+2):
        while i%j==0:
            c+=1
            i=i//j
        if c!=0:
            f.append([j,c])
            c=0
    if i!=1:
        f.append([i,1])
f.sort()
d=[]
ans=0
if n!=1:
    cou=f[0][1]
    for i in range(1,len(f)):
        if f[i][0]==f[i-1][0]:
            cou+=f[i][1]
        else:
            d.append(cou)
            cou=1
    d.append(cou)

    for i in d:
        for j,num in enumerate([2,4,14,24,74]):
            if i>=num:
                w[j]+=1
    ans=w[4]+w[3]*(w[0]-1)+w[2]*(w[1]-1)+w[1]*(w[1]-1)*(w[0]-2)//2
print(ans)

Solution (Python):
ps=[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]
n=int(input())
factor=[0]*len(ps)
for i in range(2,n+1):
    for j in range(len(ps)):
        p=ps[j]
        while True: 
            if i%p==0:
                i//=p
                factor[j]+=1
            else:
                break
res=0
if factor[0]>=74:
    res+=1
for i in range(len(ps)):
    for j in range(i+1,len(ps)):
        if factor[i]>=2 and factor[j]>=24:
            res+=1
        if factor[i]>=4 and factor[j]>=14:
            res+=1
        if factor[i]>=14 and factor[j]>=4:
            res+=1
        if factor[i]>=24 and factor[j]>=2:
            res+=1
for i in range(len(ps)):
    for j in range(i+1,len(ps)):
        for k in range(j+1,len(ps)):
            if factor[i]>=2 and factor[j]>=4 and factor[k]>=4:
                res+=1
            if factor[i]>=4 and factor[j]>=2 and factor[k]>=4:
                res+=1
            if factor[i]>=4 and factor[j]>=4 and factor[k]>=2:
                res+=1
print(res)

Solution (Python):
import math 
  


def primeFactors(n): 
      
    
    while n % 2 == 0: 
        arr[2] = arr[2] + 1 
        n = int(n / 2)
          
    
    
    for i in range(3,int(math.sqrt(n))+1,2): 
          
        
        while n % i== 0: 
            arr[i] = arr[i] + 1  
            n = int(n / i)
              
    
    
    if n > 2: 
        arr[n] = arr[n] + 1  


arr = [0] * 101
wow = [0] * 5
result = 0
n = int(input())

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


for i in arr:
    
    
    
    if i > 1: wow[0] = wow[0] + 1
    if i > 3: wow[1] = wow[1] + 1
    if i > 13: wow[2] = wow[2] + 1
    if i > 23: wow[3] = wow[3] + 1
    if i > 73: wow[4] = wow[4] + 1





x = wow[4]
y = wow[3] * (wow[0] - 1)
z = wow[2] * (wow[1] - 1)
a = wow[1] * (wow[1] - 1) * (wow[0] - 2) // 2
result = wow[4] + wow[3] * (wow[0] - 1) + wow[2] * (wow[1] - 1) + wow[1] * (wow[1] - 1) * (wow[0] - 2) // 2
print(result)

Solution (Python):
def make_divisor_list(num): 
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        i = 1
        while i*i <= num:
            if num%i == 0:
                divisor_list.append(i)
                divisor_list.append(num//i)

            i += 1
        divisor_list.append(num)

        return sorted(set(divisor_list))

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

        return ans
def usage(n):

    fct = factorize(n)
    return fct

def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

N = int(input())

NN = factorial(N)
usa = usage(NN)

ans = 0
div_75 = [3, 5, 15, 25, 75]


nums = [0 for _ in range(75+1)]

for i in usa:
    for divs in div_75:
        if i[1] >= divs-1:
            nums[divs] = nums[divs] + 1

ans = 0

if nums[5] >= 2:
    num_tmp = nums[5]
    tmp = factorial(num_tmp)//(2*factorial(num_tmp-2))
    ans += (nums[3] - 2) * tmp

if nums[15] >= 1:
    num_tmp = nums[15]
    tmp = num_tmp
    ans += (nums[5] - 1) * tmp

if nums[25] >= 1:
    tmp = nums[25]
    ans += (nums[3] - 1) * tmp

if nums[75] >= 1:
    ans += nums[75]


print(ans)

Solution (Python):
from collections import Counter as c
from itertools import permutations as p

def fact(n):
    d=[]
    for i in range(2,int(n**0.5)+2):
        while n%i==0:
            n//=i
            d.append(i)
    if n!=1:d.append(n)
    return c(d)

n=int(input())
d=c()
for i in range(1,n+1):
    d+=fact(i)

f=lambda n,x:sum(1 for i in p(d.values(),n) if all(map(lambda x,y:x>=y,i,x)))
print(f(3,(2,4,4))//2+f(2,(2,24))+f(2,(4,14))+f(1,(74,)))

Solution (Python):
from collections import Counter as c
from itertools import permutations as p

def fact(n):
    d=[]
    for i in range(2,int(n**0.5)+2):
        while n%i==0:
            n//=i
            d.append(i)
    if n!=1:d.append(n)
    return c(d)

n=int(input())
d=c()
for i in range(1,n+1):
    d+=fact(i)

v=sum(1 for i,j,k in p(d.values(),3) if i>=2 and j>=4 and k>=4)//2
v+=sum(1 for i,j in p(d.values(),2) if i>=2 and j>=24)
v+=sum(1 for i,j in p(d.values(),2) if i>=4 and j>=14)
v+=sum(1 for i in d.values() if i>=74)

print(v)

Solution (Python):
N = int(input())
primes = {}
for p in map(int, '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'.split()):
    primes[p] = 0
factors = {}
for p in primes.keys():
    factors[p] = 0
for i in range(1, N + 1):
    while i > 1:
        for p in primes:
            while i % p == 0:
                factors[p] = factors.get(p, 0)+1
                i //= p
fact3, fact5, fact15, fact25, fact75 = 0, 0, 0, 0, 0
for k, v in factors.items():
    if v >= 74:
        fact75 += 1
    if v >= 24:
        fact25 += 1
    if v >= 14:
        fact15 += 1
    if v >= 4:
        fact5 += 1
    if v >= 2:
        fact3 += 1
print(fact75 + fact25 * (fact3 - 1) + fact15 *
      (fact5 - 1) + fact5 * (fact5 - 1) * (fact3 - 2) // 2)