# CPP Program Divisors of a Factorial – Number Theory

Given a number, find the total number of divisors of the factorial of the number. Since the answer can be very large, print the answer modulo 10^9+7.

Input format:

The first line contains T, the number of test cases.
T lines follow each containing the number N.

Output format:

Print T lines of output each containing the answer.

Constraints:

1 <= T <= 500
0 <= N <= 50000

Sample Input:

```3
2
3
4```

Sample Output:

```2
4
8```

## Code:

```.wp-block-code {
border: 0;
}

.wp-block-code > span {
display: block;
overflow: auto;
}

.shcb-language {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
-webkit-clip-path: inset(50%);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
position: absolute;
width: 1px;
word-wrap: normal;
word-break: normal;
}

.hljs {
box-sizing: border-box;
}

.hljs.shcb-code-table {
display: table;
width: 100%;
}

.hljs.shcb-code-table > .shcb-loc {
color: inherit;
display: table-row;
width: 100%;
}

.hljs.shcb-code-table .shcb-loc > span {
display: table-cell;
}

.wp-block-code code.hljs:not(.shcb-wrap-lines) {
white-space: pre;
}

.wp-block-code code.hljs.shcb-wrap-lines {
white-space: pre-wrap;
}

.hljs.shcb-line-numbers {
border-spacing: 0;
counter-reset: line;
}

.hljs.shcb-line-numbers > .shcb-loc {
counter-increment: line;
}

.hljs.shcb-line-numbers .shcb-loc > span {
}

.hljs.shcb-line-numbers .shcb-loc::before {
border-right: 1px solid #ddd;
content: counter(line);
display: table-cell;
text-align: right;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
width: 1%;
}
```#include <iostream>
#include <math.h>
#define m 1000000007
#define ll long long int
using namespace std;
void makeSieve(ll n)
{
bool *isprime = new bool[n + 1];
for (ll i = 0; i < n + 1; i++)
{
isprime[i] = true;
}
isprime[0] = false;
isprime[1] = false;
for (ll i = 2; i <= sqrt(n); i++)
{
if (isprime[i])
for (ll j = i; j * i <= n; j++)
{
isprime[j * i] = false;
}
}
ll total_divisors = 1;
for (ll i = 0; i < n + 1; i++)
{
if (isprime[i])
{
ll current_sum = 0;
for (ll j = 1; pow(i, j) <= n; j++)
{
current_sum += n / pow(i, j);
}
total_divisors =(total_divisors%m * (current_sum + 1)%m)%m;
}
}
cout << total_divisors << endl;
delete[] isprime;
}
int main()
{
ll t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
makeSieve(n);
}
}
```Code language: C++ (cpp)```