QOJ.ac

QOJ

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

#22659. Politica Jersey

Statistics

Nell’ultimo censimento di mucche Jersey e Holstein, le mucche di Wisconsin hanno ottenuto tre posti in Barn of Representatives. Le Jersey controllano il comitato statale per ridisegnare i distretti. Vogliono tre distretti elettorali uguali, con vittoria garantita in almeno due.

Wisconsin ha $3*K$ ($1 \le K \le 60$) città di $1,000$ mucche, numerate $1..3*K$, ognuna con un numero noto di Jersey ($0..1,000$). Dividi lo stato in tre distretti di $K$ città con maggioranza Jersey in almeno due.

Tutti i dati di input hanno soluzione.

Input

  • Riga $1$: un intero $K$.

  • Righe $2..3*K+1$: un intero per riga, il numero di Jersey in ciascuna città. La riga $i+1$ contiene il censimento della città $i$.

Output

  • Righe $1..K$: $K$ righe con i numeri delle città del primo distretto, uno per riga.

  • Righe $K+1..2K$: $K$ righe con i numeri delle città del secondo distretto, uno per riga.

  • Righe $2K+1..3K$: $K$ righe con i numeri delle città del terzo distretto, uno per riga.

Esempi

Input 1

2
510
500
500
670
400
310

Output 1

1
2
3
6
5
4

Nota

Sono possibili altre soluzioni. 2 3 NON sarebbe vinto dalle Jersey, che sarebbero esattamente metà delle mucche.

Autore del problema: 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.