Estimathon
의견: 0
Paula and Domagoj are organizing an exciting team competition called Estimathon.
They have already prepared the questions, and now they are arranging the room
for the quiz.
Before you could blink, Domagoj had already placed \(n\) tables in the room. Now
they need to add chairs. They have very colourful chairs. They come in \(m\) colours
and there are \(a\)\(i\) chairs of the \(i-th\) colour. Every team consists of four people.
Therefore, for each table, Paula and Domagoj need to add four chairs. They want
to make the room look as nice as possible. To make that happen, they agreed on these conditions:
• Each table has all chairs of the same colour
• Every chair colour is used, that is, for every colour there exists at least one table that has chairs of
that colour
Caring too much about how nice the room will look, they suddenly realized that the quiz starts very soon!
Help them find out if a chair arrangement with these conditions is even possible.
Subtask 1 (11 points): \(a\)1 = . . . = \(a\)\(m = 4\)
Subtask 2 (39 points): No additional constraints.
The first line contains integers \(n\) and \(m\) (\(1 \le n\), \(m \le 100\)), the number of tables and the number of chair
colours.
The second line contains \(m\) integers \(a@@RISE_MATH_BLOCK_0@@i \le 100\)), where the \(i-th\) number is the number of chairs of
the \(i-th\) colour.
In the first and only line output DA if it is possible to arrange the chairs so that both conditions hold,
otherwise output NE.
| 서브태스크 | 점수 | 설명 |
|---|---|---|
1 | 11점 | \(a\)1 = . . . = \(a\)\(m = 4\) |
2 | 39점 | No additional constraints. |
7 3
5 21 9DA5 4
8 5 10 3NE6 5
5 5 5 5 5NEClarification of the second example:
We can have 5 tables with chairs of the same colour, but we cannot have a table with colour 4, so the
second condition can’t be satisfied.
평가 및 의견
Estimathon
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Estimathon