Problem:
 Score : 400 points    Problem Statement You are given an integer N . Among the divisors of N!  (= 1 \times 2 \times ... \times N) , how many Shichi-Go numbers (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.      Note When a positive integer A divides a positive integer B , A is said to a divisor of B .
For example, 6 has four divisors: 1, 2, 3 and 6 .      Constraints  1 \leq N \leq 100  N is an integer.         Input Input is given from Standard Input in the following format:  N       Output Print the number of the Shichi-Go numbers that are divisors of N! .        Sample Input 1 9      Sample Output 1 0  There are no Shichi-Go numbers among the divisors of 9! = 1 \times 2 \times ... \times 9 = 362880 .       Sample Input 2 10      Sample Output 2 1  There is one Shichi-Go number among the divisors of 10! = 3628800 : 32400 .       Sample Input 3 100      Sample Output 3 543

Solution (Python):
def add_divisors(n, divisors):
    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
    ]
    for prime in primes:
        while True:
            if n % prime == 0:
                if prime in divisors.keys():
                    divisors[prime] += 1
                else:
                    divisors[prime] = 1
                n /= prime
            else:
                break

divisors = {}
n = int(input())
for i in range(1,n+1):
    add_divisors(i, divisors)

c74_ = 0

c24_ = 0
c2_23 = 0

c14_ = 0
c4_13 = 0

c4_ = 0
c2_3 = 0

for k in divisors.keys():
    if divisors[k] >= 74:
        c74_ += 1

    if divisors[k] >= 24:
        c24_ += 1
    elif divisors[k] >= 2:
        c2_23 += 1

    if divisors[k] >= 14:
        c14_ += 1
    elif divisors[k] >= 4:
        c4_13 += 1

    if divisors[k] >= 4:
        c4_ += 1
    elif divisors[k] >= 2:
        c2_3 += 1

ans = 0


if c74_ >= 1:
    ans += c74_


if c24_ >= 2:
    ans += c24_ * (c24_ - 1)
if c2_23 >= 1 and c24_ >= 1:
    ans += c2_23 * c24_


if c14_ >= 2:
    ans += c14_ * (c14_ - 1)
if c4_13 >= 1 and c14_ >= 1:
    ans += c4_13 * c14_


if c4_ >= 3:
    ans += c4_ * (c4_ - 1) * (c4_ - 2) // 2
if c2_3 >= 1 and c4_ >= 2:
    ans += c2_3 * c4_ * (c4_ - 1) // 2

print(ans)

Solution (Python):
from itertools import combinations
n = int(input())


primelist = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
cntlist = [0]*50
res = 0

for num in range(2,n+1):
    for prime in primelist:
        while(num%prime==0):
            num //= prime
            cntlist[prime] += 1

nonZeroPrime = [prime for prime in primelist if cntlist[prime]!=0]





perm = list(combinations(nonZeroPrime,3))
for t in perm:
    nonZeroCnt = [cntlist[prime] for prime in t]
    nonZeroCnt.sort()
    if(nonZeroCnt[0]>1 and nonZeroCnt[1]>3 and nonZeroCnt[2]>3):
        res+=1
    if(nonZeroCnt[0]>=4):
        res+=2

tuples = []

perm = list(combinations(nonZeroPrime,2))
for t in perm:
    nonZeroCnt = [cntlist[prime] for prime in t]
    nonZeroCnt.sort()
    nonZeroCnt = tuple(nonZeroCnt)
    if(nonZeroCnt[0]>=4 and nonZeroCnt[1]>=14):
        res += 1
    if(nonZeroCnt[0]>=14):
        res += 1


for t in perm:
    nonZeroCnt = [cntlist[prime] for prime in t]
    nonZeroCnt.sort()
    nonZeroCnt = tuple(nonZeroCnt)
    if(nonZeroCnt[0]>=2 and nonZeroCnt[1]>=24):
        res += 1
    if(nonZeroCnt[0]>=24):
        res += 1



res += len([cnt for cnt in cntlist if cnt>=74])
print(res)

Solution (Python):
from itertools import combinations

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


