QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#180291#5088. Two Choreographiesntu_vjudge_1AC ✓77ms26860kbC++174.7kb2023-09-15 17:51:002023-09-15 17:51:02

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 10540kb

input:

4
1 2
1 3
1 4
2 3
2 4

output:

3
3 2 1 
4 2 1 

result:

ok 

Test #2:

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

input:

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

output:

3
2 1 5 
3 2 1 

result:

ok 

Test #3:

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

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:

3
4 5 2 
5 2 6 

result:

ok 

Test #4:

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

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:

3
20 26 14 
18 38 9 

result:

ok 

Test #5:

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

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:

3
127 134 199 
145 134 199 

result:

ok 

Test #6:

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

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:

5
2450 1898 1539 5885 6806 
1580 322 5060 3490 3111 

result:

ok 

Test #7:

score: 0
Accepted
time: 68ms
memory: 26460kb

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:

9
10069 40881 61968 18143 93877 60701 39464 36751 53340 
66263 42273 7017 18813 93603 72934 42555 22641 73568 

result:

ok 

Test #8:

score: 0
Accepted
time: 71ms
memory: 26464kb

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:

7
53530 21466 43112 26930 96752 10029 95122 
30010 47562 20523 31256 17213 41521 56579 

result:

ok 

Test #9:

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

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:

4
3 7 5 4 
7 5 4 1 

result:

ok 

Test #10:

score: 0
Accepted
time: 67ms
memory: 26700kb

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:

4
100000 74192 1 1137 
90805 100000 74192 1 

result:

ok 

Test #11:

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

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:

4
2 3 4 1 
8 2 3 4 

result:

ok 

Test #12:

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

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:

4
9 4 3 1 
9 4 3 2 

result:

ok 

Test #13:

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

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

result:

ok 

Test #14:

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

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
1000 1 558 
930 929 1000 

result:

ok 

Test #15:

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

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:

4
1862 9999 5913 1 
4200 9999 5913 1 

result:

ok 

Test #16:

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

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:

4
10000 1110 1 1823 
10000 1110 1 3216 

result:

ok 

Test #17:

score: 0
Accepted
time: 60ms
memory: 26380kb

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:

4
57282 94753 65964 1 
94753 65964 1 10669 

result:

ok 

Test #18:

score: 0
Accepted
time: 64ms
memory: 26700kb

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:

4
99999 56058 1 6099 
79989 99999 56058 1 

result:

ok 

Test #19:

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

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

result:

ok 

Test #20:

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

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
40717 40718 1 
66747 66746 1 

result:

ok 

Test #21:

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

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

result:

ok 

Test #22:

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

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

result:

ok 

Test #23:

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

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

result:

ok 

Test #24:

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

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
824 823 1 
283 282 1 

result:

ok 

Test #25:

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

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
5571 5570 1 
8907 8906 1 

result:

ok 

Test #26:

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

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
6295 6296 1 
2375 2376 1 

result:

ok 

Test #27:

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

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
40478 40479 1 
28328 28327 1 

result:

ok 

Test #28:

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

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
14872 14871 1 
25280 1 25281 

result:

ok 

Test #29:

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

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

result:

ok 

Test #30:

score: 0
Accepted
time: 64ms
memory: 26780kb

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
58848 58849 100000 
70237 70238 100000 

result:

ok 

Test #31:

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

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

result:

ok 

Test #32:

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

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

result:

ok 

Test #33:

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

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

result:

ok 

Test #34:

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

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
177 178 1000 
629 628 1000 

result:

ok 

Test #35:

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

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
9190 9191 9999 
6250 6251 9999 

result:

ok 

Test #36:

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

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
4519 4518 10000 
6645 6646 10000 

result:

ok 

Test #37:

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

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
65034 65035 92892 
84042 84043 92892 

result:

ok 

Test #38:

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

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
37490 37489 99999 
33728 33727 99999 

result:

ok 

Test #39:

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

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:

5
2 3 7 8 1 
7 8 1 5 6 

result:

ok 

Test #40:

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

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

result:

ok 

Test #41:

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

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:

17
652 653 867 868 265 191 203 691 690 389 996 997 998 824 825 598 492 
412 413 146 928 887 888 889 890 891 34 35 36 37 38 423 424 319 

result:

ok 

Test #42:

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

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:

52
2890 4586 498 4522 4523 4452 5639 5640 108 4963 3247 3248 8954 8945 6502 2971 2970 1273 706 1630 8687 8688 7565 7729 7728 7727 6002 4153 6328 6327 2862 2863 2078 1504 5577 5578 5579 1607 7761 7762 6290 9259 7689 7688 4202 4201 8986 8987 5064 5065 975 2891 
9666 8549 3349 2173 1271 722 721 1973 19...

