spoj#DIVREL. Divisibility Relation
Divisibility Relation
English | Vietnamese |
Given n positive integers. Your task is to select a maximum number of integers so that there are no two numbers a, b in which a is divisible by b.
Input
- Line 1: n (1 ≤ n ≤ 200).
- Line 2: n positive integers a1, a2, ..., an (1 ≤ ai ≤ 109).
Output
- Line 1: k, the maximum number of integers that can be selected.
- Line 2: k selected integers.
Example
Input 8 1 2 3 5 6 8 7 9</p>Output 5 5 6 8 7 9
Input 4 2 3 2 3
Output 2 2 3