QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#162614#5088. Two Choreographiesntu_vjudge_1AC ✓102ms48924kbC++173.5kb2023-09-03 15:10:312023-09-03 15:10:32

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
1 2
1 3
1 4
2 3
2 4

output:

3
1 2 4
1 2 3

result:

ok 

Test #2:

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

input:

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

output:

3
1 2 5
1 2 3

result:

ok 

Test #3:

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

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 2 5 6 3
2 5 6 3 4

result:

ok 

Test #4:

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

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:

5
15 18 9 34 31
18 9 34 31 38

result:

ok 

Test #5:

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

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:

8
70 171 156 103 60 107 184 113
171 70 134 15 127 8 143 173

result:

ok 

Test #6:

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

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:

387
5176 5097 201 4137 5612 667 1510 1415 7704 749 485 842 4133 2172 751 3800 1181 6477 1707 7129 4602 747 5902 4336 6660 5074 3407 5153 7310 406 5180 5649 6994 3029 5507 3229 1673 3167 5041 5004 6215 2593 5188 7109 7848 3807 6293 2443 3575 3919 1287 4737 3110 4032 6224 636 4820 1039 6823 4404 3028 ...

result:

ok 

Test #7:

score: 0
Accepted
time: 72ms
memory: 38064kb

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:

882
5278 57040 17434 35578 47112 1006 20682 25581 24373 21684 1117 40886 54559 96182 73644 20400 5815 19712 35238 72931 41158 10346 10127 59129 4027 30066 3367 71429 68753 30228 13999 12756 50663 1923 16492 67620 22760 45689 32107 39069 57382 22417 727 14491 23531 53912 91667 85764 19918 33553 33593...

result:

ok 

Test #8:

score: 0
Accepted
time: 63ms
memory: 37968kb

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:

1387
34202 95174 48222 72732 31723 4261 21810 70820 93323 24275 52516 74979 92750 86964 17950 22757 46038 63546 77733 58051 43225 11276 14480 13364 79357 17055 59416 82229 88049 41361 83794 21165 62356 92323 24789 34518 41091 43222 33654 90310 70112 72446 8115 62616 8482 62874 57196 40402 65633 7654...

result:

ok 

Test #9:

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

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
1 6 7
5 6 7

result:

ok 

Test #10:

score: 0
Accepted
time: 70ms
memory: 48472kb

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 99999 100000
1 2 3

result:

ok 

Test #11:

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

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
1 2 8
6 7 8

result:

ok 

Test #12:

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

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 9
1 2 3

result:

ok 

Test #13:

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

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
1 9 10
8 9 10

result:

ok 

Test #14:

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

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 999 1000
1 2 3

result:

ok 

Test #15:

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

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 9998 9999
9997 9998 9999

result:

ok 

Test #16:

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

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 9999 10000
9998 9999 10000

result:

ok 

Test #17:

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

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 94752 94753
1 2 3

result:

ok 

Test #18:

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

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 99999
1 2 3

result:

ok 

Test #19:

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

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 6 7
1 2 3

result:

ok 

Test #20:

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

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 99999 100000
1 2 3

result:

ok 

Test #21:

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

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 7 8
1 2 3

result:

ok 

Test #22:

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

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 8 9
1 2 3

result:

ok 

Test #23:

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

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 9 10
1 2 3

result:

ok 

Test #24:

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

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 999 1000
1 2 3

result:

ok 

Test #25:

score: 0
Accepted
time: 7ms
memory: 7540kb

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 9998 9999
1 2 3

result:

ok 

Test #26:

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

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 9999 10000
1 2 3

result:

ok 

Test #27:

score: 0
Accepted
time: 41ms
memory: 46904kb

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 97064 97065
1 2 3

result:

ok 

Test #28:

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

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 99998 99999
1 2 3

result:

ok 

Test #29:

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

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
1 2 7
5 6 7

result:

ok 

Test #30:

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

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 100000
99998 99999 100000

