Equal Numbers | 프로그래밍의 벗 PivotOJ
PivotOJ

Equal Numbers

시간 제한: 3000ms메모리 제한: 512MB출처: NEERC Northern Subregional 2017BOJ 15135

문제

You are given a list of n integers a1, . . . , an. You can perform the following operation: choose some ai and multiply it by any positive integer.

Your task is to compute the minimum number of different integers that could be on the list after k operations for all 0 ≤ k ≤ n.

입력

The first line of the input contains single integer n (1 ≤ n ≤ 3·105). The second line of the input contains n integers ai (1 ≤ ai ≤ 106).

출력

Output a single line that contains n + 1 integers. The i-th integer should be the minimum possible number of different integers in the list after i − 1 operations.

예제

예제 1

입력
6
3 4 1 2 1 2
출력
4 4 3 3 2 2 1
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.