QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#196071#6510. Best Carry Player 3ZhangYiDeAC ✓34ms3848kbC++14805b2023-10-01 11:48:062023-10-01 11:48:06

详细

Test #1:

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

input:

8
4 5 0
5 8 3
9 2 6
15 28 5
97 47 8
164 275 38
114514 1919 810
0 1152921504606846975 1

output:

1
2
3
5
11
6
331
1152921504606846975

result:

ok 8 numbers

Test #2:

score: 0
Accepted
time: 18ms
memory: 3572kb

input:

100000
84 318 6
54 226 7
92 33 0
39 54 5
76 79 7
247 110 0
211 90 0
4 430 3
230 17 1
491 93 5
196 117 7
137 29 2
76 490 6
422 43 7
277 26 4
159 43 1
67 37 5
17 2 5
113 176 7
85 473 0
68 217 7
275 8 7
124 34 1
30 66 0
80 149 3
103 149 6
84 354 1
27 342 7
94 114 1
69 125 1
72 48 7
361 8 7
285 82 1
74 ...

output:

87
45
59
6
1
137
121
213
213
150
21
81
156
95
95
116
12
6
16
388
39
67
90
36
35
17
270
79
20
56
6
89
203
108
26
15
157
98
111
389
174
123
59
289
78
17
21
36
275
191
17
102
60
93
100
11
6
79
44
63
91
60
22
109
11
3
10
67
11
85
207
47
39
83
156
189
107
27
81
247
81
335
33
144
11
50
54
347
233
175
30
7...

result:

ok 100000 numbers

Test #3:

score: 0
Accepted
time: 19ms
memory: 3696kb

input:

100000
322 25 2699
83 407 606
157 77 162
358 3 4064
407 35 1145
15 491 801
174 95 1886
67 93 2573
415 7 2014
16 203 2003
95 357 453
287 14 1247
63 108 3617
124 30 3806
116 425 830
483 63 2237
97 123 1194
124 460 2729
71 99 818
118 24 527
92 236 3298
446 55 413
0 122 3335
193 64 318
55 201 3120
475 8...

output:

1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
3
1
1
1
3
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
2
1
1
1
1
6
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
1
10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
114
1
1
1
1
1
1
1
1...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 17ms
memory: 3848kb

input:

100000
460 16 1999514420
38 120 459071025
36 5 435961014
415 44 1634888670
236 110 1172545331
116 449 1722938168
9 55 1093539809
98 9 2009254678
160 13 874849076
72 59 307472779
94 278 829310177
375 21 1588655085
85 272 1310414813
101 309 2072973009
96 370 510582365
55 6 285781515
45 99 743723479
43...

output:

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

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 20ms
memory: 3668kb

input:

100000
102 211 434535176914392191
113 382 10473939473902551
154 70 347749780432060530
307 4 770301859497555482
21 88 1148164284941713103
141 52 298799672146159282
86 67 592474494235856008
126 423 500925453682730053
72 23 751099353059890065
105 60 591595972426609814
1 312 322398882693527462
488 21 29...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 numbers

Test #6:

score: 0
Accepted
time: 26ms
memory: 3600kb

input:

100000
900433230470865373 168 0
274936233345873548 263 0
107 912910047733415890 1
148108377912190269 159 1
637618261092082754 433 0
206160758979307706 117 5
374274670768546935 258 4
84 460392244654734212 6
568787141853147589 410 2
412 739540468281060656 2
420 372651009036366141 4
99 7542107804877648...

output:

900433230470865205
274936233345873285
912910047733415783
148108377912190110
637618261092082321
77310284617240347
140353001538205004
172647091745525298
426590356389860385
554655351210795183
139744128388637146
377105390243882372
137260618027802044
228162758321107513
238496406926521455
4701988644786694...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 27ms
memory: 3616kb

input:

100000
188 488898411793715829 1662
510531470828119181 461 3880
438 860056315149583446 2443
42 812320392335060663 3402
217505267941559099 476 1869
733654172372163727 264 3646
489 830976331637915910 1805
320 291401742311195413 2413
727350143139117155 212 3564
741441713302666228 127 3543
235 6311872086...

output:

716159782900951
373924417110438
629924058947449
594961224854780
318611232336267
537344364530392
1217250485797728
213429010481833
532727155619470
543048129860350
924590637678442
364977615196297
623513894326819
700013580991870
919332840637041
328404862469641
208593246441270
504345408627412
79159378552...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 29ms
memory: 3600kb

input:

100000
257065522585566918 30 1812115310
83844174930688960 422 1624142137
375 469381000404632137 2011601386
3 867947326951574129 565346038
492077250720556083 481 302247286
12568100705985631 46 1125722166
920283886245013913 437 1819207161
447 543496034445506022 1182065585
303 120270820941724589 262528...

output:

359116387
117128959
655717681
2425016818
2749695913
17557433
1285621738
759255190
1344131167
6268476244
3054607769
1236129328
238549747
166968007
1286435771
6436773067
125390267
2868985966
1322338912
945384623
1498197809
539118172
640614664
1478520541
626183317
9372581165
1142622586
1236092431
13418...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 30ms
memory: 3628kb

input:

100000
428068929935037839 388 630663327499068933
262 958123279540916859 771299383434598713
428 822514876586340933 987799047076516848
237287479925224365 312 424435087833422191
701225953118656766 161 833708981315149466
394956250518140170 204 217521001178891893
257 1053780657770182567 11160907334756932...

output:

1
2
1
1
1
4
1
1
1
1
1
4
5
34
2
16
4
1
10
1
2
1
2
2
2
2
1
2
1
1
1
5
2
1
1
13
1
1
2
2
11
7
64
13
1
1
1
1
1
2
487
1
5
8
5
1
1
1
1
4
4
1
4
2
1
4
10
1
1
2
4
1
2
10
4
5
1
2
2
2
2
5
2
4
4
1
25
1
2
10
2
4
1
1
13
13
1
1
1
16
1
1
1
2
2
47
7
1
7
1
2
1
1
4
2
2
4
11
2
11
1
1
4
2
2
7
2
2
4
2
2
2
1
1
1
1
1
1
1
2
8...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 20ms
memory: 3696kb

input:

100000
85 421507 4
496297 10 7
356332 44 3
76 577303 5
351031 94 7
58 140834 6
29 933102 3
38 216181 3
546264 89 7
31 422649 5
109311 68 5
120 513750 4
497068 79 4
65 86390 2
283497 42 7
75 649345 0
71 38397 6
613856 39 7
594802 87 3
1032126 38 7
529937 74 6
90 63617 3
199780 82 0
19 286420 2
792882...

output:

158034
124073
178144
216460
87735
52791
466537
108073
136544
158483
40966
192611
186371
64743
70865
649270
14372
153455
297358
258023
198699
31765
199698
214801
594589
203256
187717
156414
193355
248657
12460
160862
788822
482410
333798
343807
106109
410238
173416
893773
143015
115984
252105
134100
...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 20ms
memory: 3616kb

input:

100000
392435 60 3657
48 379529 2580
460273 13 529
178138 58 1250
65 172539 1647
383884 81 1122
60 818634 2731
811128 118 2044
28 58969 589
514487 106 2905
874719 68 1312
46 578211 1635
84 856790 3883
876243 3 3395
46 631287 185
106 240163 97
114 1012795 3666
35 34985 3175
1 419802 191
49 657088 262...

output:

286
278
1348
260
253
562
599
1188
173
376
1282
847
628
641
7397
5628
742
25
4919
481
1378
286
755
602
5
712
514
265
2509
517
358
298
151
958
148
843
19
1456
466
775
136
145
406
385
691
22651
749
88
148
629
1620
322
739
643
983
547
85
616
3038
490
514
346
2350
238
703
424
242
5332
389
112
313
334
461...

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 22ms
memory: 3596kb

input:

100000
185932 2 938020241
122 450092 247160688
421772 121 1933778669
191969 15 1053606012
830655 15 1697646325
16 741472 1012788245
114212 108 1939020027
1023243 68 875622059
157245 122 1686052494
53 525698 181916400
97 330187 1577084801
44 26023 632336853
442318 10 747297252
480154 50 721797770
811...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 27ms
memory: 3540kb