result:

ok 

Test #43:

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

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:

69
8634 7278 3876 3875 3102 4625 9023 6073 2619 5921 6158 214 5026 451 450 1365 8493 562 3586 3585 3584 3583 437 9581 2832 6840 6839 4832 5264 5263 5262 4989 4990 95 1417 7445 7446 6574 8435 8434 8433 8432 7978 7977 2171 4348 4349 4350 4351 2071 7378 2169 9428 2501 2502 2000 3507 3508 6960 6961 6374...

result:

ok 

Test #44:

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

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:

88
48131 48132 7385 11061 31005 58009 58010 58011 71096 35115 81540 56104 56105 56106 20165 6439 23759 23760 23761 57440 57441 6649 6648 6647 70065 70066 84378 84377 34549 34548 97314 97313 95068 95067 28244 28245 28246 60438 60439 60440 154 155 156 66903 66904 66905 66906 16066 29787 29786 29785 29...

result:

ok 

Test #45:

score: 0
Accepted
time: 73ms
memory: 26464kb

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:

89
57630 57631 57632 2846 2845 2844 2843 73645 74540 74539 5694 5695 43985 30935 30936 16005 15950 69064 23518 23519 23520 47236 47237 83162 83161 61043 61044 53074 53075 90229 43243 43244 78276 78277 78278 87162 36237 36236 54376 54375 54374 54373 70727 17244 63849 63848 89158 93325 93324 9325 9324...

result:

ok 

Test #46:

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

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:

85
69879 78019 78020 11702 11703 85481 75331 75332 75333 81887 81888 54050 54051 55085 18494 17411 52121 21902 12055 41149 91994 5052 87561 93641 52793 52792 52791 43080 43081 66902 66903 44317 89439 62571 62570 85702 85703 85704 45255 5062 5063 88354 62667 83021 33310 67000 66999 42187 42188 50927 ...

result:

ok 

Test #47:

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

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:

74
64904 64903 8026 8027 8028 35519 35518 20646 55069 55068 55067 97475 19958 77206 77205 77204 77203 70914 96943 37806 14570 88076 86752 84732 92645 60292 10940 10939 66531 66532 8578 62524 56919 46554 46553 248 247 42870 85095 85096 69418 85617 85618 39180 39181 39182 39183 17194 74415 66964 66965...

result:

ok 

Test #48:

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

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:

93
83954 80331 80330 80329 48250 48251 93402 97612 23510 24340 93289 86819 86820 54076 54075 22370 37712 37713 32330 77460 51887 51888 14574 14573 20807 20808 14723 64259 1581 1580 1579 34822 23301 79123 30562 75494 17708 17709 73275 60800 12077 37011 68879 68878 35883 87432 87433 17824 3674 3673 42...

result:

ok 

Test #49:

score: 0
Accepted
time: 62ms
memory: 26152kb

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:

7
16623 16624 75340 75341 9627 52420 52419 
18163 29198 57066 57067 27146 18165 18164 

result:

ok 

Test #50:

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

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:

3
6 7 2 
3 2 7 

result:

ok 

Test #51:

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

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:

33
5660 18380 18381 70780 52390 52391 48177 48176 17906 29705 30912 58748 17046 17047 17048 35801 35802 59755 70543 3741 68292 58226 58225 88168 29969 77367 26583 75228 75227 40934 40935 84053 76034 
54778 91900 91901 10724 10725 10726 21857 21856 81923 62549 15514 70457 18221 21944 21945 57029 5702...

result:

ok 

Test #52:

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

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:

4
3 4 8 7 
2 4 8 1 

result:

ok 

Test #53:

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

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

result:

ok 

Test #54:

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

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:

4
9 5 1 8 
7 5 1 8 

result:

ok 

Test #55:

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

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

result:

ok 

Test #56:

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

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:

4
7 8 9 6 
3 2 5 4 

result:

ok 

Test #57:

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

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

result:

ok 

Test #58:

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

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

result:

ok 

Test #59:

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

input:

4
1 2
4 1
4 3
3 1
4 2

output:

3
2 4 1 
4 1 3 

result:

ok 

Test #60:

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

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

result:

ok 

Test #61:

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

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:

4
77 951 496 374 
825 601 282 973 

result:

ok 

Test #62:

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

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:

48
5613 4278 810 596 2903 7543 4599 3693 965 4812 1421 3095 7493 9908 3403 7561 4686 8886 2157 6493 142 6664 4077 3471 4653 5473 2780 6476 379 591 9744 5781 4478 4121 3121 9649 5714 6854 5951 4823 1287 6918 1613 5488 3420 1476 6492 8882 
1490 8157 8077 1156 4731 8304 9092 466 4225 1410 2378 526 4631...

result:

ok 

Test #63:

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

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:

42
2906 3167 4251 7633 8506 1221 5150 5689 10000 4695 3487 5204 6448 1916 2636 3599 2694 1870 6227 2199 5187 1214 8475 6299 6751 6123 7758 4788 1246 3478 8408 7834 424 9759 2032 8224 2839 9349 2509 7316 9791 8697 
6764 273 6832 5220 5845 3076 5773 9965 6584 2239 9356 2888 5344 276 7399 3672 8119 978...

result:

ok 

Test #64:

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

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:

21
43120 35378 3545 53475 15075 17298 977 53019 48153 12908 58439 42491 34843 29446 40361 60155 88865 86020 4539 26059 64234 
21933 35902 32947 54700 24373 37760 72683 35744 27197 79876 69084 46470 93271 15641 3692 72019 36100 67968 78120 76673 23681 

result:

ok 

Test #65:

score: 0
Accepted
time: 66ms
memory: 25988kb

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:

119
81142 54139 26166 79330 61638 56463 77072 69935 46803 66950 46809 26390 86339 41010 10282 9771 9151 43551 59515 51212 21505 24884 35220 60507 33668 67544 88638 22840 61087 44262 89744 70225 70376 83997 44955 47442 11634 63650 48895 73003 68335 89416 20887 38309 15250 89935 67995 52198 29514 1234...

result:

ok 

Test #66:

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

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:

110
66997 40376 93648 84136 4567 1809 87247 76788 79803 13452 41419 40242 34271 44984 38942 41179 31442 79723 27673 45995 2456 5206 56879 53489 40840 26037 19529 5960 72775 17876 47422 75348 48826 10063 91810 37248 42447 36975 24048 85559 37690 80609 18256 63798 25926 18368 44101 8688 65823 78818 43...

result:

ok 

Test #67:

score: 0
Accepted
time: 77ms
memory: 26444kb

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:

215
89191 52483 77107 77660 11781 13582 80648 58845 72564 68902 26766 92426 60972 84043 104 40143 93504 32487 98598 30971 76355 9522 90220 10170 28785 86440 59390 82707 13975 49648 41460 10043 54436 53656 14236 91037 5380 67769 28966 11769 13183 98318 67387 62218 14139 97910 37410 50294 62643 15315 ...

result:

ok 

Test #68:

score: 0
Accepted
time: 73ms
memory: 26388kb

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:

154
32041 26987 14719 33384 37909 71394 51058 14398 47561 97222 1994 52114 95789 88620 80996 38996 17756 19111 35595 65430 65982 83475 80161 95518 37045 78738 85958 50891 15593 98660 52370 57330 56392 20953 74533 22935 92092 29588 96949 20652 24173 65674 31873 18709 67461 60858 39580 90860 90350 828...

result:

ok 

Test #69:

score: 0
Accepted
time: 69ms
memory: 26192kb

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:

55
71715 17689 27641 43020 68919 29872 90391 78774 55692 2242 85792 37046 8897 92931 15037 84449 85705 31033 26063 66783 69506 34876 60738 15049 54491 93879 93562 46459 76177 25830 70017 71052 58980 64065 44607 40423 36210 30193 79668 80821 69927 46304 84807 51038 76938 1036 5682 84630 47887 51966 7...

result:

ok 

Test #70:

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

input:

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

output:

3
5 3 1 
2 1 3 

result:

ok 

Test #71:

score: 0
Accepted
time: 60ms
memory: 26196kb

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:

82
37995 36124 56954 12629 47967 25025 91947 61758 12137 4926 50927 48717 10659 81881 7020 51317 12514 76375 65027 57570 10425 53440 936 8977 14869 46082 91497 90299 54251 463 59063 37246 4265 75739 1494 12571 51934 50354 83815 27752 31743 82174 13962 11154 11708 29249 44616 31145 57688 75129 15380 ...

result:

ok 

Test #72:

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

input:

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

output:

3
5 2 1 
3 2 1 

result:

ok 

Test #73:

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

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

result:

ok 

Test #74:

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

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:

5
8 7 5 6 1 
7 5 6 1 4 

result:

ok 

Test #75:

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

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

result:

ok 

Test #76:

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

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:

4
4 6 8 3 
9 10 6 8 

result:

ok 

Test #77:

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

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

result:

ok 

Test #78:

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

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

result:

ok