TopCoder

Caido
主唱太拼命了

User's AC Ratio

86.7% (13/15)

Submission's AC Ratio

51.3% (20/39)

Tags

Description

Input Format

Output Format

Sample Input 1

5 8
5 2
2 3
3 4
4 1
1 2
3 5
3 1
4 5
1 2 3 4

Sample Output 1

2 3
3 4
4 1
1 2
3 1
5 2
3 5
4 5

Sample Input 2

6 7
1 2
5 3
4 6
2 4
3 1
6 5
1 6
1 2 3 4 5

Sample Output 2

1 2
2 4
3 1
4 6
1 6
5 3
6 5

Hints

Problem Source

YTP 2023 高中組程式挑戰營 p10

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0~23 $N, M \leq 500$ 2
3 0~36 $M \leq N + 500$ 2
4 0~23, 37~56 無額外限制 16

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 3000 524288 65536 1 2 3 4
1 3000 524288 65536 1 2 3 4
2 3000 524288 65536 2 3 4
3 3000 524288 65536 2 3 4
4 3000 524288 65536 2 3 4
5 3000 524288 65536 2 3 4
6 3000 524288 65536 2 3 4
7 3000 524288 65536 2 3 4
8 3000 524288 65536 2 3 4
9 3000 524288 65536 2 3 4
10 3000 524288 65536 2 3 4
11 3000 524288 65536 2 3 4
12 3000 524288 65536 2 3 4
13 3000 524288 65536 2 3 4
14 3000 524288 65536 2 3 4
15 3000 524288 65536 2 3 4
16 3000 524288 65536 2 3 4
17 3000 524288 65536 2 3 4
18 3000 524288 65536 2 3 4
19 3000 524288 65536 2 3 4
20 3000 524288 65536 2 3 4
21 3000 524288 65536 2 3 4
22 3000 524288 65536 2 3 4
23 3000 524288 65536 2 3 4
24 3000 524288 65536 3
25 3000 524288 65536 3
26 3000 524288 65536 3
27 3000 524288 65536 3
28 3000 524288 65536 3
29 3000 524288 65536 3
30 3000 524288 65536 3
31 3000 524288 65536 3
32 3000 524288 65536 3
33 3000 524288 65536 3
34 3000 524288 65536 3
35 3000 524288 65536 3
36 3000 524288 65536 3
37 3000 524288 65536 4
38 3000 524288 65536 4
39 3000 524288 65536 4
40 3000 524288 65536 4
41 3000 524288 65536 4
42 3000 524288 65536 4
43 3000 524288 65536 4
44 3000 524288 65536 4
45 3000 524288 65536 4
46 3000 524288 65536 4
47 3000 524288 65536 4
48 3000 524288 65536 4
49 3000 524288 65536 4
50 3000 524288 65536 4
51 3000 524288 65536 4
52 3000 524288 65536 4
53 3000 524288 65536 4
54 3000 524288 65536 4
55 3000 524288 65536 4
56 3000 524288 65536 4