QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#381675#2122. Wystawa [A]Qiuly4 5664ms4180kbC++172.7kb2024-04-07 20:06:482024-04-07 20:06:49

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

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

input:

6 2
-1 7 0 2 -5 0
3 1 4 -3 -3 12

output:

4
BBABBA

result:

ok correct answer and good plan!

Test #2:

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

input:

3 2
-1 -4 -1
-4 -2 -1

output:

0
BAA

result:

ok correct answer and good plan!

Test #3:

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

input:

1 0
2
3

output:

3
B

result:

ok correct answer and good plan!

Test #4:

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

input:

1 1
2
3

output:

2
A

result:

ok correct answer and good plan!

Test #5:

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

input:

1 0
-2
-3

output:

0
B

result:

ok correct answer and good plan!

Test #6:

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

input:

1 1
-2
-3

output:

0
A

result:

ok correct answer and good plan!

Test #7:

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

input:

16 0
563531160 901961378 326222393 38801494 -547434528 171347734 -641624169 -614556786 -230653657 -623449793 218013688 125347629 776861393 -23045559 440210131 717981887
976179340 -523567563 -300519910 146448576 181573984 -770043558 -895018483 1747139 -413175024 18785014 -86727143 -416916804 -9386021...

output:

1048481948
BBBBBBBBBBBBBBBB

result:

ok correct answer and good plan!

Test #8:

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

input:

16 1
828581831 -565796065 528285292 -16209282 -446067242 74376000 -966790498 382921346 829244619 983017409 235137184 -232727302 991307649 288374377 227774026 17155366
-211384348 -253019623 955204272 393356827 -122294916 358217082 315557432 -356397900 69824283 -59471141 -928202598 594761760 432819412...

output:

1473121717
BBABBBBBBBBBBBBB

result:

ok correct answer and good plan!

Test #9:

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

input:

16 2
-442384745 -571610593 731154779 -947166494 71474477 -586253813 -95442106 504453042 765089330 25826531 225984171 -908107929 -308066512 113614729 -426306433 -509911000
918357661 -832817126 844591683 -969161483 -738583245 488648633 64190432 -766420441 15573092 348452288 768379034 -710865373 173424...

output:

930132218
BBBBBBBBBBABBBBA

result:

ok correct answer and good plan!

Test #10:

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

input:

16 4
-302856843 -704446786 598030079 505378352 -138702791 196372638 -694703850 -549621770 -750948261 874464003 -716338756 -89047132 607005584 -286975481 -416876561 773976691
201271759 445021472 -695837457 -770312273 -712657815 259121400 172922832 -900924791 904224283 140869064 57787292 509813063 262...

output:

432044232
BABBBBBBABBABBAB

result:

ok correct answer and good plan!

Test #11:

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

input:

16 6
179577748 308160828 5002304 348496637 115909283 -218322220 194384902 -63468584 244794726 -476259674 -733969266 365716734 446770096 -175916186 -771743620 57864381
608239422 -329017433 -62375369 -372101915 853364541 884150361 767834816 -207149456 -693304111 861109778 713532321 875128717 -77343687...

output:

785373271
BBBBAABBBAAABABB

result:

ok correct answer and good plan!

Test #12:

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

input:

16 7
105932481 206740156 -330185295 -582460575 633451002 -367171456 892648655 -601201111 328123083 618426951 306584312 33242796 149435775 282987396 -984179725 -104905054
761411512 -32868500 -320471604 -272677310 748856789 -13865509 125894376 -79114911 -747555302 -730966794 -127943134 424864366 -4254...

output:

633451002
ABBBAABBBBBABAAA

result:

ok correct answer and good plan!

Test #13:

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

input:

16 8
-167073934 175324635 -128122396 -172682009 734818288 -464143190 280663890 -970059750 728757136 224894152 -214349278 -177348489 850061615 -377145248 361739817 318321990
-108846480 -612666003 935252578 -173252705 566870542 116566042 -637253201 -489137452 -316433497 -809222949 -483239005 95807152 ...

output:

850061615
AAAABABABBBAABBB

result:

ok correct answer and good plan!

Test #14:

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

input:

16 9
97976737 -315862889 -463309995 262697550 423273734 -96325582 -995471365 -944134198 812085493 -732296726 -197225782 488006662 -449312546 -65725312 149303712 155552555
-831620826 369023662 139099257 -73828100 263001642 221396600 720806360 -751676347 141095889 -401299520 -786657374 -723640397 5390...

output:

263001642
AAABBAAABABBABBA

result:

ok correct answer and good plan!

Test #15:

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

input:

16 10
-175029678 -321677417 276809990 -668259662 524641020 -245174818 679362307 -483906564 -275499878 362389899 -644891628 641712308 -286743792 245694624 371169689 -397790320
298121183 -848647822 -969342421 563653591 158493890 -624741768 -16740224 890178615 771578842 -140859737 224383526 288038167 9...

output:

618158688
AABABBBAABABAAAA

result:

ok correct answer and good plan!

Test #16:

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

input:

16 12
966538064 57266967 291168936 146411203 -856449976 389967987 591881140 -24160959 720243109 -988333778 998781925 -903523827 628328304 -641075170 528083207 374316794
119092367 -108866310 28285526 909986447 -327361257 147770839 578171760 70133533 -339769968 726864623 -972387800 167980825 -96491006...

output:

902400001
BAAAABAABABAAAAA

result:

ok correct answer and good plan!

Test #17:

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

input:

16 14
-551027346 71914420 -839109337 -349166450 -90057325 -853813144 140103042 609475873 -795794482 689389967 56458998 -84463030 -968380178 129248348 -338433357 -341795516
-450509889 -831027713 -826602882 -891164344 -761338902 -767297126 -289665759 -64370817 37100646 -943468104 -169159125 -125967744...

output:

140103042
AAAAAAABABAAAAAA

result:

ok correct answer and good plan!

Test #18:

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

input:

16 15
-138493029 456673332 -637046438 60612116 -913382456 25785041 863967788 -418646989 -712466125 -215923409 21704992 728375767 -805811424 440668284 -64689878 -357081305
679232120 563573792 -646186284 -253682653 -917724156 -150685991 920910156 554054063 494630032 293541598 -671938642 83032128 19261...

output:

863967788
AAAAABAAAAAAAAAA

result:

ok correct answer and good plan!

Test #19:

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

input:

16 16
-359621942 937038388 -972234037 -870345096 -812015170 -634844772 538801459 -444598939 199948505 852486707 -447351096 882081413 42298062 -271341862 -329003485 -519850740
-191025872 859722725 -392501942 -6774402 -536052324 491395065 305246225 144031522 925751837 701465027 -975357011 118140773 90...

output:

1623666111
AAAAAAAAAAAAAAAA

result:

ok correct answer and good plan!

Test #20:

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

input:

16 8
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

16000000000
BBBBBBBBAAAAAAAA

result:

ok correct answer and good plan!

Test #21:

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

input:

15 2
-10 -8 -10 -9 -2 -9 -3 0 3 -1 -1 -5 -7 -8 -5
-1 -9 -6 -1 -1 5 -6 -8 -2 -10 -7 -10 -10 4 -8

output:

0
BBBBBABBBBBBBAB

result:

ok correct answer and good plan!

Test #22:

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

input:

16 2
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000
2 2 2 2 1 2 2 2 2 2 1 2 1 2 1 1

output:

8
BBBBABBBBABBBBBB

result:

ok correct answer and good plan!

Test #23:

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

input:

16 3
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000
37 97 11 8 75 10 14 90 77 51 51 13 78 18 67 33

output:

153
BBBBABBBABBBABBB

result:

ok correct answer and good plan!

Test #24:

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

input:

16 15
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000

output:

8
AAAAAAAABAAAAAAA

result:

ok correct answer and good plan!

Test #25:

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

input:

16 8
1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1

output:

0
BABABABABABABABA

result:

ok correct answer and good plan!

Test #26:

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

input:

5 2
5 4 3 -3 3
-3 0 -5 -1 5

output:

3
BBBAA

result:

ok correct answer and good plan!

Test #27:

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

input:

3 1
-3 -1 0
0 1 -2

output:

0
BAB

result:

ok correct answer and good plan!

Subtask #2:

score: 1
Accepted

Test #28:

score: 1
Accepted
time: 2ms
memory: 3736kb

input:

80 15
-806772 -117802 266998 190197 -579000 615552 862955 -727153 870975 433653 583521 996193 563471 -615416 -924633 -296705 258551 -962057 -516030 -639148 -196720 656594 -667491 179513 98453 732582 -656179 525953 -955189 -711999 -708631 -6539 198681 -390094 611214 473002 -685751 787723 -511023 -183...

output:

1000383
ABBBBBBBBBBBABABBBBABBBBBBBBBABBBBBBBBBBBBBBBBABBBBBBBABBABBBBBBABBBABBAABAAABBB

result:

ok correct answer and good plan!

Test #29:

score: 0
Accepted
time: 2ms
memory: 3776kb

input:

80 27
928779 -754470 -813332 -405414 -349390 -434427 705066 595688 -863781 578598 652744 850802 29480 441561 -872297 815242 353316 -355334 37328 -874346 -722719 -62461 -650942 -286428 -899854 151553 -382903 392123 -352713 721952 -552143 358498 -947110 -505541 -72903 -324323 216970 684948 715042 -738...

output:

1250993
BBBBBABBABABBBBAABBBBBBBBBBBBBBABBABABABBBABAABBBABBBBABABBBABAAABAAAABBAABBAABB

result:

ok correct answer and good plan!

Test #30:

score: 0
Accepted
time: 2ms
memory: 3780kb

input:

80 45
69594 17146 55793 -999416 -637207 338604 752539 428350 -677453 878359 701201 784328 -611799 -865683 -793199 417853 -329841 172472 -872731 -956337 358692 -729361 -919696 807513 75078 981786 586400 -314267 640745 5673 120163 311787 -433336 -494543 627480 -943048 -315355 -34937 -156968 161067 -17...

output:

901102
BBBAABBAABBBBAABAAAABAABABBBBBBBAABAABABBABABABAAAAABBBAAAAAAABAAABAAABABAAAABAB

result:

ok correct answer and good plan!

Test #31:

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

input:

80 60
-194856 -667050 975464 845093 -380835 -293631 156140 268617 -412208 -976697 181685 -891165 980656 317739 -196674 47226 -263447 261768 -319373 808466 -119779 551585 577818 518563 -844312 -195587 986121 -601304 -392560 -737368 276651 32952 547319 738534 -624610 338545 587366 -860501 551670 80772...

output:

1473586
AAABAAAAAAAABAAAAAAAABBAAAAAAAABAAABBAAAABBBAAAAAAAAAAAAAAABAABABBBAAABBAABAAABB

result:

ok correct answer and good plan!

Test #32:

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

input:

80 72
-976733 52411 -76495 124646 -668652 577474 26622 -416148 -72673 -784224 124463 -957639 -99133 -598523 -144338 -323401 -840925 841729 849486 777021 934870 -115315 103702 -47061 648047 -749854 -123494 845514 209916 596900 -951361 -40521 884102 749532 564829 -976207 55041 -991647 -320340 944561 -...

output:

2325607
AAAAAAAAAAAAAAAAABABBAAAAAABABAAABAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAABAAA

result:

ok correct answer and good plan!

Test #33:

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

input:

79 38
-997451 -982746 -910799 -977003 -972855 -875328 -996828 -840527 -988218 -929740 -947366 -993351 -997495 -950301 -995526 -996173 -997156 -978937 -980286 -931695 -942179 -738628 -997624 -983277 -984355 -938311 -979575 -977668 -991365 -994163 -998751 -994134 -945586 -920799 -997488 -999631 -98035...

output:

0
BBBBBBBBBBBBBBBBAABAABABAABAAAAABAAABBAAAAAAABABAABBABABBAABBAABABBAABABAABBBAB

result:

ok correct answer and good plan!

Test #34:

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

input:

80 31
-883544 -427936 -999936 -713933 -752328 -865112 -835016 -150430 -333936 -997725 -955747 -941748 -593709 -664824 -853061 -800153 -744894 -276232 -887385 -905481 -870777 -995270 -867813 -896756 -734738 -772199 -812570 -370881 -989617 -944617 -337 -846543 -933019 -848227 -899366 -58734 -952617 -2...

output:

0
BBBBBBABBBBBBBBABBBBBBBBBBBABBBBAAABABBAABAABABBABBABBAAAAAABAABABAAAABAAABBABBB