def count(p, N, n=1):
    if p**n > N:
        return 0
    return N//(p**n) + count(p, N, n+1)


n_prime = [count(p, N) for p in prime]

ret = 0


gt4 = [n for n in n_prime if n >= 4]
gt2 = [n for n in n_prime if n >= 2]
ret += len(list(combinations(gt4, 2))) * (len(gt2)-2)


gt14 = [n for n in n_prime if n >= 14]
gt4 = [n for n in n_prime if n >= 4]
ret += len(gt14) * (len(gt4)-1)


gt24 = [n for n in n_prime if n >= 24]
gt2 = [n for n in n_prime if n >= 2]
ret += len(gt24) * (len(gt2)-1)


gt74 = [n for n in n_prime if n >= 74]
ret += len(gt74)

print(ret)

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    prim_dict = {}

    for i in range(2, N + 1):
        p = 2
        X = i
        for p in range(2, i + 1):
            while X % p == 0:
                if p not in prim_dict:
                    prim_dict[p] = 2
                else:
                    prim_dict[p] += 1
                X /= p
    count_3over = 0
    count_5over = 0
    count_15over = 0
    count_25over = 0
    count_75over = 0
    for p in prim_dict:
        if prim_dict[p] >= 75:
            count_75over += 1L
        if prim_dict[p] >= 25:
            count_25over += 1L
        if prim_dict[p] >= 15:
            count_15over += 1L
        if prim_dict[p] >= 5:
            count_5over += 1L
        if prim_dict[p] >= 3:
            count_3over += 1L

    count = 0L
    
    count += (count_5over * (count_5over-1))/2 * (count_3over - 2)
    count += count_15over * (count_5over - 1)
    count += count_25over * (count_3over - 1)
    count += count_75over
    print count


if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict


def calc_divisors_of_factorial(n):
    ret = defaultdict(int)
    for i in range(1, n+1):
        divisors = calc_prime_divisors(i)
        for d in divisors:
            ret[d] += divisors[d]
    return ret


def calc_prime_divisors(n):  
    ret = defaultdict(int)
    for i in range(2, n+1):
        if is_prime(i):
            while n % i == 0:
                n = n // i
                ret[i] += 1
            if n == 1:
                break
    return ret


def is_prime(n):
    memo = {}
    def calc(n):
        if n in memo:
            return memo[n]
        if n == 1 or n == 2:
            return True
        if n % 2 == 0:
            return False
        d = 3
        while True:
            if d**2 > n:
                break
            if n % d == 0:
                memo[n] = False
                return False
            d += 2
        memo[n] = True
        return True
    return calc(n)


def get_over(divisors, n):
    ret = 0
    for d in divisors:
        if divisors[d]+1 >= n:
            ret += 1
    return ret


def factorial(n):
    memo = {}
    def calc(n):
        if n in memo:
            return memo[n]
        if n <= 1:
            return 1
        ret = n *factorial(n-1)
        memo[n] = ret
        return ret
    return calc(n)


def combination(n, k):
    if n <= 0:
        return 0
    return factorial(n) // (factorial(k) * factorial(n-k))


def solve(n):
    prime_divisors = calc_divisors_of_factorial(n)
    ret = 0
    over_75 = get_over(prime_divisors, 75)
    over_25 = get_over(prime_divisors, 25)
    over_15 = get_over(prime_divisors, 15)
    over_5 = get_over(prime_divisors, 5)
    over_3 = get_over(prime_divisors, 3)

    if over_75 > 0:
        ret += combination(over_75, 1)
    if over_25 > 0 and over_3-1 > 0:
        ret += combination(over_25, 1) * combination(over_3 - 1, 1)
    if over_15 > 0 and over_5-1 > 0:
        ret += combination(over_15, 1) * combination(over_5 - 1, 1)
    if over_5 > 0 and over_3-2>0:
        ret += combination(over_5, 2) * combination(over_3 - 2, 1)

    return ret


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


if __name__ == '__main__':
    main()

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

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

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

pf = [0] * (N + 1)  

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


