|Author:||T.Chistyakov, A. Klenin||Time limit:||2 sec|
|Input file:||input.txt||Memory limit:||32 Mb|
At the running contest, jury used a new computerized stopwatch system to ensure the most accurate measuring of results. Unfortunately, despite very successfull trials, the system malfunctioned during the actual contest.
Jury was so confident in the new system that it did not use the old mechanical stopwatches. So the only way to determine outcome was to compare visual impressions of the people watching the contest. M such impressions were recorded, each in one of two forms: "runner A finished before runner B" and "runners A and B finished at the same time".
You task is to assign a place pi to each of N runners, such that
Additionally, places must be allocated as densely as possible, i.e. 1 ≤ pi ≤ K for minimum possible value of K.
|No.||Input file (
||Output file (|