Problem:
 Score : 300 points    Problem Statement You are given an integer N .
Find the number of the positive divisors of N! , modulo 10^9+7 .      Constraints  1≤N≤10^3         Input The input is given from Standard Input in the following format:  N       Output Print the number of the positive divisors of N! , modulo 10^9+7 .        Sample Input 1 3      Sample Output 1 4  There are four divisors of 3!  =6 : 1 , 2 , 3 and 6 . Thus, the output should be 4 .       Sample Input 2 6      Sample Output 2 30       Sample Input 3 1000      Sample Output 3 972926972

Solution (Python):
from collections import defaultdict

def main():
    n=int(input())
    mod=10**9+7
    ans=1
    l=[]
    d=defaultdict(int)
    for i in range(1,n+1):
        l+=prime_factorize(i)
    for i in l:
        d[i]+=1
    for i in d.values():
        ans*=i+1
    print(ans%mod)


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


if __name__ == '__main__':
    main()

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

nf = math.factorial(n)

dic = {}
for i in range(2, nf + 1):
  counter = 0
  while nf % i == 0:
    nf //= i
    counter += 1
  if counter != 0:
    dic[i] = counter
  if nf == 1:
    break
ans = 1
for item in dic.values():
  ans *= (item + 1) % (10**9 + 7)
print(ans % (10**9 + 7))

Solution (Python):
N=int(input());d={};p=1
for i in range(1,1+N):
 f=2
 while f*f<=i:
  if i%f:f+=1
  else:d[f]=d.get(f,0)+1;i//=f
 if i>1:d[i]=d.get(i,0)+1
for v in d.values():p*=v+1
print(p%(10**9+7))

Solution (Python):
def PrimeNumber(N):
    if N==2:
        ans=[2]
        return ans
    ans = list(range(2, N + 1))
    i = 0
    while ans[i] < N ** 0.5 + 1:
        j = 2
        temp = ans[i]
        while temp * j <= ans[-1]:
            if temp * j in ans:
                ans.remove(temp * j)
            j += 1
        i += 1
    return ans

N=int(input())

if N==1:
    print(1)
    exit()

mod=10**9+7
PN=PrimeNumber(N)
P=[0]*(N+1)

for i in range(2,N+1):
    temp=i
    for j in PN:
        if temp<j:
            break
        cnt=0
        while temp%j==0:
            cnt+=1
            temp=temp//j
        P[j]+=cnt

ans=1

for i in range(1,N+1):
    if P[i]!=0:
        ans=(ans*(P[i]+1))%mod
print(ans)

Solution (Python):
from collections import defaultdict


