题目描述
Problem Description
Given $ N $ distinct integers $ a_1, a_2, ..., a_N $ and an integer $ M $.
For each integer $ i $ from $ 1 $ to $ M $, find the number of integers in $ a_1, a_2, ..., a_N $ that are coprime with $ i $.
Input Format
The input is given from the standard input in the following format:
$ N $ $ M $ $ a_1 $ $ a_2 $ $ : $ $ a_N $
Output Format
Output $ M $ lines. The $ i $-th line ($1 \leq i \leq M$) should contain the number of integers in $ a_1, a_2, ..., a_N $ that are coprime with $ i $.
Sample Input and Output
Sample Input #1
4 3
6
7
8
9
Sample Output #1
4
2
2
Sample Input #2
1 5
100000
Sample Output #2
1
0
1
0
0
Sample Input #3
5 7
14142
17320
22360
24494
26457
Sample Output #3
5
1
3
1
3
0
5
Notes/Hints
Annotation
Two integers $ a $ and $ b $ are coprime if there is no positive integer other than $ 1 $ that divides both $ a $ and $ b $.
For example, $ 6 $ and $ 7 $ are coprime, but $ 6 $ and $ 8 $ are not coprime because they are both divisible by $ 2 $.
Constraints
- $1 \leq N, M \leq 10^5$
- $1 \leq a_i \leq 10^5$
- All $ a_i $ are distinct.
- All input values are integers.
Sample Explanation 1
Among $ 6, 7, 8, 9 $:
- Those coprime with $ 1 $ are $ 6, 7, 8, 9 $ (4 numbers)
- Those coprime with $ 2 $ are $ 7, 9 $ (2 numbers)
- Those coprime with $ 3 $ are $ 7, 8 $ (2 numbers)
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分