QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#88063#4289. Efficient Bus Routingxiaowuc1AC ✓165ms22300kbC++173.0kb2023-03-15 00:42:532023-03-15 00:42:56

详细

Test #1:

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

input:

3
1 2
2 3

output:

1
1 3

result:

ok correct

Test #2:

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

input:

5
1 2
1 3
1 4
1 5

output:

2
2 4
3 5

result:

ok correct

Test #3:

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

input:

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

output:

3
3 6
4 7
6 9

result:

ok correct

Test #4:

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

input:

3
3 1
1 2

output:

1
3 2

result:

ok correct

Test #5:

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

input:

3
2 3
2 1

output:

1
3 1

result:

ok correct

Test #6:

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

input:

3
2 1
1 3

output:

1
2 3

result:

ok correct

Test #7:

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

input:

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

output:

4
10 9
7 6
3 4
9 1

result:

ok correct

Test #8:

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

input:

5
3 5
2 3
4 2
5 1

output:

1
4 1

result:

ok correct

Test #9:

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

input:

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

output:

2
3 7
6 5

result:

ok correct

Test #10:

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

input:

5
1 2
5 2
4 3
3 5

output:

1
4 1

result:

ok correct

Test #11:

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

input:

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

output:

2
4 7
6 2

result:

ok correct

Test #12:

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

input:

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

output:

2
3 2
2 6

result:

ok correct

Test #13:

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

input:

5
1 4
2 3
5 1
3 5

output:

1
2 4

result:

ok correct

Test #14:

score: 0
Accepted
time: 96ms
memory: 12820kb

input:

165391
131658 81362
36824 11317
81323 3532
113971 78318
93318 48768
108814 5584
86805 157446
87287 20800
24376 136647
163727 132692
131285 152926
11625 39709
14843 125722
38227 79119
31480 25997
111343 26177
150675 5611
74980 159656
144373 88182
2083 145422
108542 116175
151704 27473
53609 67736
230...

output:

41321
80239 86880
115530 82274
40736 32636
50310 145699
109039 89459
120509 8721
74412 85143
81823 118340
75745 130768
12341 117997
141309 44647
84220 157262
110419 63168
83360 11005
114193 10424
132850 5632
94867 157413
77849 19476
36132 158773
63670 74641
109786 83203
100768 95944
81993 87738
9824...

result:

ok correct

Test #15:

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

input:

56133
24603 22191
30318 23737
3484 39520
12864 39278
32913 6233
3911 28476
8083 9104
40709 45967
52903 23389
193 5054
12703 3246
4331 23671
20452 26002
44493 31150
40923 5387
15551 51715
50753 54925
51136 12595
25561 48952
13052 18730
18061 13365
22415 52900
43798 40892
24934 12357
41309 1590
51701 ...

output:

14072
46329 20943
33338 12380
54352 26532
27807 5969
41593 37493
46451 18468
31221 24917
3083 13917
18910 2990
2969 165
50611 33024
54576 18322
33114 38827
6371 48469
43920 7576
18753 270
21775 26963
36205 3888
10558 52499
49730 17408
51833 13935
36710 3867
55825 38100
10346 43931
15167 26711
31061 ...

result:

ok correct

Test #16:

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

input:

90294
80875 26802
1919 27016
11777 78119
65749 243
52016 74231
78881 11080
60786 77501
12595 17398
76954 41893
45899 58007
80648 13956
36043 6242
66446 51737
66703 34451
2665 64034
63658 71897
86582 63166
965 54745
39353 87590
32771 63420
19754 70994
55617 67449
36777 51618
88283 49696
47724 23026
3...

output:

22554
35738 55721
85639 73230
12494 74547
79326 25633
26842 26412
78755 75605
34248 85946
42635 30376
88081 29651
83824 8013
69382 87188
40774 83609
12921 77709
8723 87077
76541 35774
57180 89450
28093 73544
48579 63054
57955 69853
73298 1433
81749 73223
9120 29228
3544 64124
18185 65502
65186 369
5...

result:

ok correct

Test #17:

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

input:

13155
7797 9955
9485 8103
6424 5131
10434 5621
10510 5995
5883 9157
2249 3657
11833 4510
1191 6811
9833 3032
5631 8118
11824 11700
7410 6352
7765 5554
1738 8717
10054 4560
6395 5998
8148 2264
5682 1688
10978 4885
12038 598
10998 8583
6374 5000
429 6005
3566 3883
1830 10467
6539 3088
1514 249
11408 9...

output:

3299
10166 4064
12583 12661
9100 1224
5544 6750
4967 7337
4775 4500
11729 12257
9304 12435
4317 5157
12417 4030
567 10642
13015 5041
7484 8222
13025 5735
13087 4356
12968 10294
3173 5640
7617 1139
12230 5934
4782 10280
5702 5798
8622 8731
6573 3403
11654 12562
6951 11033
6765 11109
9111 11236
7142 9...

