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 Ruby (2.3.3) (judge verdict: Wrong Answer)

def solve(n)
	primes=getprime(n)
	factorical(n,primes)
end

def factorical(n,primes)
	x=1
	factor=Array.new(primes.length){0}
	(2..n).each do |i|
		idx=0
		f=i
		while f>1 && idx<=primes.length-1
			if f%primes[idx]==0
				f/=primes[idx]
				factor[idx]+=1
			elsif f%primes[idx]>0
				idx+=1
			end
		end
	end
	divisor(primes,factor)
end

def divisor(primes,factor)
	idx=0
	total=0
	while idx<primes.length
		sum=0
		for x in 1..factor[idx]
			sum+=primes[idx]**x
		end
		total+=sum
		idx+=1
	end
	p total+1
end

def getprime(x)
	sieve=Array.new(x+1){true}
	(2..sieve.length-1).each do |i|
		if sieve[i]==true
			j=i*2
			while j<=sieve.length-1
				sieve[j]=false
				j+=i
			end
		end
	end
	sieve[0]=false
	sieve[1]=false
	primes=[]
	sieve.each_with_index do |v,i|
		if v==true
			primes.push(i)
		end
	end
	return primes
end

if __FILE__==$0
	reads_i=lambda{|s,d|s.strip.split(d).map(&:to_i)}
	reads_s=lambda{|s,d|s.strip.split(d)}
	read_i=lambda{|s|s.strip.to_i}
	read_s=lambda{|s|s.strip}
	dl=" "
	n=read_i[gets]
	solve(n)
end