QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#162742#5088. Two Choreographiesntu_vjudge_1AC ✓61ms41444kbC++174.9kb2023-09-03 16:13:082023-09-03 16:13:09

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 29544kb

input:

4
1 2
1 3
1 4
2 3
2 4

output:

3
1 2 3 
1 2 4 

result:

ok 

Test #2:

score: 0
Accepted
time: 1ms
memory: 29016kb

input:

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

output:

3
1 2 3 
1 2 5 

result:

ok 

Test #3:

score: 0
Accepted
time: 1ms
memory: 29212kb

input:

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

output:

5
1 3 6 5 2 
2 4 3 6 5 

result:

ok 

Test #4:

score: 0
Accepted
time: 4ms
memory: 29904kb

input:

40
1 16
1 40
2 4
2 16
2 36
3 25
3 38
4 1
4 13
5 11
5 27
6 4
7 5
7 11
8 10
8 14
8 24
9 34
10 20
12 35
13 2
14 10
14 20
15 18
15 28
15 31
16 6
16 13
17 5
17 11
17 27
18 9
19 1
19 4
19 16
20 24
21 12
21 33
21 35
22 38
23 12
23 21
25 28
25 31
25 34
25 38
26 14
26 20
27 7
27 11
28 3
28 31
29 16
29 19
30 ...

output:

4
1 4 2 16 
5 11 7 27 

result:

ok 

Test #5:

score: 0
Accepted
time: 1ms
memory: 28752kb

input:

201
1 7
1 114
1 119
2 49
2 93
4 197
5 139
6 1
6 27
7 39
7 121
8 127
9 130
9 145
11 106
11 136
11 193
12 2
12 116
13 55
13 69
13 105
13 187
13 196
14 144
14 177
15 127
15 134
15 145
15 155
15 184
15 199
16 96
16 177
17 20
21 100
22 68
22 71
22 81
22 142
23 148
23 190
24 12
24 81
24 89
25 158
25 159
2...

output:

23
7 39 34 31 153 97 95 82 50 48 109 119 176 163 35 25 158 123 175 11 106 36 121 
13 55 126 98 38 83 78 122 44 37 28 62 101 183 67 69 146 76 92 118 84 94 196 

result:

ok 

Test #6:

score: 0
Accepted
time: 9ms
memory: 30124kb

input:

8000
2 1508
2 3068
3 5268
3 5501
6 266
6 2737
6 3197
6 5863
6 6697
7 3492
9 427
9 794
9 3114
9 5509
10 2257
10 4348
11 1479
11 1957
11 2230
11 2500
11 3182
11 4399
11 5051
11 7727
12 7669
13 1403
13 5753
14 2871
14 6956
14 7959
15 6902
17 1630
17 3155
17 5950
18 7232
19 125
19 3280
19 5648
20 6879
2...

output:

614
42 7178 711 6352 7713 4055 2301 6225 3569 775 4132 3837 1084 547 1342 560 276 257 911 4484 7075 3045 1145 5652 4794 3994 6235 2753 2909 1996 2028 1233 2154 2911 4202 3898 2970 4184 3238 3580 897 558 3808 391 1897 220 1025 239 187 2202 1113 5912 796 2885 1997 6818 6209 3858 2920 6120 122 2327 269...

result:

ok 

Test #7:

score: 0
Accepted
time: 54ms
memory: 34576kb

input:

99999
1 11261
1 21544
2 9017
2 63063
2 97990
3 11995
3 42473
4 19846
5 38099
6 35872
6 80509
7 73231
8 12356
9 35384
10 45091
12 86727
13 4938
13 48917
14 62383
14 89846
15 28458
15 44277
15 51725
15 84522
16 93258
17 13934
17 42238
18 19000
19 11278
19 23672
19 61502
19 78791
20 85057
20 88080
21 2...

output:

4045
321 18089 49323 7403 2589 8281 5784 77507 9487 14285 67988 8474 12636 3923 92879 29718 48659 5578 52223 26843 68438 4760 82875 4803 85366 14634 19871 14876 21470 21437 8152 21786 5054 12592 59079 55542 5304 4302 12808 3727 12144 1942 44491 51896 10427 30087 71301 26273 22776 6905 85506 36590 32...

result:

ok 

Test #8:

score: 0
Accepted
time: 50ms
memory: 34200kb

input:

100000
1 68531
2 97359
4 68578
4 83098
4 98443
5 8053
5 30270
5 86617
6 7074
6 12266
6 69396
7 52675
7 78316
7 90757
7 92242
8 32677
8 41353
8 41457
8 74508
9 44234
10 4973
10 38390
10 96049
11 28007
11 68620
13 3016
14 36748
15 8147
15 25110
15 28489
15 72947
15 99347
16 70760
17 12774
17 68407
17 ...

output:

10016
10 38390 85689 66369 22659 19062 97982 27625 9950 81441 35818 25794 22710 52937 21837 2937 1421 77240 84091 32818 19339 38161 15736 45197 19884 23057 49536 26845 1666 50741 19622 7825 23219 1152 78317 7690 25354 15235 39798 33037 93260 8686 81281 64027 14342 25125 32531 13615 70368 26580 6865 ...

result:

ok 

Test #9:

score: 0
Accepted
time: 1ms
memory: 29204kb

input:

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

output:

3
5 7 6 
7 1 6

result:

ok 

Test #10:

score: 0
Accepted
time: 48ms
memory: 41444kb

input:

100000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 5...

output:

3
1 2 3 
100000 99999 1

result:

ok 

Test #11:

score: 0
Accepted
time: 1ms
memory: 29600kb

input:

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

output:

3
6 8 7 
1 2 8

result:

ok 

Test #12:

score: 0
Accepted
time: 0ms
memory: 29608kb

input:

9
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
1 3
1 4
9 5
9 4
1 7
9 2
1 9

output:

3
1 2 3 
1 2 9

result:

ok 

Test #13:

score: 0
Accepted
time: 1ms
memory: 29608kb

input:

10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 8
1 4
10 6
1 6
10 4
10 3
1 9
10 1

output:

3
8 10 9 
10 1 9

result:

ok 

Test #14:

score: 0
Accepted
time: 2ms
memory: 29540kb

input:

1000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
...

output:

3
1 2 3 
1000 1 999

result:

ok 

Test #15:

score: 0
Accepted
time: 8ms
memory: 31172kb

input:

9999
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
...

output:

3
9997 9999 9998 
9999 9998 1

result:

ok 

Test #16:

score: 0
Accepted
time: 0ms
memory: 30880kb

input:

10000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
9998 10000 9999 
10000 9999 1

result:

ok 

Test #17:

score: 0
Accepted
time: 25ms
memory: 40748kb

input:

94753
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
1 2 3 
94753 94752 1

result:

ok 

Test #18:

score: 0
Accepted
time: 37ms
memory: 41112kb

input:

99999
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
1 2 3 
1 2 99999

result:

ok 

Test #19:

score: 0
Accepted
time: 1ms
memory: 29824kb

input:

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

output:

3
1 2 3 
7 6 1

result:

ok 

Test #20:

score: 0
Accepted
time: 45ms
memory: 41376kb

input:

100000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 5...

output:

3
1 2 3 
100000 99999 1

result:

ok 

Test #21:

score: 0
Accepted
time: 1ms
memory: 29552kb

input:

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

output:

3
1 2 3 
8 7 1

result:

ok 

Test #22:

score: 0
Accepted
time: 3ms
memory: 29496kb

input:

9
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
1 3
1 4
1 5
1 6
1 7
1 8
1 9

output:

3
1 2 3 
9 8 1

result:

ok 

Test #23:

score: 0
Accepted
time: 5ms
memory: 29684kb

input:

10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10

output:

3
1 2 3 
10 9 1

result:

ok 

Test #24:

score: 0
Accepted
time: 1ms
memory: 30016kb

input:

1000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
...

output:

3
1 2 3 
1000 999 1

result:

ok 

Test #25:

score: 0
Accepted
time: 2ms
memory: 30836kb

input:

9999
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
...

output:

3
1 2 3 
9999 9998 1

result:

ok 

Test #26:

score: 0
Accepted
time: 2ms
memory: 31136kb

input:

10000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
1 2 3 
10000 9999 1

result:

ok 

Test #27:

score: 0
Accepted
time: 42ms
memory: 40748kb

input:

97065
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
1 2 3 
97065 97064 1

result:

ok 

Test #28:

score: 0
Accepted
time: 29ms
memory: 41104kb

input:

99999
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
1 2 3 
99999 99998 1

result:

ok 

Test #29:

score: 0
Accepted
time: 1ms
memory: 29504kb

input:

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

output:

3
5 7 6 
1 7 2

result:

ok 

Test #30:

score: 0
Accepted
time: 40ms
memory: 41252kb

input:

100000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 5...

output:

3
99998 100000 99999 
1 100000 2

result:

ok 

Test #31:

score: 0
Accepted
time: 2ms
memory: 29616kb

input:

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

output:

3
6 8 7 
1 8 2

result:

ok 

Test #32:

score: 0
Accepted
time: 0ms
memory: 29556kb

input:

9
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 7
9 6
9 5
9 4
9 3
9 2
9 1

output:

3
7 9 8 
1 9 2

result:

ok 

Test #33:

score: 0
Accepted
time: 0ms
memory: 29612kb

input:

10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 8
10 7
10 6
10 5
10 4
10 3
10 2
10 1

output:

3
8 10 9 
1 10 2

result:

ok 

Test #34:

score: 0
Accepted
time: 1ms
memory: 29672kb

input:

1000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
...

output:

3
998 1000 999 
1 1000 2

result:

ok 

Test #35:

score: 0
Accepted
time: 8ms
memory: 30836kb

input:

9999
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
...

output:

3
9997 9999 9998 
1 9999 2

result:

ok 

Test #36:

score: 0
Accepted
time: 8ms
memory: 30768kb

input:

10000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
9998 10000 9999 
1 10000 2

result:

ok 

Test #37:

score: 0
Accepted
time: 44ms
memory: 40164kb

input:

92892
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
92890 92892 92891 
1 92892 2

result:

ok 

Test #38:

score: 0
Accepted
time: 45ms
memory: 41344kb

input:

99999
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53...

output:

3
99997 99999 99998 
1 99999 2

result:

ok 

Test #39:

score: 0
Accepted
time: 1ms
memory: 28764kb

input:

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

output:

4
7 3 2 8 
6 2 3 7 

result:

ok 

Test #40:

score: 0
Accepted
time: 1ms
memory: 29684kb

input:

10
6 7
1 7
2 5
2 4
5 4
10 4
3 2
6 5
10 5
2 8
4 1
1 2
8 9
7 8
3 10
9 10
4 3

output:

4
2 3 10 4 
5 10 4 2 

result:

ok 

Test #41:

score: 0
Accepted
time: 5ms
memory: 28808kb

input:

1000
272 271
393 394
369 404
981 980
169 185
362 361
387 386
482 481
383 382
370 788
266 106
938 223
876 877
107 106
109 110
481 480
633 14
886 885
588 589
673 567
568 693
531 932
562 561
871 872
89 959
951 950
119 556
484 891
981 271
75 74
443 444
865 730
374 15
580 233
716 165
882 829
622 623
606 ...

output:

416
816 588 589 590 294 368 38 39 40 41 42 214 213 212 192 193 679 678 234 474 473 472 596 595 450 721 869 870 208 639 117 118 828 509 508 507 506 274 275 682 711 712 769 770 170 171 925 606 607 59 385 386 387 895 894 530 772 773 270 269 268 267 169 185 240 239 463 253 20 21 856 987 349 348 543 644 ...

result:

ok 

Test #42:

score: 0
Accepted
time: 5ms
memory: 30816kb

input:

9999
1503 1502
1862 3917
4579 4578
9929 8919
4989 4990
4479 7716
5512 5511
4389 4390
4430 910
5616 3889
5708 5879
8848 8849
5400 5076
7827 3718
1169 1168
1574 213
3196 4013
2414 2415
2857 2858
9177 9178
7189 7190
3550 3549
7446 5351
7766 8059
2132 2646
8813 7870
2521 2522
5158 5157
4623 4624
4957 49...

output:

1832
6863 944 945 6242 6241 6240 6239 3212 7829 925 926 927 928 929 930 4114 4113 4112 4111 1331 1332 1333 2848 2849 5119 5118 5117 8561 8560 4570 9313 6984 6985 8135 5709 1155 1154 1153 1152 3385 593 594 6326 4314 979 2656 7405 4918 5990 5989 5988 5987 6314 6313 1085 7983 7982 7981 592 6073 6074 60...

