QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#123183#6413. Classical Graph Theory ProblemZhangYiDeAC ✓730ms56548kbC++141.0kb2023-07-11 20:39:172023-07-11 20:39:19

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

2 4 6 
2 

result:

ok ok (2 test cases)

Test #2:

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

input:

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

output:

2 
5 27 22 8 9 17 25 16 18 11 15 3 2 21 
7 4 9 8 3 12 
2 4 9 3 10 1 
2 22 6 8 10 31 14 16 1 20 34 7 26 28 27 32 25 
2 16 11 17 1 12 6 15 18 
2 
2 4 
2 4 11 8 25 36 14 16 43 20 18 24 21 28 46 32 1 47 38 22 30 29 45 48 9 
5 4 7 24 10 3 14 22 9 20 25 16 26 28 11 32 34 36 
3 14 10 4 13 1 5 
17 15 19 3 1...

result:

ok ok (10000 test cases)

Test #3:

score: 0
Accepted
time: 148ms
memory: 34656kb

input:

1000
337 338
164 11
138 75
114 262
170 298
166 241
269 24
9 134
233 60
50 222
231 253
296 242
173 18
93 223
116 151
312 150
82 236
180 20
297 184
268 70
334 162
217 135
258 321
80 209
212 208
18 163
227 104
334 135
77 118
17 230
307 105
307 335
29 24
111 177
324 24
85 3
214 191
310 182
22 171
202 21...

output:

139 1 147 8 10 286 325 16 18 124 22 43 289 175 123 133 250 256 38 3 42 177 186 30 233 266 45 57 58 221 116 61 132 128 230 324 168 95 244 79 47 291 310 247 59 214 300 96 98 263 115 87 149 253 309 112 264 252 36 282 193 166 102 117 64 234 210 136 203 37 70 78 329 269 163 213 314 23 129 120 336 164 275...

result:

ok ok (1000 test cases)

Test #4:

score: 0
Accepted
time: 227ms
memory: 36120kb

input:

100
1038 1044
206 546
372 853
526 57
777 72
645 866
15 716
254 707
366 753
635 809
850 407
616 149
839 175
320 770
649 686
857 798
1027 40
988 566
315 500
187 615
100 523
867 708
51 381
858 9
177 55
310 54
355 215
78 26
740 570
523 797
828 693
930 981
208 185
663 957
298 523
235 496
622 174
285 247
...

output:

488 4 711 8 88 12 14 396 18 20 1003 309 189 28 696 32 34 188 390 575 42 903 109 411 637 211 529 979 547 60 933 629 720 992 70 910 205 421 925 80 1007 407 897 671 790 761 863 96 191 100 376 104 106 827 110 619 114 594 645 277 122 429 631 343 259 709 630 357 785 140 38 760 313 148 987 908 84 156 158 5...

result:

ok ok (100 test cases)

Test #5:

score: 0
Accepted
time: 517ms
memory: 43108kb

input:

10
1380 1393
960 647
1319 708
57 1128
751 148
1291 602
835 921
942 406
622 616
967 91
555 545
871 10
447 471
1140 306
149 121
587 165
1179 936
256 787
332 374
729 129
631 481
976 86
1128 1300
477 776
460 313
538 632
1210 275
355 470
1324 885
870 1325
389 979
468 532
41 416
1026 243
1153 152
948 323
...

output:

61 4 6 365 1013 958 1344 339 935 20 17 24 177 73 30 215 34 487 705 91 222 1306 1267 189 50 823 54 475 58 14 115 64 66 630 249 72 74 76 976 80 851 84 89 1251 455 291 94 1206 1037 100 703 1089 107 829 110 273 356 1091 116 636 122 1223 126 1039 364 717 656 172 544 140 833 1122 1279 148 150 447 154 700 ...

result:

ok ok (10 test cases)

Test #6:

score: 0
Accepted
time: 730ms
memory: 50972kb

input:

1
200000 201978
69113 28513
94227 164392
56849 195513
22579 149089
195084 193248
121765 162768
135432 101508
107443 89723
12337 87598
173450 107835
13160 161882
18965 179808
53739 23609
114567 23456
195251 178048
61586 87664
179364 25594
90158 169714
30104 161354
143346 4279
177208 87389
122480 1269...

output:

76838 40448 6 8 71907 12 31225 16 102611 161701 22 138507 105213 187100 41848 79078 159278 50293 38 40 107261 44 46 190801 106279 131055 54 120567 58 163030 2524 154995 66 168060 142080 146200 74 44989 39609 80 35030 128463 86 24901 33326 73407 74265 96 83721 100 46459 8235 93827 134929 14104 140277...

result:

ok ok (1 test case)

Test #7:

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

input:

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

output:

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

result:

ok ok (10000 test cases)

Test #8:

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

input:

10000
11 13
6 3
9 4
10 4
9 6
10 7
1 5
2 11
2 8
10 6
2 9
6 7
2 5
5 11
3 2
2 1
2 3
2 1
2 1
12 14
12 11
10 7
5 6
2 5
5 8
8 3
8 1
3 12
12 7
2 10
10 11
6 4
11 2
9 3
4 4
1 2
1 3
4 3
2 3
11 13
3 7
1 5
1 6
8 5
9 7
1 2
1 11
2 4
10 9
10 1
7 2
8 3
8 6
2 1
1 2
15 18
3 11
2 10
7 14
14 4
7 3
6 11
15 12
5 11
2 7
7...

output:

5 4 6 8 10 
2 
2 
2 4 7 8 10 9 
2 4 
2 7 6 5 1 
2 
1 4 10 8 12 7 11 
18 59 61 27 23 10 49 57 37 20 22 19 25 5 11 40 14 36 38 58 50 44 46 48 41 17 15 56 51 9 62 21 16 
13 2 12 8 5 9 
5 1 6 4 
37 4 21 8 6 16 14 3 18 33 11 19 26 28 30 15 34 36 23 
51 47 55 8 60 75 17 70 81 57 22 29 38 53 4 32 34 36 72 ...

result:

ok ok (10000 test cases)

Test #9:

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

input:

10000
10 14
4 9
5 10
1 10
7 6
8 6
9 6
8 3
8 7
4 6
5 3
10 4
10 2
4 8
1 9
6 8
1 2
5 2
5 1
3 4
5 3
6 5
2 3
3 1
3 3
2 1
3 2
3 1
18 26
18 3
10 11
2 4
17 4
8 12
14 15
1 12
13 12
15 7
13 15
14 2
17 5
1 13
11 16
9 3
13 9
6 12
11 14
3 4
3 11
7 11
8 2
8 4
15 6
12 10
12 18
24 35
18 4
22 10
1 21
22 6
23 7
6 14
...

output:

1 4 3 8 10 
2 4 6 
2 
15 5 2 1 10 3 7 16 18 
2 4 21 8 10 12 14 23 18 20 13 24 
2 59 61 63 23 10 44 57 18 21 3 5 26 55 30 32 34 51 16 13 42 11 6 43 4 47 54 56 36 60 62 64 66 
9 4 6 8 7 10 
2 4 20 8 13 19 14 29 18 1 22 24 26 33 30 32 
2 3 6 4 
2 4 6 8 10 12 
1 35 6 15 27 68 14 71 48 50 22 24 26 55 10 ...

result:

ok ok (10000 test cases)

Test #10:

score: 0
Accepted
time: 49ms
memory: 35120kb

input:

10000
4 6
1 3
2 3
4 2
4 1
1 2
4 3
25 51
19 15
19 10
12 3
9 7
5 4
7 21
25 12
20 16
1 13
20 14
15 12
20 13
8 5
16 9
17 13
3 25
25 20
16 22
4 8
5 7
9 10
5 11
4 24
13 21
9 4
15 24
16 11
13 4
22 21
4 14
20 10
12 6
1 4
3 18
9 6
5 2
24 3
16 4
6 16
25 16
21 16
22 25
3 21
10 15
25 23
1 19
7 15
15 20
19 14
17...

output:

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

result:

ok ok (10000 test cases)

Test #11:

score: 0
Accepted
time: 51ms
memory: 33672kb

input:

10000
24 60
13 22
6 12
21 17
24 8
15 11
18 19
17 7
24 1
18 16
21 2
17 12
21 11
10 7
9 18
6 21
17 10
3 24
16 12
7 23
11 8
22 24
3 17
23 3
1 12
8 5
4 24
15 13
8 22
2 8
13 17
10 2
2 7
7 18
18 14
22 20
13 6
5 16
22 23
21 22
5 24
21 14
1 7
12 20
24 20
8 14
17 11
1 19
17 8
9 10
1 11
14 13
10 15
19 11
14 2...

output:

2 17 6 8 10 12 23 16 18 20 22 24 
2 4 
2 4 6 11 10 12 17 16 13 15 22 24 26 28 30 
2 4 6 8 10 12 14 16 18 20 22 
2 11 6 8 10 12 15 21 18 20 22 1 26 28 30 32 34 36 38 40 42 44 
2 4 6 8 10 12 14 16 18 20 22 24 
2 4 6 39 23 17 36 13 16 19 1 24 26 37 30 18 34 40 27 31 
2 4 6 11 10 12 14 13 17 20 22 7 26 ...

result:

ok ok (10000 test cases)

Test #12:

score: 0
Accepted
time: 108ms
memory: 34540kb

input:

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

output:

2 41 19 16 17 43 33 40 8 32 42 7 14 28 20 53 34 36 15 39 52 48 46 38 50 6 
2 4 6 8 10 12 14 13 19 57 22 24 26 59 30 32 34 54 33 40 42 44 46 31 50 29 41 9 58 
2 41 6 242 264 49 14 178 282 20 22 259 84 28 122 153 113 201 19 126 152 149 182 72 50 52 103 56 115 267 62 198 66 234 70 61 134 76 78 80 212 2...

result:

ok ok (1000 test cases)

Test #13:

score: 0
Accepted
time: 91ms
memory: 35116kb

input:

1000
137 178
124 131
53 109
99 21
107 122
79 28
80 88
126 9
16 1
29 55
126 54
13 39
135 16
63 56
123 121
27 74
81 95
34 38
49 85
127 135
87 106
91 68
57 124
122 113
87 1
52 104
135 93
132 12
98 83
85 26
66 76
41 82
108 90
88 59
29 15
75 58
36 14
116 65
83 64
21 105
132 13
7 70
97 127
92 112
126 55
1...

output:

110 4 135 23 10 12 14 16 24 71 30 61 28 17 98 51 3 109 38 40 42 57 136 48 50 52 54 56 55 75 62 103 93 68 18 72 74 76 78 121 82 84 86 115 90 92 94 13 70 20 102 25 106 99 43 69 67 95 111 120 122 124 126 85 130 112 80 39 
2 27 29 16 44 39 11 37 8 20 22 24 45 28 30 17 33 34 38 49 47 18 12 48 1 
19 4 11 ...

result:

ok ok (1000 test cases)

Test #14:

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

input:

1000
148 221
51 9
45 80
86 44
133 98
100 25
130 4
99 17
28 44
131 87
103 87
102 53
115 49
9 5
105 130
11 69
56 23
148 106
106 85
57 102
15 147
100 52
22 10
138 60
38 12
126 119
12 125
86 62
108 123
15 63
90 93
35 116
1 75
63 126
23 127
143 127
114 24
12 133
144 82
12 29
6 51
67 26
129 79
115 16
53 6...

output:

3 99 38 27 114 60 145 41 117 36 91 5 26 64 139 32 65 95 11 124 21 44 57 147 49 52 22 42 58 71 39 89 56 25 70 9 98 76 78 33 123 85 137 46 4 92 140 96 119 111 79 19 132 86 110 68 35 116 121 146 122 109 6 82 45 16 134 136 138 61 131 90 113 40 
23 11 6 8 25 12 14 36 34 4 22 5 26 28 3 32 51 35 43 40 42 2...

result:

ok ok (1000 test cases)

Test #15:

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

input:

1000
527 1061
464 254
106 364
251 82
282 81
152 454
399 114
527 289
430 519
202 320
177 302
398 55
358 181
495 240
86 426
113 171
201 262
82 336
403 77
266 21
176 132
14 97
139 137
479 397
153 403
156 308
105 28
109 272
294 170
336 508
439 105
259 101
429 441
118 200
189 56
297 184
457 385
248 334
4...

output:

2 33 31 48 357 504 174 397 209 344 245 415 520 302 465 396 34 36 240 414 42 509 46 247 482 373 295 331 299 350 448 9 353 510 440 124 15 370 306 126 398 402 512 519 428 90 17 384 469 337 449 81 429 108 435 112 257 272 249 208 387 328 53 416 363 132 167 380 365 140 142 176 319 73 390 152 154 94 144 16...

result:

ok ok (1000 test cases)

Test #16:

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

input:

1000
24 59
14 16
17 22
19 4
3 21
15 11
4 15
24 6
12 18
15 19
6 17
6 3
19 6
17 18
24 12
3 8
13 8
3 19
22 19
20 18
2 14
16 9
22 15
19 8
22 4
10 7
11 3
22 3
8 12
11 17
24 13
8 21
22 9
13 18
9 12
19 5
10 22
23 3
21 20
4 24
1 15
21 23
18 7
5 22
1 11
22 16
16 24
1 20
20 4
5 23
10 3
7 8
20 9
9 6
23 24
14 9...

output:

1 3 6 8 10 12 14 16 18 20 22 24 
2 4 107 67 73 12 14 16 19 97 127 24 45 51 79 32 34 118 63 40 69 44 46 106 50 52 54 56 1 7 62 120 85 68 70 72 74 76 78 80 82 75 21 88 90 92 94 103 98 38 15 104 77 108 61 112 114 116 117 5 122 124 59 
2 4 209 242 10 12 14 16 18 20 141 9 279 118 30 391 34 323 38 61 159 ...

result:

ok ok (1000 test cases)

Test #17:

score: 0
Accepted
time: 168ms
memory: 35992kb

input:

100
1400 1550
949 973
216 1089
101 284
568 543
878 648
1125 1117
1052 486
1260 1161
1397 54
1005 922
483 168
202 152
899 685
978 388
1223 1178
1109 239
932 415
105 28
596 251
357 865
842 224
887 1053
304 484
697 780
1164 193
411 798
1267 1395
40 166
21 1027
814 742
905 354
1332 1346
86 1274
726 73
4...

output:

19 1340 347 759 10 12 344 1087 981 1399 1253 172 1126 1284 30 1302 751 26 145 1241 1294 70 993 155 50 228 870 969 58 60 1056 64 66 611 867 72 488 1186 157 619 82 84 1210 1101 1255 1185 94 478 1088 1065 1183 15 136 108 110 297 114 116 1387 1231 554 161 9 128 1385 1 1216 411 430 140 668 1282 944 1205 ...

result:

ok ok (100 test cases)

Test #18:

score: 0
Accepted
time: 127ms
memory: 35224kb

input:

100
15151 19865
9599 11515
2453 4807
12417 12980
8787 12984
2666 3990
7030 3605
13780 1990
6564 14035
12745 5300
9179 9047
1105 8795
13193 2009
2347 3783
4282 2640
8744 2083
12968 1734
111 1688
14899 11212
11013 15151
4326 6532
9261 10694
8013 10608
8980 9408
379 3570
5827 13496
273 14106
1090 12649...

output:

11118 12115 1963 8 1804 3785 14265 1649 11604 1985 6642 24 399 5266 30 32 2623 5162 10658 9125 42 7878 319 1356 337 12690 2887 56 58 2876 5115 14769 7993 3583 3623 13109 13113 11403 5940 14997 458 11205 5209 12347 90 14943 7532 11236 13069 14672 14720 104 11269 4847 11211 1509 3356 7016 6473 9641 12...

result:

ok ok (100 test cases)

Test #19:

score: 0
Accepted
time: 113ms
memory: 34780kb

input:

100
1387 2091
632 868
379 1372
1247 788
72 562
1014 374
677 436
478 1033
997 896
1016 925
291 450
458 392
91 65
380 135
318 757
471 281
390 874
752 953
401 688
978 284
1276 639
565 1356
368 1259
673 639
283 551
647 94
125 1097
1055 672
538 1183
998 813
391 27
1066 766
782 1323
1220 164
427 819
274 5...

output:

1129 471 6 888 10 12 14 512 587 778 41 699 26 743 30 1208 851 164 786 40 42 44 46 68 50 52 54 56 1011 60 937 64 66 483 1043 72 1149 1281 779 485 1137 1191 931 427 1145 92 1121 96 422 100 1371 647 106 351 830 461 114 116 118 1264 1352 124 126 783 22 950 134 136 138 922 142 144 146 59 150 152 154 156 ...

result:

ok ok (100 test cases)

Test #20:

score: 0
Accepted
time: 88ms
memory: 34488kb

input:

100
515 1036
358 355
124 512
414 420
214 74
423 447
344 263
431 482
364 446
314 200
299 244
389 507
191 58
85 405
130 57
288 370
231 324
442 405
324 42
453 137
312 167
33 67
443 27
497 101
447 442
211 438
200 210
472 219
462 227
210 19
416 76
483 374
48 374
259 264
331 214
486 213
146 254
264 350
36...

output:

425 197 63 291 10 12 14 16 18 135 22 24 333 28 167 107 387 318 38 183 168 44 33 159 507 354 103 81 58 60 184 64 344 211 70 11 225 260 191 80 78 400 133 88 139 92 50 96 181 100 382 104 106 76 323 112 208 116 105 23 47 483 117 128 130 155 134 136 357 140 193 416 499 355 459 490 455 156 463 160 31 164 ...

result:

ok ok (100 test cases)

Test #21:

score: 0
Accepted
time: 97ms
memory: 35708kb

input:

100
985 2463
916 513
388 126
199 847
456 244
218 236
243 961
588 899
242 137
98 45
273 505
332 492
828 494
368 889
551 617
662 87
651 450
645 884
49 487
731 934
328 482
224 101
590 687
80 972
143 154
420 155
113 886
413 716
841 402
334 374
549 893
62 743
964 386
608 294
124 692
213 980
857 886
228 6...

output:

2 4 403 558 769 12 14 16 18 282 957 516 423 751 513 32 469 13 102 915 551 679 46 349 86 52 197 30 58 639 833 64 66 68 50 716 973 925 57 271 183 41 783 107 90 92 268 96 461 944 535 104 106 108 822 953 815 116 875 76 581 399 426 213 130 653 800 136 709 360 599 674 941 148 150 555 763 156 158 405 386 1...

result:

ok ok (100 test cases)

Test #22:

score: 0
Accepted
time: 360ms
memory: 38408kb

input:

10
6620 7333
1646 5207
3808 6296
3890 1170
841 4461
3269 5613
3427 743
4429 351
6077 6488
1639 2661
704 600
1959 6216
4631 689
62 659
1849 1253
2888 6071
823 3326
4491 1670
4620 1541
2403 1275
5905 998
6515 5675
5204 2518
2 6397
5388 5626
1712 3996
6069 3525
962 4452
5528 5749
5292 1334
4864 4469
21...

output:

857 3239 6 5281 1833 2691 14 407 3642 4839 6374 1151 716 6583 30 6399 34 36 4207 5823 1982 5239 46 1670 1813 5843 6181 56 2623 2472 3567 499 5731 68 70 72 1187 76 78 5573 82 84 86 6345 1014 92 3262 2611 5891 1238 5979 104 1017 1565 5474 5972 900 1975 118 120 1806 124 126 5207 130 5021 678 3839 6165 ...

result:

ok ok (10 test cases)

Test #23:

score: 0
Accepted
time: 246ms
memory: 42956kb

input:

10
31631 41405
12464 26816
7161 23441
26603 26999
3101 17725
19057 12144
25877 18100
27212 15122
23942 15607
10953 6392
8135 30928
10824 21016
16740 16082
31166 11527
30093 3178
18953 11904
16873 18594
31034 21707
18284 11028
10289 6972
4229 16452
6726 8826
15758 31430
30272 23869
31004 31424
15626 ...

