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):
n=int(input())
p_list=[]
m=1
for i in range(1,n+1):
  m*=i
  if i==1:
    pass
  elif i==2:
    p_list.append(2)
  else:
    div=0
    for j in p_list:
      if i%j==0:
        div+=1
        break
    if div==0:
      p_list.append(i)

ans=1
for i in p_list:
  s=0
  aaa=0
  while aaa==0:
    if m%i==0:
      s+=1
      m=m//i
    else:
      aaa+=1
  s+=1
  ans*=s

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

Solution (Python):
def primes(n):
    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
    return [i for i in range(n + 1) if is_prime[i]]

def count(N, p):
    cnt = 0
    while N != 0:
        cnt += N // p
        N //= p
    return cnt

N = int(input())
mod = 10 ** 9 + 7
Primes = primes(N)
ans = 1
for p in Primes:
    ans *= (count(N, p) + 1)
    ans %= mod
print(ans)

Solution (Python):
def isPrime(x):
    if x < 2:
        return 0
    elif x == 2:
        return 1
    if x%2 == 0:
        return 0
    ir=int(x**(0.5))+1
    for i  in range(3,ir,2) :
        if x%i == 0:
            return 0
    return 1

n=int(input())

p=[]
for i in range(n+1):
    if isPrime(i):
        p.append(i)

pp=[0]*len(p)
for ni in range(2,n+1):
    for pi in range(len(p)):
        pcnt=0
        nn=ni
        while nn>0:
            if nn%p[pi]==0:
                nn=nn//p[pi]
                pcnt+=1
            else:
                break
        pp[pi]=pp[pi]+pcnt
    
mod=10**9+7
ppp=1
for pi in range(len(p)):
    if pp[pi]!=0:
        ppp=ppp*(pp[pi]+1)%mod
print(ppp)

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

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

for i in range(1, n+1):
    a = factorization(i)
    for i in range(len(a)):
        if a[i][0] not in dic:
            dic[a[i][0]] = 1
        else:
            dic[a[i][0]] += a[i][1]

ans = 1
for k in dic.values():
    ans *= k+1
