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 math
import bisect
from collections import Counter
N = int(input())

cnt = Counter()


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

for i in range(1, N+1):
    factor(i)


cnt = sorted(cnt.values())

cnt_over_n = lambda x: len(cnt)-bisect.bisect_left(cnt, x)
tmp2 = cnt_over_n(2)
tmp4 = cnt_over_n(4)
tmp14 = cnt_over_n(14)
tmp24 = cnt_over_n(24)
tmp74 = cnt_over_n(74)

ans = 0
ans += (tmp2-tmp4)*tmp4*(tmp4-1)//2 + tmp4*(tmp4-1)*(tmp4-2)//6*3
ans += (tmp4-tmp14)*tmp14 + tmp14*(tmp14-1)
ans += (tmp2-tmp24)*tmp24 + tmp24*(tmp24-1)
ans += tmp74
print(ans)

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

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(int(n))
  return table

s=[]

for i in range(1,n+1):
  s=s+(prime_decomposition(i))

count2=0
count4=0
sumation=0
for i in range(1,n+1):
  if s.count(i)==2 or s.count(i)==3:
    count2 +=1
  elif s.count(i) >3:
    count4 +=1

sumation += count4*(count4-1)/2*(count2+count4-2)

count2=0
count4=0
for i in range(1,n+1):
  if s.count(i)>=24:
    count2 +=1
  elif s.count(i) >=2:
    count4 +=1
    
sumation += count2*(count2+count4-1)

count2=0
count4=0
for i in range(1,n+1):
  if s.count(i)>=14:
    count2 +=1
  elif s.count(i) >=4:
    count4 +=1
    
sumation += count2*(count2+count4-1)

count2=0
count4=0
for i in range(1,n+1):
  if s.count(i)>=74:
    count2 +=1
    
sumation += count2

print(int(sumation))

Solution (Python):
import sys
from collections import defaultdict

N = input()
F = defaultdict(int)

def factorization(n):
    f=defaultdict(int)
    a = n
    for k in range(2, n+1):
        while a%k==0:
            f[k]+=1
            a/=k
    return f


def solve():
    A = F.values()
    B = F.keys()
    
    n = len(A)
    s1 = set()
    for i in range(n):
        a = A[i]
        if a >= 24:
            for j in range(n):
                if i == j: continue
                if A[j] >= 2:
                    a = B[i]
                    b = B[j]
                    s1.add(a**24 + b**2)
    
    n = len(A)
    s2 = set()
    for i in range(n):
        a = A[i]
        if a >= 14:
            for j in range(n):
                if i == j: continue
                if A[j] >= 4:
                    a = B[i]
                    b = B[j]
                    s2.add(a**14 + b**4)

    
    n = len(A)
    s3 = set()
    for i in range(n):
        a = A[i]
        if a >= 4:
            for j in range(n):
                if i == j: continue
                if A[j] >= 4:
                    for k in range(n):
                        if k == i or k == j: continue
                        if A[k] >= 2:
                            a = B[i]
                            b = B[j]
                            c = B[k]
                            s3.add(a**4 + b**4+c**2)

    
    n = len(A)
    s4 = set()
    for i in range(n):
        a = A[i]
        if a >= 74:
            s4.add(a**74)                    

    return len(s1) + len(s2) + len(s3) + len(s4)

    




for n in range(2, N+1):
    f = factorization(n)
    for k, v in f.iteritems():
        F[k] += v

print(solve())

Solution (Python):
import collections
import itertools
import math


N = int(input())


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


def n_C_r(n, r):
    return int(math.factorial(n) / math.factorial(r) / math.factorial(n-r))


if N > 9:
    L = [l[1]+1 for l in get_prime_factorized(math.factorial(N))]
    L = [[3, 5, 15, 25, 75] if l >= 75 else [3, 5, 15, 25] if l >= 25 else [3, 5, 15] if l >= 15 else [3, 5] if l >= 5 else [3] if l >= 3 else [1] for l in L]
    L = [l for l in L if l != [1]]
    L = list(itertools.chain.from_iterable(L))
    C = collections.Counter(L)

    R = C[75] + n_C_r(C[5], 2) * n_C_r(C[3]-2, 1) + C[25] * (C[3] - 1) + C[15] * (C[5] - 1)

    print(R)
else:
    print(0)

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:
            i //= j
            e[j] += 1

