QOJ.ac

QOJ

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

#22659. سياسة Jersey

Statistics

في أحدث إحصاء لأبقار Jersey وHolstein، كسبت أبقار Wisconsin ثلاث حجرات في Barn of Representatives. تسيطر Jersey الآن على لجنة إعادة تقسيم دوائر الولاية. تريد تقسيمها إلى ثلاث دوائر انتخابية متساوية الحجم تضمن الفوز في اثنتين على الأقل.

لدى Wisconsin عدد $3*K$ ($1 \le K \le 60$) مدينة بكل منها $1,000$ بقرة، مرقمة $1..3*K$، وعدد Jersey معروف بكل مدينة ($0..1,000$). قسم الولاية إلى ثلاث دوائر، كل منها $K$ مدن، بحيث تكون Jersey أغلبية في اثنتين على الأقل.

كل بيانات الإدخال قابلة للحل.

الإدخال

  • السطر $1$: عدد صحيح واحد $K$.

  • الأسطر $2..3*K+1$: عدد صحيح في كل سطر، عدد Jersey بكل مدينة. السطر $i+1$ يحتوي إحصاء المدينة $i$.

الإخراج

  • الأسطر $1..K$: $K$ سطور لأرقام مدن الدائرة الأولى، رقم في كل سطر.

  • الأسطر $K+1..2K$: $K$ سطور لأرقام مدن الدائرة الثانية، رقم في كل سطر.

  • الأسطر $2K+1..3K$: $K$ سطور لأرقام مدن الدائرة الثالثة، رقم في كل سطر.

أمثلة

الإدخال 1

2
510
500
500
670
400
310

الإخراج 1

1
2
3
6
5
4

ملاحظة

قد توجد حلول أخرى. 2 3 ليست دائرة تفوز فيها Jersey لأنها تمثل نصف الأبقار بالضبط.

مؤلف المسألة: 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.