QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#681628#1205. Growing Vegetables is Fun 2yellowbird100 ✓94ms17776kbC++202.4kb2024-10-27 10:28:472024-10-27 10:28:51

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 9752kb

input:

5
997051180 58 70
518922777 50 63
810437613 52 76
997051180 50 62
997051180 69 65

output:

177

result:

ok single line: '177'

Test #2:

score: 10
Accepted
time: 1ms
memory: 9812kb

input:

18
906488248 2 2
347508947 4 4
347508947 1 4
194909193 3 5
906488248 3 3
906488248 3 3
906488248 3 3
347508947 3 2
347508947 2 3
906488248 1 1
194909193 1 5
347508947 1 3
906488248 1 5
906488248 2 2
906488248 3 4
906488248 3 2
347508947 2 3
347508947 2 2

output:

26

result:

ok single line: '26'

Test #3:

score: 10
Accepted
time: 1ms
memory: 9808kb

input:

19
115754657 6 6
328471297 4 4
580249654 5 6
874884621 6 6
292673406 4 5
970065109 5 4
115754657 5 6
159979487 5 6
793438057 5 5
462934130 6 5
931754817 6 4
793438057 6 5
145437172 5 6
328471297 4 4
524468804 4 6
874884621 6 6
874884621 5 5
527503322 6 4
115754657 5 6

output:

54

result:

ok single line: '54'

Test #4:

score: 10
Accepted
time: 1ms
memory: 9776kb

input:

20
945877171 84158138 928621311
891713112 635877332 872964979
704821878 60439367 751070024
498627076 403761958 424474884
344501633 676309792 575959451
148418499 23496968 124709731
129605192 137120080 987038171
46589531 220511854 798228699
43302954 462249201 461381341
116846640 581455218 229648000
17...

output:

1300398223

result:

ok single line: '1300398223'

Test #5:

score: 10
Accepted
time: 1ms
memory: 7748kb

input:

20
372590985 39555300 673073787
507632036 276444524 13726720
601630852 75981549 184524435
988242108 139183064 525515352
429726876 298000479 524945688
340284638 316640814 143593666
914742069 554064092 898082223
38591156 886282276 946762152
325899360 352734695 121299849
137725482 971908015 908259388
1...

output:

2693366681

result:

ok single line: '2693366681'

Test #6:

score: 10
Accepted
time: 0ms
memory: 9716kb

input:

20
753637286 29 29
200859651 28 28
886966661 22 22
799132946 22 22
915418180 23 28
886966661 29 25
753637286 28 26
649199627 30 23
135473699 22 25
798304508 28 23
200859651 29 20
886966661 26 28
915418180 22 27
457874185 24 27
135473699 20 28
517201156 24 29
526357912 20 23
526357912 29 25
917924999...

output:

158

result:

ok single line: '158'

Test #7:

score: 10
Accepted
time: 1ms
memory: 9728kb

input:

20
958741178 556812544 421515110
103099711 331660534 251546782
103099711 893379466 676917658
958741178 880351744 954920066
9010022 625884994 670293826
9010022 907529201 634283414
9010022 391447282 190698844
103099711 901401655 563613065
958741178 915616033 964699368
9010022 382522306 978283987
90100...

output:

3949712005

result:

ok single line: '3949712005'

Test #8:

score: 10
Accepted
time: 0ms
memory: 9812kb

input:

20
910149571 39 15
825506021 86 33
814622109 93 35
807335459 36 13
667131372 92 16
652784786 5 21
424513562 6 6
281462791 39 67
208831169 79 92
79169000 28 94
92114038 31 5
183859467 43 73
550811804 55 12
603535119 96 56
620619896 55 99
638236915 70 59
725523679 84 56
744227181 90 12
874307409 78 62...

output:

453

result:

ok single line: '453'

Test #9:

score: 10
Accepted
time: 1ms
memory: 7668kb

input:

20
11571301 51 5
360006352 80 52
78480764 84 44
101845798 86 89
146438751 58 36
630608279 100 56
677044728 48 41
149323598 1 99
495059300 19 85
701174238 17 39
883742972 60 71
159180298 1 85
128849210 60 10
536599628 56 63
35366011 40 55
417702671 97 84
890153331 21 47
61491369 72 57
793025230 72 71...

output:

555

result:

ok single line: '555'

Test #10:

score: 10
Accepted
time: 1ms
memory: 11820kb

input:

20
978456234 919940545 508415155
917772688 552475551 938081608
709286758 395940938 760640803
664313123 334964389 562144591
591531978 162138673 600778271
514145921 232113543 109603680
511487023 528428784 722994951
245764800 567317410 22368530
243611159 206764669 989868628
227234730 362807681 67935186...

output:

3064225401

result:

ok single line: '3064225401'

Test #11:

score: 10
Accepted
time: 1ms
memory: 9768kb

input:

20
71582957 4 57
133412571 48 2
857182816 6 49
120529208 14 69
395011235 72 54
460063805 96 3
318501042 99 7
249384726 23 68
47715847 15 40
30765092 56 29
773179579 50 90
91901442 1 6
263257063 93 98
629530579 47 27
368293518 67 2
775764787 87 4
218165824 31 15
290490674 64 19
353865700 96 74
204327...

output:

463

result:

ok single line: '463'

Test #12:

score: 10
Accepted
time: 0ms
memory: 7764kb

input:

20
132984248 744808958 770782859
239185446 560773371 687625941
273922308 476343520 92407757
336125926 543294479 608319611
423270837 654672917 759960685
503687337 202215974 78102527
561840053 554582987 816105107
567738602 985125700 193613840
709819732 555283466 626378977
721871761 11137338 333825094
...

output:

10211523977

result:

ok single line: '10211523977'

Test #13:

score: 10
Accepted
time: 0ms
memory: 7692kb

input:

20
225263450 103 110
333285251 115 101
406768343 111 93
443258879 118 108
43460069 114 116
229688793 94 90
244629571 98 91
308804448 100 120
965471055 101 93
297308682 97 93
671290109 116 97
275706808 97 108
410803289 109 115
195890071 91 108
889511721 90 91
961368552 102 114
308269247 115 95
106094...

output:

1001

result:

ok single line: '1001'

Test #14:

score: 10
Accepted
time: 1ms
memory: 7836kb

input:

20
645947717 32 33
663052062 33 32
374698938 31 31
642422939 31 32
4983451 33 32
904960233 31 33
374698938 33 33
534260078 31 32
904960233 30 33
904960233 32 32
374698938 33 31
4983451 33 32
374698938 30 31
642422939 32 33
645947717 33 31
778675265 30 31
1671485 32 30
663052062 32 33
374698938 30 32...

output:

251

result:

ok single line: '251'

Test #15:

score: 10
Accepted
time: 1ms
memory: 9840kb

input:

20
739634645 40 37
836055062 39 38
838804460 37 39
30359498 38 36
466572807 34 37
189499122 34 39
697418496 40 39
747841765 36 37
60933334 36 37
191070118 38 40
966821640 34 34
221413192 39 40
378221282 34 34
807293574 34 35
960378263 34 39
510825209 37 37
57560001 40 40
975036971 37 34
763649952 38...

output:

261

result:

ok single line: '261'

Test #16:

score: 10
Accepted
time: 1ms
memory: 9872kb

input:

20
242597638 756204326 550265834
757677350 733502485 2040460
675614141 82787373 9128626
17081073 851062598 969132758
23166986 100829736 549539504
8334745 107410089 21538858
336937000 777601416 894693403
874926766 809880565 262905335
146172626 181163457 320675912
347368743 634192120 820147967
2316698...

output:

5704477386

result:

ok single line: '5704477386'

Test #17:

score: 10
Accepted
time: 1ms
memory: 9720kb

input:

20
964196581 528246070 584334753
943027329 365057317 588908909
863766119 420253946 817217113
662541315 144950619 770090536
622603827 170186609 761701843
155445150 181264280 598984118
72107133 431111313 765125914
113150300 461083450 105903859
119759364 800499174 906272650
150783638 624383868 64718995...

output:

3478405161

result:

ok single line: '3478405161'

Test #18:

score: 10
Accepted
time: 1ms
memory: 9780kb

input:

20
935909934 7 8
898013319 10 9
723653864 17 18
627128721 30 18
496440114 19 15
396746068 11 27
29657413 16 19
19791458 23 8
56413063 7 13
59098210 14 14
128210247 15 20
311954145 16 12
317869670 30 13
445671819 27 7
550605525 12 26
609394754 20 26
624629428 9 29
781705170 9 14
827642500 16 18
90428...

output:

125

result:

ok single line: '125'

Test #19:

score: 10
Accepted
time: 0ms
memory: 9724kb

input:

20
562896113 386075108 86882130
671978329 404094116 742361892
921899113 119975829 990195880
192166062 783595985 820849243
43116403 97627287 854443530
830146251 268243020 928807349
814043078 929113084 763149598
97898818 475789290 842512559
700370226 540428049 835133501
884188159 19523240 651374362
69...

output:

2467694222

result:

ok single line: '2467694222'

Test #20:

score: 10
Accepted
time: 1ms
memory: 9796kb

input:

20
931114616 678866371 160444518
856295268 282517498 275960087
794652492 154575956 4042328
578182575 953046405 21217448
413481109 518849688 828651193
210790796 678642571 365826532
130827986 889491795 656527138
917051 538162081 326679227
128595978 426718848 876206398
311650841 243348539 311634675
515...

output:

5639320763

result:

ok single line: '5639320763'

Test #21:

score: 10
Accepted
time: 1ms
memory: 9708kb

input:

20
781475027 37724071 565982115
193255985 487420629 793882074
193255985 233700445 135032020
172495631 813244775 9353452
193255985 975606597 148408647
781475027 11463558 952153970
172495631 179033928 961217105
172495631 925020844 126937116
193255985 536555732 430516452
781475027 815045430 956635822
1...

output:

4192997489

result:

ok single line: '4192997489'

Test #22:

score: 10
Accepted
time: 1ms
memory: 9820kb

input:

20
915143649 361237535 540283241
872090544 945813709 956782857
564507134 443262915 907998757
531460497 125824395 584924159
507310528 371917885 974032165
431875592 566846760 813950068
367953460 824939893 788690812
348937125 674741666 65542449
299554848 330811281 750406435
251169321 946524094 53866067...

output:

3987888461

result:

ok single line: '3987888461'

Test #23:

score: 10
Accepted
time: 1ms
memory: 9764kb

input:

20
37985122 62 56
142640068 50 60
155214077 54 56
36791126 80 69
961566525 72 57
513728489 71 77
589646706 65 56
507002210 65 54
731466042 61 51
92402602 72 50
621023471 66 76
658665985 74 53
246466702 60 77
111066025 54 72
88102067 63 77
841647342 63 63
191328208 74 55
343400345 51 50
137013089 68 ...

output:

584

result:

ok single line: '584'

Test #24:

score: 10
Accepted
time: 1ms
memory: 11796kb

input:

20
556887266 786003796 293352681
535546018 733271940 457037135
524966180 314151290 98812094
198357016 532676294 436454818
413541659 481724805 104197876
641766179 603970351 138540783
14040666 250499903 594395989
998235318 712498528 536623808
823660700 247299711 16527287
311166127 342205551 618629134
...

output:

4473496200

result:

ok single line: '4473496200'

Test #25:

score: 10
Accepted
time: 0ms
memory: 9780kb

input:

20
977926063 569959946 517946927
843989088 572817234 768448274
839920240 571870285 920789835
564747687 391250260 772787291
501349175 595559414 739887987
458627577 410751962 740283664
446474773 720710605 858190021
435638575 557764124 871709267
380519062 159970282 544465867
283945289 571725932 2005084...

output:

4006137335

result:

ok single line: '4006137335'

Test #26:

score: 10
Accepted
time: 0ms
memory: 7804kb

input:

20
856017290 758 773
800585727 198 494
691747129 356 792
273263142 772 289
453957100 757 212
133559166 337 339
142853789 592 598
182394838 316 525
423137196 763 550
229946420 765 619
820677156 230 189
813640813 801 822
922119624 750 500
240146418 428 727
128044373 827 250
882471399 663 203
522380755...

output:

3095

result:

ok single line: '3095'

Test #27:

score: 10
Accepted
time: 1ms
memory: 9792kb

input:

20
721270560 923166274 761799325
677500103 926757536 934762319
658807318 792122815 436435923
352265097 502725849 59424207
120644602 85822457 522494220
62933297 85732067 118336103
55727578 556244969 273400954
5223429 338299357 797047262
140155211 53635254 306051491
262664359 63783302 483496403
274904...

output:

2714931481

result:

ok single line: '2714931481'

Test #28:

score: 10
Accepted
time: 1ms
memory: 9732kb

input:

20
140547741 222978642 64202256
289053392 512598775 159637367
526112249 354666594 618229127
469888285 571599559 686170247
244061322 182853974 659739749
262794393 377175769 63200084
158031585 987024040 268929626
501404639 733762216 79168245
164098552 381575943 858670646
588554952 944039283 748976399
...

output:

3203509131

result:

ok single line: '3203509131'

Test #29:

score: 10
Accepted
time: 1ms
memory: 9768kb

input:

20
374742129 23 53
203344727 27 29
383561297 53 26
242566836 34 25
890243 37 34
61068755 42 42
896988599 52 51
278815208 56 26
550219763 55 23
742206698 45 20
640400764 49 43
629334154 38 34
48619713 31 29
864184925 49 22
525474598 38 23
70941078 33 32
205541610 27 56
509952660 29 20
76528080 52 44
...

output:

363

result:

ok single line: '363'

Test #30:

score: 10
Accepted
time: 1ms
memory: 11768kb

input:

20
342711434 54031743 129631345
190538748 745527427 627021391
161926322 770449319 962869811
125711484 183608500 391958025
58611328 181424991 1130364
34588569 149089090 109501526
88949028 980364166 494519517
151304012 691260059 318585707
195620579 104649212 472368141
213638301 886852098 296177173
220...

output:

4497446146

result:

ok single line: '4497446146'

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #31:

score: 10
Accepted
time: 1ms
memory: 9816kb

input:

120
171324679 880627365 279481111
317201704 504830655 489241521
490220272 992570505 195636892
490220272 59401063 296409746
549297011 204304001 537257594
961663940 200148771 714637477
100845995 164110531 574619614
469391183 11276358 56855524
749981343 937870372 22021951
309043046 112608545 61976770
3...

output:

8268340772

result:

ok single line: '8268340772'

Test #32:

score: 10
Accepted
time: 1ms
memory: 9804kb

input:

180
997958221 15774 14494
985048140 11603 12185
984212098 17976 11183
979427048 12129 15486
979349917 10646 10492
943856104 11470 17056
935601863 13451 11140
934618028 14823 17812
924798436 16223 13346
924246890 17080 13213
904211112 16335 10891
898471040 10233 16164
889363244 17150 15286
879920257 ...

output:

230317

result:

ok single line: '230317'

Test #33:

score: 10
Accepted
time: 0ms
memory: 11852kb

input:

250
998518130 489312280 100176380
971592827 744969880 726915345
968513276 595610226 547877640
958656034 522204198 805158045
952391809 185655789 86989063
946091651 101586035 305329599
942431400 892026688 15462753
933765201 717131422 276131548
927176410 313799868 6494650
914978138 317640633 794259443
...

output:

10976904780

result:

ok single line: '10976904780'

Test #34:

score: 10
Accepted
time: 0ms
memory: 9820kb

input:

300
599533 245 196
5181063 263 270
10352574 234 285
10855178 229 290
14225900 267 184
21763837 283 237
23887963 237 183
24036884 223 245
26419416 226 224
33011889 270 204
33132243 203 271
33401756 232 216
36100135 238 263
37220130 206 228
40068170 196 205
41058479 285 223
52752315 214 233
55737306 2...

output:

70531

result:

ok single line: '70531'

Test #35:

score: 10
Accepted
time: 1ms
memory: 9876kb

input:

300
210762356 317332620 696271453
553890343 806590612 374761269
328451094 247892942 491187190
131168073 997460978 739720321
547929387 270701051 503661845
352162759 683715738 25863850
697936411 69668760 66491602
792145839 539300770 739489697
873614959 150201379 983812873
616210804 109702867 615144942...

output:

7688770239

result:

ok single line: '7688770239'

Test #36:

score: 10
Accepted
time: 1ms
memory: 7696kb

input:

300
650814309 906594700 604617104
636985994 461564319 556340981
636985994 201827019 107904790
650814309 440425691 348920377
636985994 708423325 118893955
636985994 831652472 190231684
650814309 469485113 84132197
466810588 726511632 537964280
636985994 633549534 545974134
466810588 37241075 21442838...

output:

47393684007

result:

ok single line: '47393684007'

Test #37:

score: 10
Accepted
time: 2ms
memory: 11768kb

input:

300
299860199 56077869 978861958
622532666 657855315 422585062
149577400 337796134 600081028
947524188 129235303 856808201
746901338 954901585 325020000
721080362 443076821 111733675
420520465 984351814 784468919
55672101 578284549 539277941
474525697 338224651 894157999
65989657 476769485 83126060
...

output:

8452853151

result:

ok single line: '8452853151'

Test #38:

score: 10
Accepted
time: 1ms
memory: 9792kb

input:

300
999246621 893 859
998276902 863 807
976325465 844 900
974577982 875 843
961404958 876 900
956025770 849 820
927384584 805 880
919655265 850 826
918238424 829 867
916871079 833 862
907454655 825 831
895791978 860 837
891354900 842 866
889392893 885 842
885777062 858 855
878843324 835 826
86922473...

output:

16224

result:

ok single line: '16224'

Test #39:

score: 10
Accepted
time: 0ms
memory: 9836kb

input:

300
15062131 995944398 784717461
439440599 619987564 748651821
56441025 533416716 93228737
112538749 335869024 316641928
14192828 654118907 168027801
909870828 143294993 480563557
362621317 691834607 403352882
925105973 240206093 790347362
130365456 109714674 135674556
608983954 376778427 785648525
...

output:

7214278373

result:

ok single line: '7214278373'

Test #40:

score: 10
Accepted
time: 0ms
memory: 9784kb

input:

300
447970268 78066392 892592135
10416277 426408427 293066099
198154220 249332597 908365110
533872913 481622218 73930749
739839232 62980617 653551518
906090888 480364930 734657471
181367423 664366320 592627019
302784891 11218817 970982870
696752871 114829983 398343255
546135009 102335128 359487767
1...

output:

6344133935

result:

ok single line: '6344133935'

Test #41:

score: 10
Accepted
time: 0ms
memory: 9884kb

input:

300
586594972 379051493 493043202
39801779 434373940 933872401
683561943 847291237 549384472
95404099 75323890 59948888
240486257 519037395 514529540
147241038 995969594 50036531
275788486 466966083 787038843
208765493 636231185 877030649
2063439 991530693 168312337
239830267 379011734 520106577
193...

output:

6797744512

result:

ok single line: '6797744512'

Test #42:

score: 10
Accepted
time: 1ms
memory: 9784kb

input:

300
5942000 38366 81895
19785600 69021 68284
26886323 76901 70673
30546700 19484 68926
61038677 67064 28509
67199965 88624 69520
71483482 31312 88864
75335024 8822 91295
86966083 55895 81377
87199601 10321 26298
90748780 29491 27053
91061013 69190 70132
92314069 31485 82896
94247724 58327 74495
9515...

output:

14508429

result:

ok single line: '14508429'

Test #43:

score: 10
Accepted
time: 0ms
memory: 9744kb

input:

300
299805851 474411184 169771503
356261150 717434303 989319437
851912863 752192107 821365140
71651555 7283232 873351453
326536091 886215614 531874534
169239294 809233848 41255763
822160020 9618537 314383316
931308275 654064985 597571344
824753383 806245857 10723922
574297591 735564019 704426567
131...

output:

7420162325

result:

ok single line: '7420162325'

Test #44:

score: 10
Accepted
time: 1ms
memory: 9784kb

input:

300
996767656 9274324 1195411
990913165 2533047 7651372
983752500 357424 9313858
41323963 3999644 7105982
978935784 7631792 8330372
968034993 6148423 4496617
958472961 8753694 1766364
956447298 1093190 1433095
951415301 824900 3324125
950023035 9543813 7901653
936860847 4264832 7302336
913127446 932...

output:

138355598

result:

ok single line: '138355598'

Test #45:

score: 10
Accepted
time: 1ms
memory: 11744kb

input:

300
73845345 853936928 636693415
117678838 922987188 697444984
245625740 751134415 864037643
245625740 211863368 591224205
117678838 879750684 94014973
73845345 219898004 938358404
117678838 549643367 30820967
73845345 176772734 742290945
245625740 833056314 603188296
73845345 611051260 769860894
11...

output:

62716439541

result:

ok single line: '62716439541'

Subtask #3:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #46:

score: 10
Accepted
time: 1ms
memory: 9884kb

input:

500
401733023 410243821 893323189
576633669 301800644 735050721
99398839 50293275 344971550
700929498 803227737 445485050
183987848 126002333 190496038
328158212 132615901 409959294
75169333 929018758 942717465
578625052 494900620 339064434
155692593 98144500 346552596
199192537 43573479 608178824
1...

output:

6903197376

result:

ok single line: '6903197376'

Test #47:

score: 10
Accepted
time: 0ms
memory: 9816kb

input:

1500
999928046 15 19
998732499 26 30
998597257 16 23
996886210 14 21
994274315 15 16
993344916 27 21
992894190 30 30
992875800 25 12
991394753 13 21
991313044 17 11
988497375 27 16
986445831 24 26
986304169 24 24
983968222 16 23
982801796 16 25
981817616 21 25
980843538 23 20
980445568 12 14
9777380...

output:

666

result:

ok single line: '666'

Test #48:

score: 10
Accepted
time: 3ms
memory: 9876kb

input:

3000
143023882 13 4
46384340 7 17
443194755 5 13
30066040 12 9
783245468 12 13
115771662 5 14
541158625 11 3
373504139 5 3
628269651 16 11
711873172 17 6
814966163 5 6
385765392 16 9
476816353 12 6
149423288 4 11
48948915 17 11
336579259 7 7
248933702 7 6
111411318 15 5
239624404 7 17
184813649 7 8
...

output:

310

result:

ok single line: '310'

Test #49:

score: 10
Accepted
time: 0ms
memory: 9892kb

input:

4500
999681432 724782940 50960580
999252408 368442687 16455141
998633630 983253906 789908337
998049588 930196836 418465595
998029753 725609729 657610625
997274476 592849936 901250699
997118098 68350925 475990366
996375587 842659167 132533831
995862033 122923730 865423796
992728444 821013717 22245398...

output:

43827114236

result:

ok single line: '43827114236'

Test #50:

score: 10
Accepted
time: 5ms
memory: 10052kb

input:

5000
794955571 350047822 743578815
188963910 730258997 165783090
18976707 172547894 735089053
507441553 58448835 727992200
125224054 911152306 717540634
528243411 63692205 440621521
692510312 497630617 69151010
432030234 642486310 99423908
41442176 545278389 450297464
733401896 58950201 145766209
27...

output:

14290914942

result:

ok single line: '14290914942'

Test #51:

score: 10
Accepted
time: 2ms
memory: 7896kb

input:

5000
281263659 948182326 599762850
666969945 541098764 660860577
124394593 18959491 45273957
124394593 29709454 42390530
666969945 58506416 787855964
281263659 924599799 677005197
666969945 928242388 86294171
281263659 678512440 255472496
666969945 618815240 965162993
281263659 610438082 494452025
1...

output:

798241134691

result:

ok single line: '798241134691'

Test #52:

score: 10
Accepted
time: 0ms
memory: 9992kb

input:

5000
437038 899600705 846721744
496788 926014121 969933517
1121150 859914888 813913083
1781575 995107015 845415150
2025495 915523969 898660626
2709193 876428047 975652988
2828672 970016921 809027003
3620633 891241879 846016961
4269684 882317991 867231519
4672054 901513287 858808944
4736482 870476863...

output:

4496293862867

result:

ok single line: '4496293862867'

Test #53:

score: 10
Accepted
time: 2ms
memory: 12032kb

input:

5000
967535174 128380070 276492423
721367563 766372848 750748353
759220262 217467990 431965971
767785399 340022703 873765742
612882514 845091899 736618559
762682341 750338552 910848904
898773948 155265104 430889554
120867485 756003674 927036030
444326445 160904987 722535762
126791039 448310531 86877...

output:

9893757132

result:

ok single line: '9893757132'

Test #54:

score: 10
Accepted
time: 0ms
memory: 9808kb

input:

5000
147888681 49 43
693205677 42 47
693205677 45 42
693205677 43 42
147888681 41 41
693205677 47 45
147888681 49 45
147888681 42 50
367840574 45 40
147888681 40 50
147888681 40 43
147888681 44 47
693205677 46 49
147888681 40 48
693205677 42 47
693205677 41 47
367840574 44 42
147888681 40 48
1478886...

output:

76440

result:

ok single line: '76440'

Test #55:

score: 10
Accepted
time: 3ms
memory: 7952kb

input:

5000
998915462 464 582
997885907 685 379
997792995 133 415
997713615 398 787
997645416 712 331
997531180 743 112
997384133 213 292
996891401 605 413
996464506 126 79
996292642 629 67
996224279 509 416
995921003 171 606
995540793 501 517
994832079 593 229
993852689 786 216
993723950 627 421
993613744...

output:

23873

result:

ok single line: '23873'

Test #56:

score: 10
Accepted
time: 3ms
memory: 8000kb

input:

5000
999713446 125 129
998166472 128 126
997948821 124 129
997118083 123 122
996536046 128 121
996432066 129 122
996272409 130 129
995753386 126 125
995425015 127 129
995285468 125 123
995140224 124 128
995128217 126 127
994793384 122 127
994780867 121 127
994671215 129 129
994516339 129 126
9945096...

output:

5247

result:

ok single line: '5247'

Test #57:

score: 10
Accepted
time: 4ms
memory: 9924kb

input:

5000
266758050 6 6
36928484 3 1
107404234 4 2
144637034 5 1
216145585 1 1
164186250 5 1
749491749 1 3
863392750 6 6
362361850 5 6
760752715 6 5
571465924 5 2
953153986 2 3
324017750 6 4
445212714 5 4
737252576 6 6
23222953 2 5
298570284 6 6
997551772 4 4
263183808 1 1
267298408 1 1
55987147 3 4
4873...

output:

88

result:

ok single line: '88'

Test #58:

score: 10
Accepted
time: 4ms
memory: 9948kb

input:

5000
122943734 153882510 734991714
437062340 788124813 46616681
268708354 110858283 969907816
528941383 406788621 180141396
817066409 463686725 112659557
714025863 354778108 124415065
404680339 84602833 906247607
472403612 390143008 576572178
444610511 133879833 655480408
516988813 863477360 8608222...

output:

15038048932

result:

ok single line: '15038048932'

Test #59:

score: 10
Accepted
time: 4ms
memory: 8040kb

input:

5000
414251208 2 2
264082462 3 4
364136070 2 4
685877642 1 3
759024721 4 4
544024073 2 3
351192035 3 2
727689429 1 1
856306077 3 4
832287471 1 4
675074840 1 1
206485524 1 1
343802801 2 4
218693554 1 4
994924122 3 2
817512196 2 2
170333484 3 4
4264985 4 4
16495240 1 1
159129369 1 2
588993768 1 3
6937...

output:

60

result:

ok single line: '60'

Test #60:

score: 10
Accepted
time: 0ms
memory: 11896kb

input:

5000
999731719 130200998 947986236
998832712 221908515 655223524
998416566 603607985 720425301
997638838 979147376 267149199
997521371 934275542 736940752
997323174 122801465 448611498
997283540 528718811 849619622
997011396 202677356 791764125
995840575 258332693 428252783
995475681 661658574 96085...

output:

23556233318

result:

ok single line: '23556233318'

Subtask #4:

score: 50
Accepted

Test #61:

score: 50
Accepted
time: 12ms
memory: 10816kb

input:

20000
762514361 851567990 22808569
50027505 149821970 131601942
122598390 742331524 570458485
56508479 333155572 682138264
338950840 140009516 828880571
58608796 693907405 456498177
105315802 855457425 423530647
715707348 473255468 946845277
54268148 601361227 650321057
780077004 993791210 547699014...

output:

16714403696

result:

ok single line: '16714403696'

Test #62:

score: 50
Accepted
time: 32ms
memory: 11968kb

input:

40000
870425278 198 224
803500260 186 239
683171237 240 221
642088157 195 193
365427410 201 227
679930997 237 195
530559796 222 180
184253826 231 189
677970853 212 188
696372234 194 238
406470494 217 196
476795769 215 192
915428665 221 239
411270857 212 222
131289861 237 180
723414268 184 225
556561...

output:

4832

result:

ok single line: '4832'

Test #63:

score: 50
Accepted
time: 49ms
memory: 14328kb

input:

60000
492438963 76587483 534536972
70466861 668554794 36282832
265107786 362713922 801460023
880101194 668545420 351249373
87892596 607085217 41473665
124391088 510427439 490923534
344806883 798967315 378103178
191658404 792202531 807651314
659457105 397500058 21992904
343515683 24400226 28969939
95...

output:

17113938903

result:

ok single line: '17113938903'

Test #64:

score: 50
Accepted
time: 68ms
memory: 17160kb

input:

80000
153889195 67 49
356922663 61 62
658802168 66 75
87408114 50 51
165734067 59 49
122443541 71 44
906624333 69 42
318127798 42 76
355408365 40 48
35612101 49 65
779347699 52 56
176203790 73 49
137120 68 75
92222835 47 40
382120738 52 75
246770777 62 40
582474283 55 47
205090609 77 65
734355901 72...

output:

2086

result:

ok single line: '2086'

Test #65:

score: 50
Accepted
time: 70ms
memory: 16504kb

input:

100000
999911627 431942551 888226073
999908235 490765293 808669902
999834642 754798705 42022451
999785749 102643418 381127541
999779065 768305976 837913806
999772212 3250420 520974723
999770255 456034152 471096262
999763729 843085371 23859640
999736404 87185142 949027199
999733229 919478582 96710735...

output:

162754509487

result:

ok single line: '162754509487'

Test #66:

score: 50
Accepted
time: 93ms
memory: 16452kb

input:

100000
565693090 43577257 668475668
947293017 852588730 29405614
358775940 859314536 780894187
227931788 729824717 417749646
251500253 963226879 831918355
927586544 619904262 140888297
216540184 823887706 855492432
842260408 207465564 693720202
962899493 359275538 186125473
760990137 814811572 94371...

output:

17154280251

result:

ok single line: '17154280251'

Test #67:

score: 50
Accepted
time: 85ms
memory: 17708kb

input:

100000
17700532 30 34
113303401 35 33
129003873 30 30
442613282 34 30
671320144 33 30
79302385 34 34
329309886 35 34
746022388 31 32
435213065 33 30
590417722 31 33
411912368 30 33
753222608 33 35
254407645 35 34
805024164 32 35
963528920 32 30
691920773 33 31
124403749 35 34
343910335 34 34
5220158...

output:

1336

result:

ok single line: '1336'

Test #68:

score: 50
Accepted
time: 70ms
memory: 17676kb

input:

100000
999924978 30974854 775827960
999921972 423634823 57290821
999887778 914201450 173289747
999849776 455776366 866942556
999804600 515386373 119067575
999801422 855368864 948877591
999798437 240645202 732732948
999785849 467479608 609830864
999776320 950447022 215167708
999738394 98349030 591045...

output:

267590813397

result:

ok single line: '267590813397'

Test #69:

score: 50
Accepted
time: 83ms
memory: 16496kb

input:

100000
632927583 190 301
209239399 241 260
986555703 261 300
619462433 218 233
922448730 278 290
286437263 180 265
359555672 285 190
708303587 192 313
83410454 238 294
851798888 222 214
205606408 244 252
65267946 196 324
123327640 266 281
617908245 208 310
444667820 230 293
765980053 319 298
4952566...

output:

6853

result:

ok single line: '6853'

Test #70:

score: 50
Accepted
time: 87ms
memory: 17776kb

input:

100000
120903628 8806724 417461533
171305141 390601524 59385683
409712294 550244246 104095178
861425846 255120370 759081037
724121728 393884128 100829757
718621564 924536522 852710875
30700928 93135560 118366633
234907055 812070250 440035408
316109492 980685307 370003529
915827484 577896484 14312655...

output:

17015075793

result:

ok single line: '17015075793'

Test #71:

score: 50
Accepted
time: 69ms
memory: 17052kb

input:

100000
2920 220505133 851933945
12835 587846864 355635118
19502 16709384 325527818
40387 725103409 622413089
45682 10551400 485101170
54971 494100793 38326565
55919 370050012 29880692
60743 484585259 325648702
61048 781306232 663443775
62701 902480219 728745768
76908 814762653 387034529
79768 251206...

output:

47095429542107

result:

ok single line: '47095429542107'

Test #72:

score: 50
Accepted
time: 85ms
memory: 17664kb

input:

100000
808728743 7235 4311
741031460 5994 1259
274457619 1581 5516
278146566 2649 5965
656243363 6068 4640
852971679 4208 3561
26887035 7130 4009
840866563 5810 3782
307634368 2495 7205
122946176 2875 3461
583270535 3804 3111
685900689 3410 5571
284369146 2714 7477
983553402 7229 7870
755264518 590 ...

output:

168526

result:

ok single line: '168526'

Test #73:

score: 50
Accepted
time: 87ms
memory: 17672kb

input:

100000
312409373 455338104 61949392
375111255 49258229 380068902
599217979 49758355 201843564
86202590 932244492 962117796
429012875 705176097 481595443
47701437 428813278 601550969
308909274 752727988 429772209
919527593 146419575 656742825
42001269 463380352 419171901
175605278 117756861 859271556...

output:

19475238590

result:

ok single line: '19475238590'

Test #74:

score: 50
Accepted
time: 88ms
memory: 17168kb

input:

100000
886027278 359899337 10197135
237684702 14796902 627237149
305923602 258470359 624967917
969343548 634508414 741338139
970309690 306395439 420144098
770990019 624976081 20089394
876675205 595859744 519370513
121259657 231342342 987113553
73892275 468560339 961067687
227151312 928261978 3280738...

output:

18119960491

result:

ok single line: '18119960491'

Test #75:

score: 50
Accepted
time: 81ms
memory: 17564kb

input:

100000
265307960 44 32
940428214 58 43
706421195 31 58
862625882 41 40
328709866 53 38
800030 58 58
417412529 53 34
756222694 34 30
917527534 53 23
901927067 26 53
281408453 28 58
827624840 50 31
684520548 55 50
975229270 30 47
877226331 24 50
119603604 43 37
500032 51 20
393611826 27 57
340310228 3...

output:

1272

result:

ok single line: '1272'

Subtask #5:

score: 20
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #76:

score: 20
Accepted
time: 11ms
memory: 14316kb

input:

20000
250523323 113 121
712368082 140 102
304421453 104 133
53398848 118 95
980880491 135 114
60587510 94 109
468048670 87 106
996160085 84 87
337374493 108 104
424601142 128 88
403287299 135 138
205725229 84 102
734625175 133 102
38963332 122 112
98403868 119 81
151745826 122 128
898725580 133 100
...

output:

3161

result:

ok single line: '3161'

Test #77:

score: 20
Accepted
time: 30ms
memory: 13484kb

input:

40000
635060582 313986717 601690726
425279275 486938480 243277267
548731064 97371298 382904282
821049688 144470259 139511811
302552415 346232554 607705958
299000974 919159392 556752680
743381124 168144463 687153911
842083420 953544689 127063827
211405744 37940909 62522401
485102961 309520625 5625674...

output:

14188396433

result:

ok single line: '14188396433'

Test #78:

score: 20
Accepted
time: 37ms
memory: 13728kb

input:

60000
999919828 26903 75074
999905248 34379 70254
999769306 16059 69428
999693607 78819 74524
999626757 12598 15648
999552909 59054 58381
999551933 20495 10316
999517695 75400 71515
999504285 38959 47472
999496807 69344 68000
999470401 10804 49564
999467185 64039 41463
999460925 58828 25536
99932977...

output:

915158

result:

ok single line: '915158'

Test #79:

score: 20
Accepted
time: 16ms
memory: 11316kb

input:

80000
421615812 443369163 933918370
553780769 209737386 782188768
55362077 160158857 44510115
55362077 965852781 121873426
553780769 528383953 675884905
553780769 919327336 955297252
553780769 373618785 783392171
553780769 62288126 23027094
553780769 904683434 194440366
553780769 482058752 437609815...

output:

12649384146542

result:

ok single line: '12649384146542'

Test #80:

score: 20
Accepted
time: 78ms
memory: 14536kb

input:

100000
615515918 585321840 588720947
450519087 385882742 690353051
541590926 522355438 130750617
415755067 616272164 34227772
447483058 216891860 90753792
501699033 288580265 26539689
934001446 928267542 285362728
948836581 53267092 16393677
706126265 292458344 286986512
738211608 690207703 89305973...

output:

20402825323

result:

ok single line: '20402825323'

Test #81:

score: 20
Accepted
time: 78ms
memory: 17612kb

input:

100000
571235243 71 75
822180276 75 77
999646644 76 75
358835624 72 78
213150090 73 75
311783103 70 75
140474468 73 70
490142272 78 74
48433324 72 76
285922477 72 76
573067736 75 70
747554576 78 72
483044485 78 70
102751 75 77
52476960 74 73
996315710 76 70
658320810 77 70
626821444 71 70
711810642 ...

output:

2738

result:

ok single line: '2738'

Test #82:

score: 20
Accepted
time: 83ms
memory: 15388kb

input:

100000
325676391 454774096 338046742
945005045 608805593 949121134
53291928 383344203 940130221
978139560 269563819 315404709
371749881 141349825 331421009
221957169 145890171 868330933
998221968 57652697 971072299
67135700 286585234 979029232
857535203 133776072 678526809
292151781 533011813 134908...

output:

21374739103

result:

ok single line: '21374739103'

Test #83:

score: 20
Accepted
time: 13ms
memory: 12216kb

input:

100000
634719043 61 57
634719043 50 65
598117946 70 60
634719043 50 70
598117946 70 64
598117946 74 60
634719043 66 66
126903808 72 53
634719043 73 58
126903808 76 65
634719043 60 77
126903808 69 56
598117946 54 62
126903808 63 61
634719043 69 60
598117946 60 64
126903808 68 60
126903808 76 67
12690...

output:

2112771

result:

ok single line: '2112771'

Test #84:

score: 20
Accepted
time: 94ms
memory: 17336kb

input:

100000
875654645 131954999 375293379
376203140 438775077 247394017
935956098 849883615 397194186
557952189 642709341 52923975
717283165 439003705 852967957
64447706 333411011 847191690
315691338 404083599 453829783
15119222 435612948 42310243
72541688 803459091 809589482
639866481 858585623 62726190...

output:

19339727249

result:

ok single line: '19339727249'

Test #85:

score: 20
Accepted
time: 88ms
memory: 17752kb

input:

100000
880026401 104 176
966729003 122 53
434213029 178 183
441913261 71 89
519715596 66 105
566016986 142 155
852125570 102 84
807524233 61 49
480214415 161 131
418912577 168 45
106703212 175 99
137204128 165 95
385711584 91 165
789223690 106 104
564416947 48 131
812224382 170 107
960628835 102 139...

output:

4299

result:

ok single line: '4299'

Test #86:

score: 20
Accepted
time: 71ms
memory: 17712kb

input:

100000
999929672 393786784 556840442
999921839 434692056 515882805
999886667 205579816 718983186
999860330 105360605 462009463
999829428 445615695 774006991
999745586 610276497 33743790
999715718 435277881 211778305
999707152 643812879 709325830
999633328 521713655 902016282
999631041 818308539 6889...

output:

246551914338

result:

ok single line: '246551914338'

Test #87:

score: 20
Accepted
time: 20ms
memory: 11984kb

input:

100000
583117496 50 66
583117496 79 50
74102225 58 93
251307540 90 60
583117496 81 75
74102225 83 87
583117496 75 68
251307540 54 73
251307540 76 47
583117496 87 49
583117496 65 88
74102225 67 94
74102225 72 76
583117496 47 64
74102225 58 69
74102225 48 90
583117496 94 57
583117496 72 53
251307540 5...

output:

2417863

result:

ok single line: '2417863'

Test #88:

score: 20
Accepted
time: 92ms
memory: 16596kb

input:

100000
291373585 193715237 10263170
611951054 494263128 77192964
371626633 327892088 931321376
83288224 99315895 67279970
934543848 6166411 154607169
806517926 459270292 311308321
815323869 193010053 54069255
623632480 340318152 27750119
129156908 914578280 255096278
102915776 50591318 650675942
861...

output:

17781447812

result:

ok single line: '17781447812'

Test #89:

score: 20
Accepted
time: 83ms
memory: 17616kb

input:

100000
385411563 2223 1922
556216688 2101 1815
194805847 2161 1830
762022864 2368 2023
57801739 2339 1818
975129259 1899 2207
53401609 2151 2327
321609656 1904 2384
482414481 2080 1953
356710711 2401 2427
41901268 2198 1918
498914979 2478 2113
286708614 2178 2407
152504589 1882 2220
69302094 1938 22...

output:

75968

result:

ok single line: '75968'

Test #90:

score: 20
Accepted
time: 88ms
memory: 17224kb

input:

100000
125946958 180490448 732629524
282944497 735893088 982170871
318615051 579748921 462589848
214498773 734756783 577830596
933384703 440565155 106255141
36040380 500693271 80580114
596454505 15355570 633320545
293791014 522923217 394014505
405885479 68762905 301501196
554720127 89713277 31727243...

output:

21332241840

result:

ok single line: '21332241840'

Extra Test:

score: 0
Extra Test Passed