QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#760093#9552. The ChariotNailongGroupAC ✓23ms10748kbPython31.8kb2024-11-18 14:44:242024-11-18 14:44:24

詳細信息

Test #1:

score: 100
Accepted
time: 11ms
memory: 10584kb

input:

5
160 27 41 3 12 3
160 27 41 3 12 4
160 27 41 3 12 99
1 999 999 1 99 999
999 999 1 1 99 9999999999999999

output:

160
187
3226
999
10000000000099799

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 14ms
memory: 10592kb

input:

2077
63 88 64 47 55 88
4 75 38 53 33 41
41 1 28 6 13 100
57 88 77 35 5 48
100 36 97 24 93 87
57 25 26 84 62 18
29 11 33 88 86 71
33 16 7 4 73 68
50 65 72 14 43 78
15 31 72 42 39 29
31 10 76 58 35 89
39 55 99 11 16 82
21 18 57 44 80 16
38 31 99 58 59 69
24 22 69 76 14 83
96 40 56 31 14 36
75 84 27 57...

output:

126
4
310
114
400
57
29
561
300
15
62
312
21
76
48
192
150
130
97
636
76
32
112
180
39
138
36
605
30
23
88
76
285
20
330
325
174
128
32
36
1
36
30
24
192
170
17
88
83
102
140
86
52
81
25
44
8
21
180
49
51
145
55
82
31
85
156
70
158
21
84
48
156
51
145
174
156
86
2
73
83
5
200
117
44
6
152
58
122
26
...

result:

ok 2077 lines

Test #3:

score: 0
Accepted
time: 13ms
memory: 10580kb

input:

2077
4 2 6 3 5 3
6 6 9 5 1 4
6 5 6 8 7 8
5 6 2 6 5 9
3 6 4 7 7 6
10 6 4 9 3 8
8 2 7 1 2 9
9 10 1 5 7 3
10 7 10 2 5 9
10 8 6 10 7 7
2 3 2 9 9 2
8 5 6 8 6 2
6 9 2 10 2 6
3 5 10 5 2 5
5 2 4 5 4 4
2 8 6 10 4 4
6 7 3 10 2 8
5 3 3 9 6 7
5 3 9 4 7 3
8 10 8 10 4 4
4 9 7 9 3 10
9 9 8 4 1 1
9 10 8 6 7 1
6 5 1...

output:

4
6
6
10
3
10
36
9
47
10
2
8
6
3
5
2
6
5
5
8
8
9
9
6
13
10
28
13
3
10
9
4
8
32
9
23
27
11
16
4
19
10
15
3
5
8
3
20
1
8
5
1
73
6
7
5
9
9
16
20
6
9
1
1
2
1
3
24
2
7
12
3
30
12
9
8
25
14
10
21
10
6
4
8
5
9
10
3
14
10
8
17
8
10
2
6
5
4
18
1
13
6
10
2
14
3
4
10
24
3
8
7
9
1
9
6
4
10
4
4
20
10
6
2
4
14
2
...

result:

ok 2077 lines

Test #4:

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

input:

2077
1417 6409 9808 8816 7324 8530
5662 460 4915 2005 2448 7568
2364 6496 4478 9681 3398 4981
209 5212 2936 6744 841 7952
1624 4340 1128 7953 629 822
8548 8999 6702 1024 8649 3885
5481 6872 8501 3410 8413 7190
4763 2043 1656 4873 6240 1807
7865 5379 9761 4618 3415 3368
4091 5946 3144 3012 6738 4325
...

output:

1417
22648
2364
418
1624
34192
16443
4763
7865
8182
3254
7443
86816
7163
7657
34604
7606
3257
3033
18189
3225
17562
7560
14346
26664
14046
9261
29724
8342
5908
7590
17668
8738
8309
12168
7047
40800
9192
18648
9195
8935
8819
1969
6080
14334
6511
9074
419
7982
4578
9693
11504
20433
2097046
6050
3431
9...

result:

ok 2077 lines

Test #5:

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

input:

100
35536173063230675474372606727057241871490558788794679195579356708141439871609632246 61501577129508313030285232710985015233972816339881035444668942634613530833743277701 69977916214375545701616716206226956278311775009117120846318542023125616332108000926 10050605559008930496140983766520146625049146...

output:

319825557569076079269353460543515176843415029099152112760214210373272958844486690214
450560525702174822675186703542069011573945860191648382960759195841400159544341224669
95330623252648094277257142015852094363067783723454076033290618532125267190925051
1777633606276319797578182384890019944082898623010...