input:

100000
121 831582 1132382698460100719
854677 9 791000264142579750
114 594892 718123681588947593
81 198907 307112382652039393
647901 37 783561625628024954
83 232049 374223523517787944
597370 34 559296931095396836
503871 20 818832724331892685
802313 21 911117211700034289
17 922367 1114109760856744511
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 28ms
memory: 3664kb

input:

100000
1117862588729209192 762936 3
51787830086551971 1002999 0
196674022833618532 538452 2
1082937251836821513 10186 7
416454037132497157 220619 3
140455106307683420 325948 4
407028 147347965053157557 7
2070 331803764565270332 5
1085729941037194683 197609 0
480451279180004754 947702 7
1806930993983...

output:

558931294364223128
51787830085548972
147505517124810060
270734312959202833
208227018566138270
52670664865259052
36836991263187633
124426411711975599
1085729941036997074
120112819794764265
67759912274129249
21308561722547452
102925549516609787
272930161441196065
141673678896096145
1055958431742256509...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 28ms
memory: 3836kb

input:

100000
985847471568982965 676880 2029
371404268141610691 941633 1066
755437147530254580 711705 2945
774090 722706686208136825 3723
54520 896774967379280920 2713
219965 686986400756587945 3117
102640172347630747 635043 380
56365 653855598747418224 3315
477262 448502573787259708 1967
146799 7252580754...

output:

1444112507180136
544049220909184
553298692038240
529326186187035
656817603060958
503163867741481
601407259845678
478898143613791
656986192070482
1062389758934749
52064696158245
941685793855428
559425073200021
805652028169206
664596806558066
4202331239419321
1262247837130710
687903680710997
130880521...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 26ms
memory: 3676kb

input:

100000
329358874618991013 193926 1861315148
199319758836385240 654883 882120846
314346 262913994609852844 1053497487
1017229 665510310561347538 619188376
436544 445409479104980301 1117236068
593128 437153441727580149 2076848805
129816233779422452 1024161 1243937151
924004001869553483 721209 13132490...

output:

460109032
556892972
734573215
1859414327
622229854
610696303
181351183
1290818678
1299852079
762058444
1309785401
4019433799
5920828865
6134797009
236480954
1311986099
594877967
2810221058
694363724
1368260812
2244349727
2480789429
124270837
678726092
1610423407
559609507
3050154839
1527667756
13884...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 25ms
memory: 3600kb

input:

100000
211791903010682984 1038358 535289827231177928
639594184787170459 469458 328856594957100884
587279 450401032845407848 730831795215014583
900020916033422919 865031 1100282449791494376
593820172742961795 204920 984080826401173681
853023782666264310 689931 784150389810194141
73535045456261069 477...

output:

1
4
1
1
1
2
1
4
13
1
5
1
10
1
1
1
4
1
8
5
5
1
4
22
5
1
5
1
2
1
1
2
68
22
1
1
2
31
1
1
1
2
1
1
1
1
1
634
17
1
1
1
1
1
1
4
2
11
4
4
2
2
2
1
2
1
1
4
1
19
1
7
2
1
2
1
1
4
1
2
1
4
1
1
2
16
1
4
1
1
1
1
1
1
2
1
11
16
4
2
10
1
2
1
37
1
1
5
5
5
2
1
1
7
1
1
1
23
4
1
11
1
1
4
1
2
2
7
1
1
2
1
2
5
4
19
31
1
2
4
...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 18ms
memory: 3536kb

input:

100000
1437942565 43 5
233522811 73 2
685503186 5 6
1200375515 41 3
112 697453465 5
12 1053068003 0
166843878 33 0
794516384 72 0
13 1726680934 4
1331715935 114 6
106 1290615558 4
855468459 94 0
1981952243 44 7
34 140266324 3
1329475226 7 1
1486922341 19 4
115 266577576 0
989178412 70 7
34 193954228...

output:

539228445
175142053
257063694
600187737
261545008
1053067991
166843845
794516312
647505346
499393432
483980795
855468365
495488051
70133146
1329475219
557595871
266577461
247294587
1939542249
324535700
606307860
683791781
32417176
445452003
1333791761
232423116
252561332
384160543
1386260830
3895105...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 22ms
memory: 3812kb