output:

2 2929 26642 282 10 27476 15397 16 17215 8477 19371 24 31341 28786 30 318 18334 15640 12894 1900 14056 44 3313 11111 16253 27169 1831 24781 58 3084 31233 3305 25759 23017 8511 16391 9850 76 78 9648 23463 14119 13201 7855 26451 8606 94 17005 19737 22763 102 19902 6379 31180 19773 14336 6941 7644 118 ...

result:

ok ok (10 test cases)

Test #24:

score: 0
Accepted
time: 227ms
memory: 38792kb

input:

10
28538 43099
13200 13914
26716 18327
28186 28518
1215 11877
11167 9447
24145 13428
13894 1222
12303 4558
7451 3511
24131 6746
3501 5306
13827 16899
19501 15623
18276 4006
16371 3015
3638 27140
3419 28191
649 11619
7330 19380
3215 17183
13519 12575
3643 1100
23996 5666
7650 3931
11863 18905
11099 2...

output:

25314 27219 26442 10205 10 16355 3606 19481 1433 10799 22 26880 993 28 28146 32 2994 25920 13883 40 2116 16930 8300 10789 50 5084 20004 16843 24853 60 19291 21208 23513 68 1323 10676 3567 25517 8733 80 11271 24603 26427 1482 1970 7723 6812 96 19035 100 23685 5233 3550 108 5087 23984 6505 23575 7814 ...

result:

ok ok (10 test cases)

Test #25:

score: 0
Accepted
time: 191ms
memory: 46032kb

input:

10
87788 176493
85411 2449
75677 87148
41863 8856
26947 41851
69142 52475
19624 254
68187 45850
1914 1328
60252 34269
74977 29820
84340 25888
15811 3705
1188 51146
923 7500
4632 78262
79717 73522
51839 29805
50741 81652
34291 1102
47663 68963
8687 86118
17441 86354
11708 6564
87269 85939
81969 15769...

output:

2 4 41565 8 77342 9519 18113 41073 79479 55368 38964 2447 26 70205 789 13828 4435 40429 63091 12927 42 84645 84408 75879 86293 15200 1934 84376 58 57265 31636 67298 65448 68 36626 32559 6014 72518 81532 53059 24841 56745 68355 26983 73356 17732 75141 75783 15787 1042 70207 241 63908 108 30045 78701 ...

result:

ok ok (10 test cases)

Test #26:

score: 0
Accepted
time: 176ms
memory: 39388kb

input:

10
8816 22043
7419 5025
5365 4666
3322 7417
5863 5973
2641 1448
6401 2157
1667 7379
6833 7402
5527 5022
2651 4669
4676 5212
3876 2581
5037 6774
2606 6661
5930 519
3836 8394
1159 3510
2789 2327
5496 4249
5240 4702
4006 7011
5102 1260
2708 1364
8618 888
3465 3208
5175 3282
5081 6716
5593 1814
2896 663...

output:

8461 3259 6 8329 10 5167 4543 7784 2703 20 7410 6653 26 3001 1833 275 34 6329 5261 40 7682 82 2171 48 2239 8334 5093 6893 58 60 4464 348 5735 4692 70 8083 4334 3347 5290 7865 1487 2679 7613 63 5789 6657 6500 6310 3188 2850 739 8260 2867 108 6649 3240 114 5202 181 120 2130 124 4618 128 2695 5749 134 ...

result:

ok ok (10 test cases)

Test #27:

score: 0
Accepted
time: 546ms
memory: 47408kb

input:

1
200000 222059
53595 110970
173632 131224
18782 129709
79934 195396
42423 87939
191850 58500
75657 76504
130760 155268
40793 74463
110561 181427
166061 166730
169476 19173
54038 80930
98140 20017
131017 7357
135665 51329
20673 95904
15527 156410
147735 107963
185611 9516
181066 181938
6507 122388
3...

output:

134142 73007 6 146099 24203 163967 31315 79779 53378 165200 22 3827 5212 152060 80502 32 153451 11817 165502 199323 156155 146038 46 40991 88778 118097 48917 139616 21556 70581 87339 23327 158333 40281 179093 70665 74 162196 119342 80 74138 84 34983 70218 90 125441 125095 96 98 83899 26687 111504 10...

result:

ok ok (1 test case)

Test #28:

score: 0
Accepted
time: 408ms
memory: 52600kb

input:

1
200000 262063
72841 66604
94581 51837
191542 123743
149876 10516
128822 123410
139111 103089
158541 56483
183570 157423
128256 118508
92821 129228
163748 28520
2448 160970
37107 90515
139799 163596
184374 16626
78012 98010
144666 155211
146459 60321
62391 172660
124463 39432
99102 80299
22916 1273...

output:

2 70803 6 56725 117157 35023 14 16 18 136148 22 156569 26 155782 45497 74013 57833 187420 38 167415 158389 44 124131 110364 116758 141512 96538 104783 58 3620 62 50554 91307 113615 87335 72 144774 62211 78 13452 194221 176575 167331 105051 90 9449 145227 92381 187752 35553 102 1154 100397 82537 7440...