def count(n):
    f = filter(lambda x: x >= n - 1, pf)
    return len(list(f))


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

print(ans)

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

import math

l=factorize(math.factorial(n))

a74=0
a24=0
a14=0
a4=0
a2=0

for i,j in l:
    if int(j)>=74:
        a74+=1
        a24+=1
        a14+=1
        a4+=1
        a2+=1
    elif int(j)>=24:
        a2+=1
        a24+=1
        a14+=1
        a4+=1
    elif int(j)>=14:
        a2+=1
        a4+=1
        a14+=1
    elif int(j)>=4:
        a2+=1
        a4+=1
    elif int(j)>=2:
        a2+=1


if a74+a24*(a2-1)+a14*(a4-1)+a4*a4*0.5*(a2-2)>=0:
    print(int(a74+a24*(a2-1)+a14*(a4-1)+a4*(a4-1)*0.5*(a2-2)))
else:
    print(0)

Solution (Python):
import sys

def get_pfn(N):
  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
  return e


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

def main():
  input = sys.stdin.readline
  N = int(input())
  e = get_pfn(N)
  print(num(75, e) +\
        num(25, e) * (num(3, e) - 1) +\
        num(15, e) * (num(5, e) - 1) +\
        num(5, e) * (num(5, e) - 1) * (num(3, e) - 2) // 2)

  
if __name__ == '__main__':
  main()

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

counter = [0] * (N + 1)

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

def num(n):
    return len([m for m in range(2, N + 1) if counter[m] >= n - 1])

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

def combinations_count(n, r):
    if n <= 0 or n-r < 0:
      return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def primes(x):
    if x < 2: return []

    primes = [i for i in range(x)]
    primes[1] = 0 

    
    for prime in primes:
        if prime > math.sqrt(x): break
        if prime == 0: continue
        for non_prime in range(2 * prime, x, prime): primes[non_prime] = 0

    return [prime for prime in primes if prime != 0]
  
N = int(input())
primes = primes(N)
num = [0] * 5

for prime in primes:
  cnt = 0
  x = N
  while x >= prime:
    x = int(x/prime)
    cnt += x
  if cnt >= 74:
    num[0] += 1
  if cnt >= 24:
    num[1] += 1
  if cnt >= 14:
    num[2] += 1
  if cnt >= 4:
    num[3] += 1
  if cnt >= 2:
    num[4] += 1

ans = num[0] + num[1] * (num[4] - 1) + num[2] * (num[3] - 1) + \
combinations_count(num[3], 2) * (num[4] - 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 math
import random
class Prime:
    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]
    def is_prime(self,n):
        is_prime_common=self.is_prime_common(n)
        if is_prime_common is not None:return is_prime_common
        if n<2000000:return self.is_prime_brute_force(n)
        return self.is_prime_miller_rabin(n)
    def is_prime_common(self,n):
        if n==1:return False
        if n in Prime.seed_primes:return True
        if any(map(lambda x:n%x==0,self.seed_primes)):return False
    def is_prime_brute_force(self,n):
        for k in range(2,int(math.sqrt(n))+1):
            if n%k==0:return False
        return True
    def is_prime_miller_rabin(self,n):
        d=n-1
        while d&1==0:d>>=1
        witnesses=self.get_witnesses(n)
        for w in witnesses:
            y=pow(w,d,n)
            while d!=n-1and y!=1and y!=n-1:
                y=y*y%n
                d<<=1
            if y!=n-1and d&1==0:return False
        return True
    def get_witnesses(self,num):
        def _get_range(num):
            if num<2047:return 1
            if num<1373653:return 2
            if num<25326001:return 3
            if num<3215031751:return 4
            if num<2152302898747:return 5
            if num<3474749660383:return 6
            if num<341550071728321:return 7
            if num<3825123056546413051:return 9
            return 12
        return self.seed_primes[:_get_range(num)]
    def gcd(self,a,b):
        if a<b:return self.gcd(b,a)
        if b==0:return a
        while b:a,b=b,a%b
        return a
    @staticmethod
    def f(x,n,seed):
        p=Prime.seed_primes[seed%len(Prime.seed_primes)]
        return(p*x+seed)%n
    def find_factor(self,n,seed=1):
        if self.is_prime(n):return n
        x,y,d=2,2,1
        count=0
        while d==1:
            count+=1
            x=self.f(x,n,seed)
            y=self.f(self.f(y,n,seed),n,seed)
            d=self.gcd(abs(x-y),n)
        if d==n:
            return self.find_factor(n,seed+1)
        return self.find_factor(d)
    def find_factors(self,n):
        primes={}
        if self.is_prime(n):
            primes[n]=1
            return primes
        while n>1:
            factor=self.find_factor(n)
            primes.setdefault(factor,0)
            primes[factor]+=1
            n//=factor
        return primes
*d,=sorted(Prime().find_factors(math.factorial(int(input()))).values())
a=0
n=len(d)
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            a+=3*(d[i]>3)or d[i]>1and d[j]>3and d[k]>3
        a+=(2*(d[i]>13)or d[i]>3and d[j]>13)+(2*(d[i]>23)or d[i]>1and d[j]>23)
    a+=d[i]>73
print(a)

Solution (Python):
import math
import random
class Prime:
    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]
    def is_prime(self,n):
        is_prime_common=self.is_prime_common(n)
        if is_prime_common is not None:return is_prime_common
        if n<2000000:return self.is_prime_brute_force(n)
        return self.is_prime_miller_rabin(n)
    def is_prime_common(self,n):
        if n==1:return False
        if n in Prime.seed_primes:return True
        if any(map(lambda x:n%x==0,self.seed_primes)):return False
    def is_prime_brute_force(self,n):
        for k in range(2,int(math.sqrt(n))+1):
            if n%k==0:return False
        return True
    def is_prime_miller_rabin(self,n):
        d=n-1
        while d&1==0:d>>=1
        witnesses=self.get_witnesses(n)
        for w in witnesses:
            y=pow(w,d,n)
            while d!=n-1and y!=1and y!=n-1:
                y=y*y%n
                d<<=1
            if y!=n-1and d&1==0:return False
        return True
    def get_witnesses(self,num):
        def _get_range(num):
            if num<2047:return 1
            if num<1373653:return 2
            if num<25326001:return 3
            if num<3215031751:return 4
            if num<2152302898747:return 5
            if num<3474749660383:return 6
            if num<341550071728321:return 7
            if num<3825123056546413051:return 9
            return 12
        return self.seed_primes[:_get_range(num)]
    def gcd(self,a,b):
        if a<b:return self.gcd(b,a)
        if b==0:return a
        while b:a,b=b,a%b
        return a
    @staticmethod
    def f(x,n,seed):
        p=Prime.seed_primes[seed%len(Prime.seed_primes)]
        return(p*x+seed)%n
    def find_factor(self,n,seed=1):
        if self.is_prime(n):return n
        x,y,d=2,2,1
        count=0
        while d==1:
            count+=1
            x=self.f(x,n,seed)
            y=self.f(self.f(y,n,seed),n,seed)
            d=self.gcd(abs(x-y),n)
        if d==n:
            return self.find_factor(n,seed+1)
        return self.find_factor(d)
    def find_factors(self,n):
        primes={}
        if self.is_prime(n):
            primes[n]=1
            return primes
        while n>1:
            factor=self.find_factor(n)
            primes.setdefault(factor,0)
            primes[factor]+=1
            n//=factor
        return primes