result:

ok correct answer and good plan!

Test #35:

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

input:

80 38
-945162 -467444 29743 -838252 -661798 -519723 -754752 528931 -551618 462077 -459240 -739960 -738724 66478 -770642 93581 -991476 -893037 -920364 644971 -424625 -217793 -953124 -566351 -379254 349752 -416702 -131437 -683574 -480661 -187479 286136 -966012 -847004 -978180 104154 -934422 -684130 42...

output:

196627
AAAAABBBABAAABBBAABBBBABBBBBBBBBBAABAABBABBAAAAAABBABBABBABABAAAABBABABABABBAAAB

result:

ok correct answer and good plan!

Test #36:

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

input:

79 31
962776 982088 941969 -195515 923806 894326 856979 347050 788263 727019 467074 500116 917595 725602 141593 998246 985094 335194 840826 956183 949855 334934 922303 834512 574037 440673 -230530 740060 -241510 273324 -603592 -181997 718903 862184 960463 225391 597218 804665 630140 977673 368497 76...

output:

25814842
BBBABBBAAABBABABBBABBAABAAABAAAAAABABBBBBBBBBBBAAAABBABBBBBBAAABBABABBABBBBBBBA

result:

ok correct answer and good plan!

Test #37:

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

input:

79 33
990169 996263 933267 987763 916155 794010 899558 999864 962106 188360 966336 659551 729428 993943 886426 981355 991640 991093 994226 999446 930646 925232 863815 716303 992978 990239 991049 973362 173532 993918 992037 987378 998575 804749 967357 931613 908769 978601 939037 922886 738422 927038 ...

output:

59486245
BBBBABABBABAABABBBBBBAAABBBBABBBBABBBBBBAAABAABBABBAAABBAAAABAAABBBAAAAABABBBBB

result:

ok correct answer and good plan!

Test #38:

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

input:

80 45
999984 999998 999995 1000000 999505 999923 999991 1000000 999988 999994 999923 999615 999988 999904 999385 999984 1000000 999997 999994 999999 999995 999972 999819 1000000 999983 1000000 999982 1000000 999527 999990 999882 999998 999970 999966 999998 999996 999241 999915 1000000 999987 1000000...

output:

79963029
ABABAAABABAABAABBABBBAABABABAABBAABBAABABBAABAABAABABBAAAAABAAABAABABBBBAABBBAAA

result:

ok correct answer and good plan!

Test #39:

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

input:

80 2
-1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -100000...

output:

372676
BBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBB

result:

ok correct answer and good plan!

Test #40:

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

input:

80 3
-1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -100000...

output:

286702
BBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBB

result:

ok correct answer and good plan!

Test #41:

score: 0
Accepted
time: 6ms
memory: 3804kb

input:

80 18
-1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -10000...

output:

13365
BBBABBABABBBBAABBBBABBBBBBBBBBBABBABBABABBABBABBBABBBBBBBBBBABABABBBBBBBBBBBBABA

result:

ok correct answer and good plan!

Test #42:

score: 0
Accepted
time: 6ms
memory: 3808kb

input:

80 18
-1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -10000...

output:

9329
ABBBBABBBBAABBBBBBABBABABBBBBBBABBBBBABBBBBBBBBBBBBBBBBBBBABBABABBBBAABABBBAABAB

result:

ok correct answer and good plan!

Test #43:

score: 0
Accepted
time: 5ms
memory: 4076kb

input:

80 40
16585 13391 18094 17102 17950 12628 16236 18567 1679 14438 8357 7580 18616 16834 18298 15155 -8763 18067 17803 18733 16567 13897 15360 18284 16307 4198 17899 14570 18269 16254 15274 16984 14906 1631 12953 18746 18268 11700 18735 12309 17571 4111 18207 17767 16652 17983 18052 16774 18388 6187 1...

output:

18146
ABABABABAABABABAABABABABABABBABABAABBABABABABABABAABABABABABBABABABABBABBABABABA

result:

ok correct answer and good plan!

Test #44:

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

input:

80 40
1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1...

output:

0
BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA

result:

ok correct answer and good plan!

Test #45:

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

input:

80 40
41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
-1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000...

output:

32
BBBBBBBBBABABABABABABABABAABAABAAABAAAAAAAAABAAAABAABAABABABABABABABABABBBBBBBBB

result:

ok correct answer and good plan!

Test #46:

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

input:

80 40
1 1 0 1 0 0 0 1 1 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0
-1 -1 1 -1 0 1 0 -1 -1 -1 -1 -1 0 -1 -1 0 -1 0 0 -1 -1 -1 1 0 -1 -1 0 -1 1 1 -1 0 -1 -1 -1 -1 -1 -1 0 0 0 -1 -1 -1 -1 -1 1 -1 -1 -1 1 ...

output:

0
BBABAAABBBABABAAAAAABBAABAAAAABAABBABBAAABBBBBABBBAABBABBABBAABBBBAAAABBBBAAABBA

result:

ok correct answer and good plan!

Test #47:

score: 0
Accepted
time: 2ms
memory: 3808kb

input:

80 40
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 -1562 1000000 -999963 1000000 -999965 1000000 -999967 1000000 -999969 1000000 -999971 1000000 -999973 1000000 -999975 1000000 -999977 1000000 -999979 1000000 -999981 1000000 ...

output:

999999
AAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBABABABABABABABABABABABABABABABABABABABAB

result:

ok correct answer and good plan!

Test #48:

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

input:

80 40
999999 0 999997 0 999995 0 999993 0 999991 0 999989 0 999987 0 999985 0 999983 0 999981 0 999979 0 999977 0 999975 0 999973 0 999971 0 999969 0 999967 0 999965 0 999963 0 999961 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1000000 -999999 1000000 -999997 10...

output:

999999
ABABABABABABABABABABABABABABABABABABABABBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAA

result:

ok correct answer and good plan!

Subtask #3:

score: 1
Accepted

Test #49:

score: 1
Accepted
time: 48ms
memory: 3676kb

input:

400 35
282603 437907 189144 -306523 875091 -129096 135690 959139 919604 -510810 18016 -898443 -410507 -528852 -639057 503910 461833 267527 244577 -103136 -909424 -892963 -870210 -89935 509282 -930568 808009 773531 257190 -828648 -861529 -970580 -539999 260846 -620133 -979364 640196 388456 491785 -81...

