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: Wrong Answer)

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

#define LINE_BUF_SIZE 1024
#define mod (int)(1e9+7)

int prime_factor_judge(int n){  /*引数が素数だったら1を返す*/
    int i;
    int judge = 1;
    for(i=2;i<n;i++){
        if(n % i == 0)judge = 0;
    }
    return judge;
}

int main(){

    int i,j,k;
    long long int N;
    char line[LINE_BUF_SIZE];
    
    fgets(line,sizeof(line),stdin);
    sscanf(line,"%lld", &N);

    long long int count = 1;
 
    int judge;
    int num=1;
    long int num_hold = 0;

    for(i=2;i<=N;i++){

        judge = prime_factor_judge(i);

        if(judge == 1){ /*iが素数であるかどうか*/

            for(j=i;j<=N;j++){
 
                while(j % (int)pow(i,num) == 0)num += 1;
            
                num_hold += num - 1;
                num = 1;

            }

//        printf("prime %d and exp is %d\n",i,num_hold);

        }

        count *= (num_hold + 1);
        num = 1;
        num_hold = 0;

    }

    long long int ans;
    ans = count % mod;
    printf("%lld",ans);

    return 0;

}