result:

ok 100 lines

Test #6:

score: 0
Accepted
time: 13ms
memory: 10620kb

input:

100
27617223436350200283167612380427755086919233236220002664283192538263695236207991904 24208495979381798085875453581540557535168142482714452392350977196830285412065557639 58564524392293912103986330932367021242171363180777480593317714805582101784998460630 76615895837656212115270200095047400796915042...

output:

27617223436350200283167612380427755086919233236220002664283192538263695236207991904
87292880408308830696242450650003813718392417734570796139825586196653804148504332324
2243643448060891488969234170818908126849228932280094041884548577352094675056317608
6865459361426655168544467745969250961734474493686...

result:

ok 100 lines

Test #7:

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

input:

2077
4860 9866 1167 236 7596 3197
4841 3579 8767 6961 1376 6810
9064 9416 6529 7179 7687 5921
5891 483 7844 4300 6619 1692
9091 3274 7728 9861 6360 3561
7750 4744 2863 9293 4259 3631
7838 5643 2250 972 3922 2905
2776 470 2103 9431 6128 4521
2244 8597 8546 9802 715 6745
4589 2626 4956 6382 9098 8342
...

output:

68040
4841
9064
5891
9091
7750
23514
2776
2244
9178
1191
8970
15234
2416
16486
4504
190
1526
5658
13210
5763
4604
894
3305
6806
6086
8197
66220
842
62220
11602
27207
401
12384
4911
7390
8172
7552
4646
8345
9696
9255
1445
7013
962000
12070
7178
6434
106800
11097
4916
18786
4708
191912
6747
25700
9512...

result:

ok 2077 lines

Test #8:

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

input:

755
3929471836 62694 62695 62677 5808 20545488
848791 4613 4615 184 67808 128804
1712405854 91504 91506 18714 11361 9394425
1333207361 89405 89406 14912 59861 64977749
4168649572 76662 76660 54377 18493 7939044
7470761760 76482 76484 97680 3098 89084152
7427490330 77327 77329 96053 42847 111536698
5...

output:

1288078824018
594172152
859627464198
5809335650215
608607258778
6813334113264
8624798245085
516154678076
1554543417367
679601914588
1225389951605
74935221524
3695533644224
3800878040617
2470941963256
3628010083143
7377949269202
299612721670
1806371323009
1356913708574
4917313846071
1405638747628
201...

result:

ok 755 lines

Test #9:

score: 0
Accepted
time: 15ms
memory: 10708kb

input:

395
55744175100770010491 6349026815 6349026815 8779955846 4797632528 316078410444
21275756610054382673 2221625425 2221625427 9576662371 612911704 4807484510239
34302889979011935427 4783299425 4783299426 7171386721 5977114900 5321168946972
1143510247013975246 357293224 357293223 3200481202 9827516961...

output:

2006790303551532055861
10680429818240635225573
25452744364379023091910
4543099882037006617001
15218474509280131302227
17592562880580601901777
6647451067852558390522
75616010137513228624262
5052394147013299602742
77208643845618963483496
4584577740653838902644
4554471434932323799572
810959745735396611...

result:

ok 395 lines

Test #10:

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

input:

202
507126494418065393401357456690895351758 8819719604997617151 8819719604997617149 57499162913377267760 43910206553632799941 30474556344089951912795
8873908215533543066594337566156302744853 91984589256404286481 91984589256404286479 96471683868672716455 31323431856094084132 48428785302073703660407
5...

output:

268777042041574658441929059498903664656855
4454701924197838619333479524069996891338125
817211918074502648589873857193301418973696
9302117332015610822376046866250247132470096
86843338407130487906622834666176800715282
9105245869528230787680995008103761494033949
3193716823003648600336777439786910400800...

result:

ok 202 lines

Test #11:

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

input:

4
4338481318474030632417267104746824384342652333365162056394908957106139115480409624657653232265326571790489153902676703119139282462831828046766981301596739355264412026922803979802766956783274062884477586821837751268936093008499550337317983179543298654569396641523737631737178333088847214497379053319...

output:

321137295120906741714788469665696011467701551958835295060276472620103579938145411290154710923795234519840012022836844758784546153376898350212518357932129474943872464078172947148435997685199680589888246018188073610835130980258078408116918752698485233467675367668373772808661295171713144137042662600775...

result:

ok 4 lines

Test #12:

score: 0
Accepted
time: 16ms
memory: 10644kb

input:

4
1338322677990333737935546163712818993314016363460483758470888123904967199401736018146323126032790678003641993668435890770076004836205244503876361411534302658357834009122573485032598524741673633237841390599186330444712718855608391563134782840589515420395207524908355858865988880404687808299771369513...

output:

816182811118939399925095125739528147206092696075159060014144666293432773246812182951115538455994812892540291819549088238756655829687761787697947299021978494230312632924249846956992925206003275784649827956499434261465729177909544542191334270624624948359384599753222891217946321171874630522992621188474...

result:

ok 4 lines

Test #13:

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

input:

5
999 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999...

output:

999
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999...

result:

ok 5 lines

Test #14:

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

input:

1
100 10 5 100 1 202

output:

215

result:

ok single line: '215'

Test #15:

score: 0
Accepted
time: 15ms
memory: 10532kb

input:

1919
805 126 252 352 760 680
745 948 597 309 983 506
371 665 953 110 945 702
327 887 232 135 371 415
828 664 421 918 286 731
832 863 669 47 506 762
248 637 376 409 485 157
72 406 718 551 789 583
295 628 326 138 737 301
959 180 370 996 22 950
659 608 383 415 184 769
713 596 780 272 207 140
986 701 20...

output:

1610
1490
2597
1308
828
14144
248
144
885
959
1318
713
986
392
558
415
425
1869
32
1332
325
1988
9152
587
1092
1042
566
1365
338
355
182
83
874
558
806
973
1836
1182
366
720
714
2844
1347
23
8721
674
474
4752
786
1650
1464
348
1058
3848
24
800
914
2778
581
265
98782
201
412
852
120
45
572
1308
202
1...

result:

ok 1919 lines

Test #16:

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

input:

832
100 10 5 100 1 202
100 10 5 100 1 203
100 10 5 100 2 202
100 10 5 100 2 203
100 10 5 101 1 202
100 10 5 101 1 203
100 10 5 101 2 202
100 10 5 101 2 203
100 10 6 100 1 202
100 10 6 100 1 203
100 10 6 100 2 202
100 10 6 100 2 203
100 10 6 101 1 202
100 10 6 101 1 203
100 10 6 101 2 202
100 10 6 10...

output:

215
220
220
225
200
210
200
210
216
222
220
226
200
210
200
210
216
221
222
227
200
211
200
211
217
223
222
228
200
211
200
211
217
222
222
227
202
212
202
212
218
224
222
228
202
212
202
212
218
223
224
229
202
213
202
213
219
225
224
230
202
213
202
213
3440
3460
3460
3480
3400
3420
3420
3440
3444...

result:

ok 832 lines

Test #17:

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

input:

2077
1218 750 4547 3158 4790 4980
4658 2777 4476 4482 1752 4975
1045 1694 4881 2411 73 4959
2781 2874 1493 966 3793 4947
2360 790 4140 4466 3735 4998
2454 1865 3639 4833 1049 4907
1260 1653 2108 3628 2465 4960
4948 1970 4533 949 1206 4973
3594 40 3782 2816 2754 4993
4148 975 2656 1363 1460 4960
758 ...

output:

2436
9316
3135
16686
4720
4908
2520
29688
7188
16592
2274
1702
1029
2976
2994
9594
16095
8940
1830
8892
14208
26325
6400
1634
3336
7664
10809
1815
7882
5750
9016
32396
10521
8832
10584
10088
8784
23723
8120
11919
4205
6942
9118
27188
4584
14517
47709
36410
6920
6566
4260
9946
13704
20910
8421
30624
...

result:

ok 2077 lines

Test #18:

score: 0
Accepted
time: 15ms
memory: 10748kb

input:

1919
774 659 247 438 510 991
652 25 347 194 497 621
849 612 924 328 633 455
922 671 535 881 743 199
453 436 288 793 782 963
921 551 875 216 759 309
114 912 872 730 585 489
102 473 623 805 761 832
620 88 217 841 989 389
223 878 321 398 317 533
110 319 273 225 772 958
335 59 848 375 196 729
491 877 25...

output:

2322
2608
1698
922
906
1842
114
204
620
446
550
670
982
356
826
682
160
174
998
726
3
407
296
1593
18
267
34
976
920
906
1188
1174
617
59
1312
408
934
508
664
866
693
304
214
643
1524
137
1552
822
390
136373
384
464
1838
4212
54080
24570
1287
732
585
1278
550
554
204
57
345
1568
869
344
549
183
1510...

