-->
当前位置:首页 > 题库

PROGRAMMING:Half right

Luz5年前 (2021-05-10)题库477
In the field, $$n (0 < n / Leq 10) $$athletes are participating in the 100 meter dash. There are $$m (0 < m / Leq 100) $$enthusiastic spectators outside the competition field, each of them made two predictions about the result of the competition. At the end of the competition, the athletes' positions were different, but it was amazing that every audience guessed half right. What is the actual position of the athlete?
For example, there are four athletes in the stadium and three spectators outside the stadium
-Number one, number one, number two, number three
-Team 3, team 1, team 4, team 4
-Team 4, team 2, team 1, team 3
According to the fact that everyone guessed half right, we can infer that:
-Team number one, number four
-No.2, No.3
-Team number three, number one
-Team four, number two
Please write a program to calculate the actual position of the athletes according to the audience's prediction.
####Input format
>Positive integer $$n$$
>Positive integer $$m$$
>The $$M $$row data is the forecast of $$M $$viewers
>Each row contains four integers: $$X_ 1$$ $$r_ 1$$ $$x_ 2$$ $$r_ 2$$
>They represent the audience's two predictions respectively: $$X_ Athlete 1 $$$R_ 1$$,$$x_ Athlete 2 $$R_ 2$$
####Output format
>If the problem has no solution, output none
>If the problem has a solution, output multiple lines of data, each line represents an answer, output in dictionary order.
>Each line contains $$n $$integers, which are the actual positions obtained by athletes 1 ~ $$n $.
Note: spaces are used between integers, and there is no space at the end of the line.
####Input sample 1
```in
four
three
1 1 2 3
3 1 4 4
4 2 1 3
```
####Output sample 1
```out
4 3 1 2
```
####Input sample 2
```in
four
three
3 4 2 1
4 3 3 2
1 4 2 3
```
####Output sample 2
```out
None
```
####Input sample 3
```in
four
three
2 4 4 1
4 2 2 3
3 4 1 1
```
####Output sample 3
```out
1 4 3 2
2 3 4 1
```







answer:If there is no answer, please comment