#P8016. [COCI 2013/2014 #4] ČOKOLADE

[COCI 2013/2014 #4] ČOKOLADE

Problem Description

Mirko held NN parties, one each day. On the ii-th party, he invites ii people to each table.

Mirko prepared NN tables, and there are ViV_i candies on the ii-th table.

After all invited people sit down, the people at the same table share the candies on that table equally. In other words, on day ii, at table jj, each person sitting at that table will get Vji\left\lfloor \dfrac{V_j}{i} \right\rfloor candies.

The number of candies is updated every day, and it does not decrease because of sharing.

Only tables where the candies per person are the same will socialize.

Now, for each positive integer ss from 11 to NN, Mirko wants you to find the earliest day on which exactly ss tables socialize.

Input Format

The first line contains a positive integer NN, representing the number of parties.

The second line contains NN positive integers ViV_i, where ViV_i is the number of candies on the ii-th table.

Output Format

Output NN lines in total. Each line contains one integer. The ii-th line should be the earliest day on which exactly ii tables socialize. If there is no day on which exactly ii tables socialize, output -1.

5
11 10 9 6 4 
1
2
3
6
12
3
5 5 5
-1
-1
1
8
12 16 95 96 138 56 205 84
1
5
14
49
96
97
139
206

Hint

Sample Explanation #1.

On the first day, no table will socialize with any other table.

On the second day, at tables 11 and 22, everyone gets 55 candies, so these two tables will socialize.

On the third day, at tables 11, 22, and 33, everyone gets 33 candies, so these three tables will socialize.

On the sixth day, at tables 11, 22, 33, and 44, everyone gets 11 candy, so these four tables will socialize.

On the twelfth day, at tables 11, 22, 33, 44, and 55, everyone gets 00 candies, so these five tables will socialize.

Constraints.

For 100%100\% of the testdata, 1N1001 \le N \le 100, 1Vi1081 \le V_i \le 10^8.

Source.

The score of this problem follows the original COCI problem setting, with a full score of 140140.

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

Translated by ChatGPT 5