print((ans//2)%mod)

Solution (Python):

















mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    dic = {}
    for i in range(2,n+1):
        a = i
        p = 2
        while p * p <= a:
            if a % p == 0:
                if p in dic:
                    dic[p] += 1
                else:
                    dic[p] = 1
                a //=p
            else:
                p += 1
        if a in dic:
            dic[a] += 1
        else:
            dic[a] = 1
    ans = 1
    
    for k,v in dic.items():
        ans *= (v+1)
    print(ans%mod)
if __name__ == '__main__':
  main()

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

MAX = 2000
MOD = int(1e9) + 7
factors = [0] * MAX
primes = []


def p():
    ps = [True] * MAX

    for i in range(2, MAX):
        j = 2 * i
        if not ps[i]:
            continue
        primes.append(i)

        while j < MAX:
            ps[j] = False
            j += i


def fac(x):
    for p in primes:
        while x != 1 and x % p == 0:
            factors[p] += 1
            x //= p


N = int(input())

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

ans = 1
for f in factors:
    ans = ans * (f + 1) % MOD

print(ans)

Solution (Python):
MOD = 10 ** 9 + 7
N = int(input())
C = [0] * (N + 1)
for i in range(2, N+1):
    k = i
    for j in range(2, i+1):
        while k % j == 0:
            k //= j
            C[j] += 1
        if k == 1:
            break
ans = 1
for c in C:
    ans *= (c + 1)
    ans %= MOD
print(ans)

Solution (Python):
from collections import defaultdict
n = int(input())

factors = defaultdict(int)
for i in range(2, n + 1):
    for j in range(2, i+1):
        while i % j == 0:
            factors[j] += 1
            i //= j
if n == 1:
    print(1)
else:
    a = '*'.join(str(value+1) for value in factors.values())
    print(eval(a)%(10**9+7))

Solution (Python):
import math
N = int(input())
prime=[]
count=[]
ans = 1
place = 0
t=10**9
t+=7
for k in range(1,N+1):
    for i in range(2,k+1):
        while k % i == 0:
            k //= i
            if(i in prime):
                count[prime.index(i)] += 1
            else:
                prime.append(i)
                count.append(1)
                place += 1
for j in range(0,place):
    ans *= (count[j]+1)
print(ans%t)

Solution (Python):
import math

N = int(input())

f = math.factorial(N)
i = 2
ans = 1
cnt = 0

while f != 1:
    if f % i == 0:
        f //= i
        cnt += 1
    else:
        ans *= (cnt + 1)
        cnt = 0
        i += 1


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

Solution (Python):
from collections import Counter


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[i] += cnt

    if temp != 1:
        arr[temp] += 1

    if len(arr.keys()) == 0 and n != 1:
        arr[n] += 1


N = int(input())
arr = Counter()
for i in range(1, N + 1):
    factorization(i)

cnt = 1
MOD = 10 ** 9 + 7
for v in list(arr.values()):
    cnt *= (v + 1)
    cnt %= MOD

print(cnt)

Solution (Python):




def main():
    N = int(input())
    x, mod = 1, 10**9 + 7
    for i in range(1, N + 1):
        x *= i
    result = 1

    for i in range(2, N + 1):
        cnt = 1
        while x % i == 0:
            x = x // i
            cnt += 1
        result *= cnt

    result = result % mod
    print(result)


if __name__ == "__main__":
    main()

Solution (Python):
data = int(input())
modu = 10 ** 9 + 7
n = 1
for i in range(2, data + 1):
  n *= i
count = 1
ans = 1
for i in range(2, data + 1):
  if n % i != 0:
    continue
  count = 1
  while n % i == 0:
    n //= i
    count += 1
  ans *= count
print(ans % modu)

Solution (Python):



def prime_factorize(n):
    
    res = []
    for i in range(2,n+1):
        
        ex = 0
        
        if i * i > n:
            break
        if n % i != 0:
            continue
        
        while ( n % i == 0):
            ex += 1
            n /= i
        
        res.append([i,ex])
    
    if n != 1:
        res.append([int(n),1])

    return res


N = int(input())
MOD = 1000000007

exp = [0] * (N+1)

for i in range(2,N+1):
    pf = prime_factorize(i)
    for j in range(len(pf)):
        exp[pf[j][0]] += pf[j][1]

ans = 1
for i in range(2,N+1):
    
    ans *= exp[i] + 1
    ans %= MOD

print(ans)

Solution (Python):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import permutations,combinations
from collections import defaultdict,Counter


from functools import reduce
from pprint import pprint

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

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col):
    data.sort(key=lambda x:x[col],reverse=False)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

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



def makePrimeChecker(n):
    isPrime = [True] * (n + 1)
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2, int(n ** 0.5) + 1):
        if isPrime[i]:
            for j in range(i * i, n + 1, i):
                isPrime[j] = False
    return isPrime

ls = makePrimeChecker(n)













ans = 1
for p in range(2,len(ls)):
    if ls[p]:
        i = 0
        count = 0
        while n>=(p**i):
            i += 1
            count += n//(p**i)
        ans *= count + 1
    else:
        pass




print(ans%mod)

Solution (Python):
import math
n = int(input())
d = {}
       
for i in range(2,n+1):
  for j in range(2,i+1):
    while i%j == 0:
      i /= j
      if j in d:
        d[j] += 1
      else:
        d[j] = 2
ans = 1
for i in list(d.values()):
  ans *= i
print(ans%(10**9+7))

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

import math

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

num = prime_factorize(math.factorial(N))
ans = 1
num_list = set(num)

mod = 10**9+7

for x in num_list:
    ans = ans*(num.count(x)+1)%mod
    
print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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(readline())
divisors = [1]
for i in range(1, n):
    divisors += prime_decomposition(i + 1)
counter = list(Counter(divisors).items())
ans = 1
mod = 10 ** 9 + 7
for k, v in counter:
    if k != 1:
        ans = (ans % mod) * ((v + 1) % mod) % mod
print(ans)

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

for m in range(1, n + 1):
    for i in range(2, int(m**0.5) + 1):
        while not m % i:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1:
        if m in pf:
            pf[m] += 1
        else:
            pf[m] = 1

res = 1
for i, j in pf.items():
    res *= j + 1
print(res % mod)

Solution (Python):
import sys
sys.setrecursionlimit(2000)
n = int(input())

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

    return arr

factor_dict = {}
for i in range(2,n+1):
    factor_ls = factorization(i)
    for factor in factor_ls:
        if not factor[0] in factor_dict.keys():
            factor_dict[factor[0]] = 0
        factor_dict[factor[0]] += factor[1]
       
num_factor = 1
for num in factor_dict.values():
    num_factor *= num + 1
print(num_factor % (10**9 + 7))

