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 in LuaJIT (2.0.4) (judge verdict: Accepted)

local n = io.read("*n")
local t = {}
for i = 2, n do
  local sqi = math.floor(math.sqrt(i)) + 1
  local j, tmpi = 2, i
  while(j <= sqi) do
    if(tmpi % j == 0) then
      tmpi = tmpi / j
      if(t[j] == nil) then t[j] = 1 else t[j] = t[j] + 1 end
    else
      if(j == 2) then j = 3 else j = j + 2 end
    end
  end
  if(tmpi ~= 1) then
    if(t[tmpi] == nil) then t[tmpi] = 1 else t[tmpi] = t[tmpi] + 1 end
  end
end
local mod = 1000000007
local ret = 1
for k, v in pairs(t) do
  ret = (ret * (v + 1)) % mod
end
print(ret)