6838.Counting Divisors

Time Limit: 1s Memory Limit: 512MB

Given $n$ integers, your task is to report for each integer the number of its divisors.

For example, if $x=18$ , the correct answer is $6$ because its divisors are $1,2,3,6,9,18$ .

Input Format(From the terminal/stdin)

The first input line has an integer $n$ : the number of integers.

After this, there are $n$ lines, each containing an integer $x$ .

  • $1 \le n \le 10^5$
  • $1 \le x \le 10^6$

Output Format(To the terminal/stdout)

For each integer, print the number of its divisors.

Sample Input

Copy
3
16
17
18
 \n
  \n
  \n
  \n

Sample Output

Copy
5
2
6
 \n
 \n
 \n
Source: CSES, Mathematics, 1713

Submit

请先 登录

© 2025 FAQs