QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#478274#8727. Dvobojtzl_Dedicatus545100 ✓824ms41848kbC++143.0kb2024-07-14 19:55:432024-07-14 19:55:43

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 3ms
memory: 7912kb

input:

10 10
1361914 207572678 628126347 376128984 883488318 186963880 762865354 326392578 98149107 158171745
2 2 3
1 2 570852623
2 1 3
1 10 841056888
2 1 3
1 10 496132858
2 1 1
2 3 3
1 3 99470035
1 7 296222622

output:

260852338
57441684
57441684
569490709
406038050

result:

ok 5 number(s): "260852338 57441684 57441684 569490709 406038050"

Test #2:

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

input:

16 1000
1361914 207572678 628126347 376128984 883488318 186963880 762865354 326392578 98149107 158171745 61370500 127856987 9580346 570852623 646119601 178503575
2 7 1
2 2 2
1 14 993939084
2 14 1
1 9 73368655
2 4 3
1 7 60357102
1 8 631246136
1 9 220513513
2 6 3
1 7 653851474
1 8 456503385
1 5 371026...

output:

436472776
86805665
347819483
87680538
262650449
984358738
235989872
272256206
29264121
185977251
194839926
251930935
42658454
11990820
42658454
66029961
440700537
577605510
425326019
466887594
813607132
362972407
48387898
63098914
627944703
66763262
232922824
133094310
197750495
217535675
147044123
...

result:

ok 482 numbers

Test #3:

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

input:

65 1000
1361914 207572678 628126347 376128984 883488318 186963880 762865354 326392578 98149107 158171745 61370500 127856987 9580346 570852623 646119601 178503575 484012895 61261435 841056888 558195739 940535012 26358306 579095855 496132858 925772919 837126193 70268510 656565238 285836282 902043521 4...

output:

142337918
150548605
186695351
125217148
255203325
67291398
2648908
43043613
24226412
439183520
586296728
301501346
53682976
162406540
15657443
9885849
214706015
557305213
107800702
316326531
582297695
57541160
323146440
73732386
540396274
6958073
66486487
23042085
43666455
431577775
513356186
122913...

result:

ok 511 numbers

Test #4:

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

input:

65 1000
207511447 51272873 735603123 397076404 966916484 512320076 284382040 309429435 925716265 984330314 993127948 350498868 45242528 900122009 684637316 831057517 741828281 15030115 353216803 809527525 239951084 256630526 410747900 814013515 374895460 729376753 825213139 866764416 919429888 90646...

output:

22719394
273594757
184364296
45650570
227938036
348854302
216595057
69898465
123042137
547078655
353085422
31441046
163125351
150694751
254724553
125642109
474668
48784322
137746777
306679127
73236309
156188397
440590243
158822954
204074514
554177487
121598645
554177487
79359359
28590241
1539380
197...

result:

ok 523 numbers

Test #5:

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

input:

1000 1000
213378079 34508930 71287632 637752859 659977531 245762954 455483857 576582109 939803654 62528280 91772795 567245160 519776559 648525642 440759601 870753993 79121233 830364070 836922059 472097926 892749051 474527526 13096716 725009293 54135466 810116149 53609387 541454656 864260299 14827229...

output:

819243849
384496460
645939128
413892067
94704584
46680458
230543380
225168786
34308778
339710774
192803453
32592119
40448274
42815583
63939569
222218236
280995802
136044778
35905755
119728
46667819
6818746
320476902
292971525
272187426
243488937
154852879
318333429
298487803
156117205
352232549
2838...

result:

ok 524 numbers

Test #6:

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

input:

1000 1000
213596176 131514609 673536873 841721579 668353587 236064010 832632352 957205489 549880437 108760725 839907133 477543143 403049855 971248008 21939809 67431032 992061289 918570185 971654557 772163398 838389695 677675052 174311284 917009882 335321465 910674552 241976533 256318642 627949826 72...

output:

141553262
35087683
300166489
320091116
286621845
67645693
255636870
321861687
662594396
171132776
423848815
164112050
129034703
240963802
275224941
589646
194519241
103261333
5956571
156098709
244885556
335364865
181737317
273587357
43739830
146237615
238995140
51774342
363760436
53710912
239696030
...

result:

ok 477 numbers

Test #7:

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

input:

1000 1000
213705226 716855592 11532404 943755091 135687088 231214538 484335687 610646267 354902444 168780627 140216095 969513894 881557414 595787431 349368057 92044113 374822261 425818714 39037190 922212518 811242785 779232431 791789479 12993791 12736224 424082842 909885545 113750635 509827356 47782...

output:

400459814
201418778
97817103
101202496
101232344
126369058
386988434
449061123
497907128
239411107
73562892
60291011
10853609
215848031
198911635
856136103
324760569
209857607
281170280
112506308
135756415
117330976
61224204
235579329
102640489
206365168
147494798
224911679
435403922
129389938
25091...

result:

ok 506 numbers

Test #8:

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

input:

1000 1000
213781507 228520287 275818880 45723066 676729644 226365066 136039024 264119813 159957219 228734993 514299648 387808358 286323150 220261319 676829073 190399016 831325058 6776299 32645233 72261637 784063107 880822578 335558619 35301414 616474697 11200187 504085501 44891683 391672120 22978818...

output:

160711136
324248029
205251300
24085371
284024914
231417855
844716399
141214150
202127290
14050109
341466449
157258185
109726110
66789769
71324859
296404158
282847563
8096429
63717687
241501586
194942018
196345301
338485818
34093662
128858414
279129154
443668432
478997435
51797012
246854082
131907601...

result:

ok 486 numbers

Test #9:

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

input:

1000 1000
214032373 325525965 951777177 175982732 685072933 216666122 513187518 644743194 843743058 348709261 188692163 298073574 169629214 542983685 257976513 387043289 670556058 21273359 167377731 298618054 729703751 10228281 496805954 227302003 897627928 38049535 766161701 759755670 155427181 807...

output:

277141918
235454347
365324681
202940860
20329203
210642204
46115467
48106060
573038529
221128330
140628685
205087339
64509805
146397506
6800712
253176214
31396794
411974102
11460523
89303493
25487492
256998462
479895476
294381914
119982133
138882109
139322432
268937129
85705093
439193820
118020357
8...

result:

ok 510 numbers

Test #10:

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

input:

1000 1000
339631232 358854319 465176920 725456574 224720478 969211987 710307753 744328097 656189083 982581416 178522774 239824216 373676202 9988302 284004938 941896061 795118324 264881243 868072678 358005529 37931724 73597773 656729204 182694053 590982265 4363286 72819444 882741771 46457647 57222133...

output:

174176325
225788486
75577805
102122893
54288788
186859227
77413498
279099073
119319777
311859316
32925563
128565968
14953978
199633402
147074367
159726214
74560293
82460793
223348007
124751594
71739589
205731243
20279323
110626855
159955434
207874198
283086711
248125642
37707497
120782314
322135930
...

result:

ok 486 numbers

Subtask #2:

score: 13
Accepted

Test #11:

score: 13
Accepted
time: 59ms
memory: 8664kb

input:

2 200000
583392119 251603292
2 1 1
2 1 1
1 1 38574148
2 1 1
2 1 1
1 1 42719181
2 1 1
1 2 536876485
1 2 761201073
1 1 335510282
2 1 1
2 1 1
2 1 1
1 2 371383902
2 1 1
2 1 1
1 1 378794551
1 1 224150551
1 2 812716786
2 1 1
2 1 1
2 1 1
1 2 129793340
2 1 1
1 1 654577279
1 1 150709706
2 1 1
1 1 883829174
1...

output:

331788827
331788827
213029144
213029144
208884111
425690791
425690791
425690791
35873620
35873620
588566235
588566235
588566235
94357211
20916366
647936652
647936652
459423963
459423963
459423963
176008535
176008535
398886231
398886231
398886231
10658183
10658183
10658183
1477309
1477309
423872241
5...

result:

ok 99810 numbers

Test #12:

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

input:

8 200000
583937365 30955631 71369406 563916968 642881599 641904678 121445755 920580908
2 1 3
1 5 540256764
1 8 562659914
2 1 3
1 6 770926584
2 1 3
2 1 3
2 1 3
2 1 3
2 1 3
2 1 3
1 2 843982298
1 5 935286660
1 3 978153407
1 7 383158846
1 5 832692766
1 2 58984923
2 1 3
1 5 599293737
1 7 891437740
2 1 3
...

output:

737724060
279132073
150110167
150110167
150110167
150110167
150110167
150110167
7018883
46428976
271079153
361390048
361390048
198270139
198270139
198270139
3058280
3058280
3058280
3058280
156874444
203315832
203315832
24294559
24294559
333451673
333451673
408021917
408021917
408021917
249116721
586...

result:

ok 99806 numbers

Test #13:

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

input:

128 200000
584667941 833604594 289821715 204082050 135277733 607958374 904627342 642215537 851862185 918490066 11161382 578052298 945488065 100848470 671298278 643164130 337474286 341210108 509998661 364095486 9419682 751509443 595566895 968206932 413460927 242350233 527753469 808018697 17026711 530...

output:

233794795
26950959
26950959
61031769
275489501
275489501
291739948
291739948
11887608
51682559
133293465
133293465
133293465
32136635
32136635
142223630
190940681
190940681
190940681
190940681
265354431
132261455
1340730
1340730
26308845
26308845
182270618
93242112
131028415
131028415
131028415
1310...

result:

ok 99805 numbers

Test #14:

score: 0
Accepted
time: 151ms
memory: 7884kb

input:

1024 200000
585431285 636253556 508241256 917988956 701382924 574044838 614034338 363850167 560823596 264690948 408422480 800884232 106455 693522224 815976206 257775561 311702851 113142518 981513256 340664734 892903760 388767577 623012504 566450785 860691861 57400966 908214794 883751704 263780180 94...

output:

24063955
2839810
2839810
197237575
197237575
256174684
138891553
138891553
138891553
138891553
138891553
198403544
242681709
242681709
242681709
144917226
144917226
144917226
110713835
135466922
297518947
297518947
297518947
236494764
83202527
95353447
95353447
83305170
83305170
83305170
83305170
83...

result:

ok 99799 numbers

Test #15:

score: 0
Accepted
time: 748ms
memory: 29340kb

input:

131072 200000
585943763 341896840 50669734 354218084 185435770 549797478 20034663 778603240 659708224 564593850 131258296 39709127 245193374 963506379 305764871 749419008 446700414 870512334 244619063 17168510 757038139 896620008 489276314 46435872 26769562 845635119 26599918 170911669 746844122 775...

output:

18705461
19370893
19370893
7053709
7053709
7053709
7053709
10886574
10886574
19738165
19738165
19738165
3706242
3706242
1035356
6225471
22078108
22078108
22078108
7581975
8764092
8764092
245854
245854
245854
245854
245854
245854
245854
245854
245854
4610320
4610320
4610320
12043952
12043952
65659403...

result:

ok 99794 numbers

Test #16:

score: 0
Accepted
time: 755ms
memory: 29348kb

input:

131072 200000
586707106 144545802 269089275 68124989 751573728 515851173 729441660 500237870 368669634 984503788 602195682 262508293 373520821 482471077 450410032 364063206 420896211 642411976 716133657 67446813 566813161 533910910 516754690 644646958 400258673 660653084 333352189 246611909 99356482...

output:

217094034
217094034
217094034
216308384
216308384
189518893
190723023
239441846
257885830
257885830
257885830
257885830
224063218
199581231
199581231
220421785
214114210
214114210
169144106
169144106
169144106
211418158
211418158
211418158
211418158
204277195
114042449
114042449
114042449
109063472
...

result:

ok 99863 numbers

Test #17:

score: 0
Accepted
time: 762ms
memory: 29312kb

input:

131072 200000
587655781 44233210 89790824 912291561 252313151 472238693 815997151 602528647 761416883 450678937 747525583 395572676 385154331 324190909 176235401 175318909 234355776 502484966 248671694 270372479 322261595 374382105 705447633 434858632 54966550 576294988 975922483 37208902 4073354 27...

output:

19065817
16100067
16100067
16100067
16100067
16100067
10796115
9478108
9478108
12630441
12630441
12630441
1526576
62094537
111798354
111798354
84690446
84690446
75664448
75664448
75664448
96848615
137923356
117127043
117127043
84382105
84382105
137878559
5857771
5857771
2036111
9479263
8255111
82551...

result:

ok 99828 numbers

Test #18:

score: 0
Accepted
time: 571ms
memory: 19012kb

input:

65536 200000
588637223 17564138 984168661 756458132 826827166 428626212 902585410 704786657 80455076 990563143 892888251 528637058 396755074 165877973 975769825 60316433 47815341 362623492 854918788 547039967 77677261 214787765 894173345 225103074 783350715 491871356 544783721 901514951 14581884 161...

output:

5428847
5428847
5428847
5428847
5428847
14497368
5783115
3089623
3089623
118423464
118423464
118423464
118423464
118423464
118423464
118423464
99560917
99560917
93464581
93464581
93464581
93464581
20302509
86205348
86205348
86205348
86205348
86205348
74894804
124398386
118539544
118539544
118169242
...

result:

ok 99787 numbers

Test #19:

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

input:

4 200000
589509616 331877795 466841911 498591190
2 1 2
1 1 263728510
2 1 2
1 1 664167367
1 2 78783558
2 1 2
1 3 571216179
1 2 673625567
2 1 2
1 2 993007125
2 1 2
1 2 834647183
2 1 2
2 1 2
2 1 2
1 1 428011062
2 1 2
1 4 246586563
2 1 2
1 1 648303374
2 1 2
1 1 906478630
1 4 11604153
1 2 914851742
1 2 6...

output:

225882542
36400006
553634530
63166789
256214769
97854827
97854827
97854827
334011132
82006505
138285807
258225127
434737761
281884588
281884588
281884588
439813168
439813168
439813168
439813168
47405701
354525502
354525502
378919735
378919735
412815438
295472688
295472688
295472688
295472688
2954726...

result:

ok 99863 numbers

Test #20:

score: 0
Accepted
time: 230ms
memory: 8752kb

input:

8192 200000
589836763 14224456 407086683 804593423 335942646 375314788 292580340 114024526 83279108 576712560 712610668 572032191 291661879 330320172 282775403 68249175 774280497 310935364 522189323 50063871 852442628 258373718 170404568 207315336 719211823 508038896 375688392 406943162 788779942 43...

output:

34646153
34646153
34646153
16865561
60446191
60446191
217921135
217921135
183847424
183847424
183847424
183847424
236086661
236086661
236086661
236086661
9256561
9256561
23024285
76709814
70097545
70097545
70097545
70097545
40045433
40045433
40045433
58998781
58998781
58998781
46993635
46993635
4699...

result:

ok 99810 numbers

Subtask #3:

score: 16
Accepted

Test #21:

score: 16
Accepted
time: 53ms
memory: 8604kb

input:

10 200000
1 1 1 1 1 0 1 1 0 0
2 3 3
1 8 0
1 9 0
2 2 2
1 2 1
2 6 1
2 3 3
1 6 1
2 2 1
2 7 2
2 3 1
1 5 0
1 10 0
1 9 1
1 7 0
2 1 3
1 6 0
1 4 0
2 9 1
1 2 0
2 1 3
1 8 0
2 4 2
1 2 0
1 9 1
2 5 2
2 1 3
1 10 0
1 5 0
1 2 1
2 5 2
2 1 3
1 7 0
1 3 1
2 2 3
1 6 0
1 1 1
1 9 1
1 1 1
1 9 0
1 4 1
2 5 2
2 1 1
1 8 1
2 2 ...

output:

1
0
1
0
0
1
0
1
1
0
0
0
0
0
1
1
0
0
0
0
1
0
1
1
0
1
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
0
1
0
0
0
1
0
0
1
1
1
0
0
1
1
1
0
1
1
1
0
1
1
0
0
0
1
1
0
1
1
1
0
0
1
1
1
0
0
0
0
1
0
1
1
0
1
1
1
0
1
0
0
0
1
1
0
0
1
0
1
1
1
1
1
0
0
1
0
1
0
1
1
1
0
1
0
0
1
1
0
0
1
0
1
0
0
1
0
1
0
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
1
...

result:

ok 99564 numbers

Test #22:

score: 0
Accepted
time: 146ms
memory: 9520kb

input:

1939 200000
1 1 0 0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0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
0
0
1
1
0
0
1
0
0
0
0
1
1
1
1
0
1
1
1
1
1
1
0
0
1
0
1
1
0
1
0
1
0
0
1
1
1
0
1
0
1
1
1
0
0
1
1
1
0
1
0
0
0
1
0
0
1
1
1
1
0
1
1
0
0
1
1
1
1
0
1
1
1
0
0
1
0
0
0
0
1
1
0
0
1
...

result:

ok 99507 numbers

Test #24:

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

input:

257 200000
0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 0 1 1 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 0 0 1 0 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 0 1 0 0 0 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 0 1 1...

output:

1
1
1
0
1
1
1
1
1
1
1
0
0
0
1
1
0
1
1
1
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
1
0
1
0
1
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
1
0
1
1
1
1
0
1
0
0
1
1
0
1
0
0
0
0
0
1
0
1
1
0
1
0
0
0
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
0
0
1
0
1
0
1
0
1
1
0
1
1
1
0
0
1
1
1
1
1
0
0
1
0
1
0
1
1
0
0
0
0
1
0
0
1
1
0
1
1
1
0
0
0
...

result:

ok 99510 numbers

Test #25:

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

input:

255 200000
0 1 1 0 1 1 0 0 1 1 1 1 1 1 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 1 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 0 0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0
0
1
1
1
1
0
0
0
1
0
1
0
1
1
1
0
1
1
1
0
1
1
1
1
1
0
0
0
0
1
0
1
1
0
...

result:

ok 99561 numbers

Test #27:

score: 0
Accepted
time: 477ms
memory: 39580kb

input:

200000 200000
1 0 0 1 0 1 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 0 0 0 0 0 1 0 1 1 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 0 0 1 1 1 1 1 1 0 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 ...

output:

1
1
0
0
1
0
0
0
0
1
1
1
1
0
0
0
1
1
0
0
1
1
0
1
1
0
1
0
0
0
1
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
1
0
0
0
0
1
1
0
1
0
1
1
0
0
0
0
0
1
0
0
1
0
0
1
0
1
0
0
0
0
0
0
1
1
1
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
1
0
0
0
1
1
0
0
0
1
1
1
0
0
1
0
1
0
0
1
1
0
1
1
1
0
0
0
0
1
1
1
0
1
0
0
1
0
0
0
1
1
1
1
0
0
0
0
0
0
1
1
...

result:

ok 99528 numbers

Test #28:

score: 0
Accepted
time: 500ms
memory: 41848kb

input:

200000 200000
0 1 1 0 0 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 1 0 ...

output:

0
0
0
0
0
1
1
1
1
0
1
1
1
0
1
0
1
0
0
1
0
1
1
0
1
0
0
1
0
1
1
0
0
1
0
0
1
0
1
1
1
0
0
1
1
0
0
1
1
1
0
1
1
1
1
0
1
1
0
1
0
1
0
0
1
0
0
0
0
1
0
1
1
1
1
1
0
1
0
0
0
0
0
0
1
1
0
0
1
0
1
0
0
0
1
1
1
0
0
1
1
0
1
0
0
1
1
0
1
1
1
1
0
0
1
0
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
1
0
1
0
0
1
0
1
0
1
1
0
1
1
1
0
1
0
...

result:

ok 99526 numbers

Test #29:

score: 0
Accepted
time: 463ms
memory: 41548kb

input:

200000 200000
0 0 0 0 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 0 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 1 1 1 ...

output:

0
1
0
1
0
0
1
0
1
0
0
0
0
0
1
0
0
0
0
1
0
1
1
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
1
1
1
1
0
1
0
0
1
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
0
1
0
1
1
1
0
1
1
1
1
0
0
0
1
1
0
1
1
1
1
1
1
1
0
1
0
0
0
0
0
0
1
0
0
1
1
0
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
1
1
1
0
1
1
0
0
0
0
0
1
0
1
1
1
1
1
1
1
1
1
1
0
0
...

result:

ok 99478 numbers

Test #30:

score: 0
Accepted
time: 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0
0
1
0
0
1
1
1
0
0
0
0
1
0
1
0
1
0
0
1
1
0
0
0
0
0
0
1
0
1
1
1
0
1
1
0
0
0
0
1
0
1
1
0
1
1
1
1
0
0
1
1
0
1
1
1
1
0
1
0
0
1
0
0
1
0
0
0
1
0
1
0
0
0
1
0
0
1
1
0
0
1
1
0
0
0
0
0
1
0
1
0
0
0
0
0
1
0
1
0
1
1
1
1
0
0
0
0
0
1
1
1
0
1
1
1
1
1
0
...

result:

ok 99665 numbers

Test #32:

score: 0
Accepted
time: 398ms
memory: 41772kb

input:

200000 200000
1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1 1 1 1 1 1 0 0 0 0 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 ...

output:

0
0
0
0
0
0
0
1
1
1
0
0
0
1
0
1
1
1
1
0
1
1
1
1
0
1
1
0
0
1
1
0
0
0
1
0
1
1
0
0
1
1
1
1
1
1
0
0
1
0
1
1
0
0
0
1
1
1
1
0
1
1
1
0
0
1
1
1
1
0
1
0
0
1
1
0
1
1
0
0
1
1
0
1
1
0
1
1
1
1
0
0
1
0
0
1
0
1
1
0
0
1
0
0
0
1
0
1
0
1
0
1
1
1
0
0
0
1
0
1
1
1
1
1
1
0
1
1
1
0
1
1
0
1
1
0
0
1
1
0
1
0
1
0
1
1
1
1
0
0
...

result:

ok 99813 numbers

Test #33:

score: 0
Accepted
time: 481ms
memory: 41600kb

input:

200000 200000
0 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 1 0 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 0 0 0 1 1 1 0 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1
0
0
1
0
1
1
0
0
0
1
1
1
1
0
1
1
1
0
1
0
1
0
1
1
1
0
0
0
0
1
1
1
0
0
1
1
1
1
1
1
1
0
1
0
0
0
0
1
1
0
0
0
0
1
1
1
0
1
1
0
1
1
0
0
1
1
...

result:

ok 99712 numbers

Test #35:

score: 0
Accepted
time: 511ms
memory: 41592kb

input:

200000 200000
1 0 0 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 1 0 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 ...

output:

0
1
1
1
1
1
0
1
0
1
1
1
0
0
0
1
0
0
0
0
0
1
0
1
1
1
1
0
1
1
0
0
1
0
1
0
1
0
0
1
0
0
0
1
1
0
0
0
1
0
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
1
1
1
0
1
0
0
0
1
0
1
0
0
0
1
0
1
0
0
1
1
1
0
0
0
0
0
1
1
0
1
1
0
1
0
0
1
1
0
1
0
0
1
1
0
0
1
1
1
1
1
1
1
1
0
0
1
0
1
1
0
0
1
1
0
1
1
0
1
0
0
0
0
0
0
...

result:

ok 99800 numbers

Subtask #4:

score: 17
Accepted

Test #36:

score: 17
Accepted
time: 29ms
memory: 9056kb

input:

10 199991
37507664 194554609 209371390 279132948 336712965 55899332 339663138 116632087 630544272 741907097
2 9 1
2 1 2
2 8 1
2 5 2
2 7 2
2 3 2
2 1 1
2 2 2
2 3 2
2 8 1
2 5 2
2 1 2
2 7 2
2 3 3
2 3 3
2 2 3
2 3 3
2 8 1
2 5 2
2 5 1
2 1 3
2 1 3
2 6 2
2 2 3
2 6 2
2 3 2
2 9 1
2 1 3
2 4 1
2 5 2
2 1 3
2 7 1
...

output:

111362825
87285387
513912185
57782582
111668226
211052075
157046945
42763236
211052075
513912185
57782582
87285387
111668226
99383849
99383849
187385143
99383849
513912185
57782582
280813633
29502805
29502805
230148379
187385143
230148379
211052075
111362825
29502805
57580017
57782582
29502805
22303...

result:

ok 199991 numbers

Test #37:

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

input:

1999 200000
205692769 142360920 151664892 907598214 795405922 175632467 244285343 27143079 276583249 298501268 10594969 264860871 214952974 216471286 246014885 813525591 366151081 791406855 51362983 564502909 189581922 488801024 260871099 259427596 33809830 12440012 89525027 18182534 403088409 93881...

output:

10520410
204683661
144721089
157181441
8767676
31099310
113863300
57257400
301671345
179722383
92608287
96776505
120405092
63649273
283985405
379036884
62468336
302138883
315150725
261999205
46435570
108353954
228065350
126017136
38656602
223207564
355228904
130380556
485499977
34426856
176542595
15...

result:

ok 200000 numbers

Test #38:

score: 0
Accepted
time: 38ms
memory: 7696kb

input:

1024 200000
171427368 578387740 923641319 332112159 660372227 184317484 276202482 214731222 677891681 628664517 833055149 570271392 241753161 234487558 32670259 674218357 54020716 531052607 520008019 191806075 297436717 788502768 352112004 27479049 102580897 740120776 653287924 182405802 907490954 7...

output:

222179270
264087568
607239683
161938730
541833994
33742387
330008592
524852243
31274322
261649596
147025256
60384021
164683325
95912771
59528864
76518957
71732881
426010432
296347460
8517321
51117678
791218739
296093606
473746837
258225768
197702322
61054072
62307227
438754389
76908556
291323598
145...

result:

ok 200000 numbers

Test #39:

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

input:

199999 199994
858673443 225964692 493295103 926194890 726822964 191538614 839676471 907887358 475466309 187972675 148234387 645774038 979838073 786366569 77592748 916010169 46589025 314047044 614039436 597031417 924219392 680302052 964935085 414872286 579200966 451774789 586257655 380628125 25411189...

output:

195151422
74045317
354109989
668325708
909574
130036022
48401780
378943645
252940094
45301279
229828868
357270630
20607800
278381743
71131999
333626235
59009713
20916013
23035881
362585098
96321131
21377714
18523649
95089918
163618210
139905062
397910821
27505980
794769294
201226982
248933
97549717
...

result:

ok 199994 numbers

Test #40:

score: 0
Accepted
time: 185ms
memory: 39556kb

input:

200000 199991
85780249 594827653 706246193 40749596 859691670 205948107 892849857 146814285 70582796 380330815 926043741 796844866 308655323 816415533 314921371 325950271 884307536 953777742 802167806 333773046 30268328 463933386 43228669 263335047 458797584 948824637 452131582 777105540 21128358 25...

output:

46760765
2463938
18472690
68298152
221889045
36828713
220460600
7017651
138280519
16450541
129759517
90549184
85899355
62753777
139573129
361909268
147704200
258550743
232034638
35993664
27172945
22289215
16729951
267150177
271741443
7337025
153837103
6292292
57699318
250786133
557856552
82736648
26...

result:

ok 199991 numbers

Test #41:

score: 0
Accepted
time: 177ms
memory: 39584kb

input:

200000 199995
773026324 242437373 275867209 561156040 926142406 213202004 382614790 839970421 941866480 13380797 241255746 872380280 46773003 294552720 433585682 567742083 803166790 736772179 896199223 738998388 657018235 355732670 656084518 724437339 935417653 660511416 385101313 975360631 44145835...

output:

136096170
8847498
164453066
102671321
61235737
295787099
29536068
244296856
273921679
72068042
144411242
53248251
19374062
207163195
15550462
101944560
47460262
41026221
97428653
703941686
7758364
61204179
119486805
464872066
39714012
779589
116397905
39263988
128574182
13207328
5625685
20725739
975...

result:

ok 199995 numbers

Test #42:

score: 0
Accepted
time: 192ms
memory: 39500kb

input:

200000 199996
721644605 896526754 360204712 771603246 186753720 226180378 967345026 584465340 6990984 434883847 511784160 793576000 13198692 858464423 2923241 358781232 871809386 346240808 635972152 180018672 281962283 805236135 256025813 265950936 75412395 141468978 693891131 258484525 124369497 36...

output:

72215907
67574612
83886297
27627407
236864793
8614470
159865654
106027851
263804869
290587019
27876586
2171661
199382000
84763611
320356784
121735375
47474301
77425796
100409139
418257349
143704287
78735217
36294231
196430416
244212439
247203320
27462813
323585652
104918913
134879219
124120352
47170...

result:

ok 199996 numbers

Test #43:

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

input:

200000 199993
56693100 829330127 874822896 387934953 454656120 231937622 988601274 709545947 200799039 297111506 393424279 639269073 388924811 870464349 527371080 981704857 21658260 172616697 281713663 289457135 353898248 289231261 316820316 420071299 886237947 984514351 69743984 417095151 460659706...

output:

91576001
139484339
139043286
200247511
295274915
187726556
116664920
261800196
46625392
57402748
207032672
21842809
32068734
169133049
160919798
3427578
112911292
26997735
52059457
423611403
114406577
34286840
102063926
87069234
125457230
81164175
48177650
657573128
71260292
113944708
17292025
17129...

result:

ok 199993 numbers

Test #44:

score: 0
Accepted
time: 741ms
memory: 41736kb

input:

200000 199997
731253707 677059985 692914081 289166105 782579826 314232290 754894031 880971421 255263840 212502436 317310415 856068714 643133368 504862706 21111449 731962420 740807111 920149142 65352022 43771737 841844494 988602894 646361178 737451253 92364604 918569347 520091697 529673669 957762351 ...

output:

83982747
11392887
39433748
106287787
47218495
167023628
86134094
25372157
172860611
170222919
29806395
146878014
64053013
65912929
8848898
9923668
69877059
497874
1384895
47758699
204038620
39937917
58117408
12117145
53703665
60851778
64137246
80976449
68285667
30624470
69566401
86219399
34076614
15...

result:

ok 199997 numbers

Test #45:

score: 0
Accepted
time: 777ms
memory: 39500kb

input:

200000 199994
32036800 45890177 905865171 403688046 915481299 328641783 808100185 119865580 924122151 404893344 21410714 7106773 45659672 534911670 184731016 141902522 578525621 486170783 253447624 780513367 21635252 772234228 798331052 585914013 45637508 341910139 385965624 926151084 724713282 3077...

output:

172271959
9464712
120561794
47434834
66422598
27449620
3989759
23304032
40475455
63163370
28647039
10920778
56761208
3571534
41599880
79426907
4224428
65175389
39362441
20411200
140406907
85226776
132339679
70921417
22543498
155184903
80100433
3823845
373112881
86001472
10350124
36874973
50022664
10...

result:

ok 199994 numbers

Test #46:

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

input:

200000 199991
30610360 108645242 989911334 739961026 995122217 268969815 592181951 271322286 30071165 2716041 101327553 10776748 971703518 89966729 239574862 4181485 594546402 298237369 398608631 844595083 107410839 845912944 2750653 171379861 678550132 779381491 6274578 72227847 167942244 778615417...

output:

287017679
31478711
253099177
57591435
99666976
205090056
362714311
68995528
32782609
242870121
13941609
42071507
117358091
127306801
72634266
133269434
161173051
13505204
422561637
166242803
114291932
36373225
104543049
325395268
112733323
75787738
263645088
1909679
520636
238040150
7071530
20374833...

result:

ok 199991 numbers

Test #47:

score: 0
Accepted
time: 120ms
memory: 41596kb

input:

200000 199993
480320413 541745897 298480757 662046531 558785093 510401409 508382232 287260825 312928262 691459809 210427555 942619909 162103661 203307505 34309180 554697158 880683444 554649031 916935349 79871820 716693705 112272813 482171794 992149303 697518404 50950936 829860359 220664406 943130227...

output:

47739156
30616707
34176826
69312266
16251373
159171964
114322608
12978733
286467075
123802788
235323943
182663324
100743995
5482983
109416605
141281487
58714790
65878249
293365298
178284540
247591038
9679627
78550694
27868599
106438603
5477621
24452359
233054557
27100628
30899462
189639489
307248053...

result:

ok 199993 numbers

Test #48:

score: 0
Accepted
time: 167ms
memory: 41608kb

input:

199994 199992
868343126 24451914 40679351 695485222 520022084 945253564 957232231 874953299 792858102 462738924 925197474 475745859 379284070 675413682 820984570 985428518 159831617 19837203 43553717 936176221 455574753 757229385 176399558 43085939 26010194 25579450 763025359 349328173 32420177 4472...

output:

215595829
77739618
112442419
28622260
125667461
2384159
56762995
157209982
68779145
171863960
66047649
49770067
407962118
44992402
265105052
210354264
252569067
113743057
191040897
65549080
114108289
305699454
50831845
43150530
45451001
60416761
134717442
20383816
3022627
172091254
54610063
30160196...

result:

ok 199992 numbers

Test #49:

score: 0
Accepted
time: 170ms
memory: 41760kb

input:

199998 199998
182624015 580834220 856554234 728956680 481259075 306396664 332340406 388969484 199046117 234050808 566291103 8904578 596497247 73810802 533950904 342385287 512688845 558701664 96463030 718804333 194423034 328476901 944336378 20346290 428178273 273499 696190359 477926406 195451951 2602...

output:

80479806
53668179
79961939
84947161
6935524
221026506
20169786
141922030
87803872
164632729
35209217
65424887
97720059
3665654
47022135
114637370
17103478
10498175
29974
15409490
1732826
259864031
54502804
167706947
27657094
31090747
62228830
29262078
140236536
75878530
14500936
117880083
25145477
8...

result:

ok 199998 numbers

Test #50:

score: 0
Accepted
time: 188ms
memory: 39556kb

input:

199992 199995
570646728 63540237 598720060 762395370 442463300 741248820 781157638 976661958 678910421 5329923 207351966 615739584 813677656 545916979 246884471 773083880 865546072 23857067 223048630 501399677 7013137 973433473 638564140 71282927 830379119 974902015 629355360 606557405 358450957 678...

output:

218235492
151263290
169592567
181471212
64863492
130546315
87225985
34803044
30718999
114110588
123786036
135637998
90725518
125502122
339974640
293121637
70186415
59727970
102811042
100177284
89957465
4339533
71652444
223295805
85041589
73707105
11844093
231953439
76582146
64311003
52232254
8492664...

result:

ok 199995 numbers

Subtask #5:

score: 43
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #51:

score: 43
Accepted
time: 58ms
memory: 9132kb

input:

7 199995
11778582 170897052 799340250 14267050 94749094 496060591 351412126
1 6 59704314
2 1 1
1 6 437794080
2 1 1
2 1 2
2 4 2
1 2 262454123
2 4 2
1 7 60430475
2 3 1
2 2 2
2 2 2
2 2 2
2 3 1
1 7 72038827
2 3 2
2 3 1
2 1 2
1 6 11147456
2 2 1
2 5 1
1 3 948139594
1 2 885573814
2 4 2
1 2 508181213
1 6 55...

output:

159118470
159118470
625954730
5899910
5899910
785073200
456404083
456404083
456404083
785073200
442028214
785073200
534397659
536886127
83601638
19590673
437469913
478578719
539496622
642140540
220309356
477097243
220309356
641233691
220309356
519131827
906849
520038676
220309356
319187266
641233691...

result:

ok 100042 numbers

Test #52:

score: 0
Accepted
time: 373ms
memory: 14972kb

input:

37822 199999
664759255 254566360 67261405 32896494 26166136 511933970 946737719 332226520 291984313 593147736 21384286 133853027 896261362 379587244 192288097 56380421 235314791 343272832 279980605 765892265 620698702 30799794 44373984 916307881 482452939 534088602 45045542 593042638 664443638 68553...

output:

24455448
28924607
28823069
56106537
764323237
6903244
1585808
195450090
120080325
128051067
111257142
177817924
48802649
384350024
7753009
195165781
548207504
281110803
21291114
29821804
33113807
87635612
412806864
29284168
34334831
265588258
114023715
298731909
98123019
390541653
155840339
31630501...

result:

ok 100136 numbers

Test #53:

score: 0
Accepted
time: 420ms
memory: 23196kb

input:

83929 200000
630526621 690625947 839237832 531119494 964874264 520618987 978654858 519847431 693259978 923278217 917520754 439230780 923028780 397603516 978943472 990782242 996926248 82918585 822301928 393195431 728553497 256759716 135614890 610617512 624900293 188093077 535099384 830909426 95137128...

output:

176067647
174611448
441475683
9707212
99562117
238478762
311567581
247744767
164662030
4959855
148156402
114077448
159726365
88597153
141680884
31534700
65528056
118655996
61314288
14548032
58000496
85770939
82776690
408470357
198351652
272605745
148994604
204473308
108712604
95356738
28248244
87786...

result:

ok 99985 numbers

Test #54:

score: 0
Accepted
time: 458ms
memory: 25456kb

input:

111111 199997
965575117 623396552 280212495 147451201 159034842 526376230 999943873 644862503 960809856 785505876 799160873 284891086 225045844 409636209 429616720 540029579 73033300 983036298 468076207 502633894 800489461 814398363 196376625 764770641 361984022 31138449 910985005 989520053 43139456...

output:

309775709
19589419
240557909
49355286
224554662
23847545
241994095
7226775
142222861
267230734
22496184
13213091
1832711
838168876
26075903
44193284
157879957
76760420
225109826
257237100
175064699
82858934
245654227
116350992
16998
8265495
211820238
10913104
38081799
16639449
249574429
219288777
33...

result:

ok 100023 numbers

Test #55:

score: 0
Accepted
time: 541ms
memory: 39556kb

input:

200000 199997
931309715 59456139 52221687 645608667 24033914 535028479 31861011 832450646 288409233 41960069 621653820 590268840 251846030 427652481 142530271 400689578 834611990 722649282 10397529 129937060 908344256 40391051 287584763 459113040 504464143 685110158 401006078 153710552 935797115 657...

output:

509752839
282167422
133222888
152296114
51486648
560035726
62579408
89904405
329638696
334897132
130745156
4546209
42428664
142885025
55605621
215381047
129558923
163875100
868620416
406974477
206395090
113431344
44732478
102514568
63267253
121964177
200199645
251861198
472983074
372001482
481592850...

result:

ok 99881 numbers

Test #56:

score: 0
Accepted
time: 514ms
memory: 39560kb

input:

191919 199994
192649155 992259513 493196351 261940374 291936314 540818491 53150026 957498486 555926343 977864017 503261172 435961914 627572149 439685174 666945342 23613202 984428098 549057939 656139041 239408289 980280220 598062465 348379265 613266169 241547872 454446474 776858932 312321179 19837826...

output:

200118241
123783835
131510989
39820377
2496813
613345
369310732
36409189
3283621
15607138
67372599
165107448
341268044
132534203
147035316
153149549
17711132
91328392
376258981
164141325
353232758
114236554
164132245
56884285
496953236
250862394
73255346
401128778
320823824
32500716
117919265
602804...

result:

ok 100111 numbers

Test #57:

score: 0
Accepted
time: 435ms
memory: 29336kb

input:

131072 199994
158416521 354610045 191463722 760130608 156902620 549470739 11358110 71377573 957234776 234285442 325721351 741339668 654339567 457701445 379858894 884338736 672330500 288703691 124751308 940420511 14425959 897731442 439587403 307608568 384060761 108450950 266912773 550220735 702813581...

output:

631665773
115510352
33848056
2609007
107645752
9347072
8579595
105443786
9311570
110470628
9740119
111771921
175258350
54134906
15148939
76389535
79987538
40715460
180592348
236957533
188222777
17426468
64059626
75803752
146534415
311841740
838137500
143475952
188316249
24398872
176796353
122877531
...

result:

ok 99734 numbers

Test #58:

score: 0
Accepted
time: 473ms
memory: 31592kb

input:

131073 199999
794248110 656276379 919098530 490984256 557673726 569670243 85787744 509061396 819901142 288904009 985170826 738070802 358882936 499750336 67860764 917169696 659832350 754843046 32297476 786633371 266152682 165325135 652384547 310191690 675572 374804347 508672322 31566952 806054720 774...

output:

43281853
193069350
39823165
153386042
6135802
20695449
6484887
280459458
110038134
626148
256729413
252661073
240553384
194996047
173686594
223225994
38327985
87066803
195127116
152909033
29331915
148707886
182623977
42194813
119224443
279897171
127266562
100785521
445525250
108889465
24263610
37683...

result:

ok 100263 numbers

Test #59:

score: 0
Accepted
time: 445ms
memory: 31384kb

input:

131071 199999
760015476 18626910 617398668 989207257 422672799 578322493 117704883 696616772 147533286 619034491 807631005 43448554 385617587 517799375 854483372 777862462 347734751 494423263 500909745 413936537 374007477 464994112 743559917 4534088 143188461 28776055 72402450 269466508 236748209 73...

output:

158428168
139050934
148870206
237962089
42566133
42621622
45327397
9006316
118273328
28872899
4433471
50199857
95665239
123227074
79579087
259465932
35710740
71353049
13419694
266927727
36576854
242538699
78018503
24306406
92502307
130476972
63768398
19715167
61654881
29020170
16507637
4929479
18202...

result:

ok 100262 numbers

Test #60:

score: 0
Accepted
time: 799ms
memory: 39560kb

input:

200000 199995
150876538 353173069 910210456 63659494 148373734 641816009 351752980 998466720 943065527 176985656 579348608 419617580 223965280 649995159 180762054 114157251 922068419 732402134 899000896 544148872 91364655 157190865 338623159 626247315 472236646 712537173 911849315 940343272 71468226...

output:

21869858
97781044
26939694
61316703
14594295
90296533
195889652
38076435
90970726
165900374
42383552
40129868
58361107
154078919
180996
42667923
250730853
75610028
82867672
65307757
183380396
87434923
37267436
6932242
6602974
158113984
53190514
17312511
153545944
89529012
113281485
23006132
91645995...

result:

ok 99813 numbers

Test #61:

score: 0
Accepted
time: 420ms
memory: 41600kb

input:

199995 199999
68887162 240625967 893229200 413674438 224400897 100349987 218869700 792980091 157237049 732012196 872804947 673874367 22211281 248752880 377003110 914156295 166074861 907707189 532644247 352219832 209172509 843287439 663397102 492109352 408359266 966560781 656016613 659001756 6995501 ...

output:

82582234
363482705
230996895
184386945
5823816
54330597
245028814
14876258
252417911
14347738
9491240
38026722
354870201
20575778
121861930
2343965
7330033
382672208
28371733
137914490
198271767
284062766
177785
71487417
95385574
234607580
62220486
248861812
24849400
39346888
17293578
48104949
10651...

result:

ok 99782 numbers

Test #62:

score: 0
Accepted
time: 460ms
memory: 39784kb

input:

199992 199997
553915553 399257514 839396515 455489186 175906177 912350638 48310311 990749348 757108388 177716594 424163793 90240846 562114057 302039264 286580948 110376832 607170972 507595091 959328087 80488588 151201082 575749522 549592686 824231988 911118515 129589208 304012831 551355050 673930692...

output:

526642609
168954961
106490066
30377824
66473076
141547356
50885096
172256230
107133585
239148796
78857415
445263047
32040078
374181440
24711402
47015159
5607038
81962361
37719113
22086230
274535779
38723947
209574208
511482192
132347433
318134151
182890518
288180030
26543374
156562971
77219795
33991...

result:

ok 99806 numbers

Test #63:

score: 0
Accepted
time: 449ms
memory: 39572kb

input:

199999 199994
356564515 617677055 479594365 21594375 141992641 621757634 769944942 699710758 103309270 648653980 646962959 218601060 81078755 446651658 974934202 84572628 379070614 979142453 935897335 963972666 862168273 603227899 147836539 197753866 726169248 510050533 379745838 798108518 11318085 ...

output:

223827485
110926215
24105459
258266152
33306436
294302455
7394306
179711745
23153110
15943115
26153638
143362705
53166058
129617848
53952226
36091196
1917617
55088779
285671338
7165508
124674858
7062405
80239261
67353885
2382226
25995206
252114570
83167446
40818053
13900948
118065529
286015782
30621...

result:

ok 99846 numbers

Test #64:

score: 0
Accepted
time: 475ms
memory: 39788kb

input:

199993 199991
744587228 100383072 221760192 55033066 103229632 56609788 145085885 213726944 583206341 419933096 288023822 825436067 298291931 918757834 687867769 515303988 731895074 444297857 62548469 746568011 601049321 174475415 915773358 248723271 54628270 484679048 312910839 926739519 174349859 ...

output:

41975318
241082356
62865464
138227281
388632942
21433266
72736611
806797
9139028
203978589
204990872
158861209
14691939
69721676
133095733
228392302
49160789
31442759
34522683
210582789
11868123
355040211
297385029
74567251
278469758
4144592
50822093
115965149
41026626
5080893
65944942
193490374
264...

result:

ok 99769 numbers

Test #65:

score: 0
Accepted
time: 472ms
memory: 41600kb

input:

200000 199998
547236190 318802613 935634330 547461969 69316095 766049554 940429570 996397410 3116278 890870481 510855756 953796281 890965686 63435762 302479200 489532553 503794717 915812451 39117718 556375800 238372990 201921024 513984443 695954204 943388060 865140373 388643846 99783931 585413542 65...

output:

10215546
5315327
18260135
11005344
54173412
54191233
44468291
36069610
278224435
78877250
159613767
135866997
102025932
48772326
319010515
154093193
122432262
106745731
21921479
164909852
17866814
142312673
12700932
6494779
48083932
243455344
52074563
26237299
13010052
52382818
98333569
140717729
39...

result:

ok 99813 numbers

Extra Test:

score: 0
Extra Test Passed