P29768 [洛谷] [COCI2013-2014#4] ČOKOLADE
入门
题目描述

Problem Description

Mirko hosts \( N \) parties, one each day. For the \( i \)-th party, he invites \( i \) people per table.

Mirko prepares \( N \) tables, with the \( i \)-th table having \( V_i \) candies.

When each invited person sits down, the people at the same table share the candies on that table. Specifically, for the \( i \)-th day and the \( j \)-th table, each person at this table will receive \( \lfloor \dfrac{V_j}{i} \rfloor \) candies.

The number of candies is updated daily and does not decrease due to sharing.

Only tables with the same number of candies per person will socialize.

Now, Mirko wants you to find for each positive integer \( s \) from 1 to \( N \), the earliest day on which exactly \( s \) tables socialize.

Input Format

The first line contains a single positive integer \( N \), the number of parties.

The second line contains \( N \) positive integers \( V_i \), representing the number of candies on the \( i \)-th table.

Output Format

Output \( N \) lines, each containing a positive integer. The \( i \)-th line should indicate the earliest day on which exactly \( i \) tables socialize. If there is no such day, output -1.

Sample Input and Output

Input Sample #1

5
11 10 9 6 4

Output Sample #1

1
2
3
6
12

Input Sample #2

3
5 5 5

Output Sample #2

-1
-1
1

Input Sample #3

8
12 16 95 96 138 56 205 84

Output Sample #3

1
5
14
49
96
97
139
206

Notes

[Sample Explanation #1]

On the first day, no tables socialize.

On the second day, tables 1 and 2 each have 5 candies per person, so they socialize.

On the third day, tables 1, 2, and 3 each have 3 candies per person, so they socialize.

On the sixth day, tables 1, 2, 3, and 4 each have 1 candy per person, so they socialize.

On the twelfth day, tables 1, 2, 3, 4, and 5 each have 0 candies per person, so they socialize.

[Data Range]

For 100% of the data, \( 1 \le N \le 100 \), \( 1 \le V_i \le 10^8 \).

[Source]

This problem is scored according to the original COCI settings, with a maximum score of 140.

The problem is translated from COCI2013-2014 CONTEST #4 T5 ČOKOLADE.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 11 10 9 6 4
样例输出
1 2 3 6 12