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 <inttypes.h>

#define MOD_BY UINT32_C(1000000007)

uint32_t add(uint32_t a, uint32_t b) {
	return a + b - MOD_BY * (a + b >= MOD_BY);
}

uint32_t mul(uint32_t a, uint32_t b) {
	uint32_t r = 0;
	while (b > 0) {
		if (b & 1) r = add(r, a);
		a = add(a, a);
		b >>= 1;
	}
	return r;
}

int main(void) {
	uint32_t count[1024] = {0};
	int N;
	int i;
	uint32_t answer = 1;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 2; i <= N; i++) {
		int num = i;
		int j;
		for (j = 2; j * j <= num; j++) {
			while (num % j == 0) {
				num /= j;
				count[j]++;
			}
		}
		if (num > 1) count[num]++;
	}
	for (i = 2; i <= N; i++) {
		answer = mul(answer, add(count[i], 1));
	}
	printf("%" PRIu32 "\n", answer);
	return 0;
}