result:

ok 

Test #43:

score: 0
Accepted
time: 4ms
memory: 30708kb

input:

10000
5462 4989
4542 4541
7300 8478
4730 3574
7930 7051
750 7627
117 3045
4274 4275
3840 3841
5706 3638
7108 7107
28 29
2564 2563
2784 2393
1193 1192
2040 1286
3688 3687
8048 2319
2404 2405
8641 8640
6992 8729
5085 5086
5130 5131
6813 9806
6592 6769
2806 2805
7482 6021
7371 3994
4939 3217
1905 6540
...

output:

617
4405 6111 6112 6113 6958 9130 9129 3850 3046 3047 9723 9724 9725 9726 7700 7699 7698 7697 1635 979 2454 2455 2074 9252 7838 7839 7840 7841 5306 5305 5304 5303 5302 8005 8006 8007 2667 2668 2669 4122 4123 1948 1949 7288 5402 3321 3322 3323 8695 5059 6567 6568 6569 6570 7873 7872 2261 2262 2263 22...

result:

ok 

Test #44:

score: 0
Accepted
time: 47ms
memory: 39272kb

input:

99999
49253 51314
3093 3092
88617 72981
43336 77222
65739 55450
5166 90677
57235 57234
51512 51511
73274 86124
86611 77777
21808 21809
2794 2795
64109 69571
80102 80101
56177 27689
55899 58255
16908 16909
53732 53733
9213 9214
33157 33158
10706 10707
76016 11308
51459 74662
58149 58150
80976 56845
2...

output:

21824
38833 53482 32793 32792 58938 58937 2963 2964 2965 67836 67837 67838 1471 36182 36181 36180 36179 36178 73552 73551 73550 21918 21919 21920 82126 57398 57399 54341 54342 51010 51011 51012 51013 90282 90281 54743 54742 54741 54740 82923 82924 82925 82926 82927 82928 78160 78161 59152 29679 2967...

result:

ok 

Test #45:

score: 0
Accepted
time: 48ms
memory: 38920kb

input:

96827
15894 15895
33528 48199
50450 50451
63703 63702
49937 31980
93823 45726
96052 96051
54334 16426
9193 11656
49315 10079
10614 33488
84027 84028
3612 5321
64903 64904
56901 32611
33578 68521
47938 47939
32618 53239
89613 89612
82729 82728
34512 34511
54064 38673
56419 56420
23775 75336
85989 172...

output:

7342
89265 89264 23908 83977 7639 71139 71140 60925 37880 67737 67738 44273 44274 44275 44276 44277 44278 44279 44280 91111 91112 91113 91114 91115 91467 21633 35493 35494 37585 94733 35668 35669 35670 35671 35672 35673 35674 35675 35676 28942 28941 60588 60587 71300 13279 3301 3300 57782 57781 3395...

result:

ok 

Test #46:

score: 0
Accepted
time: 58ms
memory: 38760kb

input:

100000
72105 72104
4352 4351
59159 59160
78993 64103
39235 39234
4458 36615
23543 53027
54635 54634
80821 80822
8720 72158
49535 78364
64357 3035
93490 6597
52195 13285
70186 70187
14748 98067
15516 71738
77617 77616
68836 68835
61569 61570
28477 28289
50823 50822
71759 49859
59464 59463
83701 83702...

output:

22724
65933 80124 54106 54105 75883 75882 75084 75083 75082 5660 29115 29116 29117 29118 29119 17811 17812 17813 24878 24877 24876 24875 69513 97459 97458 97457 97456 97455 97454 97453 62551 62552 66463 66462 59598 59597 59596 59595 59594 46653 46654 65792 65793 28202 28201 28200 28199 28198 28197 1...

result:

ok 

Test #47:

score: 0
Accepted
time: 48ms
memory: 39260kb

input:

100000
53877 17887
7877 7878
35510 37710
15520 83926
7572 7573
11839 11840
75139 75140
63678 63679
66199 66198
3262 3263
78203 78204
87574 87575
53474 67658
86593 86594
28943 17005
71369 264
3802 41402
30583 30584
38511 38510
36776 90902
57208 57209
15408 48313
73488 46167
88419 93118
57411 57412
42...

output:

15240
75161 55924 55923 16580 16581 16582 16583 16584 8459 8460 87709 52011 52012 69996 47942 47943 47944 74264 12679 56311 56310 57215 57214 16493 16494 16495 16496 16497 37105 37106 19558 46792 96615 96616 96617 5282 5283 63696 63695 63694 27416 91486 91485 91484 39366 39367 34426 34425 76082 2163...

result:

ok 

Test #48:

score: 0
Accepted
time: 53ms
memory: 39120kb

input:

100000
78895 34726
20392 44705
57147 22069
31133 31132
78946 78947
53758 53757
68970 68971
75904 87094
12439 12438
92849 92848
80817 80818
76732 53635
79930 79931
78362 78363
87661 87662
47807 47808
73696 27386
30646 30645
17648 81813
47120 47119
84905 84906
87235 8058
8238 88843
86537 12191
68784 6...

output:

21565
68166 68167 85630 85631 85632 85633 33611 33610 33609 57478 20186 83821 70994 70995 87785 56212 56213 56214 16891 16890 16889 16888 16887 10354 10355 10356 37728 24492 24491 46672 94470 74611 27126 27125 85662 85661 50118 50117 99851 8587 8586 8585 44270 44271 66770 66769 66768 66767 66766 254...

result:

ok 

Test #49:

score: 0
Accepted
time: 40ms
memory: 38656kb

input:

94055
34740 73546
30256 30255
20298 20299
62592 62591
49467 49468
65041 2277
38788 38787
58735 65469
2375 2376
77665 77666
36242 80298
75550 16701
13820 64701
83448 83449
79313 83990
2213 2212
22172 22171
72441 92184
10391 30730
39194 38883
25064 90160
69140 85068
50433 31078
58353 4381
38997 38998
...

output:

3603
56056 36399 36400 36401 91572 91571 27280 27279 19227 19226 6610 62324 62323 62322 62321 62320 62319 28985 2759 2758 2757 69016 57865 57866 40327 85366 85365 85364 85363 85362 85361 41205 41204 41203 82828 82829 82830 24271 24272 24273 24274 78467 78468 33452 33453 71677 81631 81632 27505 27506...

result:

ok 

Test #50:

score: 0
Accepted
time: 1ms
memory: 29512kb

input:

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

output:

4
7 5 4 3 
2 6 7 3 

result:

ok 

Test #51:

score: 0
Accepted
time: 53ms
memory: 39176kb

input:

99084
7128 52592
26282 84361
19470 70586
2431 2430
33596 72767
70001 70000
65483 65484
76493 76492
62792 39465
4476 31233
72512 72511
94244 69778
84662 84663
32214 32213
4717 4718
73918 26226
71389 71390
45765 45764
87589 87590
6207 6206
47094 70119
30908 29826
34602 40286
44413 44412
21890 21889
24...

output:

8286
27635 27634 27633 83797 35614 19739 19738 3367 3366 3365 3364 3363 3362 3361 70801 70800 70799 70798 70797 70796 59654 59653 59652 72574 72575 72576 72577 384 385 386 70961 54736 54735 22470 83740 83739 55485 55486 16850 16851 16852 16853 11225 11226 11227 41833 41832 55268 55267 66015 66016 37...

result:

ok 

Test #52:

score: 0
Accepted
time: 1ms
memory: 29612kb

input:

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

output:

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

result:

ok 

Test #53:

score: 0
Accepted
time: 0ms
memory: 28368kb

input:

9
6 7
7 3
9 8
4 3
2 1
6 2
6 8
5 6
7 8
1 4
9 4
4 5
9 6
1 9
2 3

output:

5
6 5 4 3 7 
7 3 4 9 8 

result:

ok 

Test #54:

score: 0
Accepted
time: 1ms
memory: 29296kb

input:

9
5 4
1 5
3 2
1 2
2 9
6 7
1 8
3 4
7 5
5 6
5 9
6 3
9 1
7 8
8 9

output:

7
1 5 4 3 2 9 8 
5 7 8 9 2 3 4 

result:

ok 

Test #55:

score: 0
Accepted
time: 4ms
memory: 29476kb

input:

10
1 8
10 9
4 9
6 4
2 1
2 3
7 2
4 5
10 3
5 8
2 9
6 5
8 9
4 8
6 7
7 8
3 4

