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,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def integer_factorization_perm(N):
    prime_count = collections.Counter()
    for n in range(1, N+1):
        for i in range(2, int(math.sqrt(n)) + 2):
            while n % i == 0:
                n //= i
                prime_count[i] += 1
        if n > 1:
            prime_count[n] += 1
    return prime_count

def main():
    N = I()
    primes = integer_factorization_perm(N)
    over74, over24, over14, over4, over2 = 0, 0, 0, 0, 0
    for k, v in primes.items():
        if v >= 74:
            over74 += 1
        if v >= 24:
            over24 += 1
        if v >= 14:
            over14 += 1
        if v >= 4:
            over4 += 1
        if v >= 2:
            over2 += 1
    cnt = 0
    '''
    print('74: ', over74)
    print('24: ', over24)
    print('14: ', over14)
    print('4: ', over4)
    print('2: ', over2)
    '''

    cnt += over74
    if over2 > 1:
        cnt += over24 * (over2 - 1)
    if over4 > 1:
        cnt += over14 * (over4 - 1)
    if over2 > 1 and over4 > 0:
        cnt += (over2 - 2) * over4 * (over4 - 1) // 2
    print(cnt)

main()

Solution (Python):
import sys
from math import sqrt
from collections import defaultdict
from itertools import combinations
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    divisor=defaultdict(int)
    for i in range(1,N+1):
        x=2
        while i!=1:
            if i%x==0:
                divisor[x]+=1
                i//=x
            else:
                x+=1
    divisor_2=[]
    divisor_4=[]
    divisor_14=[]
    divisor_24=[]
    divisor_74=[]
    for k,v in divisor.items():
        if v>=2:
            divisor_2.append(k)
        if v>=4:
            divisor_4.append(k)
        if v>=14:
            divisor_14.append(k)
        if v>=24:
            divisor_24.append(k)
        if v>=74:
            divisor_74.append(k)
    ans=0
    for a in divisor_2:
        for p in combinations(divisor_4,2):
            if not a in p:
                ans+=1
    for a in divisor_14:
        for b in divisor_4:
            if a!=b:
                ans+=1
    for a in divisor_24:
        for b in divisor_2:
            if a!=b:
                ans+=1
    ans+=len(divisor_74)
    print(ans)
                

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
D = {}
for i in range(1, N+1):
  a = i
  dig = 1
  p = 2
  while a != 1:
    j = 0
    while a % p == 0:
      j += 1
      a //= p
      dig *= p
    if j != 0:
      if p in D:
        D[p] += j
      else:
        D[p] = j
    p += 1
    if p > int(i**(1/2)) and dig != i:
      if i//dig in D:
        D[i//dig] += 1
      else:
        D[i//dig] = 1
      break
A = [D[i] for i in D]
A.sort()
L = len(A)
i2, i4, i14, i24, i74 = 0, 0, 0, 0, 0
p2, p4, p14, p24, p74 = 0, 0, 0, 0, 0
j = 0
while j < L:
  if A[j] >= 2 and p2 == 0:
    i2 = j
    p2 = 1
  if A[j] >= 4 and p4 == 0:
    i4 = j
    p4 = 1
  if A[j] >= 14 and p14 == 0:
    i14 = j
    p14 = 1
  if A[j] >= 24 and p24 == 0:
    i24 = j
    p24 = 1
  if A[j] >= 74 and p74 == 0:
    i74 = j
    p74 = 1
  j += 1
S = (L - i74) * p74
S += (L - i2 - 1) * (L - i24) * p2 * p24
S += (L - i4 - 1) * (L - i14) * p4 * p14
S += ((L - i2 - 2) * (L - i4) * (L - i4 - 1) * p2 * p4) // 2
print(S)

Solution (Python):
import sys
from collections import defaultdict, Counter
from math import floor, sqrt
from functools import reduce
from operator import mul

def prime_factorize_factorial(n):
    res = defaultdict(int)
    for i in range(n, 0, -1):
        while i % 2 == 0:
            res[2] += 1
            i //= 2
        if i == 1:
            continue
        for j in range(3, floor(sqrt(n))+1, 2):
            while i % j == 0:
                res[j] += 1
                i //= j
            if i == 1:
                break
        else:
            res[i] += 1
    return res

def comb(n, r):
    if r < 0 or r > n:
        return 0
    r = min(r, n-r)
    upper = reduce(mul, range(n, n-r, -1), 1)
    lower = reduce(mul, range(r, 0, -1), 1)
    return upper // lower

n = int(sys.stdin.readline().rstrip())

def main():
    pcnt = prime_factorize_factorial(n)
    cnt_pcnt_atleast = [0] * 75
    for c in pcnt.values():
        if c <= 74:
            cnt_pcnt_atleast[c] += 1
        else:
            cnt_pcnt_atleast[74] += 1
    
    for i in range(74, 0, -1):
        cnt_pcnt_atleast[i-1] += cnt_pcnt_atleast[i]
    
    res = 0
    
    
    res += cnt_pcnt_atleast[74]
    
    res += cnt_pcnt_atleast[24] * (cnt_pcnt_atleast[2] - 1)
    
    res += cnt_pcnt_atleast[14] * (cnt_pcnt_atleast[4] - 1)
    
    res += comb(cnt_pcnt_atleast[4], 2) * (cnt_pcnt_atleast[2] - 2)

    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
import collections
import copy
N=int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

table=collections.defaultdict(int)
for i in range(1,N+1):
  tmp=factorization(i)
  for a,b in tmp:
    table[a]+=b

divisors=[[5,5,3],[15,5],[25,3],[75]]
ans=0
for x in divisors:
  tmp=[set() for i in range(len(x))]
  for i,y in enumerate(x):
    for z in table:
      if table[z]>=y-1:
        tmp[i].add(z)
    if len(tmp[i])==0:
      break
  for y in tmp[0]:
    if len(x)>1:
      for z in tmp[1]:
        if y==z:
          continue
        if len(x)>2:
          if y>z:
            continue
          for w in tmp[2]:
            if z==w or w==y:
              continue
            else:
              ans+=1
        else:
              ans+=1
    else:
      ans+=1
print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): 
    return int(input())
def inpm(): 
    return map(int,input().split())
def inpl(): 
    return list(map(int, input().split()))
def inpls(): 
    return list(input().split())
def inplm(n): 
    return list(int(input()) for _ in range(n))
def inpll(n): 
    return [list(map(int, input().split())) for _ in range(n)]

def f(x):
    global e
    return len(list(filter(lambda y:y>=x-1,e)))

def main():
    n = inp()
    global e
    e = [0 for _ in range(n+1)]
    for i in range(2,n+1):
        x = i
        for j in range(2,i+1):
            while x % j == 0:
                e[j] += 1
                x //= j
    print( f(75) + f(25)*(f(3)-1) + f(15)*(f(5)-1) + f(5)*(f(5)-1)*(f(3)-2)//2)

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
D = {}
for n in range(2, N+1):
    K = n
    for k in range(2, n):
        if k not in D:
            continue
        while K % k == 0:
            K //= k
            D[k] += 1
        if K == 1:
            break
    else:
        D[n] = 1
a2 = sum(v >= 2 for v in D.values())
a4 = sum(v >= 4 for v in D.values())
a14 = sum(v >= 14 for v in D.values())
a24 = sum(v >= 24 for v in D.values())
a74 = sum(v >= 74 for v in D.values())
ans = 0
if a2 > 2:
    ans += (a2-2)*a4*(a4-1)//2
if a2 > 1:
    ans += (a2-1)*a24
if a4 > 1:
    ans += (a4-1)*a14
if a74:
    ans += a74
print(ans)

Solution (Python):
prime_sieve=[1 for i in range(51)]
prime_sieve[0]=0
prime_sieve[1]=0
prime=[]

for i in range(2,51):
  if prime_sieve[i]==1:
    prime.append(i)
    for j in range(2,50//i+1):
      prime_sieve[i*j]=0



count=[0 for i in range(15)]

X=int(input())

for i in range(2,X+1):
  for j in range(15):
    while i%prime[j]==0:
      i=i//prime[j]
      count[j]+=1


tw=0
fr=0


fif=0



tf=0





sf=0



for i in range(15):
  if count[i]>=4:
    fr+=1
  if count[i]>=2:
    tw+=1
  if count[i]>=14:
    fif+=1
  if count[i]>=24:
    tf+=1
  if count[i]>=74:
    sf+=1




ans=fr*(fr-1)*(tw-2)//2+fif*(fr-1)+tf*(tw-1)+sf
print(ans)

Solution (Python):
from collections import defaultdict

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


nn=int(input())

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

dct=defaultdict(int)
for i in range(2,nn+1):
  for k,m in factorization(i):
    dct[k]+=m

li=[0]*1000

for k,v in dct.items():
  li[v]+=1

a74=sum(li[74:])
a24=sum(li[24:])
a14=sum(li[14:])
a4=sum(li[4:])
a2=sum(li[2:])

print(a74+(a24*(a2-1)+a14*(a4-1))+(max(a4*(a4-1)//2,0))*max(a2-2,0))

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 sum([ei>=m-1 for ei in 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
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for n in range(1, N+1):
    m = 2
    while n != 1:
        if n % m == 0:
            d[m] += 1
            n //= m
            m = 2
        else:
            m += 1
ans = 0

count = [0, 0, 0, 0, 0]
for v in d.values():
    if v >= 74:
        count[4] += 1
    elif v >= 24:
        count[3] += 1
    elif v >= 14:
        count[2] += 1
    elif v >= 4:
        count[1] += 1
    elif v >= 2:
        count[0] += 1
ans += count[4]
ans += sum(count[3:])*(sum(count)-1)
ans += sum(count[2:])*(sum(count[1:])-1)
ans += sum(count[1:])*(sum(count[1:])-1)//2*(sum(count)-2)
print(ans)

Solution (Python):
import itertools
import math
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7





def get_factors(n):
    """
    素因数分解
    :param int n:
    :rtype: list of int
    """
    if n <= 1:
        return []

    ret = []
    while n > 2 and n % 2 == 0:
        ret.append(2)
        n //= 2
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            ret.append(i)
            n //= i
        else:
            i += 2
    ret.append(n)
    return ret


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

counts = [0] * 101
for n in range(1, N + 1):
    for f in get_factors(n):
        counts[f] += 1

t = []
for c in counts:
    if c >= 2:
        t.append(c)
counts = t



ans = 0
for i, j, k in itertools.combinations(range(len(counts)), r=3):
    if counts[i] >= 2 and counts[j] >= 4 and counts[k] >= 4:
        ans += 1
    if counts[i] >= 4 and counts[j] >= 2 and counts[k] >= 4:
        ans += 1
    if counts[i] >= 4 and counts[j] >= 4 and counts[k] >= 2:
        ans += 1
for i, j in itertools.combinations(range(len(counts)), r=2):
    if counts[i] >= 2 and counts[j] >= 24:
        ans += 1
    if counts[i] >= 24 and counts[j] >= 2:
        ans += 1
    if counts[i] >= 4 and counts[j] >= 14:
        ans += 1
    if counts[i] >= 14 and counts[j] >= 4:
        ans += 1
for c in counts:
    if c >= 74:
        ans += 1
print(ans)

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


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


def num(M:int):
    return len(tuple(filter(lambda x: x >= M-1, e)))

answer = num(75)

answer += num(25) * (num(3) - 1)
answer += num(15) * (num(5) - 1)

answer += num(5) * (num(5) - 1) * (num(3) - 2) // 2

print(answer)

Solution (Python):
PList = [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]
PNum  = len(PList)
Beki  = [0]*(PNum)

N = int(input())
for n in range(1,N+1):
    nn = n
    for i in range(PNum):
        while nn % PList[i] == 0:
            Beki[i]+=1
            nn //= PList[i]
'''
75 = (74+1)
   = (24+1)(2+1)
   = (14+1)(4+1)
   = (4+1)(4+1)(2+1)
'''

beki02 = 0
beki04 = 0
beki14 = 0
beki24 = 0
beki74 = 0

for i in Beki:
    if i >= 2:
        beki02+=1
    if i >= 4:
        beki04+=1
    if i >= 14:
        beki14+=1
    if i >= 24:
        beki24+=1
    if i >= 74:
        beki74+=1

ans = 0
ans += beki74
ans += beki24*(beki02-1)
ans += beki14*(beki04-1)
ans += beki04*(beki04-1)//2*(beki02-2)

print(ans)

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

pn=[2];A=100
for L in range(3,A):
  chk=True
  for L2 in pn:
    if L%L2 == 0:chk=False
  if chk==True:pn.append(L)

mul = [0 for i in range(101)]
for i in range(1,N+1):
  for j in pn:
    if j > i:
      break
    temp = i
    while True:
      if temp%j == 0:
        temp /= j
        mul[j] += 1
        continue
      else:
        break
        
prime_num = []
for index, num in enumerate(mul):
  if num != 0:
    prime_num.append([index,num])

ans = 0

from itertools import combinations
nums442 = list(combinations(prime_num,3))
for num in nums442:
  if num[0][1]>=2 and num[1][1]>=4 and num[2][1]>=4:
    ans += 1
  if num[0][1]>=4 and num[1][1]>=2 and num[2][1]>=4:
    ans += 1
  if num[0][1]>=4 and num[1][1]>=4 and num[2][1]>=2:
    ans += 1


nums14_4 = list(combinations(prime_num,2))
for num in nums14_4:
  if num[0][1]>=14 and num[1][1]>=4:
    ans += 1
  if num[0][1]>=4 and num[1][1]>=14:
    ans += 1


nums24_2 = list(combinations(prime_num,2))
for num in nums24_2:
  if num[0][1]>=24 and num[1][1]>=2:
    ans += 1
  if num[0][1]>=2 and num[1][1]>=24:
    ans += 1
    

for num in prime_num:
  if num[1] >= 74:
    ans += 1
    
print(ans)

Solution (Python):
import collections

n=int(input())
a=[1]

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

for i in range(1,n+1):
    a+=prime_factorize(i)


a=collections.Counter(a)
a=a.most_common()



v=0
w=0
count=0

for i in range(len(a)):
    if a[i][1]+1>=5:
        v+=1
    elif 3<=a[i][1]+1<=4:
        w+=1

if v<2 or v-2+w<1:
    print(0)
    exit()

for i in range(len(a)):

    if a[i][1]+1>=75:
        count+=1+v+w-1+v-1
    elif a[i][1]+1>=25:
        count+=v+w-1+v-1
    elif a[i][1]+1>=15:
        count+=v-1
    else:
        continue

print((v*(v-1)//2)*(w+v-2)+count)

Solution (Python):
n=int(input())
c=[0]*(n+1)
for i in range(2,n+1):
	j=2
	while j*j<=i:
		while i%j==0:
			c[j]+=1
			i//=j
		j+=1
	if i>1:
		c[i]+=1
f=lambda x:sum(y+1>=x for y in c)
print(f(75)+f(25)*(f(3)-1)+f(15)*(f(5)-1)+f(5)*(f(5)-1)//2*(f(3)-2))

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


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 modInverse(a, p):
    return pow(a, p - 2, p)
def nCr(n, r, p=10**9+7):
    x = 1
    for i in range(r):
        x = (x * (n - i)) % p
    d = 1
    for i in range(1, r + 1):
        d = (d * i) % p
    return (x * modInverse(d, p)) % p


N = int(input())
import collections
A = []
for i in range(2, N+1):
    A.extend(prime_factorize(i))
P = collections.Counter(A)


def f(n):
    return len([k for k, v in P.items() if v >= n])


def main():
    ans = 0
    ans += f(74)
    ans += f(24) * (f(2)-1)
    ans += f(14) * (f(4)-1)
    ans += nCr(f(4), 2) * (f(2)-2)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
from bisect import bisect_right as br
input = sys.stdin.readline
N = int(input())

def check(x):
  i = 2
  res = []
  while i * i <= x:
    while x % i == 0:
      x //= i
      res.append(i)
    i += 1
  if x > 1:
    res.append(x)
  return res
table = [0] * (N + 1)
for i in range(2, N + 1):
  for p in check(i):
    table[p] += 1
  
t = [0]

for p in table:
  if p > 0: t.append(p)
t.sort()

k = len(t)

res = t[-1] >= 74
for i in range(k - 1):
  for j in range(i + 1, k):
    if t[i] + 1 >= 3 and (t[j] + 1 >= 25):
      res += 1
    if t[i] + 1 >= 5 and (t[j] + 1 >= 15):
      res += 1
    if t[i] + 1 >= 15 and (t[j] + 1 >= 5):
      res += 1
    if t[i] + 1 >= 25 and (t[j] + 1 >= 3):
      res += 1

for i in range(k - 2):
  for j in range(i + 1, k - 1):
    for l in range(j + 1, k):
      if (t[i] + 1) >= 3 and (t[j] + 1 >= 5) and (t[l] + 1 >= 5):
        res += 1
      if (t[i] + 1) >= 5 and (t[j] + 1 >= 3) and (t[l] + 1 >= 5):
        res += 1
      if (t[i] + 1) >= 5 and (t[j] + 1 >= 5) and (t[l] + 1 >= 3):
        res += 1
print(int(res))

Solution (Python):
import collections
n=int(input())
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
c=collections.Counter()
for i in range(2,n+1):
    c+=collections.Counter(prime_factorize(i))

cnt1=0
cnt2=0
cnt3=0
cnt4=0
cnt5=0
cnt6=0
cnt7=0
for a in list(c.values()):
    if a>=4:
        cnt1+=1
    if a>=2:
        cnt2+=1

    if a>=14:
        cnt3+=1
    if a>=4:
        cnt4+=1

    if a>=24:
        cnt5+=1
    if a>=2:
        cnt6+=1

    if a>=74:
        cnt7+=1
print(cnt1*(cnt1-1)*(cnt2-2)//2+cnt3*(cnt4-1)+cnt5*(cnt6-1)+cnt7)

Solution (Python):
N = int(input())
M = [0] * (101)

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

for i in range(2, N + 1):
  for m in prime_factorize(i):
    M[m] += 1


n3, n5, n15, n25, n75 = 0, 0, 0, 0, 0
for i in range(N+1):
  if M[i] >= 2:  n3  += 1
  if M[i] >= 4:  n5  += 1
  if M[i] >= 14: n15 += 1
  if M[i] >= 24: n25 += 1
  if M[i] >= 74: n75 += 1


answer = n75 + n25 * (n3 - 1) + n15 * (n5 - 1) + n5 * (n5 - 1) * (n3 - 2) // 2
print(answer)

Solution (Python):
from collections import Counter

from math import floor
from collections import Counter

def factoring(n):
    sup = floor(pow(n,1/2))
    for i in range(2,sup+1):
        while n % i == 0:
            c[i] += 1
            n //= i
    if n != 1:
        c[n] += 1
    return c

N = int(input())
c = Counter()


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


t = Counter()
for _, values in c.items():
    if values >= 2:
        t[2] += 1
    if values >= 4:
        t[4] += 1
    if values >= 14:
        t[14] += 1
    if values >= 24:
        t[24] += 1
    if values >= 74:
        t[74] += 1

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

Solution (Python):
l =    [2,	3,	5,	7,	11,	13,	17,	19,	23,	29,	31,	37,	41,	43,	47,	53,	59,	61,	67,	71,
        73,	79,	83,	89,	97]
ans = 0
l3, l5, l15, l25, l75 = 0, 0, 0, 0, 0
n = int(input())
for i in l:
  temp = n
  c = 1
  while temp >= i:
    temp //= i
    c += temp
  if c >= 3:
    l3 += 1
  if c >= 5:
    l5 += 1
  if c >= 15:
    l15 += 1
  if c >= 25:
    l25 += 1
  if c >= 75:
    l75 += 1
ans += l75
ans += l25 * (l3-1)
ans += l15 * (l5-1)
ans += (l3-2) * l5*(l5-1) // 2
print(ans)

Solution (Python):


import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def factorize(num: int) -> dict:
    """ 素因数分解 """
    from math import sqrt
    from collections import Counter

    d = Counter()
    
    for i in range(2, int(sqrt(num))+1):
        
        while num % i == 0:
            num //= i
            d[i] += 1
        
        if num == 1:
            break
    
    if num != 1:
        d[num] += 1
    return d

N = INT()


primes = Counter()
for i in range(2, N+1):
    primes.update(factorize(i))


primes = sorted(primes.values())
M = len(primes)
cnt = 0
for i, v1 in enumerate(primes):
    
    if v1 >= 74:
        cnt += 1
    for j, v2 in enumerate(primes[i+1:], i+1):
        
        if v1 >= 2 and v2 >= 24:
            cnt += 1
        if v1 >= 4 and v2 >= 14:
            cnt += 1
        if v1 >= 24 and v2 >= 2:
            cnt += 1
        if v1 >= 14 and v2 >= 4:
            cnt += 1
        for k, v3 in enumerate(primes[j+1:], j+1):
            
            if v1 >= 2 and v2 >= 4 and v3 >= 4:
                cnt += 1
            if v1 >= 4 and v2 >= 2 and v3 >= 4:
                cnt += 1
            if v1 >= 4 and v2 >= 4 and v3 >= 2:
                cnt += 1
print(cnt)

Solution (Python):
def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return is_prime, table
N=int(input())
_, table = sieve(N)
d={}
for p in table:
    sum_=0
    calc=p
    while calc <= N:
        sum_ += N//calc
        calc *= p
    d[p] = sum_ + 1
def count(d,n):
    return len([i for i in d.values() if i >=n])
print((count(d,3) - 1)*count(d,25) + (count(d,5) - 1)*count(d,15) + count(d,5) * (count(d,5) - 1) * (count(d,3)-2)//2 + count(d,75))

Solution (Python):


import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def factorize(num: int) -> dict:
    """ 素因数分解 """
    from math import sqrt
    from collections import Counter

    d = Counter()
    
    for i in range(2, int(sqrt(num))+1):
        
        while num % i == 0:
            num //= i
            d[i] += 1
        
        if num == 1:
            break
    
    if num != 1:
        d[num] += 1
    return d

N = INT()


primes = Counter()
for i in range(2, N+1):
    primes.update(factorize(i))


primes = sorted(primes.values())
M = len(primes)
cnt2 = cnt4 = cnt14 = cnt24 = cnt74 = 0
for a in primes:
    
    if a >= 2: cnt2 += 1
    if a >= 4: cnt4 += 1
    if a >= 14: cnt14 += 1
    if a >= 24: cnt24 += 1
    if a >= 74: cnt74 += 1

ans = 0

ans += (cnt2-2) * (cnt4 * (cnt4-1) // 2)

ans += (cnt2-1) * cnt24 + (cnt4-1) * cnt14

ans += cnt74

print(ans)

Solution (Python):


import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def factorize(num: int) -> dict:
    """ 素因数分解 """
    from math import sqrt
    from collections import Counter

    d = Counter()
    
    for i in range(2, int(sqrt(num))+1):
        
        while num % i == 0:
            num //= i
            d[i] += 1
        
        if num == 1:
            break
    
    if num != 1:
        d[num] += 1
    return d

N = INT()


primes = Counter()
for i in range(2, N+1):
    primes.update(factorize(i))


primes = sorted(primes.values())
M = len(primes)
cnt = 0

for i, v1 in enumerate(primes):
    for j, v2 in enumerate(primes[i+1:], i+1):
        for k, v3 in enumerate(primes[j+1:], j+1):
            if v1 >= 2 and v2 >= 4 and v3 >= 4:
                cnt += 1
            if v1 >= 4 and v2 >= 2 and v3 >= 4:
                cnt += 1
            if v1 >= 4 and v2 >= 4 and v3 >= 2:
                cnt += 1

for i, v1 in enumerate(primes):
    for j, v2 in enumerate(primes[i+1:], i+1):
        if v1 >= 2 and v2 >= 24:
            cnt += 1
        if v1 >= 4 and v2 >= 14:
            cnt += 1
        if v1 >= 24 and v2 >= 2:
            cnt += 1
        if v1 >= 14 and v2 >= 4:
            cnt += 1

for i, v1 in enumerate(primes):
    if v1 >= 74:
        cnt += 1
print(cnt)

Solution (Python):
from collections import defaultdict

def main():
    
    
    
    
    N = int(input())
    d = defaultdict(int)
    for n in range(1, N+1):
        for i in range(2, int(n ** 0.5) + 1):
            while n % i == 0:
                d[i] += 1
                n = n // i
        if n != 1:
            d[n] += 1

    d2 = 0
    d4 = 0
    d14 = 0
    d24 = 0
    d74 = 0
    for i in d.values():
        if i >= 2:
            d2 += 1
        if i >= 4:
            d4 += 1
        if i >= 14:
            d14 += 1
        if i >= 24:
            d24 += 1
        if i >= 74:
            d74 += 1

    ans = d74
    ans += d24 * (d2 - 1)
    ans += d14 * (d4 - 1)
    ans += (d4 * (d4 - 1) * (d2 - 2)) // 2

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

from collections import defaultdict
def factorize(n):
    """
    引数の値を素因数分解したリストを返す

    Parameters
    ----------
    n : int
        素因数分解したい自然数

    Returns
    -------
    retlist : list
        素因数分解後の値のリスト
    """
    retlist = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
                retlist.append(i)

    if temp!=1:
        retlist.append(temp)

    if retlist==[]:
        retlist.append(n)

    return retlist

n=int(input())
div=[]
for i in range(1,n+1):
    t=factorize(i)
    div+=t

d = defaultdict(int)
for dd in div:
    d[dd]+=1

fact_3=0
fact_5=0
fact_15=0
fact_25=0
fact_75=0

for ddd in d.values():
    if 2<=ddd<4:
        fact_3+=1
    elif 4<=ddd<14:
        fact_5+=1
    elif 14<=ddd<24:
        fact_15+=1
    elif 24<=ddd<74:
        fact_25+=1
    elif 74<=ddd:
        fact_75+=1

fact_3 = fact_75+fact_25+fact_15+fact_5+fact_3
fact_5 = fact_75+fact_25+fact_15+fact_5
fact_15 = fact_75+fact_25+fact_15
fact_25 = fact_75+fact_25
fact_75 = fact_75

ans = 0
ans += (fact_5*(fact_5-1)*(fact_3-2))//2
ans += fact_15*(fact_5-1)
ans += fact_25*(fact_3-1)
ans += fact_75

print(ans)

Solution (Python):
def pff(m):
    pf = {}
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1: pf[m] = 1
    return pf
def examD():
    N = I()
    d = defaultdict(int)
    for i in range(2,N+1):
        cur  = pff(i)
        for key,j in cur.items():
            d[key] +=j

    Num = defaultdict(int)
    for i in d.values():
        for j in [3,5,15,25,75]:
            if i>=j-1:
                Num[j] +=1
            else:
                break

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

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examD()

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

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

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


decomp_dic = defaultdict(int)

for n in range(2, N + 1):
    c = Counter(prime_factorize(n))
    for key, value in c.items():
        decomp_dic[key] += value

for key in decomp_dic.keys():
    decomp_dic[key] += 1

ans = 0
above_25 = 0
above_15 = 0
above_5 = 0
above_3 = 0
for value in decomp_dic.values():
    if value >= 75:
        ans += 1
    if value >= 25:
        above_25 += 1
    if value >= 15:
        above_15 += 1
    if value >= 5:
        above_5 += 1
    if value >= 3:
        above_3 += 1

ans += above_25 * (above_3 - 1)
ans += above_15 * (above_5 - 1)

ans += (above_3 - 2) * above_5 * (above_5 - 1) // 2

print(ans)