result:

ok 1919 lines

Test #19:

score: 0
Accepted
time: 13ms
memory: 10580kb

input:

1919
518 320 307 370 413 605
582 341 241 161 764 861
347 823 138 779 706 790
447 803 655 920 206 237
616 652 847 812 998 401
293 10 215 417 17 628
364 970 350 325 180 641
987 382 535 29 836 128
589 736 793 954 901 935
686 753 542 204 137 573
177 783 376 470 28 788
592 352 329 297 23 851
565 9 994 81...

output:

1036
3492
694
447
616
586
728
4935
589
2058
354
1776
736
87
224
3790
190
8463
944
146
137
1570
1906
325
916
726
602
1599
582
2639
897
1588
158
685
6050
289
474
328
1020
1382
107
1374
1364
654
1468
698
377
809
596
1824
226
36
1094
1460
1314
420
1458
753
756
1924
5352
7260
336
1848
586
1786
996
721
16...

result:

ok 1919 lines

Test #20:

score: 0
Accepted
time: 15ms
memory: 10584kb

input:

1919
747 540 679 609 218 232
134 1 248 178 825 288
140 649 312 804 598 795
70 915 757 939 650 284
426 96 745 104 155 266
730 987 985 970 513 938
506 952 764 499 624 554
857 620 279 197 830 131
379 900 280 421 672 977
765 90 264 983 993 357
329 420 685 803 732 285
259 197 951 104 484 727
812 41 954 6...

output:

747
244
140
70
1278
730
1012
857
1137
765
329
1813
1624
1612
3072
59
1530
1812
350
5257
1944
895
674
984
3072
308
619
539
87
716
238
423
669
501
1917
7232
852
2428
1299
66
69
2652
6802
621
45
2082
810
261
394
370
2781
661
656
1890
1845
215
912
877
867
14157
1538
874
700
1
1755
801
223
2272
187
1104
...

result:

ok 1919 lines

Test #21:

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

input:

1919
468 291 146 536 568 810
148 879 702 589 146 729
896 331 473 733 644 981
369 194 987 48 27 566
579 41 705 559 86 442
406 372 105 813 546 500
830 769 95 470 250 457
231 209 871 543 867 420
531 195 957 792 792 288
671 553 818 670 610 613
124 312 257 364 651 267
555 275 241 228 308 100
731 159 100 ...

output:

936
296
1792
4428
579
406
830
231
531
671
124
555
731
510
12680
1848
552
5290
2616
66
1470
649
3260
539
6129
3179
1610
1916
795
862
159
1640
208
1222
875
990
1638
1664
5984
762
607
11700
206
404
3560
51
982
2289
725
408
9630
2850
1602
561
176
1752
299
869
1324
506
5451
1252
663
933
937
592
195
33642...

result:

ok 1919 lines

Test #22:

score: 0
Accepted
time: 23ms
memory: 10748kb

input:

1919
67 61 809 597 523 217
479 564 993 355 913 286
890 662 4 576 468 837
403 872 37 818 19 201
140 658 944 626 750 598
847 895 906 404 354 229
517 157 247 173 544 220
1 360 469 373 886 122
5 563 7 21 757 930
659 17 459 105 916 103
598 560 48 697 748 914
193 335 410 893 326 827
1000 946 872 695 978 6...

output:

67
479
1780
403
140
847
1034
1
225
659
1196
193
1000
831
188
205
376
868
5142
370
50
1540
180
480
613
2034
2412
520
271
931
1154
1920
1268
536
7336
872
1928
1428
67
487
913
420
364
911
610
368
976
246
752
297
1658
1888
439
206
960
910
162
375
308
458
217
1404
9180
215
788
653
2094
2296
1088
333
2139...

result:

ok 1919 lines

Test #23:

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

input:

1919
375 657 908 524 708 960
930 423 798 729 162 929
220 36 52 934 143 659
196 272 5 831 241 366
888 560 439 177 957 987
694 798 550 449 392 845
616 507 631 448 878 566
933 419 316 638 121 686
124 57 369 749 893 428
635 891 543 785 26 915
552 800 119 165 674 823
758 632 762 544 741 452
475 443 224 4...

output:

750
1860
220
196
5328
1388
1232
1866
124
1270
2760
758
475
1680
966
282
1830
68
600
1628
963
1340
258
1185
579
1150
4472
1866
138
78
460
3730
69
626
854
459
1228
1330
475
1418
579
580
694
735
720
1262
705
290
559
785
1890
950
279
1011
239
2
2972
4976
332
282
189
1872
3484
652
888
1960
54
1212
1408
6...