c = tuple(filter(lambda x: x > 0, e))  

dp = [[0 for _ in range(75 + 1)] for _ in range(len(c) + 1)]  
dp[0][1] = 1

i = 1
for cc in c:
    for j in range(1, 75 + 1):
        k = 0  
        while j * (k + 1) <= 75 and k <= cc:
            dp[i][j * (k + 1)] += dp[i - 1][j]
            k += 1
    i += 1


print(dp[len(c)][75])

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


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:
            i //= j
            e[j] += 1

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

def nprf(n):
    pf = {}
    for i in range(2, n+1):
        for j in range(2, i+1):
            while i % j == 0:
                if not j in pf:
                    pf[j] = 0
                pf[j] += 1
                i //= j
    return pf

pf = nprf(n)

def f(n):
    count = 0
    for v in pf.values():
        if v >= n-1:
            count += 1
    return count

f1 = f(75)
f2 = f(25) * (f(3)-1)
f3 = f(15) * (f(5)-1)
f4 = f(5) * (f(5)-1) //2 * (f(3)-2)

print(f1 + f2 + f3 + f4)

Solution (Python):






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 divisorize(fct):
    b, e = fct.pop()  
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def ncm(n, m):
    if n<m:
        return 0
    a = 1
    for i in range(m):
        a *= (n-i)
    for i in range(m):
        a /= (m-i)
    return a


def main():
    N = int(raw_input().strip())

    
    f = []
    for i in range(2, N+1):
        f.append(factorize(i))
    

    ff = [0]*100
    
    for fp in f:
        for fpp in fp:
            ff[fpp[0]] += fpp[1]
    

    '''
      5, 4, 3, 0, 5, 2, 4
    a *  *        *     * >= 4
    b *  *  *     *  *  * >= 2
    '''
    
    
    a = 0
    b = 0
    for fn in ff:
        if fn >= 4:
            a += 1
        if fn >= 2:
            b += 1
    n1 = ncm(a, 2) * (b-2)

    
    
    a = 0
    b = 0
    for fn in ff:
        if fn >= 24:
            a += 1
        if fn >= 2:
            b += 1
    n2 = a * (b-1)

    
    
    a = 0
    b = 0
    for fn in ff:
        if fn >= 14:
            a += 1
        if fn >= 4:
            b += 1
    n3 = a * (b-1)

    
    
    a = 0
    for fn in ff:
        if fn >= 74:
            a += 1
    n4 = a

    print n1+n2+n3+n4


if __name__ == '__main__':
    main()

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