result:

ok ok (1 test case)

Test #29:

score: 0
Accepted
time: 338ms
memory: 51800kb

input:

1
200000 301952
21951 38377
145264 141899
20286 189141
49248 10797
131312 186634
193391 7330
90758 178447
133654 28458
197098 132935
142271 123768
182413 51079
106749 37339
80111 160519
130329 80747
134297 17746
89135 104031
76611 66916
13891 148818
166668 148476
177606 78551
133202 121415
17109 114...

output:

65740 183099 130416 80530 155763 12 14 16 110778 153431 195510 92997 134411 17257 68001 196768 29463 23932 188255 22287 42 39356 36330 48 50 52 146117 199431 148391 60 103935 96941 173528 41159 35504 171145 184160 76 12135 6908 155193 84 167331 139831 17580 92 187676 63955 23247 93047 87867 153509 4...

result:

ok ok (1 test case)

Test #30:

score: 0
Accepted
time: 267ms
memory: 56192kb

input:

1
200000 402105
169412 28307
39235 94949
120109 190352
59500 104359
75817 175560
50253 41771
83195 186648
20091 175725
106263 65825
156850 28786
72265 77440
104707 152961
108429 140785
176083 164531
173958 160585
89283 97448
72968 178690
182706 163213
64471 47768
59578 23108
25972 130392
101827 1729...

output:

129593 191281 114391 47753 172449 138991 150593 168667 192065 64380 149463 154318 141714 28 4095 32 84227 36 962 39065 31789 45610 145873 31386 124383 129540 163393 58697 57625 179767 136749 116219 17532 76437 23657 44252 68138 19766 11395 103703 91961 84 175223 16817 114247 88871 50110 93465 31591 ...

result:

ok ok (1 test case)

Test #31:

score: 0
Accepted
time: 269ms
memory: 56548kb

input:

1
200000 499981
80537 142045
166196 27324
188484 59794
73011 62848
54982 32788
146891 120397
145977 112297
30732 34355
198025 193511
46734 37750
74321 75081
38173 123072
90782 51316
3345 153541
108762 97369
16828 137609
157439 191613
162866 51112
72589 170889
126524 133464
82570 115809
128563 112379...

output:

175744 97914 116931 152021 68935 11997 141961 168667 156292 38287 159565 99029 147358 124499 71370 171799 117011 81682 117727 14453 139562 178057 97552 75737 83890 112661 130223 102572 58 185084 39514 31317 146079 124080 153908 72 1307 189346 130416 84888 81377 182521 175223 88 45225 191242 101259 1...

result:

ok ok (1 test case)

Test #32:

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

input:

10000
9 14
7 9
6 7
6 3
3 2
3 5
3 4
3 8
7 8
2 7
4 7
3 1
7 1
7 5
9 3
5 4
2 3
4 5
4 1
2 1
65 120
48 33
48 27
65 28
21 48
48 4
3 28
39 48
48 10
48 50
32 13
19 48
52 24
48 24
48 15
48 31
65 48
52 19
60 48
49 41
22 28
48 20
18 48
2 28
25 48
1 48
2 48
28 23
52 20
28 51
28 11
52 63
59 28
28 36
48 44
31 28
2...

output:

2 5 6 7 
2 4 
2 47 6 8 10 13 14 16 18 20 22 24 26 49 30 53 34 36 38 40 42 44 7 48 27 46 33 56 11 60 62 64 
2 3 17 11 12 33 6 5 18 28 15 27 26 13 20 30 34 
2 4 6 
7 3 6 8 9 11 
2 13 3 18 10 11 15 16 1 
22 4 7 8 10 12 14 16 18 3 1 21 
2 4 3 8 10 12 
9 4 6 10 2 
3 
2 4 6 8 10 12 14 
3 6 5 
2 4 6 7 10 1...

result:

ok ok (10000 test cases)

Test #33:

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

input:

1000
65 124
10 5
5 16
64 33
3 59
4 59
50 5
60 33
5 39
55 59
33 61
5 8
5 49
31 33
5 41
37 59
5 48
23 59
34 33
59 17
22 5
33 47
11 5
59 38
5 45
5 13
63 5
5 14
5 2
33 16
40 5
27 33
5 64
59 49
41 33
25 59
28 33
65 59
59 11
33 62
15 33
59 35
59 14
53 59
33 29
30 5
44 33
62 5
33 32
50 59
59 30
59 45
42 59...

output:

2 18 6 47 23 17 59 21 24 20 10 3 26 49 30 53 34 36 38 15 42 44 7 48 31 35 33 55 11 61 50 64 
195 130 52 263 268 260 270 247 229 168 50 100 29 44 170 166 283 262 31 40 42 219 116 48 148 278 212 293 286 60 16 236 102 112 70 72 292 123 234 121 274 242 209 275 151 284 248 223 103 66 158 249 119 230 110 ...

result:

ok ok (1000 test cases)

Test #34:

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

input:

100
2720 5430
15 549
864 1152
549 492
1152 2121
366 1608
2226 1574
2096 1152
951 1152
279 1278
1574 232
2537 1152
806 1278
1988 1152
1574 2203
1239 1278
414 549
434 549
549 2020
1608 1319
2464 1574
1232 1152
1608 728
1453 1152
992 1608
1608 1637
1242 1152
1190 1574
1278 1587
2105 1278
2577 549
1178 ...

output:

1349 1907 6 8 10 12 14 2655 18 20 22 967 1477 2472 30 32 337 392 635 40 42 44 46 48 50 52 54 56 58 2173 62 64 879 543 70 72 1074 76 183 80 82 84 910 88 90 94 1739 96 98 1851 335 104 106 108 110 2013 114 1853 118 120 122 2373 1554 128 130 132 134 1633 138 769 551 641 146 2101 1529 2333 154 156 158 16...

result:

ok ok (100 test cases)

Test #35:

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

input:

10
11424 22838
10124 2930
2930 8210
6044 2930
9338 5243
2930 1990
8267 335
11369 2930
3640 2930
2930 8394
2930 4490
10225 5027
2930 7034
336 10225
6591 10225
2723 8267
3141 8267
9338 8308
8267 7647
2930 1471
9338 742
10225 2977
8267 4214
10232 6130
5050 6130
3536 9338
9338 810
8267 6841
8267 4313
59...

output:

3158 4 6 7484 6603 12 5381 8828 5605 1855 9919 4867 1733 11082 1210 5525 4981 1873 1081 2225 42 9570 9663 6014 50 287 10625 56 11067 60 2084 64 8224 9451 5959 5705 5305 7787 10219 7291 2902 84 4868 8923 600 92 2079 1910 894 6108 10566 3241 106 6387 3680 51 4886 2163 3765 10235 7024 124 7826 10114 13...

result:

ok ok (10 test cases)

Test #36:

score: 0
Accepted
time: 186ms
memory: 50788kb

input:

1
200000 399988
171813 28023
127391 157678
139161 157678
157678 158661
157678 6685
120596 157678
189440 28023
72845 28023
28023 155435
178088 157678
54821 157678
199920 7797
7797 23002
132615 7797
7797 114612
28023 98270
157678 29354
29544 28023
28023 6304
28023 86497
20726 7797
198021 7797
4578 157...

output:

80519 199667 182932 118243 76896 55084 190865 199463 146057 47239 87880 140571 177720 165526 50733 86571 28329 462 196304 91061 86661 11749 170138 5244 170007 111025 47186 67021 126025 13262 117327 163739 177863 25385 89334 172126 113456 18902 179131 92749 95923 130303 76551 88 184830 88601 22415 92...

result:

ok ok (1 test case)

Test #37:

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

input:

1
200000 399994
17358 78776
138799 189702
78776 115828
78776 76870
189702 82466
80014 189702
78776 129553
14969 78776
161279 120022
103978 161279
189702 90678
65648 78776
164898 189702
78776 4880
189702 17932
189702 29494
71164 78776
55663 78776
78776 25638
78776 51965
78776 73585
189702 190545
1173...

output:

2 4 6 8 10 79945 14 16 192227 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 153435 72 53818 76 78 160129 82 84 86 88 90 92 94 6563 98 100 102 131927 106 108 110 112 162047 116 118 20343 21027 124 126 128 130 132 18697 27296 138 140 142 80475 146 148 184651 152 154 138393...

result:

ok ok (1 test case)

Test #38:

score: 0
Accepted
time: 88ms
memory: 50636kb

input:

1
200000 399996
43234 184957
104384 184957
184957 104551
48901 184957
130388 184957
184957 191112
93746 184957
51488 83793
46496 184957
184957 149525
48305 51488
16545 51488
155037 184957
51488 99541
5545 184957
184957 50631
147758 184957
141234 51488
33945 184957
119044 51488
99610 51488
162526 514...

output:

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 1...

result:

ok ok (1 test case)

Test #39:

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

input:

1
200000 399994
187117 14028
171699 93144
87566 171699
48194 171699
123842 171699
86963 78638
171699 77033
187117 79890
123219 171699
171699 63678
68921 187117
187117 91518
12750 187117
11203 171699
166545 171699
187117 75563
4708 187117
86963 26711
115930 86963
187117 102050
187117 66412
187117 962...

output:

45223 122046 6 8 10 69576 14 16 192227 197942 22 163327 26 144808 30 32 34 163362 38 197695 42 176554 46 48 154586 112167 15964 56 58 60 106408 67647 18488 147612 56198 72 183102 76 34508 134432 82 107435 89707 88 189086 92 94 127851 130637 198173 13917 131927 106 187887 110 112 162047 116 118 20343...

result:

ok ok (1 test case)

Test #40:

score: 0
Accepted
time: 74ms
memory: 50616kb

input:

1
200000 399996
158442 44824
102533 158442
144188 158442
180888 177991
158442 60658
130921 158442
11093 158442
158442 91269
177991 66366
45320 177991
852 158442
158345 177991
177991 101419
177991 60694
77523 177991
158442 64839
177991 97717
158442 15688
101326 177991
57416 158442
105648 158442
15844...

output:

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 1...