input:

100000
750914597 40 1901
534716046 109 2559
1582066673 61 1769
113 1909787022 964
86 1449875704 957
43 1537130136 1559
832677927 38 1191
112 1167713080 598
36 238371756 2467
1320983099 84 2846
4 606010098 3054
45 1689211823 1100
2022593191 60 3590
16 1442487521 765
973165753 127 2983
81 189329502 34...

output:

1099972
391637
2317480
5595078
4247682
2251655
1219744
3421034
174589
967516
443854
2474431
1481392
4226038
712768
138670
220435
1041241
2975038
2957677
1119485
2715832
572593
1493527
519721
66056
181288
1526644
411406
12335828
544250
871849
7233058
1708618
1556176
1215887
4064140
7114532
2914075
30...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 24ms
memory: 3596kb

input:

100000
7 212840355 1351365326
325418128 123 2107758625
1110761471 46 920576804
132180347 13 612895632
27 1760170375 542674255
313451543 109 1743977216
44 1091009299 480895092
23 484821208 1439315252
126 1103409846 1171365624
72 1190132595 1446675505
15662534 110 684191360
125 781989597 544947517
24 ...

output:

1
1
4
1
5
1
7
1
1
1
1
2
1
1
7
1
5
1
14
1
1
2
1
1
4
2
1
1
1
1
1
1
5
1
1
5
1
2
1
1
2
1
1
1
22
1
1
4
1
1
2
22
4
2
4
1
2
5
2
7
1
4
1
1
1
4
10
1
1
1
8
1
127
5
4
1
1
2
1
1
7
5
1
2
1
2
172
1
1
2
7
1
4
2
1
1
1
1
1
1
1
2
1
7
11
2
1
4
4
1
2
4
1
5
1
76
1
1
1
4
1
1
2
1
4
1
235
2
1
2
2
1
2
14
1
1
2
2
1
1
2
1
1
1...

result:

ok 100000 numbers

Test #21:

score: 0
Accepted
time: 27ms
memory: 3616kb

input:

100000
738645303 44 516300324926153733
6 2817393 921008837249510931
735824990 25 924626853631078712
75 1887692236 132671755297217183
123 436370401 47934974366463749
120 1875330451 701688582743216444
1208403246 7 471267810286592170
97 700505811 990921976869001194
34 2093211186 463456366822251
2094508...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 numbers

Test #22:

score: 0
Accepted
time: 24ms
memory: 3600kb

input:

100000
482660647546476097 1185031966 7
164808124 740618915243965567 6
1801791413 793117080257705718 0
1395821708 1048793452358556891 1
1932981956 31899692695022089 1
1318914151 656924813513699198 1
620404249181623260 1589178242 1
1589928614 827930147024380905 5
174947014777385743 1332587881 3
327929...

output:

120665161590361035
277732093154684041
793117078455914305
1048793450962735183
31899690762040133
656924812194785047
620404247592445018
310473804537919611
87473506722398931
59759728989590520
438337529107067266
208326416947422147
5209863496365379
257164449140175276
156827145366961996
382455907069504124
...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 25ms
memory: 3572kb

input:

100000
365437149714877541 1780464145 3269
637665292855593723 585150453 779
1325634327 725054698761495561 2255
1102361302 722006281113885907 64
910600682584658691 1184235350 1173
933289468 466162208405300515 1671
1220414966 230250531813092131 2258
600153265 857658903444502658 2657
319928929258538259 ...

output:

267654161084775
1868160035948565
531045920973532
16922022187770109
1333887716895153
682854796101579
168640525336435
628168141731702
234322945584345
364554617624560
10083313349337318
559135113254025
705964639257085
508007409691767
1047453526675991
9312448475486
870042621223819
638146394969433
1224754...

result:

ok 100000 numbers

Test #24:

score: 0
Accepted
time: 32ms
memory: 3604kb

input:

100000
854675358444377326 2119263737 149247452
1727006082 336779754515641632 602149100
700882962 356680850180255478 1381730310
1502599769 609802764365901802 586385085
224585295343627463 2113467115 750638527
564763801193041533 1312647739 745638395
156356867706250590 365191461 1335875908
1085894972074...

