atcoder#ARC141D. [ARC141D] Non-divisible Set
[ARC141D] Non-divisible Set
Score : points
Problem Statement
We say that a set of positive integers is good when, for any , is not a multiple of .
You are given a set of integers between and (inclusive): .
For each , determine whether there exists a good set with elements that is a subset of containing .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain Yes
if there exists a good set with elements that is a subset of containing , and No
otherwise.
5 3
1 2 3 4 5
No
Yes
Yes
Yes
Yes
Trivially, the only good set containing is , which has just one element, so the answer for is No
.
There is a good set containing , so the answer for is Yes
.
4 4
2 4 6 8
No
No
No
No
13 10
2 3 4 6 7 9 10 11 13 15 17 19 20
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No