result:

ok correct

Test #18:

score: 0
Accepted
time: 107ms
memory: 13968kb

input:

183429
95709 50315
13009 60867
163534 12072
119645 159697
27519 73628
103175 47971
102702 99396
168831 60882
98019 137031
40855 99925
51906 69203
132167 148694
182504 74603
60427 130277
15032 33290
103009 105469
50151 156514
49914 132610
152823 3430
155870 104377
101341 150021
130269 148906
164999 7...

output:

45768
55085 38523
98949 71290
35997 178524
129886 29937
141350 105863
121800 60134
132138 66581
14736 41335
178594 59892
162682 511
148450 150823
154371 113129
115144 139280
101348 62972
123387 138963
13314 82766
15580 171969
53130 177627
115403 100760
118849 138500
65936 37759
35717 85077
53017 109...

result:

ok correct

Test #19:

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

input:

20
10 4
11 18
12 20
5 6
15 13
6 20
5 14
11 16
3 2
18 7
17 9
19 1
14 19
2 20
15 16
13 9
9 8
1 8
11 4

output:

3
17 10
7 12
10 3

result:

ok correct

Test #20:

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

input:

131071
89919 85160
120901 67896
75409 80508
51758 75992
67510 127099
54350 126352
96208 16116
22218 61779
124619 101745
66949 34442
48490 88465
110334 119155
16440 53673
100123 24615
5668 27695
42069 16657
121733 103228
34051 101773
26661 128170
59272 32652
102358 126423
91611 28283
83927 14955
2970...

output:

16318
90947 103871
92285 23787
26579 116182
117938 28340
91639 94112
42900 90096
105157 115569
12500 16228
2213 113370
130476 127049
91917 68015
54610 40217
26140 40906
126219 57949
81493 35203
62284 125171
71122 37898
112474 70239
18835 28770
78370 76702
41079 61133
76210 113872
10704 72182
27064 9...

result:

ok correct

Test #21:

score: 0
Accepted
time: 83ms
memory: 13200kb

input:

131072
79927 70095
86409 119319
1367 30468
117272 73512
107410 90273
960 94145
43092 28509
11038 90964
29286 23830
45611 106594
103927 89152
84988 13074
46234 28078
19629 99078
30433 38806
14233 47914
6924 48340
87165 115840
111665 70043
67320 81507
60326 72678
39188 11552
55074 73171
16021 22738
47...

output:

16361
30941 96014
27405 32711
104551 76558
99012 27771
118882 72733
63460 119475
71326 54918
64870 14095
57620 6296
82578 81018
96313 107055
106028 44094
35070 95896
90579 34833
51174 70905
1487 54532
38242 67001
72424 75435
4869 2326
42718 41355
19447 81405
119886 97857
130669 100039
64250 98987
93...

result:

ok correct

Test #22:

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

input:

131073
108645 1847
121926 36907
104780 21147
12121 78119
1464 73934
84215 32677
80002 11621
122592 104907
60460 79189
125999 2762
34120 121265
93190 117178
68410 86951
115339 45598
88169 89422
8290 118867
65611 42330
101979 8225
123382 20773
66766 21523
73071 54924
66465 10725
81598 69643
123050 815...

output:

16447
92144 27376
51882 93481
30984 84054
112890 84828
841 7954
68002 28961
54463 54872
124209 5814
16599 85498
110623 93593
56175 124890
126652 40979
128309 19763
1778 57746
42412 121497
109586 14054
60044 60210
39555 76516
108450 100811
124731 91294
92400 100028
11689 75313
13897 106630
81146 1160...

result:

ok correct

Test #23:

score: 0
Accepted
time: 90ms
memory: 14676kb

input:

151072
76256 60730
5001 150458
44583 67425
73911 120111
22709 10487
134807 21858
21133 97912
10089 128101
46306 125763
109703 67524
71400 38826
45398 33298
44476 87136
5995 128061
66831 86319
100662 32065
39164 120399
58531 79705
60907 33606
103768 23182
133237 60840
86335 150443
86384 123776
71707 ...

output:

18822
51495 78736
78074 85963
83410 120129
5403 19159
140234 64612
91574 70416
3286 98874
86442 148735
102367 88178
58032 43905
67173 72622
134856 74774
91065 114068
119208 108673
86476 49701
116398 12817
61473 6119
61089 102165
104005 122569
18355 17434
115064 129818
122644 61161
61219 30600
135842...

result:

ok correct

Test #24:

score: 0
Accepted
time: 133ms
memory: 17668kb

input:

200000
69832 197100
175858 115954
135914 112656
27919 109318
28228 54299
83259 144512
135849 3700
135893 62189
23775 31551
173932 16288
146907 526
7905 173195
192397 189625
111145 4537
197025 25247
87297 156544
71647 111049
154939 110918
113106 132715
8909 92822
125546 3801
158277 198484
152506 1314...