def PrimeFactorization(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 main():
    n = int(input())
    d = defaultdict(int)
    for i in range(n + 1):
        for k, v in PrimeFactorization(i).items():
            d[k] += v
    ans = 1
    for v in d.values():
        ans *= (v + 1)
        ans %= 1000000007
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import collections
N = int(input())
ans = 0
ans_table = collections.defaultdict(int)
prev = []
for i in range(1, N+1):

    tmp = i
    for j in range(2, int((i**0.5//1))+1):
        if tmp % j == 0:
            count = 0
            while tmp % j == 0:
                count += 1
                tmp = tmp//j
            ans_table[j] += count
    if tmp != 1:
        ans_table[tmp] += 1

ans_list = list(ans_table.values())
ans = 1
for x in ans_list:
    ans *= (x+1)

print(ans % ((10**9) + 7))

Solution (Python):
n = int(input())
if n < 3:
    print(n)
    exit()

primes = [2]

import math
for i in range(3, n+1):
    k = int(math.sqrt(i))
    flag = True
    for p in primes:
        if p > k:
            break
        if  i%p == 0:
            flag = False
            break
    if flag:
        primes.append(i)

ans = 1
for p in primes:
    k = n
    cnt = 0
    while k:
        k = k//p
        cnt += k
    
    ans *= cnt + 1
ans = ans % (10**9 + 7)
print(ans)

Solution (Python):
n = int(input())
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
res = 1

nprime = [p for p in prime if p <= n]

for p in prime:
    tempn = n
    tres = 1
    while tempn >= p:
        tempn = tempn // p
        tres += tempn
    res *= tres
    if res > 10**9+7:
        res %= (10**9+7)

print(res)

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

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


ans=1
for m in M:
  if m:
    ans*=(m+1)
print(ans%(10**9+7))

Solution (Python):
from collections import Counter
N = int(input())
MOD = 10**9+7
  
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
  
ans = 1
counter = Counter()
for p in range(2,N+1):
  counter.update(Counter(prime_factorize(p)))
for value in counter.values():
    ans *= (value + 1)
print(ans % MOD)

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def prime(n,is_prime=True):
    """
    n: positive integer
    if is_prime: return n is prime
    else: return list of prime <= n
    """
    if n<=1: return False if is_prime else []
    S=[1]*(n+1)
    S[0]=0; S[1]=0
    for i in range(2,n):
        if S[i]==0: continue
        for j in range(2*i,n+1,i):
            S[j]=0
    if is_prime: return bool(S[n])
    else: return [p for p in range(n+1) if S[p]]
def resolve():
    n=int(input())
    P=prime(n,False)
    bin=[0]*(n+1)
    for p in P:
        q=p
        while(q<=n):
            bin[p]+=n//q
            q*=p
    ans=1
    for b in bin:
        ans=ans*(b+1)%MOD
    print(ans)
resolve()

Solution (Python):


N=int(input())
all=1
ans=1
l=[1]*(N+1)

for n in range(2,N+1):
    for i in range(2,n+1):
        count=1
        while n%i==0:
            n/=i
            l[i]+=1
for item in l:
    ans*=item
    
print(ans%(10**9+7))

Solution (Python):
from collections import Counter

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

n = int(input())

t = []
for tmp in range(2, n+1):
    t.extend(prime_decomposition(tmp))

ans = 1

for v in Counter(t).values():
    ans *= v + 1


print(ans % (10**9+7))

Solution (Python):
from math import factorial
from functools import reduce
from operator import mul

N = factorial(int(input()))
if N == 1:
  print(1)
  exit()

M = 10**9 + 7
ans = 1

div = 2
while N != 1:
  cnt = 0
  while N%div == 0:
    N //= div
    cnt += 1
  if cnt != 0:
    ans *= (cnt+1)
    ans = ans%M
  div += 1
print(ans)

Solution (Python):
from collections import Counter

n = int(input())

pf = []

for i in range(2, n+1):
    f = i
    cnt = 2
    while True:
        if not f % cnt:
            pf.append(cnt)
            f //= cnt
            if f == 1: break
        else: cnt += 1
          
c = Counter(pf)
ans = 1
for v in c.values():
    ans *= v+1

print(ans % (10**9+7))

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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
n=int(input())
a=1
for x in l:
	a*=sum(n//x**i for i in range(1,2+9*(x<32)))+1
	a%=10**9+7
print(a)

Solution (Python):
n=int(input());a=1;r=range
for x in[i for i in r(2,n+1)if all(i%j for j in r(2,int(i**.5)+1))]:a*=sum(n//x**i for i in r(1,11))+1;a%=10**9+7
print(a)

Solution (Python):
n=int(input());a=1;r=range
for x in[i for i in r(2,n+1)if all(i%j for j in r(2,i))]:a*=sum(n//x**i for i in r(1,11))+1
print(a%(10**9+7))

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


def trial_division(n):
    factor = []
    for num in range(2, int(n**0.5)+1):
        while n % num == 0:
            n //= num
            factor.append(num)
    if not factor or n != 1:
        factor.append(n)
    return factor


d = {}
for i in range(2, N+1):
    divisors = trial_division(i)
    for divisor in divisors:
        d[divisor] = d.get(divisor, 0) + 1

ans = 1
for v in d.values():
    ans = ans * (v + 1) % (10**9+7)
print(ans)

Solution (Python):
from collections import Counter

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

N = int(input())
counter = Counter()
for i in range(2, N+1):
    counter.update(Counter(prime_factorize(i)))
ans = 1
for value in counter.values():
    ans *= (value + 1)
print(ans % (10**9 + 7))

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

def factor(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                n //= i
                cnt += 1
            memo[i] += cnt
        i += 1
    if n > 1:
        memo[n] += 1

for n in range(2, N + 1):
    factor(n)

mod = 10 ** 9 + 7
ans = 1
for m in memo:
    if m >= 1:
        ans *= m + 1
        ans %= mod
print(ans)

Solution (Python):
from functools import reduce
N = int(input())
A = list(range(2,N+1))
sqrt = N**(1/2)
idx = 0
if N == 1:
    print(1)
    exit()
while True:
    p = A[idx]
    if p > sqrt:
        break
    check_numbers = A[idx+1:]
    for check_number in check_numbers:
        if check_number % p == 0:
            A.remove(check_number)
    idx += 1

ans = 1
B = [1] * 1001
for n in range(2, N+1):
    for a in A:
        if n == 1:
            break
        while True:
            if n % a == 0:
                B[a] += 1
                n //= a
            else:
                break
MOD = 10**9+7
print(reduce(lambda a,b: a*b , B)%MOD)

Solution (Python):
def make_divisors(n):
    divisors=[]
    for i in range(1,int(n**0.5)+1):
        if(n%i==0):
            divisors.append(i)
            divisors.append(n//i)
    return divisors
    
def factorization(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
    
def main():
    n=int(input())
    ans=1
    cnt={}
    for i in range(1,n+1):
        fact=factorization(i)
        for s in fact:
            if s not in cnt:
                cnt[s]=1
            else:
                cnt[s]+=1
    for value in cnt.values():
        ans=ans*(value+1)%(10**9+7)
    print(ans)
main()

Solution (Python):
N = int(input())
MOD = 10 ** 9 + 7
prime = []
for n in range(2, N+1):
    cnt = 0
    for i in range(1, n+1):
        if n % i == 0:
            cnt += 1
    if cnt == 2:
        prime.append(n)

ans = 1
for p in prime:
    cnt = 0
    for n in range(1, N + 1):
        
        tmp = n
        while n / p == n // p:
            cnt += 1
            n //= p
    ans *= (cnt + 1)
    ans %= MOD

print(ans)

Solution (Python):
n=int(input())
e=[0]*(n-1)
for i in range(2,n+1):
  a=i
  for j in range(2,i+1):
    while a%j==0:
      e[j-2]+=1
      a//=j
ans=1
for k in e:
  ans*=k+1
print(ans%1000000007)

Solution (Python):
from math import factorial
from collections import Counter

def prime(n):
    a = [0] * (n + 1)
    a[0] = 1
    a[1] = 1
    i = 2
    while n // i >= i:
        if a[i] != 0:
            i += 1
            continue
        j = 2 * i
        while j <= n:
            a[j] = 1
            j += i
        i += 1
    return [i for i, ai in enumerate(a) if ai == 0]


n = int(input())
f = factorial(n)
primes = prime(n)
counter = Counter()

while f > 1:
    for p in primes:
        if f % p == 0:
            counter[p] += 1
            f = f // p

ans = 1
for val in counter.values():
    ans *= (val + 1)

print(ans % (10**9 + 7))

Solution (Python):
from math import factorial
from collections import Counter

def primes(n):
    a = [0] * (n + 1)
    a[0] = 1
    a[1] = 1
    i = 2
    while n // i >= i:
        if a[i] != 0:
            i += 1
            continue
        j = 2 * i
        while j <= n:
            a[j] = 1
            j += i
        i += 1
    for i, ai in enumerate(a):
        if ai == 0:
            yield i


n = int(input())
f = factorial(n)
counter = Counter()

while f > 1:
    for p in primes(n):
        if f % p == 0:
            counter[p] += 1
            f = f // p

ans = 1
for val in counter.values():
    ans *= (val + 1)

print(ans % (10**9 + 7))

Solution (Python):
from math import factorial
from collections import Counter

def prime(n):
    a = [0] * (n + 1)
    a[0] = 1
    a[1] = 1
    i = 2
    while n // i >= i:
        if a[i] != 0:
            i += 1
            continue
        j = 2 * i
        while j <= n:
            a[j] = 1
            j += i
        i += 1
    return [i for i, ai in enumerate(a) if ai == 0]


n = int(input())
f = factorial(n)
primes = prime(n)
counter = Counter()

while f > 1:
    for p in primes:
        if f % p == 0:
            counter[p] += 1
            f = f // p

ans = 1
for val in counter.values():
    ans *= (val + 1)

print(ans % (10**9 + 7))

Solution (Python):
from collections import defaultdict


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


def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass

  
n=int(input())
dd = defaultdict(int)
mod=10**9+7

for i in range(1,n+1):
	for item in fctr1(i):
	    dd[item[0]] += item[1]

res=1

for item in dd.values():
  res=(res*(item+1))%mod
print(res)

Solution (Python):
import math
import collections


def sosu(N):
    res = [0] * (N + 1)
    res[0] = res[1] = 1
    for i in range(2, math.ceil((math.sqrt(N)) + 1)):
        if res[i] != 0: continue
        for j in range(2, N):
            if i * j > N: break
            res[i * j] = 1
    return [i for (i, v) in enumerate(res) if v == 0]


N = int(input())
p_tbl = sosu(N)

counter = collections.Counter()
for i in range(2, N + 1):
    tmp = i
    for p in p_tbl:
        while tmp % p == 0 and tmp // p > 0:
            counter[p] += 1
            tmp = tmp // p
ans = 1
for v in counter.values():
    ans *= (v + 1)
    ans %= (10**9)+7
print(ans)

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

MOD = (10 ** 9) + 7

def factorization(n):
    x = 2
    pw = 0
    factlist = []
    while(n != 1):
        if(n%x == 0):
            n = n // x
            pw += 1
        elif(pw > 0):
            factlist.append([x,pw])
            pw = 0
            x += 1
        else:
            x += 1
    factlist.append([x,pw])
    return factlist


list = factorization(math.factorial(N))
ans = 1
for i in range(len(list)):
    ans = ((ans % MOD) * ( (list[i][1] + 1) % MOD)) % MOD
print(ans)

Solution (Python):
import math
mod = 10 ** 9 + 7

def f(num):

    i = 2
    d = dict()

    while i * i <= num:
        if num % i == 0:
            num //= i
            d[i] = d.get(i, 0) + 1
        else:
            i += 1
    d[num] = 1

    return d

n = int(input())
if n == 1:
    print(1)
    exit()

ans = 1

for i in f(math.factorial(n)).values():
    ans *= i+1

print(ans%mod)

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

def factor(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                n //= i
                cnt += 1
            memo[i] += cnt
        i += 1
    if n > 1:
        memo[n] += 1

for n in range(2, N + 1):
    factor(n)

mod = 10 ** 9 + 7
ans = 1
for m in memo:
    if m >= 1:
        ans *= m + 1
        ans %= mod
print(ans)

Solution (Python):
import math
import collections

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

n = int(input())
mod = 10 ** 9 + 7
f = factorizec(math.factorial(n))
ans = 1
for i in f:
    ans *= i[1] + 1
print(ans % mod)

Solution (Python):
n=int(input())
sosu=[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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
a=[0]*len(sosu)
for i in range(2,n+1):
	for j in range(len(sosu)):
		while i%sosu[j]==0:
			i//=sosu[j]
			a[j]+=1
ans=1
for i in range(len(sosu)):
	ans*=(a[i]+1)
	ans%=(10**9+7)
print(ans)

Solution (Python):
import collections
n = int(input())
d = [0] * n
for i in range(2, n + 1):
    ti = i
    for j in range(2, n + 1):
        while True:
            if ti % j == 0:
                d[j-1] += 1
                ti //= j
            else:
                break
t = 1
for i in d:
    t = t * (i + 1) % (10 ** 9 + 7)
print(t)

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

def main():
    N = int(input())
    MOD = int(1e9) + 7
    if N == 1:
        print(1)
        exit()
    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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
    count = [0] * len(primes)
    for i in range(2, N+1):
        for j in range(len(primes)):
            while i%primes[j] == 0:
                count[j] += 1
                i //=primes[j]
    
    ans = 1
    for i in range(len(count)):
        if count[i] > 0:
            ans *= count[i]+1
            ans %= MOD
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict

N = int(input())
d = defaultdict(int)


def soinsuu(n):
    while n != 1:
        for i in range(2, int(n**0.5)+1):
            if n % i == 0:
                d[i] += 1
                n = n // i
                break
        else:
            d[n] += 1
            n = 1


for i in range(1, N+1):
    soinsuu(i)
ans = 1
for v in d.values():
    ans = ans * (v+1) % int(1e9+7)
print(ans)

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

N = int(input())


check = [0] * 10001
for i in range(1, N+1):
    tmp = factorize(i)
    for j in range(len(tmp)):
        check[tmp[j][0]] += tmp[j][1]

x = []
for i in range(len(check)):
    if check[i] != 0:
        x.append(check[i])


ans = 1
for i in range(len(x)):
    ans *= x[i]+1 
    ans %= 1000000007
print(ans)

Solution (Python):

from math import factorial

n=int(input())
mod=(10**9+7)
def trial_div(n):
    div={}
    for i in range(2,n+1):
        res=i
        for j in range(2,i+1):
            while res%j==0:
                res//=j
                div[j]=div.get(j,0)+1
    return div

res=trial_div(n)
ans=1
for k,v in res.items():
    ans=(ans*(v+1))%mod
print(ans)

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

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

def factor(N):
    p = []
    for l in prime(N):
        while(N % l == 0):
            p.append(l)
            N //= l
    return p
L = []
for i in range(2, N+1):
    L += factor(i)
ans = 1
for p in prime(N):
    l = L.count(p)
    ans *= (l+1)
    ans %= 10**9+7
print(ans)

Solution (Python):
z = int(input())
a = [True] * 1001
a[0] = False
a[1] = False
b = []
for i in range(2, 1001):
    if a[i]:
        b.append(i)
        for j in range(i, 1001, i):
            a[j] = False
c = {}
for i in range(1, z + 1):
    d = i
    while True:
        if d == 1:
            break
        else:
            while d != 1:
                for j in b:
                    if d % j == 0:
                        d //= j
                        if j not in c:
                            c[j] = 1
                        else:
                            c[j] += 1
e = 1
for v in c.values():
    e = (e * (v + 1)) % (10 ** 9 + 7)
print(e)

Solution (Python):
a = [True] * 1001
a[0] = False
a[1] = False
b = []
c = {}
for i in range(2, 1001):
    if a[i]:
        b.append(i)
        for j in range(2, 1001, 2):
            a[j] = False
d = int(input())
for j in range(2, d + 1):
    temp_j = j
    for i in b:
        while True:
            if temp_j % i != 0:
                break
            else:
                if i not in c:
                    c[i] = 1
                else:
                    c[i] += 1
                temp_j //= i
e = 1
for k in c.keys():
    e = (e * (c[k] + 1)) % (10 ** 9 + 7)
print(e)

Solution (Python):
import collections

factors = [[],[1]]
for i in range(2,1001):
    temp = []
    div = 2
    while div <= i and 1 < i:
        if i%div == 0:
            temp.append(div)
            i = i//div
        else:
            div += 1
    factors.append(temp)

mod = int(1e9+7)
n = int(input())
if n == 1:
    print(1)
else:
    div = []
    for i in range(2,n+1):
        for k in range(len(factors[i])):
            div.append(factors[i][k])
    s = collections.Counter(div)
    ans = 1
    for i in s:
        ans = ans*(s[i]+1)%mod
    print(ans)

Solution (Python):
import math
def isPrime(num):
    if num < 2: return False
    elif num == 2: return True
    for i in range(2,math.floor(math.sqrt(num))+1):
        if num % i == 0:
            return False
    return True

n=int(input())
if n==1:print(1);exit()
l=[i for i in range(1,n+1) if isPrime(i)==True]
ans=1
INF=10**9+7
for i in l:
    tmp=0
    tmpi=i
    while n//i>0:
        tmp+=n//i
        i*=tmpi
    ans=(ans*(tmp+1))%INF
print(ans)

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

P = [2]
for i in range(3, 1001, 2):
    flag = True
    for p in P:
        if i % p == 0:
            flag = False
            break
    if flag:
        P.append(i)

ans = 1
for p in P:
    if p > N:
        break
    t = 0
    i = 1
    while (p ** i) <= N:
        t += N // (p ** i)
        i += 1
    ans *= 1 + t

print(ans % ((10 ** 9) + 7))

Solution (Python):
mod=1000000007
n=int(input())
d={}
for i in range(2,1001):
    cnt=1
    for j in range(2,i//2+1):
        if i%j==0:
            cnt=0
    if cnt==1:
        d[i]=0
p=list(d.keys())
for k in range(2,n+1):
    for i in p:
        cnt=0
        while k%i==0:
            k=k//i
            cnt+=1
        if cnt!=0:
            d[i]+=cnt
a=list(d.values())
ans=1
for i in a:
    if i!=0:
        ans*=(i+1)
        ans%=mod
print(ans)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007


def A():
    n = I()
    return


def B():
    n = I()

    return


def C():
    def factor(n):
        if n < 4:
            return {1:1,n:1}
        else:
            d = defaultdict(lambda : 0)
            i = 2
            m = n
            while i**2 <= n:
                if m%i == 0:
                    while m%i == 0:
                        d[i] += 1
                        m //= i
                i += 1
            d[m] += 1
            return d
    n = I()
    if n == 1:
        print(1)
        quit()
    f = defaultdict(lambda : 0)
    for i in range(2,n+1):
        fact = factor(i)
        for j,k in fact.items():
            if j > 1:
                f[j] += k
                f[j] %= mod
    ans = 1
    for i in f.values():
        ans *= (i+1)
        ans %= mod
    print(ans)
    return


def D():
    def root(x):
        if x == par[x]:
            return x
        par[x] = root(par[x])
        return par[x]

    def unite(x,y):
        x = root(x)
        y = root(y)
        if rank[x] < rank[y]:
            par[x] = y
        else:
            par[y] = x
            if rank[x] == rank[y]:
                rank[x] += 1

    n,a,b = LI()
    par = [i for i in range(n)]
    rank = [0]*n
    x = LI()
    for i in range(n-1):
        if a*(x[i+1]-x[i]) < b:
            unite(i,i+1)
    ans = 0
    f = [1]*n
    f[0] = 0
    for i in range(1,n):
        if f[root(i)]:
            ans += b
            f[root(i)] = 0
        else:
            ans += a*(x[i]-x[i-1])
    print(ans)
    return


def E():
    n = I()

    return


def F():
    n = I()

    return


if __name__ == "__main__":
    C()

Solution (Python):
n=int(input())
def soinsuu(a):
    yakusuu=[]
    j=2
    while(a>1):
        for i in range(j,int(a**0.5)+1):
            if a%i==0:
                yakusuu.append(i)
                a=a//i
                j=i
                break
        else:
            yakusuu.append(a)
            break
    yakusuu.sort()
    return yakusuu
ans=[]
from collections import Counter
for i in range(2,n+1):
    ans+=soinsuu(i)
ans2=1
mod=10**9+7
for i in Counter(ans).values():
    ans2=(ans2*(i+1))%mod
print(ans2)

Solution (Python):
MOD = 10**9+7
n = int(input())
from collections import defaultdict
d = defaultdict(int)
for i in range(2, n+1):
  j = 2
  while j*j<=i:
    while i%j==0:
      i //= j
      d[j] += 1
    j += 1
  if i>1:
    d[i] += 1
ans = 1
for ele in d.values():
  ans = ans*(ele+1)%MOD
print(ans)

Solution (Python):
import functools

MOD = 10 ** 9 + 7
N = int(input())

primes = [2]

for i in range(3, N + 1):
    if not [p for p in primes if i % p == 0]:
        primes.append(i)

count = {p: 0 for p in primes}
for i in range(1, N + 1):
    num = i
    for p in primes:
        while num % p == 0:
            count[p] += 1
            num //= p

print(functools.reduce(lambda s, c: s * (c + 1) % MOD, count.values(), 1))

Solution (Python):
import math
n=math.factorial(int(input()))
a,i=1,2
while i*i<=n:
  c=1
  while n%i==0:
    c+=1
    n//=i
  a*=c
  i+=1
print(a*2**(n!=1)%(10**9+7))

Solution (Python):
import math
n=math.factorial(int(input()))
a,i=1,2
while i*i<=n:
  c=1
  while n%i==0:
    c+=1
    n//=i
  a*=c
  i+=1
print(a*2**(n!=1)%(10**9+7))

Solution (Python):
n = list(map(int, input().split()))
n = n[0]

primes = []

for i in range(n+1):
    if(i<2):
        continue
    flag = 1
    for j in range(len(primes)):
        flag *= i%primes[j]
    if(flag != 0):
        primes.append(i)

nump = len(primes)
times = [0 for i in range(nump)]

for i in range(nump):
    for j in range(10):
        times[i] += n//primes[i]**(j+1)


ans = 1
for i in range(nump):
    ans = (ans*(times[i]+1))%1000000007

print(ans)

Solution (Python):

def count_divisors(num: int) -> int:
    max_prime = 0
    dic = {}
    res = 1

    cnt = 0
    while num % 2 == 0:
        num //= 2
        cnt += 1
    if cnt > 0:
        max_prime = 2
        dic[max_prime] = cnt

    cnt = 0
    for i in range(3, int(num ** 0.5) + 1, 2):
        cnt = 0
        while num % i == 0:
            num //= i
            max_prime = i
            cnt += 1
        if cnt > 0:
            dic[max_prime] = cnt

    if num > 2:
        max_prime = num
        dic[max_prime] = 1

    return dic


def main():
    n = int(input())
    MOD = 10 ** 9 + 7
    f = {}
    for i in range(2, n + 1):
        for j, k in count_divisors(i).items():
            if j not in f:
                f[j] = 0
            f[j] += k
    ans = 1
    for i in f.values():
        ans = (ans * (i + 1)) % MOD
    print(ans)


if __name__ == "__main__":
    main()

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

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

for num in div:
    ans *= (num+1)

print(ans % (10**9 + 7))

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

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

for num in div:
    ans *= (num+1)

print(ans % (10**9 + 7))