*d,=sorted(Prime().find_factors(math.factorial(int(input()))).values())
a=0
n=len(d)
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            a+=3*(d[i]>3)or d[i]>1and d[j]>3and d[k]>3
        a+=(2*(d[i]>13)or d[i]>3and d[j]>13)+(2*(d[i]>23)or d[i]>1and d[j]>23)
    a+=d[i]>73
print(a)

Solution (Python):



from itertools import combinations
from functools import reduce
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]

def prime_factorization(x):
  
  facters = []

  if x == 1:
    return [1]

  if x in primes:
    return [x]

  for p in primes:
    while x%p == 0:
      x /= p
      facters += [p]
  return facters


facters = {i:prime_factorization(i) for i in range(1, 100+1)}

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

  nn = []
  for i in range(2, n+1):
    nn += facters[i]
  nn = [x+1 for x in Counter(nn).values()]
  count_5 = 0
  count_3 = 0
  count_15 = 0
  count_25 = 0
  count_75 = 0
  f = lambda x: x*f(x-1) if x>1 else 1
  comb = lambda x,y: int(f(x) / (f(y)*f(x-y))) if y<=x else 0
  for x in nn:
    if 75 <= x:
      count_75 += 1
    if 25 <= x:
      count_25 += 1
    if 15 <= x:
      count_15 += 1
    if 5 <= x:
      count_5 += 1
    if 3 <= x:
      count_3 += 1

  counts = [count_3, count_5, count_15, count_25, count_75] 

  ans = comb(count_5, 2) * (count_3 - 2) \
      + count_15 * (count_5 - 1) \
      + count_25 * (count_3 - 1) \
      + count_75
  print(ans)

