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 9.2.1) (judge verdict: Accepted)

#include <stdio.h>

int main(void){
    int so[500];
    int n, i = 0, t, nn, sum, ans = 1;

    scanf("%d", &n);

    for(int j = 2; j <= n; j++){
        if(j == 2){
            so[i] = j;
        }else{
            for(int k = 0; k <= i; k++){
                if(j % so[k] == 0) break;
                if(k == i) so[++i] = j;
            }
        }
    }
    
    for(int j = 0; j <= i; j++){
        nn = n;
        sum = 0;
        while(nn > 1){
            nn /= so[j];
            sum += nn;
        }
        if(ans >= (1000000000 + 7) / (sum + 1)){
            t = ans;
            for(int k = 0; k < sum; k++){
                ans += t;
                if(ans >= 1000000000 + 7) ans -= 1000000000 + 7;
            }
        }else{
            ans *= sum + 1;
        }
    }

    printf("%d", ans);

    return 0;
}