output:

25063
178725 90513
164111 53716
124818 127005
196185 42481
108193 96417
199321 185892
104615 121485
15411 122063
71947 153159
62117 185461
135369 199026
177416 160148
53434 40089
80618 131081
51029 34740
159470 67947
165150 33701
115349 175629
106892 30634
110457 10170
172718 50528
91514 112172
1217...

result:

ok correct

Test #25:

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

input:

20
20 11
2 15
16 5
19 17
12 8
17 3
16 1
10 19
3 13
5 7
9 11
17 4
5 8
13 5
16 14
2 8
11 8
17 6
11 18

output:

6
1 20
14 9
7 18
12 10
15 4
20 6

result:

ok correct

Test #26:

score: 0
Accepted
time: 57ms
memory: 10732kb

input:

131071
29621 87855
27459 77535
70081 45517
92246 80359
128241 44770
31206 94831
41495 76846
125780 40567
28067 60173
82967 6599
89903 61406
105628 128827
6565 71258
11388 25821
103121 37114
34597 38201
104213 56444
93950 32249
107903 81787
71640 90328
66274 42284
102851 122004
1313 78105
61393 33582...

output:

32752
13741 23544
56852 116652
63115 91248
108748 120733
58166 85794
59384 741
117641 21594
40401 32425
118997 4721
14561 125494
116033 108455
39605 79948
42444 92070
47634 103332
52573 26679
73562 98862
129475 62363
62246 87516
74022 25282
64978 109254
49552 64459
124395 125836
25791 66107
40810 38...

result:

ok correct

Test #27:

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

input:

131072
62575 60278
65230 81918
11649 120380
95268 120202
40919 113523
60546 36774
61570 97162
127541 42562
90034 59611
96178 59882
117026 67026
12515 1876
127220 64225
74143 84226
34035 37033
63422 100938
86059 61785
51809 77970
79684 13534
58459 88574
112825 124888
31752 3273
4515 33498
2505 87928
...

output:

32764
59672 113002
97631 2313
66381 3473
108867 10357
58211 101878
74928 105078
102012 89105
126922 25696
18690 125031
86634 18912
116793 2210
114457 1923
112348 6511
114264 111278
23747 107256
114699 32853
125669 10685
72342 85505
81923 33319
18780 30763
56910 19732
32816 122240
89119 16867
22749 8...

result:

ok correct

Test #28:

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

input:

131073
38995 41333
1909 124877
55060 95205
111777 69638
23636 77833
108364 35517
34812 86530
129073 84116
32011 109978
70931 119941
96429 63461
105828 96506
23821 93936
3788 34098
13401 93541
35759 80702
112039 72227
58576 92708
114889 26077
31241 40357
22857 66250
90159 66313
117922 21417
120793 64...

output:

32786
66340 20631
121257 59221
66281 114836
113829 9466
19095 64642
126131 4676
47309 124914
86314 125332
62758 20578
83529 79671
85021 103438
76786 830
29253 102327
38984 11097
119260 87415
38150 78862
12544 2211
60174 119166
82642 120061
25846 22317
2285 119618
57485 59891
66231 116067
118721 4506...

result:

ok correct

Test #29:

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

input:

151072
38120 106465
145270 91533
136050 109345
37435 85056
95672 38258
112656 84177
95184 100650
135000 120991
102866 143368
42322 87672
632 65351
77995 21015
82153 22895
92187 132637
137180 44403
31087 88936
49219 115533
80316 112398
98297 12997
41130 69329
131872 110782
57642 40310
106642 102865
2...

output:

37770
72428 75191
27113 141213
52888 22114
9122 114930
66282 111450
33228 16169
143819 120165
93386 110866
30272 18974
48308 109235
140244 143745
134402 141772
82567 22571
108515 9445
132612 137180
55791 89521
97852 47569
17786 71231
132922 94950
7843 68061
46628 139935
147029 131896
15479 30654
375...

result:

ok correct

Test #30:

score: 0
Accepted
time: 123ms
memory: 14832kb

input:

200000
78629 17577
146127 152055
61995 176796
9928 86492
186178 55949
188222 114525
123342 98101
92739 167173
82668 69620
154786 129646
64367 34718
49457 149097
130074 100437
121553 90583
40486 43258
161584 128463
165466 20584
188763 35376
161247 117911
197066 155774
97482 50365
1187 150710
4199 895...

output:

49936
85066 160769
63704 144336
124359 40268
35538 154608
86722 150685
111582 54578
74574 108238
189124 90766
67822 198177
59783 71440
115087 94335
54959 46038
175690 137137
76755 133806
186682 159008
74922 172564
116594 90747
168591 7269
177732 123517
176070 171725
18655 98163
84010 135358
127789 1...

