PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000201. Đếm các ước không nguyên tố (Non-Prime Factors)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm các ước không nguyên tố (Non-Prime Factors)

Đếm các ước không nguyên tố (Non-Prime Factors)

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

For every integer x≥2x\ge2, NPF⁡(x)\operatorname{NPF}(x) is the number of its positive divisors that are not prime. One is included. For example, 100100 has nine positive divisors, of which only 22 and 55 are prime; hence NPF⁡(100)=7\operatorname{NPF}(100)=7. Answer QQ queries.

Input

The first line contains QQ, followed by QQ lines, each containing xx.

Output

Print one answer for each query, on its own line.

Subtasks

  • Subtask 1 (20 points): 1≤Q≤101\le Q\le 10; 2≤xi≤1002\le x_i\le 100.

  • Subtask 2 (30 points): 1≤Q≤30001\le Q\le 3000; 2≤xi≤1000002\le x_i\le 100000.

  • Subtask 3 (50 points): 1≤Q≤30000001\le Q\le 3000000; 2≤xi≤20000002\le x_i\le 2000000.

Examples

Example 1

Input

4
100
13
12
2018

Output

7
1
4
2

Explanation

100 has nine positive divisors, of which exactly two, 2 and 5, are prime. The prime 13 has only one nonprime divisor (1). The number 12 has four nonprime divisors; 2018=2*1009 has two.