Solution (Python):
mod = 1000000000 + 7

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())
dat = [0] * 2000 


res = 1
for i in range(1, n + 1):
    d = factorization(i)
    for j in range(len(d)):
        dat[d[j][0]] += d[j][1]

for i in range(2, n + 1):
    res *= (dat[i] + 1)
    res %= mod

print(res)

Solution (Python):
mod=10**9+7
N=int(input())
M=1
y=[1 for k in range(N)]
for k in range(2,N+1):
    for j in range(2,k+1):
        if k==1:
            break
        if k%j ==0:
            count=0
            while k%j==0:
                k=k//j
                count+=1
            y[j-1]+=count
ans=1
for k in range(len(y)):
    ans=ans*y[k]%mod
print(ans)

Solution (Python):
mod=10**9+7
N=int(input())
M=1
y=[1 for k in range(N)]
for k in range(2,N+1):
    for j in range(2,k+1):
        if k%j ==0:
            count=0
            while k%j==0:
                k=k//j
                count+=1
            y[j-1]+=count
ans=1
for k in range(len(y)):
    ans=ans*y[k]%mod
print(ans)

Solution (Python):
import sys

import numpy as np
def sieve_of_eratosthenes(n=10 ** 7):
  sieve = np.ones(n + 1); sieve[:2] = 0
  for i in range(2, int(np.sqrt(n)) + 1):
    if sieve[i]: sieve[i*2::i] = 0
  return sieve, np.flatnonzero(sieve)

is_prime, prime_numbers = sieve_of_eratosthenes()

def prime_factorize(n):
  res = dict()
  if n < 2: return res
  border = int(n ** 0.5)
  for p in prime_numbers:
    if p > border: break
    while n % p == 0: res[p] = res.get(p, 0) + 1; n //= p
    if n == 1: return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = dict()
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items(): res[p] = res.get(p, 0) + c
  return res

MOD = 10 ** 9 + 7

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

def main():
  res = 1
  for c in prime_factorize_factorial(n).values():
    res *= c + 1; res %= MOD
  print(res)

if __name__ ==  '__main__':
  main()

Solution (Python):
import sys

def sieve_of_eratosthenes(n=5 * 10 ** 6):
  sieve = [1] * (n + 1); sieve[0] = sieve[1] = 0
  for i in range(2, int(n ** 0.5) + 1):
    if not sieve[i]: continue
    for j in range(i * 2, n, i): sieve[j] = 0
  prime_numbers = [i for i in range(2, n + 1) if sieve[i]]
  return sieve, prime_numbers

is_prime, prime_numbers = sieve_of_eratosthenes(10 ** 3)

def prime_factorize(n):
  res = dict()
  if n < 2: return res
  border = int(n ** 0.5)
  for p in prime_numbers:
    if p > border: break
    while n % p == 0: res[p] = res.get(p, 0) + 1; n //= p
    if n == 1: return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = dict()
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items(): res[p] = res.get(p, 0) + c
  return res

MOD = 10 ** 9 + 7

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

def main():
  res = 1
  for c in prime_factorize_factorial(n).values():
    res *= c + 1; res %= MOD
  print(res)

if __name__ ==  '__main__':
  main()

Solution (Python):
import sys
from collections import defaultdict

def sieve_of_eratosthenes(n=5 * 10 ** 6):
  sieve = [1] * (n + 1); sieve[0] = sieve[1] = 0
  for i in range(2, int(n ** 0.5) + 1):
    if not sieve[i]: continue
    for j in range(i * 2, n, i): sieve[j] = 0
  prime_numbers = [i for i in range(2, n + 1) if sieve[i]]
  return sieve, prime_numbers

is_prime, prime_numbers = sieve_of_eratosthenes(10 ** 3)

def prime_factorize(n):
  res = defaultdict(int)
  if n < 2: return res
  border = int(n ** 0.5)
  for p in prime_numbers:
    if p > border: break
    while n % p == 0: res[p] += 1; n //= p
    if n == 1: return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = defaultdict(int)
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items(): res[p] += c
  return res

MOD = 10 ** 9 + 7

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

def main():
  res = 1
  for c in prime_factorize_factorial(n).values():
    res *= c + 1; res %= MOD
  print(res)

if __name__ ==  '__main__':
  main()

Solution (Python):
import sys
from collections import defaultdict
from bisect import bisect_right as bi_r

