#P1978. 集合
集合
Description
A set is a concept in mathematics. In plain words, a set is a bunch of numbers grouped together.
A set has the following properties:
- Unorderedness: within any set, every element has the same status, and the elements are unordered.
- Distinctness: in a set, any two elements are considered different; that is, each element can appear at most once.
- Definiteness: for a given set and any given element, the element either belongs to the set or does not; there is no ambiguity.
For example, is a set. We can see that belongs to , i.e., ; does not belong to , i.e., . The size of a set is the number of its elements.
Now we define a special -set, which must satisfy:
- All the properties of sets.
- For any element in the set, there does not exist a number such that and also belongs to the set. In other words, for any number in the set, the number obtained by multiplying it by is not in the set.
You are given a set consisting of distinct integers. Please find a largest -set contained in this set.
Input Format
The first line: two integers, and .
The second line: integers, are the elements of the given set.
Output Format
The first line: one integer, , the size of a largest -set.
6 2
2 3 6 5 4 10
3
Hint
Hint: In the set given in the sample, a largest -set is .
- For of the testdata: .
- For of the testdata: .
- For of the testdata: .
- For of the testdata: , .
Translated by ChatGPT 5
京公网安备 11011102002149号