DIVREL - Divisibility Relation

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

Output
5
5 6 8 7 9
Input
4
2 3 2 3

Output
2
2 3


Được gửi lên bởi:Jimmy
Ngày:2008-10-22
Thời gian chạy:1s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:Tất cả ngoại trừ: ERL GOSU JS-RHINO NODEJS PERL6 PYPY RUST SED VB.NET
Nguồn bài:Vietnamese IOI Selection Test 2007

hide comments
2018-10-08 03:23:09
hay cmn
2017-12-27 05:26:13
bai hay qua <3

Last edit: 2017-12-27 05:26:29
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.