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

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var c int64 = 1000000007

func main() {
	scanInit()

	n := nextInt()
	if n == 1 {
		fmt.Println(1)
		return
	}

	m := map[int]int{}

	for i := 2; i <= n; i++ {
		ifac := getFactor(i)
		//fmt.Println(ifac) //! DBG
		for f, e := range ifac {
			m[f] += e
		}
	}

	var ans int64 = 1
	for _, e := range m {
		ans *= int64(e) + 1
		ans %= c
	}

	fmt.Println(ans)

}

// 素因数分解列挙Map作成
func getFactor(a int) (m map[int]int) {
	m = map[int]int{}
	for k := 2; a != 1; k++ {
		for ; a%k == 0; a /= k {
			m[k]++
		}
	}
	return m
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}