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):
def prime(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for j in range(4, n+1, 2):
        is_prime[j] = False
    for i in range(3, int(n**0.5) + 1, 2):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

n = int(input())
prime_list = prime(n)
p = len(prime_list)
key = dict()
for value in prime_list:
    key[value] = 0
for i in range(1, n+1):
    div = make_divisors(i)
    for d in div:
        if d in key:
            k = 0
            i_c = i
            while i_c%d == 0:
                k += 1
                i_c //= d
            key[d] += k
ans = 1
for v in key.values():
    ans *= v+1
    ans %= 10**9+7
print(ans)

Solution (Python):
n = int(input())
fct = [1]*(n+7)
for i in range(2,int(n**(1/2))+7):
    if fct[i]:
        for j in range(2*i,n+1,i):
            fct[j]=0
fct2 = {i:1 for i in range(2,n+1) if fct[i]}
fct3 = [i for i in range(2,n+1) if fct[i]]
for i in range(2,n+1):
    for j in fct3:
        i2 = i
        while i2%j==0:
            fct2[j]+=1
            i2//=j
mod = 10**9+7
ans = 1 
for i in fct2:
    ans*=fct2[i]
    ans%=mod
            
print(ans)

Solution (Python):
import math

N =int(input())
r = 10 ** 9 + 7
num_lis = [2]

for i in range(N+1):
    for j in range(2,i):
        if i % j == 0:
            break
        elif j == i - 1:
            num_lis.append(i)

num_lis2 = [0] * len(num_lis)

tmp1 = 1
tmp2 = 0
for i in range(len(num_lis)):
    count = 0
    tmp1 = 1
    tmp2 = num_lis[i]
    while tmp2 ** tmp1 <= N:
        tmp3 = tmp2 ** tmp1
        count += int(math.floor(N / tmp3))
        tmp1 += 1
    num_lis2[i] = count

Ans = 1
for i in range(len(num_lis2)):
    Ans = Ans * (num_lis2[i] + 1)
    Ans = Ans % r

print(Ans)

Solution (Python):
from math import log
N=int(input())
lp=[1 for i in range(N+1)]
for i in range(2,N+1):
    if lp[i]==1:
        for j in range(2*i,N+1,i):
            lp[j]=0
ans=1
MOD=10**9+7
for i in range(2,N+1):
    if lp[i]==1:
        count=0
        for j in range(int(log(N,i))):
            count=(count+N//(i**(j+1))%MOD)%MOD
        ans=ans*(count+1)%MOD
print(ans)

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

primes = []
for i in range(1, n + 1):
    p = prime_factorize(i)
    primes.extend(p)
c = Counter(primes)

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

Solution (Python):

from collections import Counter, deque 












import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def prime_factorize1(N):
        """
        Nをくって、Nの素因数を格納したリストresを返す。
        リストの要素をすべて掛ければNになる"""
        res = []
        x = N
        y = 2
        while y*y <= x:
            while x % y == 0:
                res.append(y)
                x //= y
            y += 1
        if x > 1:
            res.append(x)
        return res

    n=int(input())
    mod=10**9+7
    ans=[]
    for i in range(1,n+1):
        ans.extend(prime_factorize1(i))
    ans=Counter(ans)
    cnt=1
    for j in ans.values():
        cnt*=(j+1)
    print(cnt%mod)





resolve()

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



mod = 10 ** 9 + 7
ans = 0
def eratos(num):
    dp = [True] * (num)
    dp[0] = dp[1] = False 
    sqrt_num = int(num ** 0.5) + 1
    for i in range(2, sqrt_num):
        if dp[i]:
            for j in range(i**2, num, i):
                dp[j] = False
    primes = []
    for index, k in enumerate(dp):
        if k:
            primes.append(index)
    return primes
primes = eratos(n + 1)

m = []
for p in primes:
    t = 0
    for i in range(1, n + 1):
        while i % p == 0:
            t += 1
            i //= p
    m.append(t)
ans = 1
for k in m:
    ans *= (k + 1) % mod
print(ans % mod)

Solution (Python):
import math
n=int(input())
mod=10**9+7
ans=1

def primenumber_table(N):  
  table=[i for i in range(2,N+1)]
  l=[]
  while len(table)!=0:
    num=table[0]
    l.append(num)
    i=0
    while i<len(table):
      if table[i]%num==0:
        table.pop(i)
      else:
        i+=1
  return l
    
table=primenumber_table(1000)
v=math.factorial(n)
init_v=v
while v!=1:
  for num in table:
    cnt=0
    while v%num==0:
      cnt+=1
      v//=num
    if cnt!=0:
      ans*=(cnt+1)
      ans%=mod
  if v==init_v:
    ans*=2
    ans%=mod
print(ans)

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



arr = []

def factorization(n):
    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

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

result = []
for i in range(2,N+1):
    c = 0
    for j in range(len(arr)):
        if i == arr[j][0]:
            c += arr[j][1]
    if c > 0:
        result.append([i,c])

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

print(ans)

Solution (Python):
mod = 10**9+7
N = int(input())
prime = [2]
for i in range(3,N+1):
    flag = True
    for x in prime:
        if i%x == 0:
            flag = False
    if flag:
        prime.append(i)
ans = 1
for p in prime:
    e = 1
    cnt = 0
    while p**e <= N:
        cnt += N//(p**e)
        e += 1
    ans = ans *(cnt+1)%mod
print(ans)

Solution (Python):

N=int(input())
CNT=[0 for i in range(N+1)]
for i in range(2,N+1):
    k=2
    while k<=i:
        if i%k==0:
            CNT[k]+=1
            i//=k
        else:
            k+=1
ans=1
for cnt in CNT:
    ans*=cnt+1
print(ans%(10**9+7))

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

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

d = {}
for i in range(2, n + 1):
    t = prime_division(i)
    for j in t:
        if j[0] in d:
            d[j[0]] += j[1]
        else:
            d[j[0]] = j[1]

num = 1
for i in d.values():
    num *= i + 1

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

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

dist = [0]*(N+1)
mod = 10**9 + 7
dist[1] = 1

for i in range(1,N+1):
    for j in range(2,i+1):
        while i%j == 0:
            dist[j] += 1
            i = i/j
ans = 1
for i in range(2, N+1):
    if dist[i] != 0:
        ans = ans*(dist[i]+1)%mod

print ans

Solution (Python):
import math

N = int(input())
n = int(math.sqrt(N))
fact = [0] * (N + 1)
MOD = 10 ** 9 + 7

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

    if tmp != 1:
        fact[tmp] += 1
ans = 1
for f in fact[1:]:
    ans *= f + 1
    ans %= MOD

print(ans)

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

def D(n,d):
  c=0
  while n>0:
    c=c+n//d
    n=n//d
  return c

A=primes(1000)
P=[[0]*2 for i in range(len(A))]
for i in range(len(A)):
  P[i][0]=A[i]
n=int(input())
mod=10**9+7
for j in range(len(A)):
  P[j][1]=P[j][1]+D(n,A[j])
ans=1
for i in range(len(A)):
  ans=ans*(P[i][1]+1)%mod
print(ans)

Solution (Python):
from collections import defaultdict
n = int(input())
MOD = 10**9+7


def factorization(n):
    retval = []
    tmp = n
    for i in range(2, int(-(-n**.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            retval.append((i, cnt))
    if tmp != 1:
        retval.append((tmp, 1))
    if not retval:
        retval.append((n, 1))
    return retval


d = defaultdict(int)
for i in range(1, n+1):
    f = factorization(i)
    for k, v in f:
        d[k] += v

ans = 1

for k, v in d.items():
    if k == 1:
        continue
    ans = ans*(v+1) % MOD

print(ans)

Solution (Python):
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]


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

N = ii()
d = defaultdict(int)
for i in range(2, N+1):
    for l in factorization(i):
        d[l[0]] += l[1]

ans = 1
INF = 10**9+7

for key in d:
    
    ans = (ans * (d[key]+1))

ans = ans%INF
          
print(ans)

Solution (Python):
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]


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

N = ii()
d = defaultdict(int)
for i in range(2, N+1):
    for l in factorization(i):
        d[l[0]] += l[1]

ans = 1
INF = 10**9+7

for key in d:
    ans = (ans * (d[key]+1))%INF
          
print(ans)

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


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


def print_matrix(mat):
    for i in range(len(mat)):
        print(*mat[i])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False


def factorization(n):
    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

def main():
    N = I()
    v = defaultdict(int)

    for i in range(1, N+1):
        fac = factorization(i)
        for f in fac:
            v[f] += 1

    ans = 1
    for c in v.values():
        ans *= (c + 1)
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np
n=int(input())
mod=10**9+7
if n==1:print(1);sys.exit()
def searchPrimeNum(N):
    max = int(np.sqrt(N))
    searchList = [i for i in range(2,N+1)]
    primeNum = []
    while searchList[0] <= max:
        primeNum.append(searchList[0])
        tmp = searchList[0]
        searchList = [i for i in searchList if i % tmp != 0]
    primeNum.extend(searchList)
    return primeNum
l=len(searchPrimeNum(n))
plist=searchPrimeNum(n)
cnt=[0]*l
for i in range(l):
  k=1 
  while plist[i]**k<=n:
    cnt[i]+=n//(plist[i]**k)
    k+=1
ans=1
for i in cnt:
  ans=(ans*(i+1))%mod
print(ans)

Solution (Python):
from collections import Counter
MOD = 10**9 + 7
N = int(input())
P = []
for M in range(2,N+1):
    Q = []
    k = 2
    while k*k <= M:
        if M%k == 0:
            M //= k
            Q.append(k)
        else:
            k += 1
    if M > 1:
        Q.append(M)
    P += Q

C = Counter(P)
ans = 1
for e in C:
    ans *= C[e]+1
    ans %= MOD
print(ans)

Solution (Python):
import math

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

ans = 1
i = 2
while i <= x:
    cnt = 1
    while x%i == 0:
        x //= i
        cnt += 1
    ans *= cnt
    i += 1
                
print(ans%(10**9+7))

Solution (Python):
MOD = 1000000007

n = int(input())

cnt = [0 for _ in range(1010)]
for i in range(1, n + 1):
    j = 2
    while j * j <= i:
        while i % j == 0:
            i //= j
            cnt[j] += 1
        j += 1
    
    if i > 1:
        cnt[i] += 1

ans = 1
for x in cnt:
    ans = ans * (x + 1) % MOD

print(ans)

Solution (Python):

import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = 10 ** 18
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

N = int(input())
ans = 1
num_list = [0] * (N + 1)
for n in range(2, N+1):
    for i in range(2, 10 ** 3 + 1):
        while n % i == 0:
            num_list[i] += 1
            n //= i
for i in num_list:
    ans *= (i+1)
    ans %= MOD
print(ans)

Solution (Python):
x=int(input())
a = [1]*1001
ans=1
def prime_factorize(n):
    
    while n % 2 == 0:
        a[2]=a[2]+1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a[f]=a[f]+1
            n //= f
        else:
            f += 2
    if n != 1:
        a[n]=a[n]+1
    return a

for i in range(1,x+1):
	prime_factorize(i)
for i in range(x+1):
	ans=(ans*a[i])%(10**9+7)
print(ans)

Solution (Python):
n = int(input())
mod = 10**9+7

prime = {}
for i in range(2, n+1):
    for j in range(2, int(i**0.5)+1):
        if i%j != 0:
            continue

        prime.setdefault(j, 1)

        while i%j == 0:
            i //= j
            prime[j] += 1

    if i != 1:
        if i not in prime:
            prime.setdefault(i, 1)
        else:
            prime[i] += 1

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

Solution (Python):
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())
mod = 10**9 + 7
dic = {}
for i in range(2, n + 1):
    tmp = prime_factorize(i)
    for j in tmp:
        if j in dic:
            dic[j] += 1
        else:
            dic[j] = 1

ans = 1
for i in dic.values():
    ans *= i + 1

if ans == 1:
    print(1)
else:
    print(ans % mod)

Solution (Python):
MOD = 10 ** 9 + 7
n = int(input())

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

ans = 1
for i in range(n + 1):
    ans *= (ex[i] + 1)
    ans %= MOD
    
print(ans)

Solution (Python):
N = int(input())
m = pow(10,9)+7

A = [1]*(N+1)
for n in range(2,N+1):
    k = n
    for i in range(2,n+1):
        if k%i==0:
            while k>1:
                k//=i
                A[i]+=1
                if k%i!=0:break
ans = 1
for a in A:ans*=a
print(ans%m)

Solution (Python):


N = int(input().strip())



class factorization():
    def get_divisor(self, n :int) -> dict:
        divisor_dic={}
        
        tmp_num = n
        for i in range(2,n):
            
            while tmp_num % i == 0:
                divisor_dic.setdefault(i,0)
                divisor_dic[i] += 1
                
                tmp_num //= i
        
        return divisor_dic




divisor_dic={}  
for num in range(2,N+1):
    
    fa = factorization()
    ret = fa.get_divisor(num)
    
    if ret == {}:
        divisor_dic.setdefault(num,0)
        divisor_dic[num] += 1
    else:
        for key,v in ret.items():
            divisor_dic.setdefault(key,0)
            divisor_dic[key] += v

cnt=1
for key,v in divisor_dic.items():
    cnt = cnt * (divisor_dic[key] + 1) % (10**9 + 7)

print(cnt)

Solution (Python):
from sys import stdin
from collections import defaultdict
mod = 10**9+7
N = int(stdin.readline().rstrip())

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
  
ans = 1
fact = defaultdict(int)
for i in range(2,N+1):
    for j,k in factorize(i):
        fact[j] += k

for l in fact.values():
    ans *= (l+1)
    ans %= mod
print(ans%mod)

Solution (Python):
n = int(input())
D = [0]*(n+1)
mod = 10**9+7

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

ans = 1

if n==1:
  print(ans)
else:
  for k in range(2, n+1):
    ans = ans*(D[k]+1)%mod
  print(ans)

Solution (Python):
n = int(input())
mod = 10**9+7
prime=[]
for i in range(2,n+1):
    for k in range(len(prime)):
        if i % prime[k] == 0:
            break 
    else:
        prime.append(i)
fac = []
for i in range(len(prime)):
    fac.append(0)
for i in range(n+1):
    while i > 1:
        for k in range(len(prime)):
            while i % prime[k] == 0:
                i = i // prime[k]
                fac[k] += 1
count = 1
for i in range(len(fac)):
    count *= fac[i] + 1
    count %= mod
print(count)

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

d = {}
for i in range(2, n+1):
    j = 2
    while i >= j:
        if i % j == 0:
            i //= j
            if d.get(j):
                d[j] += 1
            else:
                d[j] = 1
        else:
            j += 1
            
ans = 1
for k, v in d.items():
    ans *= (v+1)

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

Solution (Python):
import numpy as np
from collections import Counter

def prime_factorization(n):
    arr = []
    tmp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if tmp % i == 0:
            while tmp % i == 0:
                arr.append(i)
                tmp //= i
    if(tmp != 1):
        arr.append(tmp)
    if not arr:
        arr.append(n)
    return arr

mod = 1000000007
N = int(input())
prime_factors = {}
for i in range(2, N+1):
    counts = Counter(prime_factorization(i))
    for k,v in counts.items():
        prime_factors[k] = prime_factors.get(k, 0) + v
ans = 1
for v in prime_factors.values():
    ans *= (v+1)
    ans %= mod
print(ans)

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

A = [0] * 1000
for i in range(1, x+1):
    B = factorization(i)
    for j in B:
        a, b = j
        A[a] += b

t = 1
for i in A[2:]:
    t *= (i+1)
    t %= 1000000007
print(t)

Solution (Python):
N = int(input())
mod = pow(10,9)+7
S = []
A = [True]*(N+1)
A[0] = A[1] = False
for i in range(2,N+1):
    if A[i]:
        S.append(i)
        A[i::i] = [False]*(N//i)
B = [1]*(N+1)
for i in range(2,N+1):
    n = i
    for s in S:
        while n%s==0:
            B[s]+=1
            n//=s
ans = 1
for b in B:ans*=b
print(ans%mod)

Solution (Python):
n = int(input())
MOD = 10**9 + 7

def prime_factorization(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

import math
prime_factors = prime_factorization(math.factorial(n))

from collections import Counter
c = Counter(prime_factors)

ans = 1
for v in c.values():
    ans *= (v+1)
    ans %= MOD
print(ans)

Solution (Python):
def count_divisor(n):
    count = 1
    divisor = 2
    while divisor * divisor <= n:
        degree = 0 
        while n % divisor == 0:
            n = n // divisor
            degree += 1
        divisor += 1
        count *= (degree + 1)
    if n > 1:
        count *= 2
    return count

def solve():
    n = int(input())
    MOD = 10 ** 9 + 7
    f = 1
    for i in range(1, n+1):
        f *= i
    return count_divisor(f) % MOD

print(solve())

Solution (Python):
from functools import lru_cache
from collections import defaultdict
MOD = 10**9 + 7


def Is_prime(n):
    
    if n<=1:
        return False
    
    if n==2 or n==3:
        return True
    
    if n%2==0:
        return False
    
    sqrt_root = int(n**.5)
    
    for i in range(3,sqrt_root+1,2):
        if n%i==0:
            return False
    
    return True



def Prime_table(n):
    res = []
    for i in range(n+1):
        if Is_prime(i):
            res.append(i)
    return res


def Factorization(n):
    prime_table = Prime_table(n)
    arr = []
    temp = n
    for i in prime_table:
        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

N = int(input())
L = list(map(Factorization, range(2,N+1)))

d = defaultdict(int)
for i in range(len(L)):
    for l in L[i]:
        d[l[0]] += l[1]

res = 1
for i in d.values():
    res *= (i+1)
    res %= MOD
print(res)

Solution (Python):
from collections import Counter



"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

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

N = int(input())
mod = 10**9+7
counter = Counter()
for n in range(1,N+1):
    fs = factorization(n)
    for f in fs:
        counter[f[0]] += f[1]

counts = counter.most_common()
ans = 1
for count in counts:
    if count[0] != 1:
        ans *= (count[1]+1)
        ans %= mod
print(ans)

Solution (Python):
import math
MOD=1000000007
    
def prime(n):
    max=int(math.sqrt(n))
    li=[i for i in range(2,n+1)]
    primes=[]
    while li[0]<=max:
        primes.append(li[0])
        tmp=li[0]
        li=[i for i in li if i%tmp!=0]
    primes.extend(li)
    return primes

sosu=prime(1000)
N=int(input())
Nbeki=1
for i in range(1,N+1):
    Nbeki=Nbeki*i%MOD

soin=[0]*1000

for i in range(1,N+1):
    for j in range(len(sosu)):
        while(i%sosu[j]==0):
            i//=sosu[j]
            soin[sosu[j]]+=1

ans=1
for i in range(len(soin)):
    if(soin[i]!=0):
        ans=ans*(soin[i]+1)%MOD
print(ans)

Solution (Python):
def ord(N,n):
    if n%N!=0:
        return 0
    else:
        return 1+ord(N,n//N)

def get_sieve_of_eratosthenes_new(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

primelist=get_sieve_of_eratosthenes_new(1000)

import sys

input=sys.stdin.readline

N=int(input())

factorize=[0 for i in range(0,len(primelist))]

for i in range(1,N+1):
    for j in range(0,len(primelist)):
        factorize[j]+=ord(primelist[j],i)
        i=i//primelist[j]**ord(primelist[j],i)

ans=1
for i in range(0,len(primelist)):
    ans=ans*(factorize[i]+1)
print(ans%(10**9+7))

Solution (Python):
def ord(N,n):
    if n%N!=0:
        return 0
    else:
        return 1+ord(N,n//N)

def get_sieve_of_eratosthenes_new(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

primelist=get_sieve_of_eratosthenes_new(1000)

import sys

input=sys.stdin.readline

N=int(input())

factorize=[0 for i in range(0,len(primelist))]

for i in range(1,N+1):
    for j in range(0,len(primelist)):
        factorize[j]+=ord(primelist[j],i)
        i=i//primelist[j]**ord(primelist[j],i)

ans=1
for i in range(0,len(primelist)):
    ans=ans*(factorize[i]+1)
print(ans%(10**9+7))

Solution (Python):
import math

N = int(input())

def append_divisor(divisors, num):
    if num not in divisors:
        divisors[num] = 1
    else:
        divisors[num] += 1

def solve(divisors, num):
    limit = int(math.sqrt(num)) + 1
    for i in range(2, limit):
        while num % i == 0:
            append_divisor(divisors, i)
            num //= i
    if num != 1:
        append_divisor(divisors, num)

divisors = {}
for i in range(2, N + 1):
    solve(divisors, i)


mod = 10**9 + 7

ans = 1
for d in divisors:
    ans = (ans * (divisors[d] + 1)) % mod
print(ans)

Solution (Python):

def prime_factorization(N):
    
    pf = {}
    for i in range(2, int(N**0.5) + 1):
        while N % i == 0:
            if i not in pf.keys():
                pf[i] = 1
            else:
                pf[i] += 1
            N //= i
    if N > 1:
        pf[N] = 1
    return pf
mod = 10**9 + 7
N = int(input())
primes = {}
for v in range(1, N+1):
    p = prime_factorization(v)
    for k in p.keys():
        if k not in primes.keys():
            primes[k] = p[k]
        else:
            primes[k] += p[k]
ans = 1
for k in primes.keys():
    ans *= primes[k] + 1
    ans %= mod
print(ans % mod)

Solution (Python):


def count_divisor(num: int) -> int:
    i =1 
    count = 0
    while i * i < num:
        if num % i == 0:
            count += 2
        i += 1
    if num % i == 0:
        count += 1
    return count

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

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

data = [0] * (N+1)
i = N
while i > 0:
    
    lis = factorization(i)
    
    
    for li in lis:
        k, v = li
        data[k] += v 
    i -= 1

ans = 1
data[1] = 0
for d in data:
    if d != 0:
        ans = ans * (d+1) % M
        ans %= M

print(ans)

Solution (Python):
import sys
import math
import fractions
import bisect
import queue
import heapq
import collections
import itertools
sys.setrecursionlimit(4100000)

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288
INF = 1e18

'''
1行のint=====================================
N, K = map(int, input().split())
N, M = map(int, input().split())
A, B = map(int, input().split())

H, W = map(int, input().split())

L, R = map(int, input().split())

1行のstring=================================
S, T = input().split()

1行の整数配列================================
P = list(map(int,input().split()))

A = list(map(int,input().split()))
B = list(map(int,input().split()))

D = list(map(int,input().split()))

L = list(map(int,input().split()))
R = list(map(int,input().split()))

T = list(map(int,input().split()))

改行あり整数==================================
X = []
Y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    X.append(x1)
    Y.append(y1)

A = []
for i in range(N):
    a=int(input())
    A.append(a)

Pair = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    Pair.append((x1, y1))
    
2次元整数配列=====================================
A = []
for i in range(N):
    tmp = list(map(int,input().split()))
    A.append(tmp)


N行M列の初期化====================================
dp = [[VAL] * RETU for i in range(GYO)]

'''



N = int(input())

g_sosuu = [] 



def eratos(n):
    global g_sosuu

    for i in range(n):
        g_sosuu.append(True)
        
    g_sosuu[0] = False
    g_sosuu[1] = False
    for i in range(2, int(math.sqrt(n)) + 1):
        if g_sosuu[i]:
            for j in range(i*2, n, i):
                g_sosuu[j] = False


eratos(N+10)

sosuu_list = []
for i in range(N+10):
    if g_sosuu[i]:
        sosuu_list.append(i)


ans = 1
count = [0]*1010
for n in range(1, N+1):
    
    for s in sosuu_list:

        for i in range(1, 100):
            if n%(s**i) == 0:
                count[s] += 1
            else:
                break

for c in count[2:]:
    ans *= (c+1)%MOD
    ans %= MOD

print(ans)

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

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

for i in range(1, n+1):
    for j in range(2, int(i**0.5)+1):
        cnt = 0
        while i % j == 0:
            cnt += 1
            i //= j
        factors[j] += cnt
    if i > 1:
        factors[i] += 1

ans = 1

for f in factors:
    if f > 0:
        ans *= f+1
        ans %= 10**9+7

print(ans)