QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#869601#8613. Cardinalityucup-team2819#AC ✓257ms293644kbC++201.6kb2025-01-25 11:53:272025-01-25 11:53:30

詳細信息

Test #1:

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

input:

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

output:

2
2
3
3
4

result:

ok 

Test #2:

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

input:

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

output:

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

result:

ok 

Test #3:

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

input:

100 100
82 51
68 54
25 11
21 47
84 43
78 91
1 88
29 50
10 62
38 29
100 65
23 4
77 10
29 7
59 39
56 81
73 3
113 10
49 25
59 103
20 40
42 55
46 87
9 26
30 43
70 97
7 12
2 54
41 68
82 60
129 69
86 82
85 38
105 71
81 58
59 36
76 111
10 68
108 19
46 31
127 60
35 120
79 125
138 21
14 10
64 72
140 127
126 ...

output:

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

result:

ok 

Test #4:

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

input:

1000 1000
89 983
726 406
473 684
779 306
5 585
185 774
484 220
988 291
857 606
783 143
238 193
187 68
342 227
833 183
645 453
714 271
717 845
811 608
601 1013
101 716
563 790
500 449
962 863
255 787
236 837
560 412
788 681
487 992
311 884
389 251
199 927
942 1013
760 829
794 763
323 37
380 773
520 9...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
4
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
3
3
2
2
2
2
2
2
2
2
2
3
2
4
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
3
2
2
2
3
2
2
2
2
2
2
2
2
2
2
5
3
2
2
4
2
2
2
2
3
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
3
3
2
2
2
...

result:

ok 

Test #5:

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

input:

1000 10000
609 422
750 225
479 328
513 581
935 302
164 982
913 807
716 785
888 102
867 698
397 957
743 229
35 252
222 697
614 421
442 266
748 44
698 740
556 746
748 637
259 372
752 867
503 605
483 380
586 608
977 584
603 335
347 202
514 622
343 167
700 845
370 673
597 499
314 38
647 976
784 644
721 ...

output:

2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
5
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
3
3
2
2
2
3
2
3
2
2
2
2
2
2
2
2
2
3
2
2
3
3
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
3
2
2
3
3
2
2
2
2
2
2
2
2
2
2
2
4
2
...

result:

ok 

Test #6:

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

input:

1000 100000
359 877
601 2
857 749
72 386
503 918
74 209
504 14
653 714
168 192
993 870
342 822
540 854
495 452
996 651
1005 932
898 279
105 83
778 924
517 326
326 16
747 863
73 501
190 386
211 416
330 72
857 269
543 485
344 637
111 611
449 942
426 739
585 459
100 269
1025 249
763 945
834 432
492 148...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
3
2
2
3
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
2
2
2
3
3
2
2
2
2
2
2
3
3
2
2
2
2
3
2
2
2
2
3
2
2
3
2
3
2
2
2
2
2
2
2
2
2
2
2
2
3
5
2
2
2
3
2
2
2
4
2
2
...

result:

ok 

Test #7:

score: 0
Accepted
time: 103ms
memory: 110636kb

input:

1000 200000
769 45
350 115
462 826
361 748
422 502
757 529
131 165
525 252
5 610
58 557
894 966
867 661
699 337
508 118
248 715
307 307
814 382
957 825
302 694
22 761
146 621
149 929
553 337
428 844
429 371
355 740
889 726
1017 938
31 269
906 259
173 45
852 442
41 87
179 284
866 1033
115 130
757 192...

output:

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

result:

ok 

Test #8:

score: 0
Accepted
time: 257ms
memory: 267232kb

input:

1000 500000
24 935
982 976
490 112
293 703
499 131
922 786
572 620
322 364
508 616
333 817
664 297
581 82
257 726
95 310
119 28
208 523
86 518
866 919
777 618
314 979
640 663
377 898
713 187
64 78
725 243
883 113
868 514
546 816
945 529
749 724
300 243
282 41
625 398
376 572
63 420
91 995
715 757
12...

output:

2
2
2
2
2
2
2
2
2
2
2
3
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
3
2
2
2
3
2
2
2
2
2
2
4
2
2
2
2
2
2
2
3
2
2
2
2
2
4
3
2
2
2
2
3
4
2
3
2
2
2
2
2
3
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
3
2
2
2
2
2
2
2
3
2
2
2
2
2
3
2
3
2
5
2
2
3
2
3
2
2
2
3
2
2
3
2
2
2
2
2
2
2
...

result:

ok 

Test #9:

score: 0
Accepted
time: 111ms
memory: 114848kb

input:

10000 200000
7688 6283
9094 4308
3710 4803
6747 3889
4207 6061
2726 4542
8829 796
5675 7143
5638 863
245 5734
8825 5750
3987 8324
4975 5890
1970 7899
6849 4477
8086 4128
6329 4663
2284 2090
4982 2135
6163 5095
9030 9535
108 3964
1061 123
9528 6368
5864 6484
4099 7490
1920 9370
7465 708
3243 6206
630...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #10:

score: 0
Accepted
time: 248ms
memory: 271784kb

input:

10000 500000
4238 1173
7415 9171
1036 3929
5665 6622
4280 3162
7301 6823
2154 445
9185 5840
4198 6413
9036 2268
3659 2967
5637 8316
5780 1226
5938 9093
9100 3838
6007 5413
3857 8879
4906 5397
2021 3341
4985 1707
5864 6741
3197 2603
4317 2856
8878 1328
4816 5476
5198 5055
7852 2466
8879 2727
3989 261...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
3
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #11:

score: 0
Accepted
time: 131ms
memory: 135768kb

input:

50000 200000
24283 15305
35392 28314
13315 5349
10170 7781
42876 13753
34175 21569
11942 14204
1993 45946
11509 11900
10043 9558
14244 9734
4580 37268
16648 39526
19899 24112
44057 13366
47918 7636
389 40237
4394 36992
8894 8771
29697 9897
30621 4081
42771 15449
31622 35612
12973 30560
7681 19828
38...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #12:

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

input:

50000 300000
11693 27473
4419 47627
11979 41885
20751 12734
30639 47169
41840 27300
7892 33220
4116 26228
30690 17518
23187 16309
21190 17458
15955 17074
34788 18568
42756 21077
11124 11398
42742 19740
46114 34720
7416 723
2170 34395
34295 41661
35876 21475
4521 38462
19581 26469
5173 25422
12836 30...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #13:

score: 0
Accepted
time: 214ms
memory: 241344kb

input:

50000 400000
7615 31129
42049 21800
17248 30526
40947 17687
31150 28034
49912 33031
31316 4192
40159 3837
49783 13856
39932 23060
36612 39290
40200 46892
13105 21117
41015 17146
28206 15100
4698 31844
47743 23283
7496 6964
20400 31672
10539 23405
41128 38869
2119 11454
7539 45680
39912 28035
35727 2...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #14:

score: 0
Accepted
time: 254ms
memory: 292316kb

input:

50000 500000
20834 43298
11076 9715
27013 17059
11139 32255
31661 48702
45825 13075
27265 21245
8363 34126
18957 29986
17987 29812
2024 38537
37049 13830
17993 13479
13860 14110
10319 18801
45870 14747
49372 17765
18024 31158
13677 32231
15137 19327
46387 6247
35566 4253
25986 34403
32112 7928
47585...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #15:

score: 0
Accepted
time: 181ms
memory: 292020kb

input:

50000 500000
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
97 98
99...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #16:

score: 0
Accepted
time: 193ms
memory: 291880kb

input:

50000 500000
35122 41597
46653 34477
4759 5545
27232 41147
40010 47164
8555 15425
16064 15665
17188 3099
2706 14150
1304 6345
22237 893
38036 5296
27618 40220
24653 14968
34438 8301
43850 22348
37315 17374
48004 27549
9910 275
973 1295
39599 17327
21350 20987
40804 27982
37799 26636
414 13647
37099 ...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
...

result:

ok 

Test #17:

score: 0
Accepted
time: 172ms
memory: 291940kb

input:

50000 500000
16472 44223
6875 42968
49798 820
39107 40446
42776 43968
47231 18549
3893 19475
47745 31479
47161 34705
38944 11906
30850 4755
44724 33065
49510 17271
31659 48547
10459 46924
35559 26619
27278 26279
45966 26510
27773 14290
44569 33808
11805 48599
13141 35703
49012 37849
27541 8350
8175 ...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #18:

score: 0
Accepted
time: 163ms
memory: 292092kb

input:

50000 500000
40833 1750
9818 32101
33827 23465
21445 9673
36431 42532
41182 46441
4481 7772
25611 5574
20874 16700
10680 27124
19793 11108
2309 36459
43487 25669
15702 12858
1666 34166
42993 15199
13995 11698
38163 2080
44240 6296
17308 32357
40026 48026
7566 5739
23528 16126
8546 20514
16635 16464
...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #19:

score: 0
Accepted
time: 181ms
memory: 291944kb

input:

50000 500000
16874 49369
46277 28122
10666 49548
16985 35828
28238 46731
32978 48613
46353 22527
42108 46711
24320 21585
44551 10759
30719 48354
11801 7175
18722 29459
29175 37099
38149 13101
20592 36252
30821 15051
2674 40520
2757 6763
39235 44223
33338 9985
6041 13624
40671 5140
18274 10010
14354 ...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #20:

score: 0
Accepted
time: 162ms
memory: 292696kb

input:

50000 500000
1890 38262
37322 29615
3112 31389
49009 34813
37169 25852
20386 15728
382 7689
22082 11666
22308 42845
7558 558
9355 16039
13034 46757
39794 41017
37965 32666
38409 33161
6947 34374
11253 28130
37666 38356
25311 32288
41717 5126
29813 19911
37132 21438
35800 35709
35194 35670
15933 2250...

output:

2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #21:

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

input:

50000 500000
45689 20258
21471 38004
21367 13231
31033 33798
28805 22269
899 15548
4412 42851
26248 42029
44487 31401
46372 48869
13800 25212
22780 36339
43569 35279
38244 28233
21372 20517
27894 6688
41684 17016
22658 44705
15161 25109
18392 16028
480 5646
35519 46549
39441 42086
45218 37138
34807 ...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #22:

score: 0
Accepted
time: 171ms
memory: 292180kb

input:

50000 500000
31508 18904
48289 32818
38641 49757
43605 28376
10808 42331
30407 28416
7536 47975
47353 39882
48675 25855
41119 3805
19361 1122
26642 43027
5931 7171
41103 11047
4952 46538
40709 24205
45955 6979
31563 42667
14122 25676
32407 42328
32993 2043
16791 21044
21453 8807
5084 33776
23418 404...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 

Test #23:

score: 0
Accepted
time: 223ms
memory: 291976kb

input:

50000 500000
42370 39588
50001 17555
50002 8957
50003 7501
50004 7143
50005 49623
50006 32821
50007 34454
50008 12923
50009 7474
50010 6257
50011 42669
50012 3122
50013 9190
50014 34580
50015 47743
50016 34792
50017 33324
50018 42564
50019 5809
50020 28770
50021 916
50022 7812
50023 34220
50024 1473...

output:

2
3
4
5
6
7
8
9
10
12
13
13
15
16
17
18
19
20
21
21
22
24
25
27
28
29
31
31
32
34
35
36
38
39
39
40
42
43
44
44
45
46
48
48
49
50
50
52
53
54
55
55
55
57
58
58
59
62
62
63
64
68
69
69
70
71
72
72
72
75
75
76
77
77
79
80
80
80
81
82
82
82
83
84
84
86
88
92
92
92
94
94
96
103
104
106
106
106
107
107
1...

result:

ok 

Test #24:

score: 0
Accepted
time: 221ms
memory: 292956kb

input:

50000 500000
23241 30670
50001 29025
50002 5654
50003 25139
50004 13805
50005 19668
50006 14070
50007 16390
50008 20022
50009 33118
50010 35964
50011 37387
50012 26593
50013 19723
50014 25204
50015 33419
50016 48743
50017 35413
50018 19664
50019 46115
50020 27849
50021 25000
50022 24466
50023 17707
...

output:

2
3
4
5
6
6
7
8
9
10
11
11
12
13
15
16
17
19
20
20
21
21
22
25
27
28
28
29
31
32
33
34
35
36
37
37
37
38
39
41
41
41
42
43
44
45
47
47
48
48
48
48
48
50
50
51
51
52
52
53
54
55
55
55
56
56
58
60
61
61
61
61
62
62
64
64
66
67
67
70
71
71
72
75
76
76
76
76
79
79
83
84
84
87
87
89
90
90
91
91
91
92
93
...

result:

ok 

Test #25:

score: 0
Accepted
time: 232ms
memory: 292032kb

input:

50000 500000
49350 29471
50001 14196
50002 40945
50003 29788
50004 10332
50005 49348
50006 48665
50007 21426
50008 21447
50009 30254
50010 19627
50011 49653
50012 21930
50013 3067
50014 45818
50015 6864
50016 43385
50017 26358
50018 39812
50019 37447
50020 13645
50021 34138
50022 6770
50023 12674
50...

output:

2
3
4
6
7
8
9
10
10
12
13
14
15
16
17
19
20
21
23
23
24
24
26
27
27
28
28
30
31
33
33
35
35
37
38
38
39
39
40
42
44
45
48
48
49
49
53
53
53
53
54
55
55
55
56
56
56
57
57
58
58
59
60
63
63
63
63
63
66
67
68
69
70
70
71
71
72
72
73
75
77
78
80
82
82
85
85
85
88
88
89
90
94
95
95
97
97
99
99
101
101
10...

result:

ok 

Test #26:

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

input:

50000 500000
46627 21773
50001 21930
50002 32788
50003 45253
50004 2425
50005 17406
50006 39311
50007 15322
50008 24285
50009 31602
50010 49659
50011 552
50012 37153
50013 1788
50014 25412
50015 38911
50016 44001
50017 33480
50018 20979
50019 5737
50020 42273
50021 9909
50022 22189
50023 20139
50024...

output:

2
3
4
5
7
8
9
10
10
11
13
13
15
17
17
19
19
20
21
21
22
23
24
25
26
28
32
33
34
36
37
38
41
41
41
41
42
42
42
43
44
45
46
47
47
49
49
50
51
52
52
53
54
55
56
56
56
58
59
59
61
62
63
63
63
63
65
65
67
68
68
68
72
73
79
80
80
81
82
82
82
84
85
85
85
87
89
90
93
94
95
99
99
99
101
101
101
101
105
105
1...

result:

ok 

Extra Test:

score: 0
Extra Test Passed