QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22659. Chính trị Jersey

Statistics

Trong điều tra mới nhất về bò Jersey và Holstein, bò Wisconsin giành ba ô chuồng tại Barn of Representatives. Jersey hiện kiểm soát ủy ban chia lại khu bầu cử của bang. Chúng muốn chia bang thành ba khu bằng nhau, bảo đảm thắng ít nhất hai khu.

Wisconsin có $3*K$ ($1 \le K \le 60$) thành phố mỗi nơi $1,000$ bò, đánh số $1..3*K$, với số Jersey mỗi thành phố đã biết ($0..1,000$). Chia bang thành ba khu mỗi khu $K$ thành phố để Jersey chiếm đa số ở ít nhất hai khu.

Mọi bộ dữ liệu đầu vào đều có lời giải.

Dữ liệu vào

  • Dòng $1$: một số nguyên $K$.

  • Các dòng $2..3*K+1$: một số nguyên mỗi dòng, số Jersey ở từng thành phố. Dòng $i+1$ là điều tra của thành phố $i$.

Dữ liệu ra

  • Các dòng $1..K$: $K$ dòng số thành phố khu thứ nhất, mỗi dòng một số.

  • Các dòng $K+1..2K$: $K$ dòng số thành phố khu thứ hai, mỗi dòng một số.

  • Các dòng $2K+1..3K$: $K$ dòng số thành phố khu thứ ba, mỗi dòng một số.

Ví dụ

Dữ liệu vào 1

2
510
500
500
670
400
310

Dữ liệu ra 1

1
2
3
6
5
4

Ghi chú

Có thể có lời giải khác. 2 3 KHÔNG là khu Jersey thắng vì chúng đúng bằng nửa số bò.

Tác giả bài toán: Coaches, 2004

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.