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 C (GCC 5.4.1) (judge verdict: Accepted)

#include <stdio.h>
#include <limits.h>

int main(void){

	int n, p=1;
	scanf("%d", &n);

	int i, j;
	unsigned long long int ans=1;
	int s[1000];
	for(i=0; i<1000; i++){
		s[i]=0;
	}
/*	for(i=1; i<=n; i++){
		p *= i;
	}
	
	int ans=0;
	for(i=1; i<=p; i++){
		if(p%i==0){
			ans++;
		}
	}
*/
	int mem;
	for(i=2; i<=n; i++){
		mem = i;
		for(j=2; j<=n; j++){
			if(j==mem || mem==1){
				s[mem]++;
				break;
			}
			if(mem%j==0){
				s[j]++;
				mem /= j;
				j--;
			}
		}
	} 

	//printf("1000000007\n");
	//素因数分解
	for(i=2; i<=n; i++){
		if(s[i]!=0){
			ans *= (s[i]+1);
			/*if(ans - 1000000007 >= 0){
			do{
				ans = ans -1000000007;
			}while(ans - 1000000007 >= 0);
			}*/
			if(ans >= 1000000007){
				ans %= 1000000007;
			}
		}
	}

	printf("%llu\n", ans);
	return 0;
}