result:

ok correct

Test #31:

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

input:

20
17 13
12 13
13 9
20 13
13 2
13 8
11 13
18 13
13 19
3 13
13 5
6 13
13 10
13 16
7 13
13 1
15 13
4 13
13 14

output:

10
17 3
12 5
9 6
20 10
2 16
8 7
11 1
18 15
19 4
3 14

result:

ok correct

Test #32:

score: 0
Accepted
time: 46ms
memory: 11476kb

input:

131071
82174 48801
48801 43121
48801 65385
48801 32341
122662 48801
80753 48801
22046 48801
48801 99877
74771 48801
20974 48801
48801 79386
48801 80145
48801 82422
69881 48801
31180 48801
57196 48801
110976 48801
48801 86207
48801 58886
48801 128664
99175 48801
41444 48801
48801 33430
48801 14002
48...

output:

65535
82174 14502
43121 99427
65385 86537
32341 3877
122662 100223
80753 38049
22046 27478
99877 7639
74771 32181
20974 97477
79386 107118
80145 56228
82422 48216
69881 121150
31180 61733
57196 35917
110976 102876
86207 39934
58886 91101
128664 101349
99175 69588
41444 84918
33430 45223
14002 113342...

result:

ok correct

Test #33:

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

input:

131072
130960 116054
130960 124520
15089 130960
130960 115675
130960 15848
67363 130960
63640 130960
130960 43690
130960 26040
130960 130759
130960 31726
129480 130960
90972 130960
110972 130960
26377 130960
130960 116791
130960 55587
73650 130960
93277 130960
49058 130960
130960 90977
130960 76399
...

output:

65536
116054 2411
124520 38775
15089 105395
115675 106003
15848 76192
67363 18213
63640 126100
43690 17345
26040 95817
130759 87684
31726 100151
129480 82525
90972 75536
110972 110668
26377 59862
116791 121453
55587 7029
73650 20486
93277 95846
49058 31584
90977 105620
76399 45353
57842 105934
58064...

result:

ok correct

Test #34:

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

input:

131073
55605 21148
46809 21148
118327 21148
21148 95558
80287 21148
21148 86592
21148 45740
79067 21148
21148 37458
41683 21148
21148 17060
21148 124737
98377 21148
21148 34108
108577 21148
21148 60418
21148 33649
113555 21148
21148 69330
80455 21148
91568 21148
20022 21148
2010 21148
62085 21148
21...

output:

65536
55605 2035
46809 4606
118327 2884
95558 27142
80287 17418
86592 52819
45740 110065
79067 96732
37458 108254
41683 84462
17060 85314
124737 114447
98377 104741
34108 22316
108577 131055
60418 97123
33649 23676
113555 123926
69330 57325
80455 74602
91568 22203
20022 34493
2010 36158
62085 65425
...

result:

ok correct

Test #35:

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

input:

151072
138494 43881
10654 138494
138494 107420
36677 138494
138494 67255
88456 138494
14668 138494
138494 78327
39392 138494
111229 138494
138494 32447
138494 119975
138494 15833
86507 138494
72980 138494
138494 132546
105641 138494
53764 138494
138494 103182
25835 138494
69788 138494
138494 7400
13...

output:

75536
43881 107397
10654 26952
107420 33645
36677 132958
67255 77444
88456 38224
14668 110983
78327 4761
39392 91775
111229 134479
32447 109723
119975 10530
15833 74308
86507 124564
72980 97274
132546 60779
105641 126749
53764 90981
103182 94516
25835 69529
69788 62821
7400 92699
106087 11679
52452 ...

result:

ok correct

Test #36:

score: 0
Accepted
time: 78ms
memory: 16360kb

input:

200000
59515 114554
114554 195654
99535 114554
45165 114554
193806 114554
114554 127255
114554 128277
114554 11927
114554 90556
155550 114554
33321 114554
114554 126838
114554 110283
114554 185093
2399 114554
114554 139961
114554 58528
101397 114554
160141 114554
114554 129072
16944 114554
114554 35...

output:

100000
59515 175007
195654 150835
99535 108908
45165 154061
193806 82665
127255 11851
128277 54659
11927 99546
90556 35210
155550 122020
33321 70068
126838 43933
110283 55208
185093 12369
2399 144371
139961 76453
58528 12109
101397 105637
160141 35603
129072 84537
16944 86668
3574 98934
55888 145757...

result:

ok correct

Test #37:

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

input:

20
11 17
19 10
6 14
11 7
18 14
10 2
9 3
15 14
11 12
8 9
10 20
16 9
11 1
2 14
2 9
2 11
13 11
4 10
9 5

output:

8
19 8
20 16
4 5
6 17
18 7
15 12
3 1
8 13

result:

ok correct

Test #38:

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

input:

131071
100267 125287
73272 32361
118665 100267
103778 41386
73272 14940
119574 100267
65093 59159
73272 1374
100267 112142
60901 59159
103778 124094
125773 103778
100267 17498
73272 129757
15888 59159
129210 59159
59159 29228
59159 83829
103778 100482
73272 83035
100267 11155
100267 14160
116025 100...

output:

65533
41386 6392
124094 7484
125773 111044
100482 84332
74968 87112
114008 16761
86133 105853
81085 88106
12998 17139
105328 82195
48675 40302
4411 99377
44507 71177
48835 2474
99555 23111
71550 125603
67659 12417
593 25018
89504 90569
129354 21160
16334 70824
129001 62282
95907 24465
60282 121033
1...

result:

ok correct

Test #39:

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

input:

131072
59956 99133
57372 28739
99133 117377
57372 109331
17470 49644
59519 57372
70423 49644
57372 19842
22793 126346
3820 49644
126346 63182
57372 23212
49644 111868
49644 113089
97071 99133
87056 49644
126346 76011
57372 28438
122650 57372
49644 27289
25103 57372
99133 64204
67579 49644
64635 5737...

output:

65534
28739 72614
109331 105087
59519 100142
19842 106894
23212 96294
28438 95111
122650 68014
25103 41726
64635 66795
108227 66782
50750 119920
33206 68415
25578 127452
118189 10176
40180 17545
50285 123550
50335 74821
8095 112131
1502 125311
60981 45856
6453 71246
108969 68524
81603 48659
77606 10...

result:

ok correct

Test #40:

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

input:

131073
98074 130543
4604 66206
115105 66206
74626 114720
123968 74626
110493 74626
130543 97154
74626 91594
130543 105132
130543 85811
40176 66206
126853 130543
66206 42150
8358 66206
74626 110142
104548 66206
112756 117835
129587 74626
46120 66206
17089 117835
66206 78314
110662 66206
117835 13659
...

output:

65534
98074 125566
97154 102001
105132 88245
85811 4591
126853 118880
91885 25746
77847 78878
115768 10020
108652 15424
28914 46964
41017 124913
26304 23488
94289 84022
32594 26043
80068 587
32376 52764
8674 52695
61460 66137
56138 105020
89229 104973
67866 26118
77602 112756
82690 17089
31551 13659...

result:

ok correct

Test #41:

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

input:

151072
136788 29891
48461 104590
48461 29219
73252 40682
42206 48461
922 354
29891 147942
29891 43534
922 91441
922 84953
113991 922
29891 143418
56518 29891
111406 48461
79621 48461
29891 25567
144288 922
11665 48461
922 61092
48461 64574
48461 105730
87041 48461
922 147437
48461 77199
133952 73252...

output:

75534
136788 51597
147942 19861
43534 60836
143418 17727
56518 131576
25567 29047
121851 19548
104309 16261
6102 20010
16469 16510
136559 74124
53007 99591
70901 20094
85509 121619
44215 62670
87849 91191
95705 51470
93605 135568
22985 130105
10233 92274
120583 59630
59640 85419
89275 128282
132394 ...

result:

ok correct

Test #42:

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

input:

200000
118 26714
118 159319
158195 118
68354 55603
176490 2655
59335 68354
33488 173919
176490 124004
33488 39040
186195 176490
118 110199
176490 85826
67428 176490
118 194305
33488 141234
118 81806
8558 118
33488 167345
118 196451
158689 68354
118 52232
68633 118
68354 118869
85326 118
58751 68354
...

output:

99998
26714 173088
159319 82882
158195 31761
110199 16403
194305 35055
81806 68182
8558 149372
196451 82063
52232 103139
68633 30710
85326 129664
67587 183252
23412 60454
126697 102406
46422 74597
56812 52774
135776 152716
74713 138808
77342 21372
52534 44254
36208 94464
34020 80375
167282 8024
1890...

result:

ok correct

Test #43:

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

input:

20
17 9
12 15
11 9
20 13
4 2
15 8
11 20
18 3
18 19
3 1
9 5
6 4
11 10
10 16
7 18
20 1
15 1
4 3
10 14

output:

6
19 17
7 5
2 16
6 14
13 12
17 8

result:

ok correct

Test #44:

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

input:

131071
82174 108078
99223 43121
74172 65385
23758 32341
122662 71458
80753 76020
22046 56159
77913 99877
74771 47481
20974 56644
98421 79386
27052 80145
99092 82422
69881 50453
31180 60020
57196 112183
110976 94346
49023 86207
111330 58886
31056 128664
99175 39208
41444 13609
36757 33430
82888 14002...

output:

32768
48801 99002
95752 44270
28881 52505
109231 130814
41781 129132
57689 110498
67588 106377
70083 22945
76742 91276
44189 39853
20928 83813
21823 113528
109408 6108
36098 62812
8980 45680
11037 46050
46593 79323
11852 127326
101548 78852
117312 9846
46682 90702
78837 60234
69030 94820
62939 77144...

