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

Estimathon

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

의견: 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.

예제 1
입력
7 3
5 21 9
출력
DA
예제 2
입력
5 4
8 5 10 3
출력
NE
예제 3
입력
6 5
5 5 5 5 5
출력
NE
설명

Clarification 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.

문제 정보

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

출처 COCI 2022/2023 Contest 3

평가 및 의견

Estimathon

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

Log in to rate problems.

개별 의견

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

풀이 제출

Estimathon

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