result:

ok ok (1 test case)

Test #41:

score: 0
Accepted
time: 342ms
memory: 50700kb

input:

1
200000 399984
132326 109212
15458 104058
141635 150556
42757 160742
104058 183026
140555 176509
105281 104058
98409 123058
115963 132326
110622 160742
124231 104058
9948 132326
149792 132326
186350 132326
114248 132326
117808 104058
149757 178717
20007 132326
103768 104058
160742 132129
181418 132...

output:

40527 82246 167207 167280 174884 127142 177846 206 124773 171188 100944 83948 35145 42783 147645 58093 163284 100776 2588 7708 117509 152889 77290 105316 25400 180760 37693 3812 193615 101382 33305 113585 37500 171612 120580 82541 180798 87093 173387 158119 107569 39784 195146 44597 131861 79060 156...

result:

ok ok (1 test case)

Test #42:

score: 0
Accepted
time: 288ms
memory: 50712kb

input:

1
200000 399938
118765 169368
80877 55756
183643 55120
179690 39975
52846 39431
183643 142616
40237 9287
169765 51704
169765 196513
180903 78049
2468 127986
103196 92043
171000 183643
51970 16065
33387 150171
54791 100228
96040 51970
183643 73275
194778 116171
119619 51970
78820 25947
121977 74719
1...

output:

22180 177420 187045 55722 191972 88001 47755 188585 197940 401 16049 104395 152106 25777 77524 152846 174940 132405 12618 44616 15935 36569 68525 91423 83844 117184 16369 67803 80611 7207 44436 135861 103108 154981 107431 102059 36786 172373 108137 138058 29982 52861 78529 33958 111596 66716 162107 ...

result:

ok ok (1 test case)

Test #43:

score: 0
Accepted
time: 331ms
memory: 52956kb

input:

1
200000 399918
4808 186087
3193 20269
53579 193832
181866 119189
96009 51067
26071 110895
180290 198389
75156 67809
146896 88504
26232 199270
41761 194173
163583 73217
11161 69425
127108 172920
26071 136318
4808 20765
58003 13956
56475 127108
124690 96369
98349 88504
88504 129805
1116 75156
193832 ...

output:

118271 159623 134596 125027 96941 98836 123383 188585 144347 121868 184276 174001 197625 154091 146441 99483 62938 141802 186106 138841 139125 58274 44744 141146 161798 5096 87474 148113 175846 7207 81906 153247 13328 14254 84771 75571 178216 10775 108137 101418 198417 158233 58081 192623 182774 402...

result:

ok ok (1 test case)

Test #44:

score: 0
Accepted
time: 265ms
memory: 50256kb

input:

1
200000 394970
67823 148797
176646 48645
130521 57454
24214 159679
58899 105974
31385 9900
98402 172520
136909 143412
104381 107770
158622 39611
181123 4031
93760 67853
87239 94179
102524 50092
53452 91220
161571 173978
140608 6827
8215 91048
101935 80437
20495 175157
85578 193822
117607 100231
195...

output:

167749 40996 128902 36734 78386 93510 108539 178255 18 116066 57191 109315 26 146427 139654 65778 72789 196358 43137 183580 85249 37135 147455 32195 70234 71431 58412 130367 159847 142572 49940 57246 130331 184824 118612 199271 172925 63440 157695 29071 116043 142318 116205 129300 5867 35021 72082 1...

result:

ok ok (1 test case)

Test #45:

score: 0
Accepted
time: 279ms
memory: 52884kb

input:

1
200000 324098
195943 81674
197522 192121
73692 10625
137597 30541
116880 163679
19609 78824
65138 65608
122246 18120
69217 48636
96269 102482
152468 42380
70492 187039
106990 158537
130005 170494
6227 16267
17532 42444
156564 89378
116737 22782
3890 98135
93103 18506
14764 134508
107699 107653
151...

output:

2 158 26066 101680 95086 11464 37849 68819 18 190283 11821 68103 26 87249 34743 72533 46473 34048 55978 40 122982 63082 193427 97525 193756 57442 36988 79113 75656 157308 62 156159 66 192673 149628 113609 7944 197720 7485 80 740 78748 95778 182652 44477 56835 27527 96 4310 156074 183531 158326 59738...

result:

ok ok (1 test case)

Test #46:

score: 0
Accepted
time: 275ms
memory: 49892kb

input:

1
200000 200000
10712 34133
109916 81898
148586 4152
6534 159576
7955 53276
15698 110638
182088 163751
60650 31286
73846 141810
54346 154107
123853 122076
157857 161032
36509 82064
151785 146929
124102 184007
26103 42788
135406 130776
30940 184626
184648 4748
54625 68760
4035 142644
13678 114822
386...

output:

136075 4 6 152809 42590 83699 93129 114876 174280 20 154269 124684 141011 28 119029 169935 84474 130869 36916 118260 36306 130523 135393 18369 89871 52 84516 56 113826 91347 197419 169685 194767 114833 186357 72 74 137139 32841 80 122257 78286 184750 59247 115585 3857 183308 121827 168521 105636 102...

result:

ok ok (1 test case)