U = 5 * 10 ** 6
def sieve_of_eratosthenes(n=U):
  if n == 1: return set()
  sieve = set(range(2, n + 1))
  for p in sieve_of_eratosthenes(int(n ** 0.5)):
    sieve -= set(range(p * 2, n + 1, p))
  return sieve

prime_numbers = sieve_of_eratosthenes(10 ** 3)
soted_prime_numbers = sorted(prime_numbers)

def is_prime(n): return n in prime_numbers

def prime_factorize(n):
  res = defaultdict(int)
  if n < 2: return res
  for p in soted_prime_numbers[:bi_r(soted_prime_numbers, int(n ** 0.5))]:
    while n % p == 0:
      res[p] += 1
      n //= p
    if n == 1:
      return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = defaultdict(int)
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items():
      res[p] += c
  return res

MOD = 10 ** 9 + 7

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

def main():
    res = 1
    for c in prime_factorize_factorial(n).values():
        res *= c + 1; res %= MOD
    print(res)

if __name__ ==  '__main__':
    main()

Solution (Python):
import sys
from collections import defaultdict
from bisect import bisect_right as bi_r

def sieve_of_eratosthenes(n=10 ** 6):
  if n == 1: return set()
  sieve = set(range(2, n + 1))
  for p in sieve_of_eratosthenes(int(n ** 0.5)):
    sieve -= set(range(p * 2, n + 1, p))
  return sieve

prime_numbers = sieve_of_eratosthenes()
soted_prime_numbers = sorted(prime_numbers)

def is_prime(n): return n in prime_numbers

def prime_factorize(n):
  res = defaultdict(int)
  if n < 2: return res
  for p in soted_prime_numbers[:bi_r(soted_prime_numbers, int(n ** 0.5))]:
    while n % p == 0:
      res[p] += 1
      n //= p
    if n == 1:
      return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = defaultdict(int)
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items():
      res[p] += c
  return res

MOD = 10 ** 9 + 7

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

def main():
    res = 1
    for c in prime_factorize_factorial(n).values():
        res *= c + 1; res %= MOD
    print(res)

if __name__ ==  '__main__':
    main()

Solution (Python):
import math
from functools import reduce
N=int(input())
MOD=10**9+7

def all_multiple(a):
    return reduce(lambda a,b:a*b,a)

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


A=[1]*(N+1)
ans=1
for N_t in range(2,N+1):
    for num in range(1,N_t+1):
        if is_prime(num):
            cnt=0
            while N_t%num==0:
                N_t=N_t//num
                cnt+=1
            A[num]+=cnt 

print(all_multiple(A)%MOD)

Solution (Python):
import math
from functools import reduce
N=int(input())
MOD=10**9+7
'''
def all_multiple(a):
    return reduce(lambda a,b:a*b,a)
'''
def all_multiple_mod(a,m):
    return reduce(lambda a,b:((a%m)*(b%m))%m,a)




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


A=[1]*(N+1)
ans=1
for N_t in range(2,N+1):
    for num in range(1,N_t+1):
        if is_prime(num):
            cnt=0
            while N_t%num==0:
                N_t=N_t//num
                cnt+=1
            A[num]+=cnt 

print(all_multiple_mod(A,MOD)%MOD)

Solution (Python):
import math
from functools import reduce
N=int(input())
MOD=10**9+7
'''
def all_multiple(a):
    return reduce(lambda a,b:a*b,a)
'''
def all_multiple_mod(a,m):
    return reduce(lambda a,b:((a%m)*(b%m))%m,a)

def is_prime(n):
    if n<=1 or (n!=2 and n%2==0):
        return False
    elif 2<=n<=9:
        return True
    else:
        res=True
        for d in range(3,int(math.sqrt(n))+1,2):
            if n%d==0:
                res=False
                break
        return res


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

A=[1]*(N+1)
ans=1
for N_t in range(2,N+1):
    for num in range(1,N_t+1):
        if is_prime(num):
            cnt=0
            while N_t%num==0:
                N_t=N_t//num
                cnt+=1
            A[num]+=cnt 

print(all_multiple_mod(A,MOD)%MOD)

Solution (Python):
n=int(input())
s,ans,num =1,1,2
for i in range(2, n+1):
  s*=i
l=[]
while s!=1:
  if not s%num:
    l.append(num)
    s//=num
  else:
    num+=1
for i in set(l):
  ans*=l.count(i)+1
  ans%=10**9+7
print(ans%(10**9+7))

Solution (Python):

import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque
import itertools


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