def main():
    N = int(input())
    e = [0] * (N + 1)

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

    print(check(75, e) +
          check(25, e) * (check(3, e) - 1) +
          check(15, e) * (check(5, e) - 1) +
          check(5, e) * (check(5, e) - 1) * (check(3, e) - 2) // 2)


if __name__ == '__main__':
    main()

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 functools import lru_cache

def prime_factor_of_fact(n):
    di = {}
    for i in range(1, n + 1):
        pf = prime_factor(i)
        for p in pf:
            if p not in di:
                di[p] = 1
            else:
                di[p] += 1
    return di

@lru_cache()
def prime_factor(n):
    if n == 1:
        return []
    for i in range(2, n + 1):
        if n % i == 0:
            res = prime_factor(n // i) + [i]
            break
    return res

def shichigo_su(pff):
    have_seventyfour = len([k for k in pff if pff[k] >= 74])
    have_twentyfour = len([k for k in pff if pff[k] >= 24])
    have_fourteen = len([k for k in pff if pff[k] >= 14])
    have_four = len([k for k in pff if pff[k] >= 4])
    have_two = len([k for k in pff if pff[k] >= 2])
    if have_four >= 2 and have_two >= 3:
        res = ((have_four * (have_four - 1)) // 2) * (have_two - 2) \
            + have_fourteen * (have_four - 1) \
            + have_twentyfour * (have_two - 1) \
            + have_seventyfour
        return res
    else:
        return 0

def main():
    n = int(input())
    pff = prime_factor_of_fact(n)
    print(shichigo_su(pff))

main()

Solution (Python):


from collections import Counter

PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
II = lambda: int(input())
MI = lambda: map(int, input().split())

def factorization_pow(n):
    facts = Counter()
    for i in range(2, n + 1):
        for p in PRIMES:
            while i % p == 0:
                facts[p] += 1
                i = i // p
    return facts

C2 = lambda n: n * (n-1) // 2

def main():
    N = II()
    f = factorization_pow(N)
    LC = lambda v: len(list(filter(lambda x: x >= v, f.values())))
    return LC(74) + LC(24) * (LC(2) - 1) + LC(14) * (LC(4) - 1) + C2(LC(4)) * (LC(2) - 2)

if __name__ == "__main__":
    print(main())

Solution (Python):
n = int(input())
yakusu = [0]*105
for num in range(1,n+1):
    for i in range(2,n+1):
        while(num%i==0):
            yakusu[i] += 1
            num//=i
        if num == 1:
            break

over = [0]*100
for i in range(1,n+1):
    if(yakusu[i] >= 2):
        over[2]+=1
    if(yakusu[i] >= 4):
        over[4]+=1
    if(yakusu[i] >= 14):
        over[14]+=1
    if(yakusu[i] >= 24):
        over[24]+=1
    if(yakusu[i] >= 74):
        over[74]+=1

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

Solution (Python):
N = int(input())
e = [0] * (N+1)
for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            e[j] += 1
            cur //= j

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

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

Solution (Python):
import collections

n = int(input())

counts = collections.defaultdict(int)
for x in range(2, n + 1):
    for y in range(2, n + 1):
        while x % y == 0:
            counts[y] += 1
            x //= y

def f(a):
    return sum(1 for b in counts if counts[b] >= a - 1)

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

Solution (Python):
N = int(input())
e=[0]*(N+1)
for i in range(2, N+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      e[j] += 1
      cur //= j
def num(m): 
  return len(list(filter(lambda x: x >= m-1, e)))
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)
    + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

Solution (Python):
N = int(input())
primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]

two = sum(p<=N//2 for p in primes) 
four = sum(p<=N//4 for p in primes) if N>=12 else sum([N>=9, N>=6]) 
ft = sum([N>=91, N>=60, N>=30, N>=16]) 
tf = sum([N>=100, N>=54, N>=28]) 
sf = N>=78 

tff = four * (four-1) * (two-2) // 2 
ttf = tf * (two-1) 
fft = ft * (four-1) 
sfo = sf 

print(tff+ttf+fft+sfo)

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

def nprf(m):
    pf = {}
    for i in range(2, m + 1):
        for j in range(2, i + 1):
            while i % j == 0:
                pf[j] = pf.get(j, 0) + 1
                i //= j
    return pf

def c(P, m):
    count = 0
    for i in P:
        if P[i] >= m - 1:
            count += 1
    return count   
    
P = nprf(n)

f75 = c(P, 75)
f253 = c(P, 25) * (c(P, 3) - 1)
f155 = c(P, 15) * (c(P, 5) - 1)
f553 = int(c(P, 5) * (c(P, 5) - 1) * (c(P, 3) - 2) * 0.5)

print(f75 + f253 + f155 + f553)

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

e = [0] * (N+1)

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


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


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

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

p = [i for i in range(2,N+1)]
q = []

for i in p:
    for j in range(2,i):
        if i%j==0:
            q.append(i)
            break
        
p = list(set(p)-set(q))

def div(n):
    ret=0
    a=math.factorial(N)
    while a%n == 0:
        a//=n
        ret+=1
    return ret

Ans=0

for n in p:
    if div(n)>=74:
        Ans+=1

for n in p:
    if div(n)>=24:
        for m in p:
            if div(m)>=2 and n!=m:
                Ans += 1

        
for n in p:
    if div(n)>=14:
        for m in p:
            if div(m)>=4 and n!=m:
                Ans += 1

for n in p:
    if div(n)>=2:
        for m in p:
            if n!=m and div(m)>=4:
                for l in p:
                    if l!=n and l>m and div(l)>=4:
                        Ans +=1

print(Ans)

Solution (Python):

"""
Created on Thu Jan  3 10:20:42 2019

@author: Yamazaki Kenichi
"""

N = int(input())

prime = [2]
for j in range(3,100):
    if all(j % i != 0 for i in prime) :
        prime.append(j)

N1 = 1
for i in range(1,N+1):
    N1 *= i 

prime1 = []
for j in prime:
    temp = 0
    while N1 % pow(j,temp) ==0:
        temp += 1
    prime1.append(temp-1)

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

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

print(ans)

Solution (Python):

"""
Created on Thu Jan  3 10:20:42 2019

@author: Yamazaki Kenichi
"""

N = int(input())

prime = [2]
for j in range(3,100):
    if all(j % i != 0 for i in prime) :
        prime.append(j)

N1 = 1
for i in range(1,N+1):
    N1 *= i 

prime1 = []
a02,a04,a14,a24,a74 =0,0,0,0,0
for j in prime:
    temp = 0
    while N1 % pow(j,temp) ==0:
        temp += 1
    a02 += 1 if temp > 2 else 0
    a04 += 1 if temp > 4 else 0
    a14 += 1 if temp > 14 else 0
    a24 += 1 if temp > 24 else 0
    a74 += 1 if temp > 74 else 0    
    prime1.append(temp)

ans = a74 +a24*(a02-1) +a14*(a04-1) +a04*(a04-1)//2*(a02-2)



print(ans)

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

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

ans = 0


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


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


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


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

print(ans)

Solution (Python):
def getPrimelist(num):
    if num == 1:
        return([])
    primelist = []
    limit = int(num ** 0.5)
    templist = [i for i in range(2, num + 1)]
    while True:
        p = templist[0]
        if limit < p:
            return primelist + templist
        primelist.append(p)
        templist = [i for i in templist if i % p != 0]

def getfactorsdict(num, power = {}):
    primelist = getPrimelist(int(num ** 0.5))
    for prime in primelist:
        while num % prime == 0:
            if prime in power.keys():
                power[prime] += 1
            else:
                power[prime] = 1
            num //= prime
    if num > 1:
        if num in power.keys():
            power[num] += 1
        else:
            power[num] = 1
    return(power)

N = int(input())
fd = {}
for i in range(1, N + 1):
    fd = getfactorsdict(i, fd)

c75 = 0; c25 = 0; c15 = 0; c5 = 0; c3 = 0
for v in fd.values():
    if v >= 74:
        c75 += 1
    if v >= 24:
        c25 += 1
    if v >= 14:
        c15 += 1
    if v >= 4:
        c5 += 1
    if v >= 2:
        c3 += 1

ans = c75 
ans += c25 * (c3 - 1) 
ans += c15 * (c5 - 1) 
ans += (c5 * (c5 - 1)) // 2 * (c3 - 2) 
print(ans)

Solution (Python):
n = int(input())
primes = [2]
for i in range(3, 100):
    flag = True
    for j in primes:
        if i%j==0:
            flag = False
            break
    if flag:
        primes.append(i)

factors = [0 for i in range(len(primes))]
def mul(x):
    
    
    
    if x==1:
        return 1
    else:
        tmp = x
        while tmp != 1:
            for i, prime in enumerate(primes):
                if tmp%prime==0:
                    factors[i] += 1
                    tmp = tmp//prime
                    break

        return x*mul(x-1)

mul(n)
num74 = 0
num24 = 0
num14 = 0
num4 = 0
num2 = 0
for factor in factors:
    if factor>=74:
        num74 += 1
    elif factor>=24:
        num24 += 1
    elif factor>=14:
        num14 += 1
    elif factor>=4:
        num4 += 1
    elif factor >=2:
        num2 += 1

ans = 0
''' 3 * 5 * 5 '''
tmp1 = num74+num24+num14+num4
tmp2 = num2
ans += tmp1*(tmp1-1)//2*tmp2 + tmp1*(tmp1-1)//2*(tmp1-2)
''' 5 * 15 '''
tmp1 = num74+num24+num14
tmp2 = num4
ans += tmp1*tmp2 + tmp1*(tmp1-1)
''' 3 * 25 '''
tmp1 = num74+num24
tmp2 = num14+num4+num2
ans += tmp1*tmp2 + tmp1*(tmp1-1)
''' 75 '''
tmp1 = num74
ans += tmp1
print(ans)

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

p = [0] * (N+1)

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

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

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

Solution (Python):
def run(N):
  '''
  a^x*b^y*c^yの約数の数が75となるのは(x,y,z)が以下の場合
  (74,0,0), (2,4,4), (24,2,0), (14,4,0)
  N!の素因数分解を行い、各素数のうち上記の取得方法の数を数える
  '''
  
  primes = {1: 1}
  for i in range(2, N+1):
    tmp = i
    for j in range(2, N+1):
      while tmp%j == 0:
        if j in primes.keys():
          primes[j] += 1
        else:
          primes[j] = 1
        tmp /= j
  cnt = 0

  
  for i in primes.values():
    if i >= 74:
      cnt += 1

  
  cnt4 = 0
  cnt2 = 0
  for i in primes.values():
    if i >= 4:
      cnt4 += 1
    if i >= 2:
      cnt2 += 1
  if cnt4 >= 2:
    cnt += (cnt4*(cnt4-1)//2)*(cnt2-2)

  
  cnt24 = 0
  cnt2 = 0
  for i in primes.values():
    if i >= 24:
      cnt24 += 1
    if i >= 2:
      cnt2 += 1
  if cnt24 >= 1:
    cnt += cnt24*(cnt2-1)

  
  cnt14 = 0
  cnt4 = 0
  for i in primes.values():
    if i >= 14:
      cnt14 += 1
    if i >= 4:
      cnt4 += 1
  if cnt14 >= 1:
    cnt += cnt14*(cnt4-1)
  return cnt


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


if __name__ == '__main__':
    main()

Solution (Python):

N=int(input())
p_list = [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_c_list = [0 for i in range(len(p_list))]
for i in range(1,1+N):
    for j in range(len(p_list)):
        for k in range(1,8):
            if i%((p_list[j])**k)==0:
                p_c_list[j]+=1
            else:
                break
count=0
for i in range(len(p_list)):
    for j in range(i+1,len(p_list)):
        for k in range(j+1,len(p_list)):
            if min(p_c_list[i],p_c_list[j],p_c_list[k])>=2 and max(p_c_list[i],p_c_list[j],p_c_list[k])>=4:
                if (p_c_list[i]<4 and p_c_list[j]<4) or (p_c_list[k]<4 and p_c_list[j]<4) or (p_c_list[i]<4 and p_c_list[k]<4):
                    count+=0
                elif p_c_list[i]<4 or p_c_list[j] < 4 or p_c_list[k] < 4:
                    count+=1
                else:
                    count+=3

for i in range(len(p_list)):
    if p_c_list[i]>=74:
        count+=1

for i in range(len(p_list)):
    for j in range(i+1,len(p_list)):
        if max(p_c_list[i],p_c_list[j])>=24 and min(p_c_list[i],p_c_list[j])>=2:
            if p_c_list[i]>=24 and p_c_list[j]>=24:
                count+=2
            else:
                count+=1
        if max(p_c_list[i],p_c_list[j])>=14 and min(p_c_list[i],p_c_list[j])>=4:
            if p_c_list[i]>=14 and p_c_list[j]>=14:
                count+=2
            else:
                count+=1        
        
print(count)

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

n = int(input())
x = 1

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

d = dict()
for i in range(2, 100):
    tmp = 0
    while x % i == 0:
        tmp += 1
        x //= i
    if tmp:
        d[i] = tmp

c = [ 0 for _ in range(5)]
for v in d.values():
    if v >= 2:
        c[0] += 1
    if v  >=4:
        c[1] += 1
    if v >= 14:
        c[2] += 1
    if v >= 24:
        c[3] += 1
    if v >= 74:
        c[4] += 1

ans = c[4]
ans += c[3]*(c[0] - 1)
ans += c[2]*(c[1] - 1)
ans += comb(c[1], 2)*(c[0]-2)
print(ans)

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

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

a = count(75)
b = count(25) * (count(3) - 1)
c = count(15) * (count(5) - 1)
d = count(5) * (count(5) - 1) * (count(3) - 2) // 2

print(a + b + c + d)

Solution (Python):
from collections import Counter
N = int(input())



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


T = []
for i in range(2, N + 1):
    T.extend(prime_factorization(i))

C = list(Counter(T).values())


def num(x):
    return len([n for n in C if n >= x - 1])


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

Solution (Python):
N = int(input())
d = {}
for i in range(2, N + 1):
	m = i
	for j in range(2, i + 1):
		if m == 1:
			break
		while m % j == 0:
			if j in d:
				d[j] = d[j] + 1
			else:
				d[j] = 1
			m = m / j
l = [3, 5, 15, 25, 75]
e = {}
for i in l:
	e[i] = 0
for i in d:
	for j in l:
		if d[i] > j - 2:
			e[j] += 1
ans = 0
if e[5] > 1 and e[3] > 2:
	ans = int(e[5] * (e[5] - 1) / 2 * (e[3] - 2))
if e[3] > 1 and e[25] > 0:
	ans += e[25] * (e[3] - 1)
if e[5] > 1 and e[15] > 0:
	ans += e[15] * (e[5] - 1)
if e[75] > 0:
	ans += e[75]
print(ans)

Solution (Python):
import sys
import collections
from collections import Counter


import itertools







import math







from math import factorial



N = int(input())


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


P = prime_decomposition(factorial(N))
C = Counter(P)

n2, n4, n14, n24, n74 = [0] * 5

for k, v in C.items():
    n2 += 1 if v >= 2 else 0
    n4 += 1 if v >= 4 else 0
    n14 += 1 if v >= 14 else 0
    n24 += 1 if v >= 24 else 0
    n74 += 1 if v >= 74 else 0

p1, p2, p3, p4 = [0] * 4
p1 = n4 * (n4 - 1) * (n2 - 2) // 2
p2 = n14 * (n4 - 1)
p3 = n74
p4 = n24 * (n2 - 1)

print(sum([p1, p2, p3, p4]))

Solution (Python):
import collections

n = int(input())


seed_primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

d = collections.defaultdict(lambda: 0)

def bunkai(n):
    if n == 1:
        return 0
    else:
        for i in seed_primes:
            if n % i == 0:
                d[i] += 1
                return bunkai(n//i)


for i in range(1, n+1):
    bunkai(i)

tot = 0
s = 0
dd = collections.defaultdict(lambda: 0)
for v in d.values():
    if v >= 74:
        dd[74] += 1
        s += 1
    elif v >= 24:
        dd[24] += 1
        s += 1
    elif v >= 14:
        dd[14] += 1
        s += 1
    elif v >= 4:
        dd[4] += 1
        s += 1
    elif v >= 2:
        dd[2] += 1
        s += 1



tot += dd[74]

tot += (dd[74]+dd[24])*(s-1)

tot += (dd[74]+dd[24]+dd[14])*(s-dd[2]-1)

tot += int((dd[74]+dd[24]+dd[14]+dd[4])*(dd[74]+dd[24]+dd[14]+dd[4]-1)*(s-2)/2)

print(tot)

Solution (Python):
import collections

n = int(input())


seed_primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

d = collections.defaultdict(lambda: 0)

def bunkai(n):
    if n == 1:
        return 0
    else:
        for i in seed_primes:
            if n % i == 0:
                d[i] += 1
                return bunkai(n//i)


for i in range(1, n+1):
    bunkai(i)

tot = 0
s = 0
dd = collections.defaultdict(lambda: 0)
for v in d.values():
    if v >= 74:
        dd[74] += 1
        s += 1
    elif v >= 24:
        dd[24] += 1
        s += 1
    elif v >= 14:
        dd[14] += 1
        s += 1
    elif v >= 4:
        dd[4] += 1
        s += 1
    elif v >= 2:
        dd[2] += 1
        s += 1



tot += dd[74]

tot += (dd[74]+dd[24])*(s-1)

tot += (dd[74]+dd[24]+dd[14])*(s-dd[2]-1)

tot += int((dd[74]+dd[24]+dd[14]+dd[4])*(dd[74]+dd[24]+dd[14]+dd[4]-1)*(s-2)/2)

print(tot)

Solution (Python):
N = int(input())
e = [0] * (N+1)
for i in range(2,N+1):
    cur = i
    for j in range(2,i+1):
        while cur % j == 0:
            e[j]+=1;
            cur //=j

def num(m):
    return len(list(filter(lambda x: x >=m-1,e)))
    
print(num(75) + num(25) * (num(3)-1) + num(15)*(num(5)-1) + num(5) * (num(5)-1) * (num(3)-2) // 2)

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

s = [0] * (N+1)

for j in range(1, N+1):
    now = j

    for i in range(2, N+1):
        if now==1:
            break
        else:
            while now%i==0:
                now = now//i
                s[i] = s[i]+1
                
s2 = 0
s4 = 0
s14 = 0
s24 = 0
s74 = 0
                
for i in range(N+1):
    if s[i]>=2:
        s2 = s2+1
    if s[i]>=4:
        s4 = s4+1
    if s[i]>=14:
        s14 = s14+1
    if s[i]>=24:
        s24 = s24+1
    if s[i]>=74:
        s74 = s74+1

A = s74
B = max(0, s24*(s2-1))
C = max(0, s14*(s4-1))
D = max(0, s4*(s4-1)*(s2-2)//2)

print(A+B+C+D)

Solution (Python):
def solve(n):
    p = {}
    for m in range(1,n+1):
        for q in range(2,m+1):
            while m % q == 0:
                if not q in p:
                    p[q] = 0
                p[q] += 1
                m /= q
    S = set()
    
    for k1, v1 in p.items():
        for k2, v2 in p.items():
            for k3, v3 in p.items():
                if (v1 >= 2) and (v2 >= 4) and (v3 >= 4) and (k1 != k2) and (k2 != k3) and (k1 != k3):
                    S.add((k1**2) * (k2**4) * (k3**4))
    
    for k1, v1 in p.items():
        for k2, v2 in p.items():
            if (v1 >= 24) and (v2 >= 2) and (k1 != k2):
                S.add((k1**24) * (k2**2))
    
    for k1, v1 in p.items():
        for k2, v2 in p.items():
            if (v1 >= 14) and (v2 >= 4) and (k1 != k2):
                S.add((k1**14) * (k2**4))
    
    for k1, v1 in p.items():
        if (v1 >= 74):
            S.add(v1**74)
    return len(S)
print solve(input())

Solution (Python):
from itertools import combinations,permutations

N = int(input())

p_dic={}

for i in range(2,N+1):
    p=2
    while i!=1:
        c=0
        while i%p==0:
            c+=1
            i//=p
        if c>0 and p not in p_dic.keys():
            p_dic[p]=c
        elif c>0:
            p_dic[p]+=c
        p+=1

ans=0

p_keys = p_dic.keys()

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

for p,q in permutations(p_keys,2):
    i=p_dic[p]
    j=p_dic[q]
    if i>=2 and j>=24:
        ans+=1
    if i>=4 and j>=14:
        ans+=1

for p,q,r in combinations(p_keys,3):
    i,j,k = sorted([p_dic[p],p_dic[q],p_dic[r]])
    if i>=4:
        ans+=3
    elif j>=4 and i>=2:
        ans+=1
print(ans)

Solution (Python):
N = int(input())
primeCounter = [0 for _ in range(N + 1)]
for i in range(2, N + 1):
    for div in range(2, i + 1):
        while i % div == 0:
            primeCounter[div] += 1
            i /= div
ans = 0
ans += len([i for i in primeCounter if i >= 74])
ans += len([i for i in primeCounter if i >= 24]) * (len([i for i in primeCounter if i >= 2]) - 1)
ans += len([i for i in primeCounter if i >= 14]) * (len([i for i in primeCounter if i >= 4]) - 1)
ans += len([i for i in primeCounter if i >= 4]) * (len([i for i in primeCounter if i >= 4]) - 1) * (len([i for i in primeCounter if i >= 2]) - 2) // 2
print(ans)

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

print Ans[N]

Solution (Python):
import sys

N = int(sys.stdin.readline().strip())

def f1(p, k):
  
  u = p
  ans = 0
  while u < k:
    ans += k//u
    u = u*p
  return ans

def f2(p, k):
  
  u = p
  ans = {}
  r = 1
  while u < k:
    ans[r] = k//u
    u = u*p
    r = r+1
  return ans

ps = []
for x in range(2, N+1):
  primeflag = True
  for p in ps:
    if (x % p) == 0:
      primeflag = False
      break
  if primeflag == True:
    ps.append(x)









ps_lim = {p: f1(p, N) for p in ps}

ps_2 = [p for p in ps if ps_lim[p] >= 2]
ps_4 = [p for p in ps if ps_lim[p] >= 4]
ps_14 = [p for p in ps if ps_lim[p] >= 14]
ps_24 = [p for p in ps if ps_lim[p] >= 24]
ps_74 = [p for p in ps if ps_lim[p] >= 74]



sum1 = len(ps_4) * (len(ps_4) - 1) * (len(ps_2) - 2) // 2

sum2 = len(ps_24) * (len(ps_2) - 1)

sum3 = len(ps_14) * (len(ps_4) - 1)

sum4 = len(ps_74)
sum = sum1 + sum2 + sum3 + sum4

print(sum)