RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00290

Čokolade

Unrated 레이팅 미적용
난이도
2s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

\(4^{th}\) round, January \(18^{th}\), 2014

Mirko is a party animal, so he has decided to organise an endless amount of parties for his friends. To
satisfy the party's needs, he has decided to set up N tables with candy on them. We know the number
of candies b_{i} on each table. On the first day of the rest of eternity, Mirko is going to invite one friend
per table, on the second day he will invite two friends per table, on the third day three friends... In
general, obviously, on the k^{th} day he is going to invite k friends per each table.

When his friends enter the room, k people will sit down at each table and they will divide the candies
on their table in k as large as possible equal pieces, and get rid of the possible remains. After the
candy division, because of jealousy and various other reasons, only tables with the same amount of
candy per capita will socialise together. Mirko has all eternity to study the social dynamics of his
parties. Firstly, he wants to know the answer to the following question: given an s between 1 and N,
what is the earliest day when there is a group of exactly s tables socialising together?

As usual, Mirko is incapable of solving his own problems, so every few days he comes to you and asks
you what the required number is, given an s. Alas, he has all eternity to ask questions, but you don't.
Therefore, you are going to write a programme which outputs Mirko's required answers for each s
from 1 to N.

Please note: Before each party, Mirko renews the candy supply on each table, meaning the supplies are
equal to those before the first party. Additionally, all people leave from the current party before the
next one starts.

제약

In test cases worth 30% of total points, the number of candy on all tables will not exceed \(10^{3}\).
In test cases worth additional 30% of total points, the number of candy on all tables will not exceed
\(10^{6}\).

\(4^{th}\) round, January \(18^{th}\), 2014

입력 형식

The first line of input contains the integer N (\(1 \le N \le 100\)).
The second line of input contains N integers, the i^{th} number marking the number of candy on the i^{th}
table.
The numbers are from the interval [1, \(10^{8}\)].

출력 형식

Output N lines, each line containing a single integer.
The s^{th} line should contain the required number for a group sized s \(or -1\) if there will never be a group
of that size.

예제 1
입력
5
11 10 9 6 4
출력
1
2
3
6
12
예제 2
입력
3
5 5 5
출력
-1
-1
1
예제 3
입력
8
12 16 95 96 138 56 205 84
출력
1
5
14
49
96
97
139
206
설명

Clarification of the first example: On the first day, each table will socialise only with itself so the
answer for groups sized 1 is 1. Already on the second day, people sitting at tables 1 and 2 are going to
get 5 candies per capita and socialise together, so the answer for a group sized 2 is 2.
On the third day, tables 1, 2 and 3 will socialise (because they all have 3 candies per capita).
On the sixth day, tables 1, 2, 3 and 4 will socialise (because they now have 1 candy per capita).
Finally, on the twelfth day, all tables will socialise together because they will all get zero candy per capita.

Clarification of the second example: All tables have the same amount of candy per capita, so a group
sized less than 3 will never exist.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2013/2014 Contest 4

평가 및 의견

Čokolade

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Čokolade

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8