if __name__=='__main__':
  main()

Solution (Python):

def cmb(n,r):
    if n==0:return 0
    else:
        r=min(r,n-r)
        result=1
        for i in range(n-r+1,n+1):
            result*=i
        for i in range(1,r+1):
            result//=i
        return result


def factorize(n):
    i=2
    result={}
    while True:
        if i**2>n:
            break
        count=0
        while n%i==0:
            n//=i
            count+= 1
        if count!=0:
            result[i]=count
        i+=1
    if n>1:
        result[n]=1
    return result

N = int(input())
l={}
for i in range(1,N+1):
    for i,j in factorize(i).items():
        l[i] = l.get(i,0)+j


l2 = [0]*5

r = 0
for j,i in l.items():
    if i>=74:
        l2[4]+=1
    elif i>=24:
        l2[3]+=1
    elif i>=14:
        l2[2]+=1
    elif i>=4:
        l2[1]+=1
    elif i>=2:
        l2[0]+=1

r += l2[4]
r += sum(l2[3:])*(sum(l2)-1)
r += sum(l2[2:])*(sum(l2[1:])-1)
r += cmb(sum(l2[1:]),2)*(sum(l2)-2)
print(r)

Solution (Python):
N = int(input())
p = [
    sum(N // (i**k) for k in range(1, 8))
    for i in range(2, 97 + 1)
    if all(i % j != 0 for j in range(2, i))
]
def f(m):
  return len([i for i in p if i >= m])
ans = f(74) + f(24) * (f(2) - 1) + f(14) * (f(4) - 1) + f(4) * (f(4) - 1) * (f(2) - 2) // 2
print(ans)

Solution (Python):
def prime_decomposition(n):
    p = 2
    prime = {}
    while n!=1:
        while n%p == 0:
            n = n/p
            if p not in prime:
                prime[p] = 0
            prime[p] += 1
        p += 1
    return prime

N = int(input())
primes = {}
for i in range(1,N+1):
    
    i_prime = prime_decomposition(i)
    for p in i_prime:
        if p not in primes:
            primes[p] = 0
        primes[p] += i_prime[p]

over75 = 0
over25 = 0
over15 = 0
over5 = 0
over3 = 0
for p in primes:
    
    if primes[p]>=74:
        over75 += 1
    if primes[p]>=24:
        over25 += 1
    if primes[p]>=14:
        over15 += 1
    if primes[p]>=4:
        over5 += 1
    if primes[p]>=2:
        over3 += 1

ans75 = over75
ans253 = over25*(over3-1)
ans155 = over15*(over5-1)
ans553 = over5*(over5-1)/2*(over3-2)

ans = ans75+ans253+ans155+ans553

print(int(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):


n=int(input())

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

def num(m):
    return len(list(filter(lambda x:x>=m,cntDiviser)))

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


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


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())
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 = 101
prime = [True]*(N+1)
count = [0]*(N+1)
prime[0] = prime[1] = False

for i in range(N+1):
    if prime[i]:
        for j in range(2*i, N+1, i):
            prime[j] = False
a = int(input())
for i in range(1,a+1):
    cur = i
    for j in range(2,i+1):
        if prime[j]: 
            while cur%j==0:
                count[j]+=1
                cur//=j
            
s=r=0
for i in range(1,a+1):
    if count[i]>=4:
        s+=1
        r+=1
    elif count[i]>=2:r+=1
def num(m): 
    return len(list(filter(lambda x: x >= m-1, count)))



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

Solution (Python):
def isprime(n):
    if(n<2):
        return False
    for i in range(2,n):
        if(n%i==0):
            return False
    return True

def primelist(n):
    return [i for i in range(n) if isprime(i)]

def factor(n):
    f = {}
    while(n > 1):
        for p in primelist(n+1):
            if(n % p == 0):
                f[p] = f.get(p, 0) + 1
                n //= p
    return f

def factorfactorial(n):
    f = {}
    for i in range(1,n+1):
        fi = factor(i)
        for k, v in fi.items():
            f[k] = f.get(k,0) + v
    return f


n = int(input())
f = factorfactorial(n)


cnt = 0

for i in f.keys():
    if(f[i]>=75-1):
        cnt += 1
    for j in primelist(n+1):
        if(i==j):
            continue
        if(f[i]>=25-1 and f[j]>=3-1):
            cnt += 1
        if(f[i]>=15-1 and f[j]>=5-1):
            cnt += 1
        if(i > j):
            for k in primelist(n+1):
                if k in [i,j]:
                    continue
                if(f[i]>=5-1 and f[j]>=5-1 and f[k]>=3-1):
                    cnt += 1



print(cnt)

Solution (Python):
from collections import Counter
N = int(input())
c = Counter()
for n in range(2, N + 1):
    i = 2
    while i**2 <= n:
        count = 0
        while n % i == 0:
            n //= i
            count += 1
        if count != 0:
            c[i] += count
        i += 1
    if n > 1:
        c[n] += 1


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


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

Solution (Python):
from collections import Counter
N = int(input())
c = Counter()
for n in range(2, N + 1):
    i = 2
    while i**2 <= n:
        count = 0
        while n % i == 0:
            n //= i
            count += 1
        if count != 0:
            c[i] += count
        i += 1
    if n > 1:
        c[n] += 1

d = Counter()
for v in c.values():
    if 2 <= v:
        d["3"] += 1
    if 4 <= v:
        d["5"] += 1
    if 14 <= v:
        d["15"] += 1
    if 24 <= v:
        d["25"] += 1
    if 74 <= v:
        d["75"] += 1

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

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

n = int(input())
N = math.factorial(n)

M = N
fac_lst = []
for i in prime:
    count = 0
    M = N
    while M % i == 0:
        M = M // i
        count += 1
    fac_lst.append(count)
    
count0, count1, count2, count3, count4 = 0, 0, 0, 0,0
for i in fac_lst:
    if i >= 74:
        count0 += 1
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 24:
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 14:
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 4:
        count3 += 1
        count4 += 1
    elif i >= 2:
        count4 += 1
count_lst = [count0, count1, count2, count3, count4]

ans0 = count_lst[0]
ans1 = count_lst[1] * (count_lst[4] - 1)
ans2 = count_lst[2] * (count_lst[3] - 1)
ans3 = (count_lst[3]*(count_lst[3]-1) // 2) * (count_lst[4] - 2)
if ans1 < 0:
    ans1 = 0
if ans2 < 0:
    ans2 = 0
if ans3 < 0:
    ans3 = 0
print(ans0+ans1+ans2+ans3)

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([i for i in e if i >= m-1])

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

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

    def is_prime(self, n):
        is_prime_common = self.is_prime_common(n)
        if is_prime_common is not None:
            return is_prime_common

        if n < 2000000:
            return self.is_prime_bf(n)
        else:
            return self.is_prime_mr(n)

    def is_prime_common(self, n):
        if n == 1: return False
        if n in Prime.seed_primes: return True
        if any(map(lambda x: n % x == 0, self.seed_primes)): return False

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

    def is_prime_mr(self, n):
        d = n - 1
        while d % 2 == 0:
            d //= 2

        witnesses = self.get_witnesses(n)

        for w in witnesses:
            y = pow(w, d, n)

            while d != n - 1 and y != 1 and y != n - 1:
                y = (y ** 2) % n
                d *= 2

            if y != n - 1 and d % 2 == 0:
                return False

        return True

    def get_witnesses(self, num):
        def _get_range(num):
            if num < 2047:
                return 1
            if num < 1373653:
                return 2
            if num < 25326001:
                return 3
            if num < 3215031751:
                return 4
            if num < 2152302898747:
                return 5
            if num < 3474749660383:
                return 6
            if num < 341550071728321:
                return 7
            if num < 38255123056546413051:
                return 9
            return 12

        return self.seed_primes[:_get_range(num)]

    def gcd(self, a, b):
        if a < b:
            a, b = b, a
        if b == 0:
            return a
        while b:
            a, b = b, a % b
        return a

    @staticmethod
    def f(x, n, seed):
        p = Prime.seed_primes[seed % len(Prime.seed_primes)]
        return (p * x + seed) % n

    def find_factor(self, n, seed=1):
        if self.is_prime(n):
            return n

        x, y, d = 2, 2, 1
        count = 0
        while d == 1:
            count += 1
            x = self.f(x, n, seed)
            y = self.f(self.f(y, n, seed), n, seed)
            d = self.gcd(abs(x - y), n)

        if d == n:
            return self.find_factor(n, seed+1)
        return self.find_factor(d)

    def find_factors(self, n):
        primes = {}
        if self.is_prime(n):
            primes[n] = 1
            return primes

        while n > 1:
            factor = self.find_factor(n)

            primes.setdefault(factor, 0)
            primes[factor] += 1

            n //= factor

        return primes

prime = Prime()

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

    prime = Prime()

    factors = {}

    for i in range(2, N + 1):
        f = prime.find_factors(i)
        for k, v in f.items():
            if k in factors:
                factors[k] += v
            else:
                factors[k] = v

    t = factors.values()

    r = 0

    g75 = len([v for v in t if 74 <= v])
    g25 = len([v for v in t if 24 <= v])
    g15 = len([v for v in t if 14 <= v])
    g5 = len([v for v in t if 4 <= v])
    g3 = len([v for v in t if 2 <= v])

    
    r += g75

    
    r += g25 * (g3 - 1)

    
    r += g15 * (g5 - 1)

    
    r += g5 * (g5 - 1) // 2 * (g3 - 2)


    print(r)


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, N + 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())
Nprime = [x for x in range(2,N+1) if (x%2 !=0 and x%3!=0 and x%5!=0 and x%7!=0)]
Nprime = [2,3,5,7] + Nprime
F = []
for i,j in enumerate(Nprime):
    number = N
    while number != 0:
        F.append(0)
        F[i] += number//j
        number = number//j

more_two = 0
more_four = 0
ans1 = 0
ans = 0

for i in F:
    if i >= 2:
        more_two += 1
    if i >= 4:
        more_four += 1

for i in F:
    if i >= 4:
        ans1 += (more_four-1)*(more_two-2)
    else:
        continue
    if i >= 14:
        ans += more_four - 1
    if i >= 24:
        ans += more_two - 1
    if i >= 74:
        ans += 1

ans += ans1//2

print(ans)

Solution (Python):
def era(n):
    table = [0] * (n + 1)
    prime_list = []
    
    for i in range(2, n + 1):
        if table[i] == 0:
            prime_list.append(i)
            for j in range(2*i, n + 1, i):
                table[j] = 1
    
    return prime_list

def f(n):
    cnt = 0
    for i in data:
        if i[1] >= n-1:
            cnt += 1
    return cnt
 
N = int(input())
s = era(N)
data = []
 
for i in s:
    k = i
    c = 0
    while N // k >= 1:
        c += N // k
        k = k*i
 
    data.append([i,c])
 

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