result:

ok 1919 lines

Test #24:

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

input:

2077
1781 1056 6118 6477 3057 2778
3276 9910 1858 3390 7866 6763
5541 3079 9537 5392 5395 3655
6939 8862 2842 3224 9743 5062
6309 7196 661 8243 3346 3230
5665 6765 6172 3129 5574 1621
1992 7529 8846 271 7624 8814
5543 5108 2779 4201 6287 3064
2814 3661 1242 6799 4770 1922
2367 3645 489 6483 6032 799...

output:

1781
6552
5541
13878
6309
5665
65736
5543
2814
4734
8196
163075
62328
4678
5028
6266
6387
5717
2261
40302
9315
231
2944
9678
6176
2589
17991
7381
5455
12221
4874
38792
8520
18954
2860
8408
5127
8829
15882
1232
8543
2185
7040
16844
6894
6520
1674
2768
8326
4238
2673
4857
6444
14
8177
11008
9178
7864
...

result:

ok 2077 lines

Test #25:

score: 0
Accepted
time: 12ms
memory: 10536kb

input:

100
46080299351457689643706711545373523630462333678014465839712071913839465329051250 9689721527623008064428046951414200041624 9689721527623008064428046951414200041631 4755585516064018205517374388085720872770 223874957615222726960130836673557912546 3115417271395201356363220106695786899804323058577737...

output:

301875258021666139913899241402112884228302939324420800549635142042085349970206053060703372739478758393585856691387537106228
193111250054069560610942613571998851765999005165950456406189205406154425592697275226463754916596681773366822670441120275081
1347662707165970152468872963894266337135029407961925...

result:

ok 100 lines

Test #26:

score: 0
Accepted
time: 12ms
memory: 10720kb

input:

100
54990741788250614623076744598567526893834728939024359338366298599559757498111602 7495798748072090585949215293308213282107 7495798748072090585949215293308213282107 7336208406394870176204226374771344714317 2036879744285469351431471000102057203240 812950739790967556501561768004547984216641039139869...

output:

609371513756941448691240486443318762326570270032954307249265979078805112550670378694136041466414269806360061054016510114621
32525975989450332488832635002062955794364883009852333518647227584712250071791147174292516080492905448491166841059110017706
33047786482777612210100911106017324330376194222125423...

result:

ok 100 lines

Test #27:

score: 0
Accepted
time: 23ms
memory: 10704kb

input:

1919
957 949 888 433 509 895
796 45 833 292 489 365
290 319 207 380 867 254
267 263 186 425 488 661
995 22 769 949 541 340
896 128 26 466 282 791
115 885 433 967 235 240
857 604 895 609 907 438
724 773 252 384 865 613
375 86 600 631 191 145
378 880 830 271 688 446
474 554 242 110 914 340
684 758 789...

output:

2871
1592
290
534
995
1792
115
857
1448
375
756
1896
1368
1702
1888
585
798
2085
1518
891
2948
783
603
394
2166
525
906
64
164
69
15
674
840
1275
20493
257
711
975
1474
729
116
2262
525
284
995
934
2424
1906
293
2468
527
1362
639
4352
996
1214
236
517
932
697
1049
4038
31293
1916
170
87
746
1400
143...

result:

ok 1919 lines

Test #28:

score: 0
Accepted
time: 23ms
memory: 10632kb

input:

1919
127 973 689 266 359 119
983 548 120 577 606 719
908 496 769 427 558 199
376 644 370 628 61 529
330 712 879 176 338 158
259 960 869 684 686 672
277 437 900 343 327 672
45 275 724 933 186 420
810 148 68 156 345 571
750 229 871 770 422 1000
76 584 496 374 215 983
307 218 959 94 529 467
330 949 139...

output:

127
1966
908
376
330
259
554
45
3240
1500
228
1535
660
10036
293
3726
149
303
131
524
714
635
1822
290
911
166
1692
82
920
2331
995
1510
1776
1554
799
999
302
646
192
1668
58
706
60
552
4
897
894
892
1796
1626
307
842
454
58
6584
57
563
886
925
600
2988
851
2512
254
747
220
2820
279
408
145
6440
774...

result:

ok 1919 lines

Test #29:

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

input:

1919
198 27 271 336 752 876
670 207 76 917 907 674
225 327 566 569 452 398
118 636 867 294 947 774
729 575 178 623 398 484
61 774 124 183 440 463
907 508 981 755 141 753
337 673 323 685 485 266
494 78 717 562 902 496
788 926 527 7 319 783
311 370 797 742 882 885
62 299 94 559 121 311
711 54 236 933 ...

output:

594
670
225
354
729
183
907
337
494
88256
622
62
711
1534
2120
750
392
336
7280
612
764
499
94
253
853
610
861
1648
792
417
444
859
604
898
820
68
1280
968
1894
3616
2506
646
693
664
2736
45248
580
949
474
16
381
2622
862
330
378
81
753
936
2445
4116
23640
366
909
12906
970
492
880
767
432
1734
648
...

result:

ok 1919 lines

Test #30:

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

input:

1919
88 282 114 129 947 909
519 803 448 930 24 880
177 957 649 354 785 1000
277 946 273 866 922 423
916 170 699 319 260 763
245 119 922 532 370 380
194 957 753 39 108 987
555 328 53 340 760 745
996 314 872 62 261 666
603 941 209 40 266 679
132 94 715 942 6 296
528 131 907 922 241 567
459 502 349 275...

output:

704
519
531
277
2748
245
5044
1665
10956
10251
132
528
1377
557
1558
15
504
1502
712
500
396
386
150
572
530
580
11
361
826
811
2636
88
7843
1036
462
2709
2995
2835
178
1322
1545
4860
726
170
850
656
871
1746
970
405
1024
440
5744
2127
331
1164
1408
1179
749
595
213
822
103
2934
742
173
954
1380
6
1...

result:

ok 1919 lines

Test #31:

score: 0
Accepted
time: 23ms
memory: 10620kb

input:

1919
766 768 538 122 765 180
614 919 507 109 601 251
606 907 307 194 844 974
923 426 604 288 138 396
747 783 840 386 465 540
606 437 969 741 643 597
212 35 704 487 590 357
315 592 120 906 120 304
101 761 611 584 77 402
487 393 788 297 850 740
52 888 574 435 567 586
722 871 862 521 104 980
477 530 38...

output:

1532
1842
3636
1846
1494
606
212
315
101
1461
104
1444
954
1670
991
17040
823
2652
1780
214
1674
98
5944
377
4660
1492
426
636
1178
1492
1496
2688
2556
183
5060
2290
107
46665
1720
165
703
1594
52
564
690
20142
942
382
202
312
767
1452
268
280
434
509
998
481
562
694
954
473
803
300
1590
1096
606
47...

result:

ok 1919 lines

Test #32:

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

input:

1919
454 102 668 665 464 598
137 255 12 186 424 310
981 646 279 41 501 720
279 263 505 704 633 956
968 766 823 996 191 712
822 214 808 655 491 308
270 922 963 36 554 429
561 35 578 340 300 384
469 754 982 656 832 504
94 736 852 918 191 347
845 67 903 512 532 999
17 874 990 178 27 617
412 683 272 979...

output:

454
274
17658
558
968
822
3240
1122
469
94
1690
68
412
704
2920
150
1040
739
660
584
591
3752
1059
822
229
816
244
3576
4440
1664
264
1008
875
570
47386
1652
600
1712
170
116
3775
4338
168
2127
2
2355
859
2577
728
226
960
686
287
1872
904
876
2224
887
332
687
1641
1692
1008
2115
686
1292
877
194
324...

result:

ok 1919 lines

Test #33:

score: 0
Accepted
time: 14ms
memory: 10612kb

input:

1919
41 463 974 127 62 223
446 286 893 734 251 248
47 319 672 743 666 588
549 855 945 781 444 477
391 748 95 772 696 180
576 358 697 935 878 954
691 684 743 685 988 710
312 600 237 173 839 219
637 604 634 41 420 346
749 244 361 479 968 981
605 487 311 878 54 546
664 297 597 120 912 554
136 316 623 1...

output:

82
446
47
549
391
1152
1382
624
5733
2247
605
3320
680
1915
1594
1638
656
1286
1645
1330
316
548
674
156
2060
272
291
110
1000
888
11502
2180
9500
345
979
696
1120
1964
23
681
3805
2802
81
982
816
161
864
1966
876
4995
2028
226
380
7174
886
478
1516
1182
2991
426
2265
351
408
1260
3336
373
596
1470
...

result:

ok 1919 lines

Extra Test:

score: 0
Extra Test Passed