output:

1451726
BBBBBBABBBBBBBBBBBBBBABBBABBBBBBABBBBBBBBBBBBBBABBBBABBAABBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBABBBBABBABBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBABBBABBBBBBBBBBBBBBBBABBBBBBABBABBBBABBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBABBBBBABB...

result:

ok correct answer and good plan!

Test #50:

score: 0
Accepted
time: 35ms
memory: 3748kb

input:

400 147
-499274 -763716 -917948 -928896 587274 -661648 85089 791801 -788390 -337494 -39206 -964917 557233 681332 -42532 133283 -15962 847488 -684639 -232655 145225 342064 655675 -555876 -515787 -107940 -713354 639701 733221 455074 -62778 750586 -26225 145399 597677 223312 -18574 284072 -282151 -1373...

output:

1573326
BBBBBABBABBBBBBBBBBABBBAABBBBBBBBBBAAABBBBBBBBBBBBBBBBBBBBBBBBBABBBBABBBBBBBBBBABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBABBAABBBBBBABBABBBBBBBBBABBBBABBBBAABAABAABBAABAABBABAABBBBABABBAAAAABABABAABABABABBBABABBBABBABBBAABBABAABABABAAAAABABAABABAAAABABBBAABBABAABBABBABABAAAABABBAAABAABBBABA...

result:

ok correct answer and good plan!

Test #51:

score: 0
Accepted
time: 40ms
memory: 3728kb

input:

400 197
-664041 599617 -48823 942375 816884 111383 -590227 114641 -523145 -66104 -41295 -513964 23242 -652674 -42351 -208973 -76013 -545790 -131281 -467853 -432929 -250546 358550 -944509 485907 820367 50587 -66689 -273322 -287967 93710 677113 437003 -416163 -682784 960716 -989409 -462575 845840 -272...

output:

1292509
BBBBBBBBABBBBBBBBABABBABBBBBAAABBAABAABABAABAABAAABAAAABBBAABAABAAABAABBBBBBBBAAABBABBAABBBABAAABBBBAAAAABBABAABBABAAABBABAABBAAABBBAAAAABBBBBAABBBABBAAAABBAAABBABBABABABBAABBABABABBBAAAAABABBBAAABBABAAAAAAABBAABBAABBBBAABBABABAAABABBABBBABBBABAAABBBBBBABAABBABABAAAABBBBABABBBAAAABABBAAAAAAA...

result:

ok correct answer and good plan!

Test #52:

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

input:

400 257
475166 -630377 870848 348373 476912 -599769 -669199 -25935 -336817 107212 27928 -706883 -510749 431065 9985 -579600 -527046 108461 958661 -549844 621720 -917446 401861 687625 -460245 239338 450308 -255652 846581 -953700 221827 -931089 -708788 -610527 17599 270679 430739 -565350 -524440 72504...

output:

1266945
AABAAAAAAAAAAAAAAAAAAAABAAAABAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAABAAAAABAAAAAAAAAAAAAAAAAAAAAABABABAAABAAAAAAAABBAAABAABAABAABABABABBAAABAABBBBAABABAABAABBAAAABABBABAAAAABBBAABBBAABABBBBABBBBABABBABABBBBBBBAAABBBAABBABABAABABABBBAABAABAAAABAABAAABAAAAAAAAABBAABBBBBAAABBAAAAAAB...

result:

ok correct answer and good plan!

Test #53:

score: 0
Accepted
time: 50ms
memory: 3808kb

input:

400 372
210716 685428 -307556 -372074 706522 350253 -748171 -319718 -71572 -217742 -21689 -852274 974418 -464431 606510 532347 -558726 197757 -487982 -785042 -295261 -180689 -99017 -190064 -941125 -882902 -561233 -906909 -159962 303260 895742 868994 -293088 -599529 -843509 -526646 -745458 714766 729...

output:

2896713
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAABAAAAAAAAAAAABAABAAAAAAAAAAAAABAAAAAAAAAAAAAAAAABAAAAABAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABAAAAAAAAABAAAAAABAAABBABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAABBAAAAAAAABABAAABAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #54:

score: 0
Accepted
time: 74ms
memory: 3720kb

input:

399 196
-980499 -999052 -855043 -999390 -982791 -987200 -999808 -878173 -946218 -860336 -980155 -719827 -952639 -474100 -974250 -998201 -990990 -993396 -985772 -969592 -999920 -985264 -939460 -990318 -999390 -924918 -611343 -973343 -998344 -998344 -998639 -947560 -908169 -994430 -995260 -998700 -897...

output:

0
BBBBBBBBBBBBBBBBBAABAAAAAABAABABBBAABABABBABBABBAAAAABBBABBAABAABABBBBABABBABABAAABABAABBABBBABAAABBBABABBBAAAAAAABBBBBBBBABAAABBABAABAAABBABBAABBBAABAAABABABBBBAABAABBBBAAAABBBAAAABABBABAABAABBAABBAABBABABAABABBBABABABAABABBBAABBBAABBAAABBBBABAAAAAAABBBBBABAABBBABBBAAAABBBAABABBABABABBBAABAABBABA...

result:

ok correct answer and good plan!

Test #55:

score: 0
Accepted
time: 71ms
memory: 3724kb

input:

399 210
-971089 -430545 -969039 -838400 -890740 -688234 -999904 -969078 -989776 -965337 -925768 -967879 -999037 -677515 -924384 -990673 -944949 -955868 -557480 -952916 -888157 -686325 -946317 572562 -90422 -466094 -724604 -285157 -967792 -847260 -981342 -947480 -697225 -717403 -965455 -486962 -97425...

output:

317657
BBBBBBBBBBBBBBBBBBBBBAABBABBABAAAAABABBBBABBAABAABBBABAAABAAAABBABAABAABABAAAAABAABAAABABBBABBBBAAABBAAABAAABABABABBBBAAAABAAABBBABAAABABABBABBAAABBBABBBAABBBBAAAAAAABAABABAAABBABAABAAABABABBBAAABBBAABBAAABABBAABABBAABBABABABAAABAAAAAABAAABAABABABAABAABAAABBBBBBAAABAABABAABABBBAABAAAAAABABBAB...

result:

ok correct answer and good plan!

Test #56:

score: 0
Accepted
time: 58ms
memory: 3756kb

input:

400 190
2697 -38389 -598069 -168539 231770 -65433 -737643 -947902 -48094 130598 -840546 -954760 -715225 -698768 -13956 -652250 -889370 -499280 -949576 -906842 148338 -626952 -785731 -773340 -982028 -326373 -789204 -430922 -763976 -451701 -873539 -931773 312120 -722330 -719305 -883332 -976755 -928277...

output:

413619
BBBBBBBBBABBBBBAABBBBBBBBBBBBBBABBBBAAAABBABBAABBBAAAABAABABBABBBABAAABBAABAABBABBABBBBBAAABBBAABAAAABAAABBAAAABBBBABABAABBABBABABAAAABABABBAABBABAABBABBBABAABBAAAAABABAABBABAAAABBAAABBBABABBBBBBBABABBAABBAAAABBAAABAAABABAAABABAAAAABAAAABABBAAABBAAAAAAAABABABBBBBABABABAABBABABABABBBAAABAAABAB...

result:

ok correct answer and good plan!

Test #57:

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

input:

400 208
-333302 872121 526193 -294 850068 919469 915136 -447303 558406 796458 850223 960256 988007 815008 813206 953269 974989 918495 605683 928149 909409 942496 -372461 -12439 747709 487031 254323 287024 331895 373777 975387 429819 718828 741536 911823 -167707 229992 -431523 -480719 -613316 156551 ...

output:

115308361
ABAABBBABABBBBBBBAAAABAAAABBAABBBBBABAAAAAABBBAAABAABAABABABBAAAAABABAAABBAABAAAABBBABABAABBBBAABBBBAABBBAABAAAABAAABBBBABABABBABABAABBAABABAAAAABABABBBAAAABABABBAAAABAABBBAABBAABAAAAAABABABBBBABAABABBABABBABBABAABBBAAABAABAAABBBABABAAABAABABBAABBBABBBABBABAABABAAABBAAAABBBABAABABBBABBAABA...

result:

ok correct answer and good plan!

Test #58:

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

input:

399 219
764468 996027 989977 895378 999994 985278 843485 966463 999771 992337 944189 957381 622714 961684 605989 960770 785241 972856 997123 888936 999745 871109 824514 1000000 892052 336955 995226 649009 990767 999298 985865 525909 963854 969893 380973 959961 999514 960853 999553 684950 989626 9371...

output:

318837973
ABBAAAABABBAAAABABBABAABAABABBBABAABBAAABABBABBBAAAAABAAABBBBABAABBBBBBABABBABAABABBAAAABBBABABBBBAAAAAABABABBBBBAAAAAAABABBABABBBAAABBABBABBAABBBBABABAAAAABAAAAAAABABBBBAABBBBAAABAAABBBABABAAAABBBABBBABBAAABABABBBABAAABBBAABAAAAAABABAABABAAAAABABAABBBBABBAABAABAABAAAAABAABBBAABAAABABAABBA...

result:

ok correct answer and good plan!

Test #59:

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

input:

399 202
999996 999999 999958 999992 1000000 999999 999992 999913 999966 999969 999914 1000000 999980 999995 999479 999984 999984 999977 999996 999993 999999 978254 997662 999999 999999 999977 1000000 999608 1000000 999999 1000000 999908 999999 999929 999995 999967 1000000 999859 999991 999868 999991...

output:

398840541
BBABBBBAAAABABAABBBBBAAABBBABBBBAAAABAAABABBBABBBABBAABBBABAAABBBABAAABABBAABBAABBBBBBAAABABBAABBAAAABBABBBABBBAABBBBAAAAABBBAABBABBAAABBBBBABBBBBAABABBAAABAAAABAABABBABBABAAAAABBAABAABABABBBBAABAAABBABBBBAABBABBAABBABBBBAABBBABAAAAABBABBAABBAAAABABBAAAAAABBAAABBABABAABABBABAABBABBBABABBBA...

result:

ok correct answer and good plan!

Test #60:

score: 0
Accepted
time: 190ms
memory: 3828kb

input:

400 393
458 3719 3686 3622 726 2739 3680 3615 2442 3693 2874 3269 3585 3494 3383 3603 2103 2701 2161 3233 1819 2404 1940 1200 -456 3600 3304 3268 2903 3651 3725 3533 3750 2469 3342 3667 1309 3725 1739 2667 1773 3556 3430 3750 3731 2815 3361 3553 2268 2001 3699 3742 997 2265 985 1670 3732 989 3420 67...

output:

139102
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #61:

score: 0
Accepted
time: 184ms
memory: 3828kb

input:

400 13
-1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000...

output:

79906
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #62:

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

input:

400 28
-1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000000 -1000...

output:

6446
BBBBBBBABBBBBBBBBBBBBABBBBBABBBBBBBBBBBABBBABBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBABBBBBBABBBBBBBABBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBABBBBBABBABBBBBBBBBBBBBBBBBBABBABBBBBBBBBABBBBBBBBBBBBABBBBBBABBBBBBBBBBBBBABBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBABBBBBBBBBABBBBBBBBBBBBBBBBBBBBBABB...

result:

ok correct answer and good plan!

Test #63:

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

input:

400 360
1857 -1543 -1232 -3274 3408 2845 -1080 3131 -3684 -2586 -1266 3412 -355 3487 -504 -1198 1522 278 -2374 1796 1259 295 -1937 -2254 856 752 3446 -778 -795 3066 -505 986 1288 1224 2177 -39 530 -2294 1163 -2360 -874 580 1502 2075 2066 -1337 3025 -3039 1367 2139 -1867 -3254 2358 2461 -978 -2671 14...

output:

4778
AAAAABAAAAAAABAAAAAAAAAAAABAAAAABAAAAAAAAAAABAAAAAAAABAAAAAABAABAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAABAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAABABABAAAAAAAABAAAAABAAAAAAABAAAABAAAAAAABAAAAAAAAAAAAAAAAAAAABAABAAAAAAAAABAAAAAAAAAAAAAAAABAAAAAAAAAAAAABAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAABAAABAAAAA...

result:

ok correct answer and good plan!

Test #64:

score: 0
Accepted
time: 145ms
memory: 3704kb

input:

400 200
3437 3550 3695 3288 3490 3468 2108 2722 3697 -487 3745 3427 2647 3728 3134 2547 3644 2631 3186 3064 3455 3072 2785 2166 3468 2604 3629 3072 2718 3233 3625 3592 3573 3747 3224 2839 3258 3106 1454 2238 2183 3555 3735 3396 1569 2849 95 3440 699 3400 2872 3748 3711 3399 3400 2696 3266 1506 3275 ...

output:

3711
ABABABABAABABBABABABABABABABABABABABABAABABABAABABABABABABABABABABABAABABABABABAABABABABBABABABABABABABABABBABABABABABABABABAABBABBAABABABABBABABABABABABABBAABAABABABABABABABABABABABBABABABABABABABABABABABABAABABABABABABABABBABBABABABABABABABABABABAABABABABBABABBABABABABABABABABABBABABBABABBABB...

result:

ok correct answer and good plan!

Test #65:

score: 0
Accepted
time: 73ms
memory: 3724kb

input:

400 200
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1...

output:

0
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...

result:

ok correct answer and good plan!

Test #66:

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

input:

400 200
201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 ...

output:

156
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABAABAABAABAABAABAABAABAABAAABAAABAAABAAAABAAAABAAAAABAAAAAAAABAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAABAAAAABAAAABAAABAAABAAABAABAABAABAABAABAABAABAABAABABABABABABABABABAB...

result:

ok correct answer and good plan!

Test #67:

score: 0
Accepted
time: 62ms
memory: 3820kb

input:

400 200
1 1 0 1 0 1 0 1 0 0 1 1 1 1 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 0 0 0 1 1 1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 1 1 1 1 1 ...

output:

0
BBABABABAABBBBABAAAAABBBBBBBBBAABBBBBAAAABABABBAAAABBBABABBAAABABAABBABAAABABABBABBBBABAAABAABABABBBBBBAAAABBBABABABABABBABBABBAAABBBAAAAABAABBBBBABBBAABBABAABAABAABABBABAAAABAABABBABBABBAAABABBAAAABBAAABAAABBBAABAABAABAAAAABAAABBABAAAAAAAAAABAAABAABBBBBBBABBBABBBBABBBBBBBABABBBAABBAAAAAABBAAAAABB...

result:

ok correct answer and good plan!

Test #68:

score: 0
Accepted
time: 46ms
memory: 3828kb

input:

400 200
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

999999
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...

result:

ok correct answer and good plan!

Test #69:

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

input:

400 200
999999 0 999997 0 999995 0 999993 0 999991 0 999989 0 999987 0 999985 0 999983 0 999981 0 999979 0 999977 0 999975 0 999973 0 999971 0 999969 0 999967 0 999965 0 999963 0 999961 0 999959 0 999957 0 999955 0 999953 0 999951 0 999949 0 999947 0 999945 0 999943 0 999941 0 999939 0 999937 0 9999...

output:

999999
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Subtask #4:

score: 1
Accepted

Test #70:

score: 1
Accepted
time: 1242ms
memory: 3892kb

input:

2000 196
53359475 -389458277 27443906 213187393 525501489 -563370396 -780381693 990456678 -966127727 -926000233 -208464373 99915107 429573188 471624215 -533030054 790604637 -643361957 -590004012 412092763 -856885908 -857464588 176819165 -218862254 802719311 794718647 525976558 341493086 692047249 14...

output:

2939757937
BBBBBBBBBABBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBABBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBABBBBBBBBBABBABBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #71:

score: 0
Accepted
time: 1240ms
memory: 3888kb

input:

2000 620
-440775853 475665691 380498790 -481751408 -681829352 -466284677 -329805774 912951785 -482165317 -129240263 849212701 580279966 -707232219 -293262926 600453383 74492327 -864164800 440292860 46322716 240344970 -288767901 834253329 830096007 -858195654 -758714746 -146011182 709555860 -33174157...

output:

3090280208
BBBBBBBBBBBBBBBBABBBBBBABABBBABBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBABBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBABBBBBBAABBBBBBBBBBBBBBBBBBBBBBABBBBB...

result:

ok correct answer and good plan!

Test #72:

score: 0
Accepted
time: 1653ms
memory: 3892kb

input:

2000 1024
675321968 -997906280 764040934 997069947 960509735 776113777 -269803295 570018698 513577670 571913563 -656637233 -600659238 207839877 -156602638 609883255 -641619983 -885606495 372943748 582906686 412883431 479289934 -486922266 907501688 331234825 664421781 -106988269 -631352180 608747796 ...

output:

2927194261
AAAAABABBAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABABAABBBABAAABBAAAABAAAAABBAABBBBBABAAABBABABBBBABAABAAAABABBBABAABBAABAABABBAAAAABABBBAAABBBABABBABBBABBABBAABAABBAABBBBBABAABBABABBAAABBABBABBBAABBBBBBBBABAAAABBBABBAABAABBBAABAAAABBABBBBBBBABBABABABBBBBAABAAABBBBABBABBABBAABBB...

result:

ok correct answer and good plan!

Test #73:

score: 0
Accepted
time: 1588ms
memory: 3828kb

input:

2000 1302
181186640 869257528 630916234 987671878 -273097615 -953040350 -869065039 -484056114 997540080 -778810114 401039841 -145895372 611131396 -19135762 766796773 -381162374 407411079 -232462450 -784903201 48171394 71416702 170511898 520118027 522836215 599338884 -631492363 -410773052 860096309 -...

output:

1934956526
AAABAAAAAAAAAABAAAAAAABAAAAAAAABAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAABABAAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #74:

score: 0
Accepted
time: 1123ms
memory: 3804kb

input:

2000 1826
-677245619 372255476 -964151381 -631959340 493295036 -855954631 -470366622 2097072 -6716934 -129533790 -102770253 673165425 -525674011 265008172 -99719791 902725317 334091882 286184917 -760099808 732490432 839474537 363156720 -578407359 275924772 994027990 696519898 -554359783 525448343 -2...

output:

2164252329
AAAAAAAAAAAAAAAAAAABABAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAABAAABABAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAABBAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAABAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAAABAAAAABAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #75:

score: 0
Accepted
time: 2750ms
memory: 3804kb

input:

2000 966
-993017862 -987762422 -848469645 -999321730 -999370349 -998989534 -971236942 -983496919 -990128713 -858280533 -956410897 -994489634 -998022640 -996996458 -994929952 -957212477 -983505099 -835883950 -999529704 -966342777 -998974629 -925474804 -989472022 -984300771 -451422569 -962333251 -8994...

output:

0
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAABBBABBAABAAABBAAAABABAAAABBAABBAABABBABABBABABAABBBBBBABBAAABAAAAABBAAAABBBAAAAAAAABBBBBBAABBBABABBABABBABBBAAAABAABABBABBBABAAABBAA...

result:

ok correct answer and good plan!

Test #76:

score: 0
Accepted
time: 2015ms
memory: 4168kb

input:

1999 1039
-867908265 -721403353 -986421106 -974997850 -991440534 -936676085 -876586012 -325668009 -893911134 -941228419 -995254996 -863840249 -995824805 -986122784 -614065925 -738820935 -947517229 -187728159 -986740157 -980873242 -800627271 -990236960 -986484898 -626263444 -990251892 -998021432 -979...

output:

78145373
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBAABBAABAABBAAAABBBABBABABBAABABBBBAABBBBBABAABAABBABBAAABBAABBAABBABBABBAABBABAABAAABAABBBABAABABBAABBBBAABBBABBBBBABBAABAAAAAABAABAABBAABAAAAABBBBBAABBAAAAAABAAABAAABAAABAABBABABBBBBAAAAAAABBBBBAAAABBBBAAAAAABAABABAAAABABBBAABBAAAAABB...

result:

ok correct answer and good plan!

Test #77:

score: 0
Accepted
time: 2234ms
memory: 3860kb

input:

1999 966
-422416484 -308503409 -997761215 -634570518 164360961 -704199334 538343592 -962367428 672969853 109969270 -499358751 -915654137 -872611217 -678379835 -968920999 -915423908 541774462 -762322000 -499422056 500194996 -375175622 -234994863 332042788 408298941 -957548823 -24219709 36292785 -8564...

output:

877112872
BBBBBBBABBBABAAABABBBBBBABBBBAAAABBBBBAAAABBBABAAABBBBAABAAABAAAABABBAAAAAABABBAABBAAABAAAAAABBABBBABAABABBABBAAAAAAAABBBBBABBBBBABBABBBBBBABAAAABBABAAAABAAAABBBBBBBABBBBABBBABBBAABBBABBAABBBAAABBAABBBABABBBBABABBAAAABBAABBABAABABBBBAABAABABABBBBAABAABAABBBABAABBABBABAABBAABBABBABAABBABABA...

result:

ok correct answer and good plan!

Test #78:

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

input:

2000 1040
-175397565 584120107 839300932 241598853 507105068 897205495 219840388 -289892451 866274969 -818631181 -148135715 403902612 877950355 732264802 184271345 827589983 995310475 760245147 353296313 849730447 159566528 462845694 885915840 928619532 55435625 997819088 964318257 771704957 6203900...

output:

490878571491
ABAABBAABAAABAABBBABAABAABBABBABBABAABAAABABAAAAABBAABBAABBABABABBBAABBAAABAABBBBBBAABBABAABBBBBBAAABABAAAAAABAAAABBABBAAAAAABABBABBABABABABBAAABAABABAAABABBBBBABBAABABAAAAAAABAAABAAABAAAABBBBBBABAABBABBBAAABAAAABABABAABABABAABBBBBAABAAAAABAAABBAAABBBAABBBABABAABBBABAAABABAAABAAABBABABA...

result:

ok correct answer and good plan!

Test #79:

score: 0
Accepted
time: 5ms
memory: 4152kb

input:

2000 967
864145608 994500100 971879495 998085257 886429775 914884187 973798541 992883010 919086814 968647114 719863139 986619329 775221129 987320442 988511225 879534626 998444291 830756634 989530593 994191905 916954444 -74518201 977437954 990436600 997793050 847935373 959028920 585143437 946943014 -...

output:

1590206391221
ABABAAABBAAAABBBBABBAABBBABABABBABAAAAAABBABAAABBBBBABABABAAAABBABBBBBBAABBBBBBABABBBABAAABAABBAABAAAABABAABBABBBABAABAABABBBABAABBBABBBBBABAABBABBAAAAAAABBBAABABAABBBBAAABABBABAAAAAAAAABBBAAAAABAAABBAABAABBBABABBBABBBBAAAABAABBAAABAABBBBAAAABBABAAABABABABBAAAABABABBABBBABBBBABBAABAAAA...

result:

ok correct answer and good plan!

Test #80:

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

input:

1999 1032
997582182 999907801 999910295 999999171 999786305 999937654 999991777 999999848 999829913 999999939 999975701 999999965 999999999 999999996 999999670 999998677 999908287 999906280 999987536 999975391 999998539 999931085 999954481 999995267 999999914 999955177 999951821 999988370 999982697 ...

output:

1998085328069
AAAAAAABBAABBBBBBBAABAAAAAAAABBAABBAABBBBBBBAABBAABBBBBAAABAABBBABAAAABAAABBAAABBAABBAABAAAAAABAAAAAAAAAAAAAABAAABAAAABBBABAAAABBBABBBAAABAABABBABABAAAAABABBABABABBABBABABAAABABBBABABABAABAABBAAABBBAABBAAABAAABBABBBBAABBBAAAAABABABAAABBABABBABAAAABBBAAABABABBABBBBAAABBBAAAAAAAABBBABBAA...

result:

ok correct answer and good plan!

Test #81:

score: 0
Accepted
time: 5664ms
memory: 4144kb

input:

2000 1998
739282 423672 749326 721064 634842 744022 376251 459720 553871 642961 628850 575172 749048 598249 739211 582328 740579 733634 702555 671920 649882 536711 339649 717152 528470 740271 569533 642983 698305 716794 525872 688276 687424 658622 421070 286230 369239 742142 724835 722340 341281 742...

output:

373723266
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #82:

score: 0
Accepted
time: 5615ms
memory: 4152kb

input:

2000 6
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000...

output:

160754290
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBB...

result:

ok correct answer and good plan!

Test #83:

score: 0
Accepted
time: 5166ms
memory: 4144kb

input:

2000 1628
506759 -634896 -313019 93210 -150404 227500 324791 -323453 687424 43738 -147444 228161 566581 -329918 -437002 -525957 697622 -325750 67961 365829 -367150 -262499 203853 -745985 546504 -59110 -544315 728157 716622 -584420 -292129 -619008 444236 629203 571208 -199598 189521 89439 106800 -382...

