AtCoder Regular Contest 141
D
Non-divisible Set
AtCoder
⌀ 2890
原题
← CE →
翻译中…

Problem Statement

翻译中…

We say that a set $S$ of positive integers is good when, for any $a,\ b \in S\ (a\neq b)$, $b$ is not a multiple of $a$.

翻译中…

You are given a set of $N$ integers between $1$ and $2M$ (inclusive): $S=\lbrace A_1,\ A_2,\ \dots,\ A_N\rbrace$.

翻译中…

For each $i=1,\ 2,\ \dots,\ N$, determine whether there exists a good set with $M$ elements that is a subset of $S$ containing $A_i$.

翻译中…

Constraints

翻译中…
  • $M \leq N \leq 2M$
  • $1 \leq M \leq 3 \times 10^5$
  • $1 \leq A_1 < A_2 < \dots < A_N \leq 2M$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M
A_1 A_2 \dots A_{N}

翻译中…

Output

翻译中…

Print $N$ lines. The $i$-th line should contain Yes if there exists a good set with $M$ elements that is a subset of $S$ containing $A_i$, and No otherwise.

翻译中…

样例

Input #1
5 3
1 2 3 4 5
Output #1
No
Yes
Yes
Yes
Yes
Trivially, the only good set containing $A_1=1$ is $\lbrace 1\rbrace$, which has just one element, so the answer for $i=1$ is `No`. There is a good set $\lbrace 2,\ 3,\ 5\rbrace$ containing $A_2=2$, so the answer for $i=2$ is `Yes`.
Input #2
4 4
2 4 6 8
Output #2
No
No
No
No
Input #3
13 10
2 3 4 6 7 9 10 11 13 15 17 19 20
Output #3
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
题目信息
题号
arc141_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。