"Prime" numbers
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a set of distinct natural numbers, we define a number as "prime for the given set" if it is not divisible by any other number in the set, except itself.
Input
The input begins with an integer N (1 ≤ N ≤ 100) on the first line, representing the number of elements in the set. The second line contains N distinct integers ranging from 1 to 1000000, each separated by a space.
Output
Output the numbers that are "prime for the given set," separated by a single space. The numbers should be printed in the same order as they appear in the input.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 49%