pf = [0]*(N+1)
for n in range(2,N+1):
    q = n
    i = 2
    while q>1:
        if q%i == 0:
            pf[i] += 1
            q /= i
        else:
            i += 1

ans = 1
for f in pf:
    ans = (ans*(f+1))%MOD

print(ans)

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:
    return a
  return gcd_(a,a % b) 
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""


def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7
def main():
  n = int(input())
  m = 1
  for _ in range(n,1,-1):
    m *= _
  
  cnt = 1
  for i in range(2,n+1):
    tmp = 1
    while m % i == 0:
      m //= i
      tmp += 1
    cnt *= tmp
  print(cnt%mod)
if __name__ == '__main__':
  main()

Solution (Python):
from math import factorial as f
n=int(input())
m=f(n)
ans=1
p=[1]*1000
for i in range(2,1001):
  while m%i==0:
    m//=i
    p[i]+=1
for i in p:
  ans*=i
  ans%=(10**9+7)
print(ans)

Solution (Python):
N=int(input())
pf={}
m=0
insuu=[0]*(N+1)
p=10**9+7
for i in range(1,N+1):
    m=i
    for j in range(2,int(m**0.5)+1):
        while m%j==0:
            pf[j]=pf.get(j,0)+1
            m//=j
    if m>1:pf[m]=1
    
    keys=list(pf.keys())
    values=list(pf.values())
    pf={}
    for j in range(len(keys)):
        insuu[keys[j]]=insuu[keys[j]]+values[j]
    
    
    
ans=1
for i in range(N+1):
    if insuu[i]>0:
        ans=(ans*(insuu[i]+1))%p
print(ans%p)

Solution (Python):
sosu = [2]
A = 10 ** 9 + 7
N = int(input())
man = []
buriburi = 1
n = [0] * 1000

def prime(a):
    flag = 0
    m = a
    for i in range(2,m):
        if m % i == 0:
            flag = 1
            break
    if flag == 0:
        sosu.append(a)

for i in range(3,1001,2):
    prime(i)

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

for i in n:
    if i != 0:
        buriburi *= i + 1

print(buriburi % A)

Solution (Python):

mod=10**9+7

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod


def isPrime(x):
    if x < 2:
        return 0
    elif x == 2:
        return 1
    if x%2 == 0:
        return 0
    ir=int(x**(0.5))+1
    for i  in range(3,ir,2) :
        if x%i == 0:
            return 0
    return 1

n=int(input())

p=[]
for i in range(n+1):
    if isPrime(i):
        p.append([i,0])
        
for i in range(2,n+1):
    for j in range(len(p)):
        ii=i
        ip=0
        while ii>=p[j][0]:
            if ii%p[j][0]==0:
                ip=ip+1
                ii=ii//p[j][0]
            else:
                break
        p[j][1]=p[j][1]+ip

psum=1
for j in range(len(p)):
    if p[j][1]!=0:
        psum=mul(psum,p[j][1]+1)

print(psum)

Solution (Python):
mod=10**9+7
import math
n=int(input())
ans=1
l=[0]*n
for ii in range(2,n+1):
  i=ii
  for j in range(2,int(math.sqrt(i))+1):
    if i%j==0:
      cnt=0
      while  i%j==0:
        cnt+=1;i//=j
      l[j-1]+=cnt
  if i!=1:
    l[i-1]+=1
for i in l:
  ans*=(i+1)
  ans%=mod
print(ans)

Solution (Python):
import sys
n = int(input())
a = []

if (n==1):
    print(1)
    sys.exit()

def prime_factorize(n,a):
    while n%2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f*f <= n:
        if n%f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

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

a.sort()
c = []
count = 1
for i in range(1,len(a)):
    if(a[i-1]!=a[i]):
        c.append(count)
        count = 1
    else:
        count += 1
c.append(count)

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

Solution (Python):
from collections import Counter
n = int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

lst=[]
for i in range(n):
    lst.extend(prime_factorize(i+1))
lst=Counter(lst)
ans=1
INF=1000000007
for i in lst.values():
    ans*=i+1
    ans%=INF
print(ans)

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

sosu = []

primes = list(range(n+1))
primes[1] = 0
for i in range(2,int(n**.5)+1):
    if primes[i]!=0:
        for j in range(i*2,n+1,i):
            primes[j] = 0
primes = [prime for prime in primes if prime!=0]

power = []
for prime in primes:
    p = prime
    tmp = 0
    while p<=n:
        tmp += n // p
        p *= prime
    power.append(tmp)


res = 1
mod = 10**9+7
for i in power:
    res *= i + 1
    res %= mod

print(res)

Solution (Python):
n=int(input())
mod=10**9+7
arr = {}
def factorization(k):
    temp=k
    for i in range(2,int(-(-k**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp//=i
            if i in arr:
                arr[i]+=cnt
            else:
                arr[i]=cnt
    if temp!=1:
        if temp in arr:
                arr[temp]+=1
        else:
            arr[temp]=1
    if arr==[]:
        if k in arr:
                arr[k]+=1
        else:
            arr[k]=1
for i in range(1,n+1):
    factorization(i)
ans=1

for value in arr.values():
    ans*=(value+1)
    

print(ans%mod)

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


n=int(input())
mod=1000000007
ans=1
l=[1 for _ in range(n)]
for i in range(2,n+1):
  f=fctr1(i)
  for x,y in f:
    l[x-1]+=y
for x in l:
  ans*=x
  if ans>=mod:
    ans%=mod


print(ans)

Solution (Python):
import collections
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())
l=[0]*(n+1)
for i in range(1,n+1):
    c=prime_factorize(i)
    
    for j in range(len(c)):
        l[c[j]]+=1

ans=1
for i in range(n+1):
    if l[i]!=0:
        ans=ans*(l[i]+1)%(10**9+7)
print(ans%(10**9+7))

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




def prime_factorize(n):
    n_origin=n+0
    primelist=[]
    a=2
    while a*a<=n_origin:
        if n%a!=0:
            a+=1
            continue
        ex=0
        while n%a==0:
            ex+=1
            n=n//a
        primelist.append([a,ex])
        a+=1
    if n!=1:
        primelist.append([n,1])
    return primelist
dic={}
for i in range(1,n+1):
    pfs=prime_factorize(i)
    for pf in pfs:
        dic[pf[0]]=dic.get(pf[0],0)+pf[1]

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

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




def prime_factorize(n):
    n_origin=n+0
    primelist=[]
    a=2
    while a*a<=n_origin:
        if n%a!=0:
            a+=1
            continue
        ex=0
        while n%a==0:
            ex+=1
            n=n//a
        primelist.append([a,ex])
        a+=1
    if n!=1:
        primelist.append([n,1])
    return primelist
dic={}
for i in range(1,n+1):
    pfs=prime_factorize(i)
    for pf in pfs:
        dic[pf[0]]=dic.get(pf[0],0)+pf[1]

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

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


def isPrime(num):
    
    if num < 2: return False
    
    elif num == 2: return True
    
    elif num % 2 == 0: return False

    
    
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    
    return True


def callIsPrime(input_num=1000):
    numbers = []
    
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    
    return numbers


pr=callIsPrime(1000)
ans=1
for i in range(len(pr)):
  count=0
  j=1
  while(N>=pr[i]**j):
    count+=N//(pr[i]**j)
    j+=1
  ans=(ans*(count+1))%(10**9+7)
print(ans)

Solution (Python):
import math
MOD=1000000007
N=int(input())
f=[0]*1000

def factors(n):
  for i in range(2,n+1):
    if n==1: return
    if n%i==0:
      while n%i==0:
        f[i]+=1
        n//=i

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

ans=1
for i in range(1000):
  if f[i]>0:
    ans*=(f[i]+1)
    ans%=MOD

print(ans)

Solution (Python):
pf = {}
ans = 1
m = int(input())
for i in range(2, m+1):
    for j in range(2, int(i**0.5)+1):
        while i%j==0:
            pf[j]=pf.get(j,0)+1
            i//=j
    if i>1:
        pf[i]=pf.get(i,0)+1

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

Solution (Python):
pf = {}
ans = 1
m = int(input())
for i in range(2, m+1):
    for j in range(2, int(i**0.5)+1):
        while i%j==0:
            pf[j]=pf.get(j,0)+1
            i//=j
    if i>1:
        if i in pf.keys():
            pf[i]+=1
        else:
            pf[i]=1

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

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

prime=[]
for n in range(2, 1001):
    for i in range(2,n):
        if n % i == 0:
            break
    else:
        prime.append(n)


bucket={}
for p in prime:
    bucket[p]=0


for i in range(2, N+1):
    for p in prime:
        if p > i:
            break
        
        while i % p == 0:
            i //= p
            bucket[p] += 1



ans=1
for p in prime:
    ans = (ans * (bucket[p] + 1)) % MOD

print(ans)