아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Ski race

시간 제한1초메모리 제한1024 MB

요약
서로 다른 정수 최대 100000개가 주어질 때, 다른 어떤 수도 X로 나누어떨어지지 않는 X를 오름차순으로 출력한다.
난이도

보통10점 중 5점

유형
배열, 정수론, 정렬
정답자
아직 제출이 없습니다

문제

Winter has come to the town of NN, and it's time for the first cross-country skiing race. This year, participants registered through the Internet --- they entered their data, and each picked a number which had not yet been picked by other skiers. Due to the high number of participants, the organizers decided to split the race into several starts. To pick the lucky skiers for the first start, they've come up with a simple rule --- the skier with the number XX comes to the start if no other skier's number is divisible by XX.

Help the organizers write a program to define the numbers of those who will start first.

입력

The first line of the input file contains an integer KK --- the number of registered participants (1≤K≤1051 \leq K \leq 10^5). The second line contains KK space-separated integers A_iA\_i --- the numbers chosen by the participants at the registration (1≤A_i≤1071\leq A\_i\leq 10^7). All the numbers A_iA\_i are distinct.

출력

The output file must contain a single line containing the numbers of all participants starting first, in the ascending order. Numbers must be space-separated.

예제1

  1. 예제 1

    입력
    3
    4 8 12
    
    예상 출력
    8 12