output:

8
1 2 3 10 9 4 5 8 
5 6 7 2 3 10 9 4 

result:

ok 

Test #56:

score: 0
Accepted
time: 4ms
memory: 29600kb

input:

9
5 6
8 7
1 2
5 2
8 6
6 9
9 8
2 9
4 7
4 1
4 5
6 1
2 3
3 4
7 6

output:

5
2 5 6 8 9 
5 4 7 8 6 

result:

ok 

Test #57:

score: 0
Accepted
time: 0ms
memory: 29244kb

input:

10
1 2
3 2
6 8
5 4
5 6
8 7
4 1
6 7
4 3
2 5
3 10
8 9
6 2
10 1
9 3
8 4
9 10

output:

4
1 4 3 2 
2 3 4 5 

result:

ok 

Test #58:

score: 0
Accepted
time: 2ms
memory: 29192kb

input:

9
3 6
2 1
5 6
9 7
4 2
4 3
1 3
8 9
1 5
6 7
4 6
1 9
7 8
4 5
2 3

output:

3
4 3 6 
7 9 8 

result:

ok 

Test #59:

score: 0
Accepted
time: 5ms
memory: 29600kb

input:

4
1 2
4 1
4 3
3 1
4 2

output:

3
1 4 2 
3 1 4

result:

ok 

Test #60:

score: 0
Accepted
time: 1ms
memory: 29708kb

input:

10
8 10
10 9
7 8
8 3
6 3
1 3
9 6
1 8
5 10
3 4
10 4
3 9
2 1
1 9
6 5
6 10
9 5

output:

4
10 5 6 9 
3 8 10 4 

result:

ok 

Test #61:

score: 0
Accepted
time: 1ms
memory: 29248kb

input:

1000
937 387
833 217
405 422
502 356
529 374
497 662
803 845
726 979
999 43
463 620
749 828
661 573
191 708
513 963
737 819
439 571
787 166
873 842
993 566
590 908
34 184
699 314
756 255
996 242
653 402
451 656
90 762
562 382
945 397
600 816
789 890
378 965
613 827
319 645
156 684
477 570
131 419
43...

output:

73
652 544 574 707 427 668 426 598 195 162 527 948 255 756 168 885 749 828 918 666 9 822 500 830 665 582 907 137 825 637 915 596 595 852 276 926 717 308 760 718 65 669 588 182 937 387 86 248 567 517 360 928 346 785 176 179 818 716 442 793 304 14 112 690 570 477 353 502 356 862 863 258 4 
432 814 238...

result:

ok 

Test #62:

score: 0
Accepted
time: 0ms
memory: 30676kb

input:

9999
2524 8191
1533 7530
356 1008
8210 3560
2071 540
2876 4324
9158 3771
2872 5625
4701 4769
4728 2104
2264 9841
4009 2392
9900 4852
9836 1027
3996 1557
97 1319
5587 7722
7488 4073
2940 9762
246 6394
380 6935
7929 3557
8049 8841
2105 7255
2710 6626
7926 6255
8392 6949
6174 2040
9959 8955
8701 3730
5...

output:

4410
9292 9006 7786 7057 8758 7115 3771 9158 4755 1116 4183 1297 7326 3856 2038 7648 6168 3748 9110 3430 3365 5847 5130 1792 2204 8441 4282 2046 1766 7394 8506 4952 3170 2647 6010 8659 5655 4535 901 225 3903 8443 9349 9401 7000 3102 2148 7748 2221 3057 2871 9438 6464 2397 1556 870 1496 5824 8786 490...

result:

ok 

Test #63:

score: 0
Accepted
time: 3ms
memory: 30084kb

input:

10000
8697 615
9680 5350
5924 4698
4478 7356
3510 7535
6046 3305
885 4890
8224 2297
2267 8411
7331 7035
1747 7766
3540 1409
4143 212
9541 5746
1062 539
2060 9566
5293 350
6143 2220
1446 2866
4603 4151
9625 5078
3432 4169
1528 1525
9522 2738
3154 3100
8560 9024
1200 4420
3138 9200
2346 182
1694 6303
...

output:

3059
1664 1591 7321 9350 1818 4049 1759 8442 1651 7354 92 3746 5336 1864 5334 6986 7482 5598 8746 5538 5783 6073 1988 3183 4284 2411 6409 3715 8348 6009 8887 120 9970 8565 4908 9669 1987 8102 7877 5357 9007 292 5084 1062 539 6688 3527 5780 9280 1238 328 6854 9238 2179 3511 2444 5908 883 2587 3565 63...

result:

ok 

Test #64:

score: 0
Accepted
time: 61ms
memory: 38272kb

input:

99999
84520 53880
95569 33800
30674 78149
34453 98159
29766 87018
38710 45543
78103 64279
95388 6083
90709 6245
28076 59536
89121 25989
17455 86681
24869 49677
88947 54071
59069 14675
2211 80543
84618 24731
71749 96646
3072 81888
41124 19659
78748 83891
86353 92485
51719 3101
86489 39980
2846 67916
...

output:

4281
59718 64220 59090 74553 23304 10500 81025 75091 6701 95306 75221 84256 65314 22635 11849 26724 19806 91835 72615 16687 74920 99815 13622 24094 31754 51088 34089 59948 49679 35809 7678 81959 62473 85614 69891 36850 86703 87806 84774 40397 29056 48852 22918 95949 75411 95305 52678 25162 94881 888...

result:

ok 

Test #65:

score: 0
Accepted
time: 55ms
memory: 37584kb

input:

91648
4472 25803
85060 29770
38233 78885
69505 11992
74584 56733
44447 19721
38611 47816
64374 1051
85078 88959
3376 77926
30914 66149
47776 2665
24048 19740
63674 58321
31035 27289
28597 78620
26732 63968
3921 28544
88344 48945
17800 78918
39469 31300
58279 76356
88378 67190
87900 74995
96 31664
86...

output:

16895
51348 74820 55557 11840 6827 90717 39312 7111 29522 41366 43323 52597 5977 12470 51383 23565 75131 33041 14477 6765 29933 15675 23831 51165 90113 61269 71512 28451 72143 74915 9428 11897 11949 39898 43873 43729 89053 76804 15794 65932 50543 70145 527 67873 86726 15965 23133 74076 78460 46593 5...

result:

ok 

Test #66:

score: 0
Accepted
time: 59ms
memory: 38508kb

input:

100000
13352 1027
26975 28733
58784 97055
76806 68544
9735 23022
13365 25281
80851 10373
95287 91860
59771 31042
51912 68412
26741 29961
34375 25709
13755 46111
50736 39736
95695 18184
57397 62912
97590 59408
6754 50322
16563 80551
76371 58366
31788 49867
41825 95414
16211 24996
32999 62870
4946 820...

output:

2538
21387 41588 99070 47574 86437 99813 72490 64715 3909 97080 65815 49028 99232 7787 29744 83903 36362 85206 74979 66013 88990 75328 72546 22460 22575 91304 15843 16711 97311 93383 29922 8719 54339 98814 43910 41946 91728 11688 43866 77028 18968 60035 35597 77435 62375 78029 73329 8531 53606 76647...

result:

ok 

Test #67:

score: 0
Accepted
time: 43ms
memory: 38568kb

input:

100000
20959 25336
91898 62660
72720 51175
61002 85224
24094 15898
17841 75902
96298 91723
60352 50707
73566 69660
14089 5220
50982 29437
79898 86395
1734 56103
52555 46603
63369 73948
72151 60200
25210 3152
38452 28051
85173 32730
57691 99457
69691 30053
2072 97708
97968 56344
65532 44367
12342 346...

output:

14176
95426 80665 4018 45597 2521 14441 58941 62192 69211 35584 4349 93412 94139 1494 58388 59425 81303 35844 96166 16936 323 88388 71815 7359 82397 70492 88279 17677 88602 23835 29513 59020 10569 3835 95779 15688 36520 72734 17483 59207 42626 58107 78743 15154 74994 32875 79543 28187 38624 62770 54...

result:

ok 

Test #68:

score: 0
Accepted
time: 48ms
memory: 38332kb

input:

100000
16435 98228
89180 57831
43189 90862
16293 29922
91964 47722
34278 901
54950 37026
95302 76757
42452 74646
38280 38053
65541 27258
36041 61691
27600 40344
23817 62272
71323 52794
81547 61348
39381 11415
52865 23221
79787 93823
91146 34985
66479 79975
16439 79659
36874 49350
50891 86175
33479 5...