output:

9551741442
940951761
498277391
1703769238
627484062
1577931829
218428021
1516977750
1078474986
1451101464
697835241
3982860671
289577792
4940114727
2648274483
601936878
1529461266
213771006
1245581185
838226301
3219713566
340915506
1382000421
1152660972
2032713934
304324927
3146727525
974763210
9914...

result:

ok 100000 numbers

Test #25:

score: 0
Accepted
time: 34ms
memory: 3836kb

input:

100000
1434620072 868292152925984526 969590329142935034
758406947148898454 950016661 899090649112510540
867695890485660915 870003428 275252443500128738
234426442167893487 1546397228 409848412401881244
17485296530777613 1457516901 434590951680082740
541374948 332496545751374519 796002481753142832
338...

output:

1
1
10
1
1
1
1
1
1
1
1
5
2
1
1
1
2
1
1
1
1
13
1
1
1
1
1
5
4
1
4
4
1
4
1
4
1
1
1
7
13
1
7
1
4
2
1
1
2
4
1
1
2
2
4
1
1
41
23
22
4
1
1
1
17
1
4
2
1
1
1
116
1
1
10
1
1
1
4
1
1
1
4
1
10
10
4
5
2
4
10
1
1
4
2
4
1
1
4
22
2
1
1
2
4
10
52
1
4
7
4
11
1
4
1
4
1
4
5
1
1
1
2
1
1
2
7
1
1
1
1
22
2
1
1
155
2
46
1
5...

result:

ok 100000 numbers

Test #26:

score: 0
Accepted
time: 21ms
memory: 3800kb

input:

100000
39 346489936481992578 2
19 938605854271045828 2
533972989469209375 30 2
92 664357542641453386 1
61 24997380520790761 2
100 899955567648592547 2
72 102663594750289139 5
557235412803812906 79 6
67 483964315599574872 3
108 816568261692802994 7
111 1066384252622684834 0
71 93681462634521057 6
102...

output:

259867452361494404
703954390703284357
400479742101907009
664357542641453294
18748035390593025
674966675736444335
38498848031358400
208963279801429811
241982157799787403
204142065423200723
1066384252622684723
35130548487945371
512352167152943310
156258961358861999
1002098132581363271
1534765011739728...

result:

ok 100000 numbers

Test #27:

score: 0
Accepted
time: 26ms
memory: 3628kb

input:

100000
67 452739344572491893 2747
119 971079485269879233 3193
32 344467895301239544 3433
183301704200822394 62 2903
33 763471348854530836 304
48 673975553329542227 3047
12 425863113085566329 690
451368902032819204 70 2817
581844031383386694 78 3753
495222713547669423 114 832
332967009692678301 19 37...

output:

331596199638055
711239857375399
252295821753838
134254177881461
4473464934694516
493634438473786
1247645839117870
330592457543569
426155296423378
1450847793596687
243872321552254
41081364198478
8361647497761787
739458400291859
5636774061988582
615460750049881
325709562764707
3004000133377
1062263140...

result:

ok 100000 numbers

Test #28:

score: 0
Accepted
time: 28ms
memory: 3596kb

input:

100000
58 37300143208110277 1617222872
860745148898492456 1 1371084676
367389542906006331 99 1888733613
1130661363847188255 23 703420111
74 1048463439723743560 981941239
488415894311982589 30 760622661
608233717117417177 39 2023852401
108 791366799669143885 1026690628
1018098089268157420 26 97664934...

output:

52107697
1202447083
513237262
3159031357
2929373011
1364618245
849692686
2211053296
2844533200
4375860793
1394512055
251072341
1780476817
925441331
649437424
1248681016
109090708
2936523934
1290417148
883098115
207989293
1348195003
959221424
169218335
370268471
2477465782
1214792168
1546732468
46533...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 30ms
memory: 3832kb

input:

100000
342471042011595857 32 87226565166468789
40 819401467523789587 694266742627594346
48 1069630456235229270 1119026694174612869
111 658375227778071907 1075990422795071768
114 1045029262577394099 242040158122154919
163896217459514741 23 556399655940251050
251258157228644499 16 336100450849996694
4...

output:

7
2
1
1
10
1
1
2
1
13
1
22
4
1
1
1
4
2
7
16
1
304
1
5
1
5
2
4
1
7
7
1
1
1
1
1
1
10
1
2
2
1
1
1
5
1
4
1
11
1
4
4
1
1
4
7
4
10
1
1
2
4
1
2
1
10
2
1
2
1
4
1
1
1
10
8
1
2
4
1
2
19
1
2
4
2
1
4
4
1
1
7
41
4
1
1
1
1
1
2
1
2
1
1
4
1
1
55
10
1
10
2
1
1
1
10
1
4
5
2
1
1
10
5
10
1
1
1
5
2
1
1
4
4
10
1
1
4
1
10...

result:

ok 100000 numbers

Test #30:

score: 0
Accepted
time: 32ms
memory: 3800kb

input:

100000
152598024252556634 681654813376472939 3
681938946300942863 628897116094378528 5
811684279997734855 270403556967279343 3
672017587820376686 897601668331566194 6
912345664171921371 568781582077049448 1
374814196103956320 211610288105962177 4
347285812072843961 586812129155809702 1
1066037307509...

output:

264528394561958153
19890686327461625
270640361515227756
84594030191696067
343564082094871923
61201465499247804
239526317082965741
788467533416657595
219925561594958321
117205748047025513
100717880539089330
737554201043623548
133231266027956184
49724331158429930
365606842775771163
151239744525625879
...

result:

ok 100000 numbers

Test #31:

score: 0
Accepted
time: 31ms
memory: 3596kb

input:

100000
592726515487329224 429035372458611525 3557
901106767948864261 503456228772786564 1751
96314421358194503 913574556376953011 1141
390352892147563481 620635509950221179 2166
739846426899529064 371334464192841288 1690
1021557121699862580 614090573068717599 288
966158256440584566 70981740347419960...

output:

119890973897985
582495906996207
1197158400906387
168664026710932
539812445371125
2387499308385616
375499296337479
217202675308020
1019407257080643
676939477460419
504438557238913
1608057103560525
213583066896348
1835261361867519
35943234730259
328403961154489
410097847827405
280036780713565
23410269...

result:

ok 100000 numbers

Test #32:

score: 0
Accepted
time: 29ms
memory: 3604kb

input:

100000
567213331731061155 847461263624081717 1117404261
693118528681237547 385911455040269094 2110725569
160842822646904494 216660015199408165 1331217885
530693905413793180 140069811669875203 378880871
738103499814402870 419383843958127482 933994897
727669139897338527 158507491000465434 76432787
425...

output:

391501838
429163326
77975718
2182782220
890492430
12721754215
1635618013
365334591
1116886032
130852706
4643892717
1363541163
752816520
877244164
285316143
4019423907
168262805
251343106
23772743
1138735545
1251824790
2750255892
1796647639
937542135
597988647
5291409339
748772740
929519049
24533883
...

result:

ok 100000 numbers

Test #33:

score: 0
Accepted
time: 34ms
memory: 3576kb

input:

100000
1045557359662210853 853864343798662305 936192839816843204
528273158249108026 1052645593213902395 548804101449971471
711026077457415003 804057235279512905 1061801069946384788
797778816121912908 133233860528402977 1082197052750853322
530764695067707856 136729970998134649 897028734433829579
5395...

output:

1
3
1
1
1
2
1
1
1
1
1
1
7
2
6
1
1
2
1
3
1
1
1
1
1
6
4
4
1
2
1
3
1
2
1
1
1
12
16
3
2
2
1
1
6
3
6
1
2
1
4
1
1
3
1
2
1
15
3
2
15
2
1
9
18
1
1
1
3
1
12
4
1
2
3
1
6
2
3
2
33
1
2
3
2
1
2
2
9
2
27
6
1
19
2
1
1
1
1
3
4
3
1
2
1
3
1
1
1
2
4
1
5
2
1
1
1
4
1
3
8
1
1
7
2
9
1
1
1
3
1
1
2
1
1
1
1
2
1
1
1
24
1
3
18...

result:

ok 100000 numbers