result:

ok correct

Test #45:

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

input:

131072
16714 116054
57120 124520
15089 127014
8106 115675
112983 15848
67363 92780
63640 30583
129047 43690
21435 26040
113980 130759
52555 31726
129480 46788
90972 107141
110972 39630
26377 110366
116620 116791
78101 55587
73650 17048
93277 39837
49058 105231
47573 90977
45891 76399
44105 57842
580...

output:

32769
130960 61698
106963 88033
116173 73188
17723 43831
74542 21264
52830 129119
49046 80968
47515 70534
111960 78428
40166 118466
121618 61317
83859 28999
84766 59094
86990 127529
13267 101316
81051 109597
107152 71208
48279 95367
74222 59573
63219 70524
126015 10735
88402 30987
106234 103442
1019...

result:

ok correct

Test #46:

score: 0
Accepted
time: 78ms
memory: 10764kb

input:

131073
55605 18874
46809 63228
118327 106176
124604 95558
80287 129602
58938 86592
54273 45740
79067 117723
62178 37458
41683 121135
7773 17060
20683 124737
98377 117158
93087 34108
108577 85993
130162 60418
95024 33649
113555 130567
79016 69330
80455 80984
91568 6473
20022 8538
2010 99170
62085 535...

output:

32769
97164 21148
49330 24634
128208 88950
13406 57642
64861 69134
39108 15170
40925 130244
94630 93272
123089 67219
9632 40373
124199 35882
124657 121439
28931 349
113153 77651
60446 110502
56196 33982
38765 75401
122854 59203
76231 53335
52832 67225
68947 43912
65 51051
125210 130118
76219 25761
3...

result:

ok correct

Test #47:

score: 0
Accepted
time: 65ms
memory: 11940kb

input:

151072
43038 43881
10654 149528
75336 107420
36677 78984
43933 67255
88456 87853
14668 96283
58015 78327
39392 38031
111229 40890
32963 32447
82543 119975
46075 15833
86507 131779
72980 4529
83836 132546
105641 6133
53764 5113
128667 103182
25835 73629
69788 300
98700 7400
121824 106087
52452 86128
...

output:

37769
65290 12738
101260 23342
90299 95488
89124 147021
17446 39734
45156 4370
103178 145467
92729 61762
48712 73174
19090 93335
58106 6146
68751 21695
58183 27633
51073 134089
69635 110209
94445 115335
88348 49830
55318 130892
118723 63331
11009 126812
128489 64272
138489 127382
121394 121250
9138 ...

result:

ok correct

Test #48:

score: 0
Accepted
time: 105ms
memory: 14528kb

input:

200000
59515 184601
171003 195654
99535 74432
45165 101066
193806 156066
53983 127255
97967 128277
194925 11927
74007 90556
155550 150173
33321 188061
70663 126838
103917 110283
89592 185093
2399 28090
129171 139961
26518 58528
101397 190014
160141 53116
82848 129072
16944 151679
39211 3574
55888 16...

output:

50001
185023 175760
109895 22098
165223 89560
76199 67289
161995 84975
77648 146468
100656 165913
192342 168576
110889 142143
688 181990
177467 32239
72405 79544
146868 25121
21858 140247
149344 19809
169860 54308
83575 66901
108084 177166
149076 39243
19360 88430
125480 86029
74833 45636
55421 7137...

result:

ok correct

Test #49:

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

input:

20
3 7
10 2
9 3
12 10
8 3
18 1
14 13
15 17
1 19
12 6
5 18
14 6
9 20
17 16
11 13
5 8
17 13
4 9
2 19

output:

3
7 11
20 15
4 16

result:

ok correct

Test #50:

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

input:

131071
51488 107750
96014 4426
63651 78397
72869 88915
46584 21799
40457 109124
87591 83035
38081 50307
103081 65527
83571 111835
4433 36639
98033 127018
35867 55636
121984 65641
122152 116810
92427 74343
29978 68173
26154 120796
69255 110923
27995 64917
77498 58986
25363 90103
95820 28503
73588 380...

output:

16384
31789 29839
113638 93170
1411 109751
65775 119511
31981 80830
91995 104116
33643 72518
60659 83484
92298 55195
43342 122656
38138 13503
106574 12039
32289 74083
100531 8280
118068 26769
63870 26038
10966 102043
75462 10559
86651 56700
18278 24481
107268 90109
58237 57872
83447 15625
23693 1058...

result:

ok correct

Test #51:

score: 0
Accepted
time: 82ms
memory: 13248kb

input:

131072
119842 52966
6994 98895
128573 125248
116908 61045
4061 89973
86218 42857
27273 39606
122339 122542
128143 92902
102128 36971
34658 4064
74373 111851
104366 94615
16845 38381
96145 36273
95321 101328
106312 124199
81463 16645
86980 46225
27793 96965
33330 5818
72083 22987
121429 101876
20184 ...

output:

16384
33788 110173
72057 36987
39109 66085
83509 86721
31746 30601
30523 128558
45265 128551
73614 39421
106755 59828
6781 87751
114540 116598
122207 108916
104620 83992
2529 118353
5444 81170
112715 119672
116113 29397
69510 60538
52296 48140
130450 33786
23934 93652
68240 66091
42144 71028
54081 3...

result:

ok correct

Test #52:

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

input:

131073
130058 35194
28432 41277
126872 88256
33183 15462
114816 3493
109065 120274
9822 127572
116153 81621
91618 75013
100774 15749
25652 41210
101040 1055
111861 127755
126128 57263
30996 69919
52757 81040
44161 97651
18550 59254
46036 113118
36218 82115
107429 120941
26895 96826
31447 69150
10593...

output:

16385
34606 1778
19271 97558
64900 119352
42286 124457
8398 89115
12888 128900
78426 84491
107028 9957
101937 97591
20159 14180
38535 40454
38763 84549
44373 515
31895 16305
48415 42571
103317 100504
42088 73157
110250 65345
85706 81038
22140 128962
80359 58492
3881 53737
130530 9748
126371 11338
26...

result:

ok correct

Test #53:

score: 0
Accepted
time: 82ms
memory: 14760kb

input:

151072
99370 116423
11779 53959
38167 97436
56355 48542
99475 147637
149720 143279
28212 47770
73040 145740
51854 76827
70398 94985
129790 116769
61458 68029
65395 78976
82832 71941
135730 28351
147273 138554
116163 114403
136096 64878
46749 59070
32529 142135
60668 15200
35130 134123
4716 100466
17...

output:

18884
62533 128451
112877 59436
117879 74545
16321 139403
128144 89479
55091 5510
8780 111293
132563 107527
26804 34319
145703 45733
149825 27771
50559 100111
65555 90273
102858 66006
40914 103026
66143 78852
36170 73203
121926 124858
32981 108686
93522 1110
138384 23641
10472 32975
96377 2355
32471...

result:

ok correct

Test #54:

score: 0
Accepted
time: 130ms
memory: 18336kb

input:

200000
73259 70772
140028 88512
23169 94269
194938 127812
175557 160330
70597 163528
108800 177389
42500 42465
94296 98123
35425 118226
52948 30977
92669 160132
95591 67658
21155 65372
194985 28464
161918 9334
117818 166233
75584 142109
82756 45982
195161 79612
77909 114851
44655 43542
176897 4529
6...

output:

25000
121604 124141
127810 181089
66885 184943
35539 176609
25427 84023
132668 80332
84140 47515
130053 197970
156654 84565
48663 61158
148588 188260
24837 134964
128580 48841
193137 78614
148424 52237
137755 43877
143253 184674
24164 35228
122610 180401
171499 162579
41535 90661
145339 91322
10821 ...

result:

ok correct

Test #55:

score: 0
Accepted
time: 155ms
memory: 21988kb

input:

200000
137434 6394
56716 4377
82618 103233
53888 117323
82038 190684
186285 91082
127534 44315
153039 27806
181799 196433
42851 15188
159730 123242
151915 170747
102631 149661
89952 178578
13934 86842
162352 171756
152063 69522
47990 98374
56473 50742
135867 23393
71158 114603
147338 114419
13932 15...

output:

2
26216 165389
22915 21934

result:

ok correct

Test #56:

score: 0
Accepted
time: 164ms
memory: 21892kb

input:

200000
138794 104602
87197 175242
86352 86095
167646 42556
17916 186987
140558 63750
126963 160203
191730 102864
178250 173024
126831 139942
9765 177779
20614 39174
130261 98158
138470 71648
190950 46552
15692 7050
21100 121878
121537 84704
20692 177337
64195 48609
144569 7444
97861 136074
114738 13...

output:

2
106082 17410
56131 4622

result:

ok correct

Test #57:

score: 0
Accepted
time: 153ms
memory: 21952kb

input:

200000
30732 80909
126594 68785
157801 2791
61690 123184
60982 152568
132168 30294
199577 146380
109608 137298
117352 75620
68527 138687
10610 130958
59369 62605
129171 198623
37409 175549
128990 92467
165912 70913
7979 122464
195600 80789
172479 172664
102638 68721
184123 185021
67779 145213
46918 ...

output:

2
90292 28783
58481 20789

result:

ok correct

Test #58:

score: 0
Accepted
time: 145ms
memory: 22300kb

input:

200000
48187 185809
23493 71342
18957 90131
174587 127780
105927 39587
189804 187222
109765 104224
6982 66953
161918 43542
27723 52137
129016 42044
71396 145440
8787 131393
146394 137994
124250 89231
13552 11696
12609 125330
25947 199840
42337 107653
115737 138812
139766 18929
69643 61086
74777 8978...

output:

2
13153 88185
40987 6081

result:

ok correct

Test #59:

score: 0
Accepted
time: 165ms
memory: 21960kb

input:

200000
18703 128374
106450 176118
32350 149679
184757 29623
79879 118442
19563 62412
150477 79491
87602 26871
70519 108006
121833 35926
29376 61688
168014 114209
167700 91645
118173 23595
103708 30804
50096 5923
119889 386
141207 78116
41031 193129
35084 44460
125138 142940
141755 120787
88434 13011...

output:

2
164002 183427
75575 190427

result:

ok correct

Test #60:

score: 0
Accepted
time: 160ms
memory: 21992kb

input:

200000
187697 123900
66170 173989
145622 31673
659 115656
132017 150362
143245 124017
155731 66336
180510 79485
85315 11190
69945 66445
186246 191399
192040 120316
70392 15105
19680 86808
89746 148016
27481 85557
57952 141863
147545 80359
111412 84656
169090 175240
172595 125676
32102 59308
169514 6...

output:

2
6139 47666
91996 64443

result:

ok correct

Test #61:

score: 0
Accepted
time: 150ms
memory: 21896kb

input:

200000
14752 121212
131266 159242
131554 27452
102544 118689
96135 171051
100947 72497
134529 104828
65879 192024
96225 14021
13592 199923
19840 187963
121187 120204
64555 181046
41642 143753
31412 16873
144677 92063
147236 108900
96315 72000
81919 174445
197858 85131
121018 126818
140927 115609
193...

output:

2
142418 40266
108014 104410

result:

ok correct

Test #62:

score: 0
Accepted
time: 164ms
memory: 21984kb

input:

200000
49995 8607
19272 138999
180377 28394
168525 103013
35719 176197
54417 165230
140428 172161
43186 111019
156417 80860
97877 176107
188741 86363
155168 133132
47171 155863
40710 66585
84463 2578
106992 192415
165985 61219
26275 44229
164306 168404
190034 115370
49990 135416
192760 85066
70032 1...

output:

2
106676 177788
62577 114649

result:

ok correct

Test #63:

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

input:

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

output:

2
2 7
5 4

result:

ok correct

Test #64:

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

input:

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

output:

2
7 4
3 1

result:

ok correct

Test #65:

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

input:

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

output:

2
4 1
2 7

result:

ok correct

Test #66:

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

input:

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

output:

2
4 3
5 1

result:

ok correct

Test #67:

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

input:

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

output:

2
3 4
6 5

result:

ok correct

Test #68:

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

input:

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

output:

2
3 6
7 4

result:

ok correct

Test #69:

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

input:

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

output:

2
7 2
4 6

result:

ok correct

Test #70:

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

input:

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

output:

2
7 2
4 1

result:

ok correct

Test #71:

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

input:

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

output:

2
2 3
7 4

result:

ok correct

Test #72:

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

input:

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

output:

2
2 7
5 4

result:

ok correct

Test #73:

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

input:

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

output:

2
5 4
3 6

result:

ok correct

Test #74:

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

input:

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

output:

2
6 4
2 1

result:

ok correct

Test #75:

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

input:

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

output:

2
4 7
6 3

result:

ok correct

Test #76:

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

input:

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

output:

2
1 7
4 2

result:

ok correct

Test #77:

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

input:

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

output:

2
7 1
6 2

result:

ok correct

Test #78:

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

input:

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

output:

2
7 5
6 4

result:

ok correct

Test #79:

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

input:

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

output:

2
2 7
6 4

result:

ok correct

Test #80:

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

input:

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

output:

2
5 1
4 3

result:

ok correct

Test #81:

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

input:

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

output:

2
4 1
7 3

result:

ok correct

Test #82:

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

input:

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

output:

2
5 2
4 3

result:

ok correct

Test #83:

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

input:

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

output:

2
7 6
2 5

result:

ok correct

Test #84:

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

input:

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

output:

2
6 2
1 5

result:

ok correct

Test #85:

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

input:

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

output:

2
7 4
2 5

result:

ok correct

Test #86:

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

input:

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

output:

2
5 6
1 7

result:

ok correct

Test #87:

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

input:

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

output:

2
7 4
2 6

result:

ok correct

Test #88:

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

input:

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

output:

2
2 4
1 3

result:

ok correct

Test #89:

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

input:

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

output:

2
5 1
2 7

result:

ok correct

Test #90:

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

input:

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

output:

2
6 3
5 2

result:

ok correct

Test #91:

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

input:

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

output:

2
3 1
7 2

result:

ok correct

Test #92:

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

input:

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

output:

2
7 6
4 3

result:

ok correct