output:

21220
70048 16301 47620 62877 92231 59323 87275 6155 45645 93102 13557 94678 82469 2803 8527 83954 61907 72516 55326 65052 60513 84420 74463 40666 55669 77985 79504 2190 31968 74947 42156 14495 93207 58957 17578 31571 65909 53423 12268 61456 65086 69532 10519 59986 34831 96801 69470 41375 93285 2680...

result:

ok 

Test #69:

score: 0
Accepted
time: 52ms
memory: 38468kb

input:

95728
48566 69797
54999 85490
75942 40279
51954 81016
58241 2418
39067 29211
81791 12312
77375 65571
56275 38417
19545 83406
22125 73565
35590 62148
23344 55309
39501 86411
68603 19541
75927 74829
9467 14763
65439 91977
45467 52791
94490 35940
32928 3568
76229 95312
78704 76042
23090 10023
59356 602...

output:

11287
58724 26456 20098 92996 7425 10013 21920 14811 57562 82034 38666 73507 17349 19461 3763 32587 35257 62727 86952 47210 1377 17820 36015 18630 62340 70033 53461 68118 8612 42608 57988 21511 78727 93957 24618 15652 7730 40005 8124 70496 94817 51201 45810 62184 88581 34816 24579 56172 42393 22006 ...

result:

ok 

Test #70:

score: 0
Accepted
time: 1ms
memory: 29600kb

input:

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

output:

4
5 4 2 3 
1 5 3 2 

result:

ok 

Test #71:

score: 0
Accepted
time: 56ms
memory: 37988kb

input:

93309
71437 20546
7225 87604
42872 46689
48394 70601
79628 80229
46286 21730
85596 24788
78402 13849
4309 88242
46678 82455
59146 64364
43993 73409
35381 77031
24159 45740
49493 15690
53789 31467
78790 88954
13595 76316
85033 35716
5254 44215
33086 43366
81849 23644
22197 53918
78118 73130
44242 230...

output:

785
66979 48378 10292 86390 39178 23516 40747 6297 41797 46234 72301 75700 19349 44669 62492 7583 8217 17290 69900 59154 26785 71189 71800 75328 15259 92505 70979 70446 91269 37694 34387 78702 25137 36197 33221 2368 6104 81143 12803 33385 45962 23168 28877 12501 55406 35949 57574 40058 64187 3496 24...

result:

ok 

Test #72:

score: 0
Accepted
time: 1ms
memory: 29604kb

input:

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

output:

3
1 5 3 
3 5 6 

result:

ok 

Test #73:

score: 0
Accepted
time: 1ms
memory: 29212kb

input:

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

output:

4
1 7 3 6 
7 2 5 3 

result:

ok 

Test #74:

score: 0
Accepted
time: 1ms
memory: 29516kb

input:

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

output:

3
7 6 3 
5 6 7 

result:

ok 

Test #75:

score: 0
Accepted
time: 1ms
memory: 29892kb

input:

9
1 3
4 8
2 4
8 6
5 4
8 5
9 2
9 4
8 9
1 6
2 3
5 2
4 7
7 1
9 5

output:

3
4 5 8 
8 5 9 

result:

ok 

Test #76:

score: 0
Accepted
time: 0ms
memory: 29612kb

input:

10
6 5
8 3
8 9
9 10
3 4
10 6
7 8
6 9
2 3
4 7
6 8
4 10
6 3
6 4
5 10
5 4
9 5

output:

7
3 8 9 10 6 5 4 
8 7 4 5 6 10 9 

result:

ok 

Test #77:

score: 0
Accepted
time: 4ms
memory: 29616kb

input:

9
6 5
5 8
7 8
2 3
7 2
3 6
5 2
9 1
6 4
5 3
5 7
4 2
4 7
3 1
9 7

output:

4
5 6 3 2 
6 3 2 4 

result:

ok 

Test #78:

score: 0
Accepted
time: 4ms
memory: 29864kb

input:

10
3 6
10 4
3 7
2 3
3 8
8 9
10 9
2 10
6 5
4 3
4 2
1 3
8 6
5 1
10 1
10 7
10 6

output:

3
3 6 8 
10 2 4 

result:

ok