result:

ok 

Test #31:

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

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
1 2 8
6 7 8

result:

ok 

Test #32:

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

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
1 2 9
7 8 9

result:

ok 

Test #33:

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

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
1 2 10
8 9 10

result:

ok 

Test #34:

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

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 1000
998 999 1000

result:

ok 

Test #35:

score: 0
Accepted
time: 7ms
memory: 7532kb

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 9999
9997 9998 9999

result:

ok 

Test #36:

score: 0
Accepted
time: 7ms
memory: 7368kb

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 10000
9998 9999 10000

result:

ok 

Test #37:

score: 0
Accepted
time: 33ms
memory: 45308kb

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
1 2 92892
92890 92891 92892

result:

ok 

Test #38:

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

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 99999
99997 99998 99999

result:

ok 

Test #39:

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

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
2 3 7 6

result:

ok 

Test #40:

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

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:

3
3 10 4
4 2 5

result:

ok 

Test #41:

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

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:

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

result:

ok 

Test #42:

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

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:

70
2235 2236 5978 5979 5980 5981 5982 8189 8188 9097 3834 3833 4084 4083 8975 9167 9871 9872 9873 9448 9447 9446 9445 9444 9443 9442 807 806 2356 2357 2358 871 870 869 4587 4442 4441 3364 8295 4130 6718 6719 1674 1673 1672 4800 1324 4190 7195 7194 6403 5270 1828 1827 1826 6214 6215 6216 6217 4746 19...

result:

ok 

Test #43:

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

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:

1511
1577 2360 2361 2480 2481 5405 596 595 5551 5550 5744 3238 8331 8332 177 3831 1952 1951 1950 9640 5111 5112 9688 9689 9653 9654 4840 603 602 601 2250 2251 4166 4165 4164 4163 4303 4302 7123 7124 7125 1386 1061 1060 7563 7564 7565 330 329 328 3664 3665 9175 5708 674 675 676 4628 4629 5091 9769 97...

result:

ok 

Test #44:

score: 0
Accepted
time: 101ms
memory: 45412kb

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:

5613
6894 6895 44688 44689 23680 1007 83930 74048 74047 74046 74045 74044 67754 67753 85003 85004 85005 85006 52526 27067 87921 87922 8102 17667 17668 17669 17670 17671 17672 47820 79192 79193 50295 52398 70893 70894 70895 93960 93961 93962 93963 18901 18900 9079 39482 39481 39480 39479 49012 49011 ...

result:

ok 

Test #45:

score: 0
Accepted
time: 95ms
memory: 45268kb

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:

6084
46013 46012 77887 48952 48953 48954 48955 48956 48957 11564 64013 64014 55632 55633 55634 77371 77372 77373 88369 88370 88371 88372 89442 4184 4183 35177 35178 402 73968 32450 44758 81142 79119 10843 10844 10845 10846 11945 11946 218 75252 55016 55017 76388 85564 85563 10145 51397 51398 59665 7...

result:

ok 

Test #46:

score: 0
Accepted
time: 95ms
memory: 45536kb

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:

784
12203 16135 892 891 28436 28437 30061 88448 96771 96772 96773 96774 96775 42503 42502 74580 95155 95154 75258 707 708 709 19004 19003 37030 37031 42903 42902 42901 42900 47140 47139 47138 34362 34361 29823 29824 75190 33373 33374 21074 21075 14246 20844 20845 27159 27158 27157 27156 59885 46805 ...

result:

ok 

Test #47:

score: 0
Accepted
time: 102ms
memory: 45996kb

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:

8773
34710 34711 99176 68137 68138 71211 71210 71209 71208 71207 71206 71205 71204 71203 25585 24967 65409 65408 65407 99573 88740 88739 94851 94850 94849 58741 58742 46941 46940 87974 18230 64313 64314 64315 93746 53805 53806 53807 53808 53809 53810 53811 81080 81081 61881 28822 28821 28820 88605 8...

result:

ok 

Test #48:

score: 0
Accepted
time: 75ms
memory: 45388kb

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:

2944
4246 4247 4248 4249 76372 76371 39105 88978 88979 88980 97789 97788 60107 60106 60105 73772 73773 73774 73775 72303 15595 15594 15593 15592 15591 44399 44398 13935 28879 28878 28877 28876 86944 10290 26835 88679 88678 30409 30408 8766 8767 64877 17273 61873 61874 61875 50278 50277 50276 64118 6...

result:

ok 

Test #49:

score: 0
Accepted
time: 75ms
memory: 43232kb

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:

8333
81144 81143 32336 32335 4265 4266 32219 32218 32217 32216 32215 9963 9962 9961 12952 2118 45258 51107 23974 23975 75100 75099 81438 81439 59758 70764 55141 55140 55139 55138 55137 55136 12153 39078 39079 35496 35497 35498 35499 68822 35538 35539 35540 86231 61898 1655 11630 3671 10888 40695 532...

result:

ok 

Test #50:

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

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
2 6 7 3
5 4 3 7

result:

ok 

Test #51:

score: 0
Accepted
time: 76ms
memory: 45160kb

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:

10853
66250 18195 18194 18193 18192 59981 59980 59979 59978 59977 59976 97647 97648 77815 77814 29351 21612 21613 77178 77177 77176 77175 44225 44226 18457 18458 57742 57743 79973 79972 7605 54587 17004 45457 45458 11948 11949 69240 63070 63071 63072 63073 91017 88739 88740 88741 12055 49406 24344 2...

result:

ok 

Test #52:

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

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
1 2 3 4 8 7 6
2 3 4 8 7 6 5

result:

ok 

Test #53:

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

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
7 3 4 9 8
5 4 3 7 6

result:

ok 

Test #54:

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

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:

5
1 5 4 3 2
5 4 3 2 9

result:

ok 

Test #55:

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

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:

4
3 10 9 4
2 3 10 9

result:

ok 

Test #56:

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

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:

3
6 8 7
6 8 9

result:

ok 

Test #57:

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

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
2 3 4 5
4 5 6 8

result:

ok 

Test #58:

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

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: 0ms
memory: 3560kb

input:

4
1 2
4 1
4 3
3 1
4 2

output:

3
1 3 4
1 2 4

result:

ok 

Test #60:

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

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:

3
6 9 10
5 6 9

result:

ok 

Test #61:

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

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:

26
249 964 520 761 277 723 50 432 856 773 549 730 784 840 803 845 986 261 942 901 372 603 185 225 742 838
80 483 78 43 999 434 3 473 683 599 726 979 378 965 450 534 219 777 631 844 48 338 923 449 289 134

result:

ok 

Test #62:

score: 0
Accepted
time: 6ms
memory: 7016kb

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:

92
8131 3853 4807 8981 6014 3858 3186 3448 6329 3530 9137 3949 6830 2023 6543 969 7041 7643 3832 2905 5369 5561 8614 1675 5209 8284 9265 199 6636 5316 9371 2962 4646 6431 900 5721 4340 9177 7380 864 963 3261 4179 3970 5133 1154 4100 5989 6942 8900 9500 9393 4208 894 7585 9421 7052 4743 4690 5756 327...

result:

ok 

Test #63:

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

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:

63
5317 3438 6879 9682 6145 360 1607 3107 1371 1457 7550 755 3717 3057 8317 8930 850 8643 180 2307 4393 11 1924 6505 6060 6364 3496 9151 5007 4874 9755 9497 3962 6147 7710 5127 1993 211 1009 1020 8371 2662 9622 4769 5592 3173 8894 8517 9252 5130 4666 8768 345 3744 3992 783 9475 8916 4557 1260 5442 8...

result:

ok 

Test #64:

score: 0
Accepted
time: 80ms
memory: 45204kb

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:

787
30553 42799 41393 40930 34016 54976 55468 12628 71833 90521 11895 59319 28781 80215 24785 69295 31352 97317 98188 84597 4704 57492 40745 36568 13338 23608 62025 57873 98673 29795 42164 70240 43404 44495 56822 46596 89501 20550 24982 42589 89619 37175 61467 31511 71449 66168 79529 31495 83816 387...

result:

ok 

Test #65:

score: 0
Accepted
time: 75ms
memory: 41380kb

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:

2718
48017 55950 73628 86445 30009 58060 84633 37205 65715 34530 48249 74205 38787 44722 50555 40147 24802 18729 2381 79804 53657 24040 43482 73764 23011 73913 73328 54303 38086 81471 12047 67558 34879 53653 32714 1613 31947 76940 6636 43234 49082 50653 74377 32629 39087 43616 57458 3354 29088 52045...

result:

ok 

Test #66:

score: 0
Accepted
time: 87ms
memory: 44616kb

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:

930
29830 10159 34080 3809 18891 73582 63840 15276 20470 3121 5585 34506 36354 22250 4736 95970 35565 23793 47711 98914 9201 33058 18518 26197 84614 96245 8001 98017 70550 62816 16032 86688 73117 28131 25645 58427 74031 80610 70209 69961 98576 24976 76210 1061 4090 182 33274 77964 21785 8111 84170 6...

result:

ok 

Test #67:

score: 0
Accepted
time: 92ms
memory: 44364kb

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:

905
21555 52465 5035 63185 97892 81049 35496 97026 26330 3473 70234 6508 74388 41888 92993 44081 62936 99580 37831 43315 24845 50037 87400 79768 35716 96417 59462 79583 57654 95836 81719 57075 70175 20327 72229 90511 69874 7684 52595 19419 44954 31444 33270 51790 97878 26399 81622 50780 71908 45649 ...

result:

ok 

Test #68:

score: 0
Accepted
time: 85ms
memory: 44568kb

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:

35
32850 12478 38154 61382 79642 40923 59273 74269 52834 56780 80157 29784 18167 78230 2567 87620 9604 40837 41722 40112 95448 10522 29943 43330 40569 39793 74068 83749 43901 9035 25458 81216 76995 36234 98425
47484 78284 88097 39503 47696 48314 40563 80998 86613 90186 45041 13493 75602 90529 41295 ...

result:

ok 

Test #69:

score: 0
Accepted
time: 85ms
memory: 43032kb

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:

3250
18274 63033 22995 43510 50003 27697 11667 27243 37259 11156 95697 61663 43354 78538 83559 35883 87438 8000 84144 74966 16473 95181 6300 84406 38388 92337 67814 73523 74233 23735 55181 19858 80137 25293 25588 90818 57820 27231 23386 87425 59906 71364 64594 60855 73124 89178 17702 29016 78393 563...

result:

ok 

Test #70:

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

input:

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

output:

4
1 5 3 2
4 2 3 5

result:

ok 

Test #71:

score: 0
Accepted
time: 80ms
memory: 41700kb

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:

1065
889 42603 65845 89500 27813 33898 15277 15047 78785 8316 60007 24867 24569 8289 20013 81747 59893 33633 83764 7316 3922 88643 27497 87002 78351 44179 67918 56637 78402 65217 13918 57015 11025 39665 50916 6808 34245 88692 73937 72731 6524 73816 1945 51804 86408 44924 91986 60662 6793 70184 73213...

result:

ok 

Test #72:

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

input:

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

output:

3
3 5 6
2 5 3

result:

ok 

Test #73:

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

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
2 5 3 7
4 5 3 7

result:

ok 

Test #74:

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

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 8
3 6 7

result:

ok 

Test #75:

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

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 8 5
8 5 9

result:

ok 

Test #76:

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

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:

3
4 5 6
5 6 10

result:

ok 

Test #77:

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

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
4 2 3 6
2 3 6 5

result:

ok 

Test #78:

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

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
2 4 10

result:

ok