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
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đế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 , is the number of its positive divisors that are not prime. One is included. For example, has nine positive divisors, of which only and are prime; hence . Answer queries.
Input
The first line contains , followed by lines, each containing .
Output
Print one answer for each query, on its own line.
Subtasks
-
Subtask 1 (20 points): ; .
-
Subtask 2 (30 points): ; .
-
Subtask 3 (50 points): ; .
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.