Non-Prime Factors(素数筛 + 质因分解)

In many programming competitions, we are asked to find (or count the number of) Prime Factors of an integer ii. This is boring. This time, let’s count the number of Non-Prime Factors of an integer ii, denoted as NPF(i).

For example, integer 100100 has the following nine factors: {1,2⎯⎯,4,5⎯⎯,10,20,25,50,100}{1,2_,4,5_,10,20,25,50,100}. The two which are underlined are prime factors of 100100 and the rest are non-prime factors. Therefore, NPF(100)= 77.

Input

The first line contains an integer QQ (1≤Q≤3⋅1061≤Q≤3⋅106) denoting the number of queries. Each of the next QQ lines contains one integer ii (2≤i≤2⋅1062≤i≤2⋅106).

Output

For each query ii, print the value of NPF(i).

Warning

The I/O files are large. Please use fast I/O methods.

Sample Input 1 Sample Output 1
4
100
13
12
2018
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值