output:

587740
AAAAAAAABAAABAAABAAAAAAAAAABBAAAABAAABAAAAAAAAAABAAABAAAAABBAABAAAAAABAAAAABAAAAAAAAABAAAAAAAABAABABAAABAAABAAAAABAABAAAAAAABAAAAAAAAAABAAAAAAAAABABAABAABAABAAAAAAABAAAAAAABAAAAAABAAAAAAAAAAAAAAAAABAAAAAAAAAABAAABAAABAAABAAAAAAAAABAABAAABAAAAAAAAAAAAAAAABABAAAAAAAAAAAAAAAAAABBAAABAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #84:

score: 0
Accepted
time: 5647ms
memory: 3856kb

input:

2000 65
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -100...

output:

2084794
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #85:

score: 0
Accepted
time: 4087ms
memory: 3952kb

input:

2000 1000
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1...

output:

739803
BABABABAABBABAABABABAABABAABABABBAABABBABABABAABABABABAABABABABABABABBABABABABABABABBABABABABABABABABABABABABABABABBBABBABAABABBABABABABABABABABBABABABBAABABABABBAABAABBABABABAABABABABABABAABABABAABABBABABABAABABAABABAABABABABABABABABABABABABAABABAABAABABABBABAABABABABABABABABABAABBBAABABABAB...

result:

ok correct answer and good plan!

Test #86:

score: 0
Accepted
time: 2740ms
memory: 4056kb

input:

2000 1000
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 ...

output:

0
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...

result:

ok correct answer and good plan!

Test #87:

score: 0
Accepted
time: 4799ms
memory: 3948kb

input:

2000 1000
1001 1000 999 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 ...

output:

776
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...

result:

ok correct answer and good plan!

Test #88:

score: 0
Accepted
time: 2002ms
memory: 4180kb

input:

2000 1000
1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0 1 1 0 1 0 1 1 0 0 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 1 0 1 1 1 0 0 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 0 0 1 1 0 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 1 0 1 0 1 1 1 0 1 1 1 0 1 0 0 1 ...

output:

0
BBABAABABBAABBABAAABBABABBAABAAABABBAABBBAABBBABAAABAABABBBAABABAAABABBBABBABBBBABAABAAABBBABBBABABBAAABBAABAABBABAAAABBBABBAABABBABABBBABBBABAABBBAAABABBBBBABABBBAAABABBAAAABAAAABAAAAABABBBAAABABABABABBABAAAAABBABBBABAABBAABABBBABABAAAAABABBAABBBAABAAAAAAABBBBABBABAABBABBAABABABBAABAABBABBBABABBB...

result:

ok correct answer and good plan!

Test #89:

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

input:

2000 1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

999999999
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #90:

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

input:

2000 1000
1000000000 -999999999 1000000000 -999999997 1000000000 -999999995 1000000000 -999999993 1000000000 -999999991 1000000000 -999999989 1000000000 -999999987 1000000000 -999999985 1000000000 -999999983 1000000000 -999999981 1000000000 -999999979 1000000000 -999999977 1000000000 -999999975 1000...

output:

999999999
BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...

result:

ok correct answer and good plan!

Subtask #5:

score: 0
Time Limit Exceeded

Test #91:

score: 0
Time Limit Exceeded

input:

8000 819
-80520 58858 -66529 -89399 -29326 -30844 -11574 101653 -19630 11590 -82857 -41398 47160 -103616 -72194 58679 39849 -58831 -74715 -21618 -42309 -108923 -62472 88514 82625 -38663 17205 -19790 -88376 -108625 67220 -93508 72195 72062 55863 118603 -58888 75786 -113297 -53630 -24366 119300 19571 ...

output:


result:


Subtask #6:

score: 0
Time Limit Exceeded

Test #113:

score: 0
Time Limit Exceeded

input:

25000 2601
684640294 598432913 -623227598 -736881259 -283494811 310898894 999454243 606030163 480256573 -699956166 388593535 -71688332 824098087 -969996868 53222581 730834964 -294074303 -949074306 -245586236 -170646877 -543582352 -466099725 -422182532 218666222 -822502298 -448284895 465111319 550729...

output:


result:


Subtask #7:

score: 0
Time Limit Exceeded

Test #134:

score: 0
Time Limit Exceeded

input:

50000 5073
401620049 252597114 638998890 -773942367 -994194991 773972290 755430111 -523539687 -749222285 70295502 406924746 -866460865 -321006536 -20842814 -717101098 238603919 -973981419 -263358138 341137321 -595132691 346299278 -897934865 -155536848 753555039 -925676770 -262539063 -447140814 22418...

output:


result:


Subtask #8:

score: 0
Time Limit Exceeded

Test #156:

score: 0
Time Limit Exceeded

input:

80000 7878
777864027 -240722331 387404961 -663519829 -216544675 -615470669 389523326 -655149376 147392262 -473912099 -138402122 -464043161 559358763 -559101596 -823274287 110669805 -604050872 544371755 -438475893 567469656 820006475 817713642 888317607 -538471506 971148759 -445976429 128957549 -1023...

output:


result:


Subtask #9:

score: 0
Time Limit Exceeded

Test #178:

score: 0
Time Limit Exceeded

input:

100000 10047
-5502 -308 7976 6352 -3142 -4377 528 1970 944 2448 8449 -4615 2083 4754 4525 -679 9798 -441 3115 5770 9575 6992 90 6051 -5122 70 -7052 2254 8847 2273 9231 9556 -8342 7092 -8287 -5179 -7231 -5016 4408 -4634 -1591 -6752 2148 2256 -9048 7607 553 -2994 -3081 -1207 3352 -578 8193 9903 7113 -...

output:


result:


Subtask #10:

score: 0
Time Limit Exceeded

Test #198:

score: 0
Time Limit Exceeded

input:

100000 10184
897364269 894652505 421467601 -125369057 974459026 -179714212 582271101 448643533 643614224 628078404 484256779 -635646600 -559936755 337166672 300228846 50900132 -792820304 -300878123 -67707471 -746291314 157318792 -311384832 -239695088 218211183 -159892602 67981542 252575782 580382287...

output:


result: