QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#44314#2122. Wystawa [A]SuffixTree10 ✓1051ms11408kbC++171.6kb2022-08-15 15:48:412022-08-15 15:48:41

详细

Subtask #1:

score: 1
Accepted

Test #1:

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

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: 2ms
memory: 3796kb

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: 2ms
memory: 3792kb

input:

1 0
2
3

output:

3
B

result:

ok correct answer and good plan!

Test #4:

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

input:

1 1
2
3

output:

2
A

result:

ok correct answer and good plan!

Test #5:

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

input:

1 0
-2
-3

output:

0
B

result:

ok correct answer and good plan!

Test #6:

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

input:

1 1
-2
-3

output:

0
A

result:

ok correct answer and good plan!

Test #7:

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

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: 1ms
memory: 3664kb

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: 2ms
memory: 3800kb

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: 2ms
memory: 3800kb

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: 2ms
memory: 3852kb

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: 1ms
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: 1ms
memory: 3864kb

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: 2ms
memory: 3844kb

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: 1ms
memory: 3668kb

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: 2ms
memory: 3796kb

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: 2ms
memory: 3788kb

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: 2ms
memory: 3704kb

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: 2ms
memory: 3800kb

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: 2ms
memory: 3792kb

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: 2ms
memory: 3860kb

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: 0ms
memory: 3828kb

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: 2ms
memory: 3796kb

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: 2ms
memory: 3796kb

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: 2ms
memory: 3792kb

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: 1ms
memory: 3720kb

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: 3796kb

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: 0ms
memory: 3724kb

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
BBBBBABBABABBBBAABBBBBBBBBBBBBBABBAABBABBBABAABBBABBBBABABBBABAAABAAAABBAABBAABB

result:

ok correct answer and good plan!

Test #30:

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

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: 3864kb

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: 2ms
memory: 3804kb

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: 2ms
memory: 3800kb

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: 2ms
memory: 3664kb

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: 2ms
memory: 3800kb

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: 2ms
memory: 3780kb

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: 2ms
memory: 3796kb

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: 3796kb

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: 2ms
memory: 3796kb

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: 2ms
memory: 3804kb

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: 2ms
memory: 3796kb

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: 2ms
memory: 3708kb

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: 2ms
memory: 3792kb

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: 2ms
memory: 3868kb

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: 2ms
memory: 3868kb

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: 3724kb

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: 3800kb

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: 2ms
memory: 3784kb

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: 1ms
memory: 3800kb

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: 3ms
memory: 3804kb

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: 3ms
memory: 3872kb

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
BBBBBBBBABBBBBBBBAABBBABBBBBAAABBAABAABABAABAABAAABAAAABBBAABAABAAABAABBBBBBBBAAABBABBAABBBABAAABBBBAAAAABBABAABBABAAABBABAABBAAABBBAAAAABBBBBAABBBABBAAAABBAAABBABBABABABBAABBABABABBBAAAAABABBBAAABBABAAAAAAABBAABBAABBBBAABBABABAAABABBABBBABBBABAAABBBBBBABAABBABABAAAABBBBABABBBAAAABABBAAAAAAA...

result:

ok correct answer and good plan!

Test #52:

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

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: 4ms
memory: 3672kb

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: 3ms
memory: 3796kb

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: 3ms
memory: 3800kb

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: 1ms
memory: 3836kb

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: 4ms
memory: 3816kb

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: 4ms
memory: 3740kb

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: 3ms
memory: 3820kb

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: 4ms
memory: 3808kb

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: 4ms
memory: 3800kb

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: 4ms
memory: 3800kb

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: 4ms
memory: 3804kb

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: 4ms
memory: 3784kb

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: 0ms
memory: 3796kb

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: 3ms
memory: 3800kb

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: 4ms
memory: 3788kb

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: 3ms
memory: 3792kb

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: 3ms
memory: 3884kb

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: 8ms
memory: 3880kb

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: 9ms
memory: 3892kb

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: 9ms
memory: 3752kb

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: 5ms
memory: 3892kb

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: 8ms
memory: 3816kb

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: 5ms
memory: 3820kb

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: 2ms
memory: 3888kb

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: 5ms
memory: 3816kb

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: 10ms
memory: 3932kb

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: 11ms
memory: 3960kb

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: 11ms
memory: 3952kb

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: 10ms
memory: 3828kb

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: 7ms
memory: 3900kb

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: 9ms
memory: 3884kb

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: 6ms
memory: 3896kb

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: 9ms
memory: 3828kb

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: 3ms
memory: 3824kb

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: 6ms
memory: 3824kb

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: 14ms
memory: 3924kb

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: 9ms
memory: 3748kb

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: 6ms
memory: 3908kb

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: 1
Accepted

Test #91:

score: 1
Accepted
time: 31ms
memory: 3848kb

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:

323537
BBBBBBBBBBBBBBBBBABBBBABBBBBAABABBBBABBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBABBBBBBBABBBBBBBBBBBBBBBABBBABBBBBBBBABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBABBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBABBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #92:

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

input:

8000 2647
38642 46138 36494 -42389 -95522 81653 -95362 21680 -951 93428 -67784 99778 117299 27429 -86811 -57996 70448 116447 10946 86304 38209 102184 3975 52506 -87847 68023 103894 101483 18155 -3659 -107034 -52931 79264 -23536 -86613 -109688 95333 116658 54939 115102 -50734 -18122 89517 -116770 -77...

output:

312702
BBBBBBBBBBABBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAABBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBABBBBABBBBBABBBABBBBBBBBBBBBBAABABBABBBBABBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBABBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBAABBBBBBBBBBBABBBABBBBBBBBBBBBABB...

result:

ok correct answer and good plan!

Test #93:

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

input:

8000 3920
-25589 85223 -62150 42955 15143 56075 -27583 98101 -16238 -51236 -43551 41451 -25564 -104186 -83589 -111531 -80154 -56717 37807 69198 91728 -51738 -38479 -40110 -109380 -19991 -67257 -76505 -115315 -109520 81113 -114280 11869 107368 -36553 112849 -110212 25970 110377 -87727 35696 -37943 11...

output:

324354
BBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBABABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBABBBBBBBBBBABBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBAAABAABABAAABBABABBAABAABBBBBBABBABAAABABBBBBAABABBAABBBBBAABBABBBBBBBBAABBBBBBAAAAABBABABBBABABAAAAAA...

result:

ok correct answer and good plan!

Test #94:

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

input:

8000 5410
114040 106469 40873 -32435 -5752 871 53695 -90313 2441 -41698 103082 -50842 -71293 26859 107829 97594 9245 21455 3703 -83348 23307 -80632 -10366 -3818 -5885 -10411 98699 107908 31714 -38520 26624 -55864 -66861 61411 -61428 61419 -14791 -96520 83913 33540 -69939 73796 -105534 -12097 -59890 ...

output:

334609
AAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAABAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #95:

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

input:

8000 7231
-58632 48448 39335 86875 70947 38433 -30093 49248 -12846 40140 -87880 -728 -1154 -64258 47911 -19081 -66422 -106408 116363 53748 -2441 114348 -98121 103069 -113217 -71426 -117753 106781 -101756 -96916 -25230 13887 -48457 -68153 -49702 -110247 19665 41486 -60152 70712 -69308 8674 118614 -45...

output:

333654
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAABAAAAAAABBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABABABAAB...

result:

ok correct answer and good plan!

Test #96:

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

input:

8000 3973
-119125 -113966 -119824 -117021 -119683 -119840 -119968 -118161 -119919 -119973 -118881 -119942 -91440 -119993 -108538 -119978 -56615 -119101 -119861 -113695 -119241 -97822 -67626 -97532 -117341 -110112 -117286 -119861 -119417 -88813 -119205 -107468 -119139 -119200 -117911 -119625 -56023 -...

output:

0
BBBBBBBBBBBBBBBBBBBBBBBBBBAAABBAAAAAABBBABBBBABBAABABABBABABBBBABBAAABAABABABAABABBABABBABAAAABABBAABABBAABABBAABAABBBABBBAABBABABABBBBABBBAAAABABABBABBABAABBBABABAABBBAABABABBBAABAAABBBBABABABABBABABABBBAABABABABAAABBBBBBAABBBABABBAABAAAABBAABBAABBAAAAABABAABBBABBABBBBAABBAABABBBBBABABAAAABABAAAA...

result:

ok correct answer and good plan!

Test #97:

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

input:

8000 3915
-94004 -25273 -111523 -105842 -80072 -93353 -110168 -80908 -115798 -8384 10596 -117211 -101158 -109551 -118704 -94880 -64194 -111122 -103313 -102264 -117535 51137 -53588 -73492 -117906 -119124 -103893 -109820 -8893 -116630 -117665 -54796 -104111 -114519 -89493 -80936 -117895 13546 -110049 ...

output:

55591
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAABBABABBAABAABAABBBAAAABBBABAABBBAABABABBAABBABABBBBABAABBBBAAABBBABBAAAAAABBBBABABABBBAAAABAABBBABABBBBBABAAABAABAABAABBABABAABBBBBBAABAABBABBBBBAABBA...

result:

ok correct answer and good plan!

Test #98:

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

input:

7999 4066
-2486 -101045 -94605 -112805 -64089 42060 -119645 -115330 -70805 -109870 13424 -87309 -55863 57077 49958 -107867 -108692 -80480 8164 -101239 -37349 -41753 35624 -111971 -118043 -119517 -55226 -118333 -75987 -21656 19193 -97799 -90148 19344 -119987 12631 66096 -119195 16831 -23621 -63893 -1...

output:

94244
AAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAAABBBBBBBBAAABAABABABAABABBABABAAABABBBBBABBBBBABABABABABABABBABBBAABABBABABABBAABAABABABBBAABABAABBAABABABBBBABABBBAABAABBBBBAABBBAABAABABBABBABA...

result:

ok correct answer and good plan!

Test #99:

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

input:

7999 3953
-2893 31114 17445 46725 -32293 116095 79899 89708 106961 48962 118051 111412 -2756 -11941 57039 114955 16269 -19522 90589 108031 54451 -3069 118243 44223 119127 90241 111333 -76157 89923 78632 20116 68318 108944 54178 110042 -31259 97825 74153 21007 70630 23603 94164 10255 113885 117561 -8...

output:

242162703
BAABABAAAABBAAABAAABAABBBBBABBABBABABAAAAAABBAAAAAAAAABBBBBAABAAAAAABBAABAABAAAABAABBBABABAAAABBBABBAAABABBBABBBBABABBABABAABABBABBAAABAABBBAABBBBAAAAAABBBABAABBABBABBABABBBBBBABABBAAAABBABABABABBAABABAABBBBABBBAABBABABBAABBABBAAAABBBBAAABABBBABBAABBAABBBBBBABBBAAABBBAABABBBBAABBABBAAABAAA...

result:

ok correct answer and good plan!

Test #100:

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

input:

8000 3993
119071 115974 118799 101611 119948 117696 115995 112624 88266 111450 118172 117505 60683 115547 114211 118488 111690 107705 85628 119306 70439 118863 119039 102998 110539 111869 116151 119352 104918 107420 118578 115392 92521 119751 115826 74250 117548 118050 116442 110797 103267 109547 89...

output:

762284470
BAAABBBBAAABAAAABAAAABAAAABBAABBABAABBBBABAABBABABABAAAAABBAABBABAAABAAABBBBBAABBABBBBBAABBAABBAAABBBBBBBAABBABBBBAAAABABBAAAABBBAABBAAABBAAABBBBBAAAAABBABABABBABAABABBAAABBABABAABABABBBAABBABBAABBAABBAABBAAABAABBABBBAAABABAAABBBBABAAAABAABABBABAAAAAAAAABBBBBBAAABBABABBAABBAABABBAABBBBBBAA...

result:

ok correct answer and good plan!

Test #101:

score: 0
Accepted
time: 39ms
memory: 4280kb

input:

7999 4027
120000 120000 119735 119999 120000 120000 119980 120000 119984 120000 120000 120000 120000 119993 119920 119997 119978 119973 119998 120000 119223 120000 120000 120000 120000 120000 120000 120000 119970 119856 119949 120000 120000 120000 119997 119980 119996 120000 120000 120000 119978 119...

output:

959429138
BBABBBABABBBBAAAAAABABBBBBBBAAABBBAAABBBAABBBAAABBAABABBABBABAABBBBBBBBBAAAABBABBABBBBBBAABABBAAAABBBBABABAABBABBBABBBAABABBBBBBBBAAABBBAABBABBABBABBBABBBABABBBBBAAAABABBAABBABAABBBBBBBABABBABBBBABABBBBBBBABBBBBBBAAAABBABBAAABAAABBABBBABABBBBBBBABABABBBABABBBBBABABBBBBBBAABAABAAAAAABABABBB...

result:

ok correct answer and good plan!

Test #102:

score: 0
Accepted
time: 36ms
memory: 3876kb

input:

8000 7989
19 20 22 17 21 14 22 11 22 20 20 19 22 21 22 8 22 22 21 18 14 7 21 7 22 21 18 22 18 16 21 -9 11 22 21 12 -2 19 18 21 18 22 1 21 22 18 16 22 21 17 19 12 20 20 21 6 -1 16 12 21 19 17 1 19 19 13 10 12 20 21 15 22 17 12 22 14 -1 7 22 18 22 22 18 18 18 16 22 5 17 22 18 20 20 21 22 20 7 18 11 20...

output:

10928
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #103:

score: 0
Accepted
time: 33ms
memory: 3960kb

input:

8000 15
-120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120...

output:

8273
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #104:

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

input:

8000 7081
7 -12 -1 2 -1 -10 9 15 2 13 13 -14 -2 -4 -18 -3 -4 -2 -4 -15 17 -4 -18 -9 -5 -13 -16 -11 3 -13 12 -13 -16 -16 -19 0 3 -15 19 -8 8 -5 -14 19 -5 -12 -6 -12 22 -12 7 -12 -3 -18 15 19 9 15 17 -11 -1 3 -16 12 -7 19 -9 -21 5 -21 -2 -15 -17 18 -6 -2 17 -3 -21 0 -3 -14 17 -1 -7 -1 0 -20 2 -13 20 -...

output:

24
AAAAAAAABABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAABAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAABAAAAAABABABAAAAABAAABAAAAAAAAABAAAABAAAAAAAAAAAAABAAABAAAAABAABAAABAAAAABAAAAAAABAAAAAABAAAAAAAABAAAABAAAAAAAABAAABAAAAABAABAAAAAAAAAAAABAAABAABAAAAAAABAAABAAAAAABAAAAAAAAABAAAAAAAAAAAAABAAAAAAABAAAAAAA...

result:

ok correct answer and good plan!

Test #105:

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

input:

8000 342
-120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -12...

output:

50
BBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBABBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #106:

score: 0
Accepted
time: 51ms
memory: 3988kb

input:

8000 4000
-120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -120000 -1...

output:

22
BABABABABABABABABABABABABABABABBABABABABABABABABABBABBABABABABBABABABABABABABABABABABBABABABABABBABABABABABABABABABABABABBABABABABABABABABBABBABABABABABABBABBBABABABBBABABABABBABABABABABABABABABABABABABABABABBABABABABBABABABABBABABABABABBBABBABABABABBABABABABBABABABABABABABABABABABABBABABABABABAB...

result:

ok correct answer and good plan!

Test #107:

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

input:

8000 4000
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -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 #108:

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

input:

8000 4000
4001 4000 3999 3998 3997 3996 3995 3994 3993 3992 3991 3990 3989 3988 3987 3986 3985 3984 3983 3982 3981 3980 3979 3978 3977 3976 3975 3974 3973 3972 3971 3970 3969 3968 3967 3966 3965 3964 3963 3962 3961 3960 3959 3958 3957 3956 3955 3954 3953 3952 3951 3950 3949 3948 3947 3946 3945 3944 ...

output:

3102
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #109:

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

input:

8000 4000
0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 1 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 ...

output:

0
AAABBABAAABABBBBBAAABBBBBAAABBAABBBBAABAABABBBABAABAAAAAAABBBBBABABABABBBABBBABBBAABBAABABBBAABBBAAAAAAAABBBAABAAAAAABABAABBABAAAABAABABAABABBBAAAAABABABABBBABBBBBAABABABABBBAABBABBBBABBAAAABABBAABBAABBABBBAABBAAABBBBABAABAABBAAAABBAABABBBABAABABBAABABBAAAAAAABBABBAAABABABABBBAAABABBAAABABAAABAAAA...

result:

ok correct answer and good plan!

Test #110:

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

input:

8000 4000
4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 -104000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 4000 -1...

output:

119845
AAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #111:

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

input:

8000 4000
0 120000 -119845 120000 -119843 120000 -119841 120000 -119839 120000 -119837 120000 -119835 120000 -119833 120000 -119831 120000 -119829 120000 -119827 120000 -119825 120000 -119823 120000 -119821 120000 -119819 120000 -119817 120000 -119815 120000 -119813 120000 -119811 120000 -119809 120...

output:

119845
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...

result:

ok correct answer and good plan!

Test #112:

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

input:

8000 3589
69123 -88510 -42568 -24870 92933 16946 31132 24164 86694 -67816 109234 87155 61303 -88674 33237 21483 -27600 117037 102825 -60767 11852 269 -3643 86515 58298 -11712 85845 101199 47750 86736 -32349 50744 17202 104489 97165 -36102 85546 -114150 98328 82929 21314 68501 -79122 12154 90918 3072...

output:

262576
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBABBBBABBBBBABBABBBBABBABBBBABBBABBBBBBABABBABBBBBBABBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBABBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAB...

result:

ok correct answer and good plan!

Subtask #6:

score: 1
Accepted

Test #113:

score: 1
Accepted
time: 83ms
memory: 4212kb

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:

2987102435
BBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBAABBBBBBBABBBBBBBBBBBBBBBBBBABBBBBBABBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBABBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #114:

score: 0
Accepted
time: 77ms
memory: 4156kb

input:

25000 8178
190504966 -875139058 -756352298 568179941 -641155725 581744768 -454363695 189829332 14056645 -50679842 -41948815 -762237201 -312707320 -833336580 210136099 552779740 -514877146 -66261080 -73299197 978461503 -899578082 191334439 678653231 384666619 -913186188 367946789 -823919219 -17449193...

output:

3628981392
BBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBABABBBBABBBBBABBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #115:

score: 0
Accepted
time: 79ms
memory: 4020kb

input:

25000 12436
308642626 992024750 -715716843 -929568624 -386543651 -297739432 -77055520 -352464903 -990200369 650473984 477671173 -307473335 90584199 766073211 219565971 -163332570 266359851 -671667278 -74772313 -362820453 -183397749 848768603 -272388509 -400301910 995323335 -104679803 55924132 467430...

output:

3335489399
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBABBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBAAAAABAAABAAAAABAABAAABABABBBABABAAAAABBBAABAAAABAAABAABAAAABAABABABBAABBAABABABBABABBBBABAAAABAABABAABBAABAAAABBAABBAABABABBBABAAABABBBBBBABBBBABAAABABBAAAAAAAB...

result:

ok correct answer and good plan!

Test #116:

score: 0
Accepted
time: 80ms
memory: 4212kb

input:

25000 16625
448170528 4632363 -848841543 -938966693 232365354 -78771060 373520399 645337788 -506237959 -700249693 460040663 511587462 -994343706 -975383849 -646950593 -879444880 244918156 870410171 609295303 -701931497 411575447 -958586576 316797749 -34940365 930240438 394246185 -746926822 718778536...

output:

5381096765
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAAABBAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #117:

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

input:

25000 22634
-45964800 -128203830 -930088741 -948364762 22188086 703855391 -78257699 -772902883 -487064891 96510277 -968461848 -521868096 845420807 624025942 -490037075 -618987271 24115313 -758426109 582221194 -43213452 151185861 -301152412 -729850135 -819908894 -137013371 -789522132 -916921134 -1539...

output:

3290020876
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #118:

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

input:

24999 12408
-993066398 -987759073 -999901870 -995785850 -875145805 -766067687 -999707968 -894861639 -696682722 -998045392 -826166859 -968710512 -999816719 -685173934 -999121677 -995313954 -949380754 -989299930 -980780197 -840322612 -532029014 -998333596 -937707721 -915864264 -988285928 -990188170 -9...

output:

0
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABAAABAAABBBBAAABAABBABBBBBBABABBBAAABAAAAABAABBAABABAAABBABAAABABABBAA...

result:

ok correct answer and good plan!

Test #119:

score: 0
Accepted
time: 33ms
memory: 4164kb

input:

25000 12539
-727972901 -851608779 -933105013 -275480356 -999287616 -978078421 -430540880 -992530808 -972015370 -773634867 -756008837 -990039771 -142519650 -920359567 -677967801 591108502 -913364467 -139506456 -954264137 -733797735 -382350097 -909975031 -614703516 -785003206 -872563571 -904378628 -73...

output:

384141552
AAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAAABBAABBBABABABBABABAABBAAAABBABBAAABAAABBABBABBABABBABAABBAABBABAAABABAAAAAAABABBAABBAAAAABBABBABABBAABABABABBAABBAAAAAABBBAABBBAABBABAAAABAAAAAAAABAAABBBBAAABBBABAABABAABAABBBABAAABAA...

result:

ok correct answer and good plan!

Test #120:

score: 0
Accepted
time: 47ms
memory: 4112kb

input:

25000 12436
-355223944 -575730090 -305452013 -665504745 -785292463 -561924245 -888715633 -990008725 498923871 502409603 -892241876 -973768961 -688496090 -268068453 -208931014 -244510056 256178727 -224081567 -287430116 -928229595 945827160 -57439084 123667054 363110885 -521107697 -568757096 -31086149...

output:

897993941
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #121:

score: 0
Accepted
time: 129ms
memory: 4904kb

input:

24999 12552
373139630 725242427 527905085 589889636 968438081 864884212 261504404 395657290 -543042745 999490637 947710697 454412713 764282458 766171518 -53787628 398037847 956562977 790234029 82653098 526425509 975932718 -250487319 -14299315 939558961 970857100 289703588 476255484 981659434 -491918...

output:

6471359470036
ABBBBBABABBABAABAABABAABBAABAABABABAAABBBABABABBABABBABAABBAABAABAAABAABBAABABBAABABBBBAABBABBAAABABABAABBABBABABAAABBABABABABAABBAAAABBBBABABBBBABAABABAAABABABBBBABABAAABBBBBAAABBBABBAABABABBBBABBAABBBABABAAABBABABABAAABABBBBAAABABBABBABBABABABBBABABBABAABBAABBBABAABBBAABBABAABBBBABBB...

result:

ok correct answer and good plan!

Test #122:

score: 0
Accepted
time: 140ms
memory: 4928kb

input:

25000 12547
980511092 902571756 999942249 999972546 999055301 982371638 990884041 992267466 995688241 805782714 710265851 998531113 500922480 995618651 970286608 945785302 950793916 971949705 481776903 992974881 990767615 985904861 936001969 999379830 938761510 985408646 965315450 998352740 89775725...

output:

19817644427572
BBBBBBBABABBABAAABABABABAAABBBABABAAABBBABAAAABABABBAAABABBBBAAABBAAABBAABAAABBBABBABAAAABAABABBBBBAAABBBBBBAABAAAAABABBBBABBBAABBBAABBBBBBAAAABAAABBBABAAAAABBBBABBBAABBABAABBABBBAAABABBBBAAAABAABAABBAABAABABABABBABABBABAAABBBAAABBBBABAAAAAABABABBBBBBBAAAABBAABAAABAAAABBBABAABABBBBBAB...

result:

ok correct answer and good plan!

Test #123:

score: 0
Accepted
time: 141ms
memory: 4896kb

input:

25000 12597
999998558 999999997 999951567 999943935 999960382 999986304 999998351 999999711 999973595 999950673 999996527 999676685 999999158 999999979 999999792 999997666 999993464 999986109 999997048 996066757 999998848 999983341 999854359 999999808 999981180 999417247 999999957 999996583 99999490...

output:

24988324195761
BBBBABBABBBBBBBAABBABBAAABBABBAABBBABABABAABBBABBAAAABAABBAABABAABBBBAAAAABAAAAABBABABBAAAAABABBABAAAABABAABABAABBBBAABABBAABABAABAABABBAAAAAABAAABAABBBABBABBAAABAAABBBAAABBABAAABBBBBAABBBBAAAABBBBBAAAABAAAABAABBBBBAAABABBBBAAAABBABBBABBBABBABABAABBBBBBBBABABAAABBABABBBABBBBAAABABBBAB...

result:

ok correct answer and good plan!

Test #124:

score: 0
Accepted
time: 93ms
memory: 4232kb

input:

25000 11
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -10...

output:

93316587
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #125:

score: 0
Accepted
time: 93ms
memory: 4304kb

input:

25000 24929
38981 59245 58398 49246 57765 32623 45062 59991 46174 48856 56683 57851 46854 47131 58551 46843 56657 43887 42589 34052 54350 1586 59480 -7725 49377 58910 55578 44702 55454 24462 32678 38273 46162 -15104 20848 43410 48018 44960 46090 57711 23072 47401 -5122 57810 55013 55658 34709 57323 ...

output:

15601198
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #126:

score: 0
Accepted
time: 103ms
memory: 4264kb

input:

25000 216
-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:

331939
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBB...

result:

ok correct answer and good plan!

Test #127:

score: 0
Accepted
time: 135ms
memory: 4236kb

input:

25000 335
-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:

252377
BBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #128:

score: 0
Accepted
time: 86ms
memory: 4296kb

input:

25000 12500
57766 53440 59977 57541 58046 53191 54586 47953 5770 26252 57730 38670 -5748 59559 54179 47760 -13943 59533 50864 52802 53918 41409 52183 40794 59467 43699 56296 36336 16072 20189 40518 54331 58195 33034 58610 52846 54071 57545 20255 49154 59671 37286 53649 -19732 36583 56710 20837 44085...

output:

59045
ABBABABAABABABABABABABABBABAABABABABABABBABAABABABBABABABABBABAABABABABABAABAABABABABBABABABABABABABABBABABABABABABABAABABABABABAABABABABABABABABABABABABABBABABBABABABABABAABAAABABAAABABABBABAABABAABABABABABABABBABABBBABABABAABBAAABABABABABABABABABAAABABABABABBABAABABAABABABABABABABABABABABABA...

result:

ok correct answer and good plan!

Test #129:

score: 0
Accepted
time: 111ms
memory: 4104kb

input:

25000 12500
1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -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
BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...

result:

ok correct answer and good plan!

Test #130:

score: 0
Accepted
time: 89ms
memory: 4224kb

input:

25000 12500
12501 12500 12499 12498 12497 12496 12495 12494 12493 12492 12491 12490 12489 12488 12487 12486 12485 12484 12483 12482 12481 12480 12479 12478 12477 12476 12475 12474 12473 12472 12471 12470 12469 12468 12467 12466 12465 12464 12463 12462 12461 12460 12459 12458 12457 12456 12455 12454 ...

output:

9692
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #131:

score: 0
Accepted
time: 153ms
memory: 4548kb

input:

25000 12500
1 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 1 0 0 0 0 1 1 1 1 1 1 0 0 1 0 0 1 1 0 1 1 0 1 0 1 1 0 1 0 0 0 1 1 0 0 1 0 1 0 0 1 0 0 0 1 1 0 1 1 1 0 0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 ...

output:

0
BABABBABABAABBBBAABABABBBABBBABAABBBBAABAAAABBBBBBAABAABBABBABABBABAAABBAABABAABAAABBABBBAABBABBBAABABBBAAAAABBABBBBABABAAAAAABBAABABBAABBBBAAAABABABABABABABABBBBAABABABBBAAABBBABBAAAABBBAAAAAAAABAABABABBBBBBBAABAAABBABBBBBAABBBBBBBABAAABABABAAAAABABBAAAABABAABBABBABAABABBAABAAAAAABABABBBBBBAAABAA...

result:

ok correct answer and good plan!

Test #132:

score: 0
Accepted
time: 116ms
memory: 4848kb

input:

25000 12500
12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 12500 ...

output:

999999999
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #133:

score: 0
Accepted
time: 84ms
memory: 5408kb

input:

25000 12500
999999999 0 999999997 0 999999995 0 999999993 0 999999991 0 999999989 0 999999987 0 999999985 0 999999983 0 999999981 0 999999979 0 999999977 0 999999975 0 999999973 0 999999971 0 999999969 0 999999967 0 999999965 0 999999963 0 999999961 0 999999959 0 999999957 0 999999955 0 999999953 0 ...

output:

999999999
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...

result:

ok correct answer and good plan!

Subtask #7:

score: 1
Accepted

Test #134:

score: 1
Accepted
time: 159ms
memory: 4584kb

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:

4159789614
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #135:

score: 0
Accepted
time: 158ms
memory: 4428kb

input:

50000 16491
54968367 631541498 992053774 166821902 -227802340 68248245 667948944 -89264003 -265259875 -594887443 926544734 -411696999 30407481 -421433024 416382339 -477508391 805215739 255289229 -974795064 89186347 -425870885 -240500701 -277492315 -907359926 -479110162 236386925 -738211191 -64852475...

output:

3518512257
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBABBBBBBBBBBBBBABBBABBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAABBBBBABBBBBBBBBBBBBBBABBBBB...

result:

ok correct answer and good plan!

Test #136:

score: 0
Accepted
time: 179ms
memory: 4428kb

input:

50000 24828
537402958 -867631466 399025999 157423833 391106665 312817610 580467777 -943977667 -731459803 -431790703 908914224 554847444 945479577 201406848 573295857 806379300 783774044 -350116969 998130828 -275525690 194703304 -47855879 823343448 845728632 944026365 -947381392 -908205503 89003346 -...

output:

3866929582
BBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBABBBBBBBBBBBABBBBBBBBBBBBBABABBBBBABABBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBABABBBBBBBB...

result:

ok correct answer and good plan!

Test #137:

score: 0
Accepted
time: 174ms
memory: 4448kb

input:

50000 33421
676930860 -488687082 413384945 -976027801 180929397 384302336 614869263 -509701983 -247497393 217485621 478371874 -626091760 -139448328 177786 70945152 -446983508 76791617 -981124160 -317801557 -102987229 910883637 609578285 435959787 525549445 -634876949 -448455404 288943544 244745715 -...

output:

3596500550
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAABAAAAABAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #138:

score: 0
Accepted
time: 171ms
memory: 4544kb

input:

50000 45093
-181501399 -985689134 818317331 -985425870 799838402 190358868 579265598 635584354 748245594 918639447 -25438220 340452683 359449335 623017658 -795571412 836904183 3472420 560953289 -319274673 -953878850 -811448864 949706753 -515081953 -259419084 -188310341 -434902412 657006318 -48047569...

output:

3289387874
AAAAAAAABBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABAAAAABBBABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAABAAAABAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #139:

score: 0
Accepted
time: 82ms
memory: 4332kb

input:

49999 24856
-988302792 -981126735 -993911777 -998932503 -990601597 -996725127 -852773701 -972654283 -998555823 -973007443 -928635102 -980439418 -946974943 -914074387 -414843676 -995721020 -999424024 -998729927 -999854642 -679951444 -984732844 -957580390 -795011482 -986081370 -962325749 -938740055 -9...

output:

0
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #140:

score: 0
Accepted
time: 70ms
memory: 4416kb

input:

49999 25071
-981236939 -482874649 -882394403 -844745427 -899214011 38091729 -928209316 -959916063 -907370298 126998636 -902557684 -913822692 -659272760 -840812191 -823395423 -478443811 -983289846 -904734085 -650302540 -848829760 398396981 -956361221 -544686396 -714945377 -960650412 -887381984 -88847...

output:

496110550
BBBBBBBBBBBBABBBABBBBABBAAAABBBBBAAABAABBAABBAAABAABBBAAABBBAABABABBBBABABBBBABABBABABAABAABBBBBBBAAABBBBBBBAABBBABABAABAAAABABBABABBAABAABAAAABBBBBAAAAABBBBAAABAABABBABBBAABBABBABBAAABABAABBABABAABBABAAAAAAABAAAABABABAABABBABABBBBABBBBBBAAAAAABABBABBBAABBBBAAAABBBBAAAAABBABAABBBBABAABABBA...

result:

ok correct answer and good plan!

Test #141:

score: 0
Accepted
time: 84ms
memory: 4476kb

input:

50000 25003
-315785577 -972450445 -883496956 -807952825 -865349961 -373486477 -996804487 -122121346 -961680960 -996638935 -634600134 -909746783 -105790480 -970467848 -613552691 281146822 -839175048 -931417510 -989870583 61387672 159562116 -79180666 -714552894 -309335761 -382355236 -411209329 -935500...

output:

862142636
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBAABABBABAAABABBAAABBBAABAAABB...

result:

ok correct answer and good plan!

Test #142:

score: 0
Accepted
time: 296ms
memory: 5984kb

input:

49999 25048
-148770102 822009433 903725720 830766607 360950186 866164115 728017623 718323599 -440591967 432940684 471765398 656316534 528813416 485636389 313126215 635031247 963977484 481103144 330738987 954824424 164155939 854309519 227042306 -434861233 165100450 999803920 -19459025 872476496 98789...

output:

13136959272726
ABBBABBAABABAAABBBAAABAABBAABBBBAABAABAABABAABAAABAABABBBAABABAAAABBAABBABBABABABBBBBABAAAABBBBBAABAABBABBAABABAAAABBAABAABBAABABABBBBABABAABAABABABABABAAAABABAABBBBBBAAABAAAABBABABBABAABBBBBBAAAAABBABABBBAAAABABABBABBBBABABABBAABBABABABBABAABAABAAAABBBABABBAABBAABBABABAABAABBAABABABA...

result:

ok correct answer and good plan!

Test #143:

score: 0
Accepted
time: 316ms
memory: 5968kb

input:

49999 24980
839583600 929326507 963755389 692370328 989855422 719769260 933496792 983032933 994789300 997643370 -106307963 992737344 998876281 926234381 614546823 998647410 970200776 978576605 910293053 956191138 859700494 663366223 989976111 587714478 854609336 986819617 553404661 952183350 9912528...

output:

39704902325442
AAAABABBABABBBABAAAAAABAABABBAAABBBABABBBBABBABBAABAABABAABABBABAAAAABBABABAABBAABBABBBAAABBAABAAAABBBBAABAAAAABBBBABBAABABAAABABABAAABBBAABBBBBBAABABBBBABAAABBABAAAAABAABBBBAABABABBABBABABAABAAAABBBBABBBBAAABABBAABBBBAABABBAAABAAAAABABAABAAAABABAABBBBBBAAABBAABBBABABABABAABBBBBAAAABA...

result:

ok correct answer and good plan!

Test #144:

score: 0
Accepted
time: 325ms
memory: 6008kb

input:

50000 25195
999924881 999992689 999894044 999979922 999994702 999997671 999941598 999992659 999959047 999978240 999022246 999657511 999991717 999999999 999999471 999971144 999997083 999881262 999999934 999999942 999990738 999999995 999999947 999999404 999992458 999826689 999945388 999996661 99999844...

output:

49976768196969
AABBABAAAAAAABBAAABBABBBBAAABBBBBBBABAAAAAABAABBABAAAABAAABABABBBBBBBAABBAABAAAAAAABBBBBBBBABBAABBBABBBAAABABABABAABABBBBBBABAAAAAABABABABABAAABBBBBABABAAABAABAAABBAAAABABAAAABBABAABBABAAAABBBBBAAAAABBBAABAABBABBBBABABAABBAAAABBAABBBBAAABBABBABBAABABBAABBBBBBAABBBAABBABABBAABBBABABBBB...

result:

ok correct answer and good plan!

Test #145:

score: 0
Accepted
time: 179ms
memory: 4548kb

input:

50000 23
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -10...

output:

46843654
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #146:

score: 0
Accepted
time: 189ms
memory: 4568kb

input:

50000 49956
8150 29903 29182 27069 13423 26356 8371 29810 29977 20175 26073 26586 29037 19918 28484 15078 26633 28658 29339 5982 7444 26612 27849 -2115 15685 5666 29147 22857 29133 3295 29137 28601 1036 15446 26571 23153 28059 27159 14820 24185 23480 28779 27845 18928 27754 26746 27379 22753 25815 2...

output:

25028859
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #147:

score: 0
Accepted
time: 183ms
memory: 4412kb

input:

50000 6677
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -...

output:

29115
BBBBBBABBBBBBBBABBBBBBBBBBBABBBABBBABBBBBBBBBBABABBBABBBBABABBBBBABBBBBBBBBBBBBBBABBBBBBBBBBBBBBBABBABABBBBBBBBBBBBBBABBBBBBBBABBBABBBBBABABBBBBBBBBBBABABBBBBBBBBABABBBBBBABBBBBBBBABBBBBABBBBBABBABBBBBBBBBBBBBBBBBBBABBBBBBBBBBABBABBBBBBBBBBABBBABBBABBBBBABBBABBBBABABABBBBBBABBBBBBABABBBBBBBBBA...

result:

ok correct answer and good plan!

Test #148:

score: 0
Accepted
time: 179ms
memory: 4540kb

input:

50000 47638
2157 -23738 -29921 25094 -6992 -21638 23802 8566 -24055 25581 -22184 -2984 28516 -20222 16885 -18971 21541 18130 -3745 -23496 -23405 19454 -15177 -20270 14533 -26652 -20613 21897 5773 -17358 14825 -6664 8635 -22558 6160 824 -27894 27203 -9077 13147 23632 -14057 8968 -8681 -22904 3839 186...

output:

62926
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #149:

score: 0
Accepted
time: 186ms
memory: 4532kb

input:

50000 25000
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 ...

output:

29580
BABBABABAAABABABBABABABAABBABABABBABABABABABABABBABABAABBABBABAABABABABAABABABABABABABABABABABABABABABABABBABABAABABBABABABBABABABABABABABABABABAABABABABABABABABAABABABABABABABABABABBABABABABAABABAABABABABABABABABABBABABABABABBAAAABABABABABAABABABABABBABABBABAABABABABABABABAABBBBAABAAABABABAAB...

result:

ok correct answer and good plan!

Test #150:

score: 0
Accepted
time: 119ms
memory: 4424kb

input:

50000 25000
1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -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
BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...

result:

ok correct answer and good plan!

Test #151:

score: 0
Accepted
time: 172ms
memory: 4616kb

input:

50000 25000
25001 25000 24999 24998 24997 24996 24995 24994 24993 24992 24991 24990 24989 24988 24987 24986 24985 24984 24983 24982 24981 24980 24979 24978 24977 24976 24975 24974 24973 24972 24971 24970 24969 24968 24967 24966 24965 24964 24963 24962 24961 24960 24959 24958 24957 24956 24955 24954 ...

output:

19383
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #152:

score: 0
Accepted
time: 322ms
memory: 5272kb

input:

50000 25000
1 0 1 1 0 1 0 1 1 0 0 0 0 1 0 1 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 1 1 0 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 1 0 1 1 0 ...

output:

0
BABBABABBAAAABABABBAAABAAAAABBAAABBBBAABABBBABABAAAAABBBAAAABABAABAABABBABABABABABABAABABAABBBABABABBBBBBBAABAAABBAAAABABBAAABAABABABABBBBABABBABBBBABAABBBBAABBBABAAAAABBBBAABBABABBABABBAABBBAAAAABAAAAAAABBBBABAAAABABAAABABAAABABAAAABAABBAABBBBABBBAAABBBAABABBBABBBBABBBAAAAAAAAABBAAAABBBABABBBAABA...

result:

ok correct answer and good plan!

Test #153:

score: 0
Accepted
time: 243ms
memory: 6052kb

input:

50000 25000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 #154:

score: 0
Accepted
time: 180ms
memory: 6896kb

input:

50000 25000
999999999 0 999999997 0 999999995 0 999999993 0 999999991 0 999999989 0 999999987 0 999999985 0 999999983 0 999999981 0 999999979 0 999999977 0 999999975 0 999999973 0 999999971 0 999999969 0 999999967 0 999999965 0 999999963 0 999999961 0 999999959 0 999999957 0 999999955 0 999999953 0 ...

output:

999999999
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...

result:

ok correct answer and good plan!

Test #155:

score: 0
Accepted
time: 438ms
memory: 7672kb

input:

50000 32965
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 10...

output:

50000000000000
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Subtask #8:

score: 1
Accepted

Test #156:

score: 1
Accepted
time: 240ms
memory: 4924kb

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:

3874967607
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBAABBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBABBBABBBBBABAAABBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #157:

score: 0
Accepted
time: 271ms
memory: 4932kb

input:

80000 26630
-228051878 771885283 254280261 763424024 549847976 479444139 -209738418 -680776767 -856864752 175364225 -130431639 502501282 -429962998 -422441308 -813844415 345526421 836450348 -425331374 98108077 202757619 -611296839 -989641537 475332953 -346870116 -582284634 -606314664 -188520409 -975...

output:

3801583361
BBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #158:

score: 0
Accepted
time: 255ms
memory: 4820kb

input:

80000 39764
401866359 127399585 147432070 120362725 -831243020 -737929411 -297219585 924412645 113277242 876518051 927245435 -678437922 -538320984 -675547872 319639022 -223102243 615647505 969262429 244118607 323418578 -819808923 -332207373 -423831285 -958078490 840851893 921058745 -843887717 -23754...

output:

3554018068
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBABBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #159:

score: 0
Accepted
time: 221ms
memory: 5000kb

input:

80000 53449
541394261 142047038 14307370 110964656 446799136 847375732 -262818099 846907752 -839102270 -474205626 423435341 288106521 351150119 -52708000 476552540 -939214553 56148724 363856231 268922000 -15692466 -251112236 837007368 503244323 -766477100 -200800923 396554651 -623308589 -81803460 47...

output:

3494197937
AAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAABBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAABAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #160:

score: 0
Accepted
time: 255ms
memory: 5008kb

input:

80000 72060
585316019 520991422 566723402 101566587 -786808214 601554762 187757820 -155289558 -355139860 -311108886 -371403940 742870387 728165129 -939477794 485982412 344673138 -164654119 735019952 952989616 156845995 -459624320 -995948804 90259669 422953379 -777664397 236216416 573840458 -32084528...

output:

3621845085
AAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAABAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAABAAAAAA...

result:

ok correct answer and good plan!

Test #161:

score: 0
Accepted
time: 116ms
memory: 4812kb

input:

80000 40282
-807845064 -908407153 -996182535 -998422152 -978187317 -995906659 -953369638 -988177157 -998824616 -999966807 -884672099 -988584498 -997940093 -980901953 -952527122 -992778892 -837750727 -999727941 -997701618 -999698096 -573993821 -998880725 -978741842 -998212098 -826379409 -985836668 -9...

output:

0
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #162:

score: 0
Accepted
time: 101ms
memory: 4880kb

input:

79999 40013
-896374382 -361614483 -975141669 -973889985 -898047826 -990311398 -961506844 -750797689 -860253155 -987303203 -862102858 497945101 -965764904 -947801132 436307350 -883581278 -167332142 -670306738 -881098628 -995234520 -240252209 -336713158 -595832767 -923190546 -766929916 -859271804 -981...

output:

693110785
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAABAAAABBAABABBAAABAAAAABABBBABBAABABAAAABBAAABABBBABAAAAAAAABBAABAAABBABABABABBAAABAABBBABAAABBABABBAABABABABABBAABBAABBAAABBABABBBABAABBABABABBBABABABBBBBABBBAABBABBAAAABBBABBBBBBBAAABABBABABAAABAABABABAABBAAAA...

result:

ok correct answer and good plan!

Test #163:

score: 0
Accepted
time: 150ms
memory: 4800kb

input:

80000 40185
-443887057 -701963261 -908144478 -979301695 -876663216 -846154154 -672448306 -939206055 -996694533 -917704326 -406342998 645850042 -288331467 167050868 -874813444 -706410602 -812811972 -454889561 -36767926 -169740434 -838922894 -712728806 -988915561 -560620770 -889613124 -759224262 -9184...

output:

843482072
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBAABAAABBAABAAABBBBABBBBBAAAABABBBBBBABBABAAAAAAAAAABABAAAAAABABBBAABBABBBAAAAAAAAABBABABABABAAAABABBBBABABBBAAAABABBABBAABBABBABBBABBABAABAAAAAAAABBBBABAABBAAAAABAABABBBAAABAABAAAABBABAAABBABBAAA...

result:

ok correct answer and good plan!

Test #164:

score: 0
Accepted
time: 512ms
memory: 7328kb

input:

80000 39916
63614150 -358765600 682295190 862985212 -350552943 817860106 996583373 923396357 -374068874 942711588 691508327 -160712727 439699841 677772308 -297051394 -175188947 550344449 -805816172 18815069 988227442 894520329 545995328 905215645 290095722 857215048 701972750 531102205 189653216 639...

output:

20627697019926
BBABABBBABBABBABAAABBABABBAABAAABBBBABBBBAABBABAABBBABAAABAABBAABBAABAABAAABBBBABBBBBBBBABBBABBABBBBAAABABABBBBABBBABBABAAAABABBAAAAAABBBAABBBBBABABBBABBABBBABBABABAABAABABAAABBBBBAAAAAAAABBAABBABABBBBABAABBBABABBABAAABABABAAABAAAAABABAAAABABAABBBBAABBABBABAAABAAAAAAABABBBABABAABBABAA...

result:

ok correct answer and good plan!

Test #165:

score: 0
Accepted
time: 552ms
memory: 7328kb

input:

79999 40150
882407581 953539826 993470985 986703182 934118890 694242408 947804526 955772698 797684357 942535343 984520574 979860088 871008737 932159870 360559043 997797257 371405524 977264406 940186951 865738858 964903249 980529641 978603319 813535449 928400310 999682136 988485019 721756694 99273828...

output:

63499322614512
AABBAABAAABBAAABAAAABABABBBAABAABABBBBBAAAAABBABBABAABBBBBBBBBABBBBBAAABAABBAAAAABABBABABBBAAABBBAAABABBBBBBABAAAAABBAAAAABAABBBBBAABBABBAABBAABBABABAAABAAABABBAABBABBBABAAABABAAAABBBABBBBBABAAABABABAABABBAABAABABABAAABAABABBBBBABBBBABABBABBBBBABAAAABAABBBABBBABBBBBBBABBBAABBBABBBAAAB...

result:

ok correct answer and good plan!

Test #166:

score: 0
Accepted
time: 557ms
memory: 7236kb

input:

79999 39894
999980445 999742869 999995056 999999976 999985531 999981968 999999849 998506718 997907012 999386148 999990665 999999992 999983952 999922217 999987255 999942793 999999134 999998489 999997117 999947966 999962283 999999732 999986423 999961169 999773632 999973032 999991676 999986791 99999715...

output:

79961053529424
AAABBAAAAAABAAAABAAAABAAABBABABBAAABBBBABAABBBAAAAABBBBBAABABABBBABBBABBAABBBAABBBBABBBABBBBABAABABBBBAAAABBAABABBAAABBBBABABABABABBAABBABBBABBBBAAAABBBBABABAABBAAAAAAAABAAAAABBABAAAAAAABBBABAABABAAAAAABABAABBABABAAABABBAAAAAAABBBBBBBAABABAAABBBAAABBAABBBAABABBBBAABABABBBABBBBBABAABBB...

result:

ok correct answer and good plan!

Test #167:

score: 0
Accepted
time: 298ms
memory: 4944kb

input:

80000 79998
-6559 -725 18103 17079 18104 13497 11586 13526 18046 9754 17557 15630 15657 9725 14252 13793 18284 18670 17537 13004 18093 17895 18404 -3977 18708 13677 12445 18726 5164 16790 15692 17429 16240 16752 -1130 16983 18200 18403 15624 12012 17071 1826 18474 18619 16323 -5323 2164 12087 16850 ...

output:

374249699
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #168:

score: 0
Accepted
time: 325ms
memory: 4964kb

input:

80000 79995
18704 18456 17052 10784 18091 15649 17192 14245 6837 18724 15161 18719 17994 12173 12570 17812 15834 17765 18662 12979 9091 17805 18658 16105 9018 11127 13178 17652 17279 5753 17379 18318 18152 13531 17604 12543 18103 17542 6710 11786 18720 13661 17791 13927 5053 13446 18416 18087 -6189 ...

output:

187808655
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #169:

score: 0
Accepted
time: 286ms
memory: 4932kb

input:

80000 77881
-7199 3422 -14297 -3925 -14449 4958 2703 -15347 -310 -7795 17105 -17774 -3690 12576 -7168 -11805 12847 7306 12521 3743 -11959 1703 1913 13181 -18155 11849 -6880 3521 -18214 -13136 15417 -7204 -5323 -13010 -2993 -14971 -7340 10597 12153 1097 -18085 -15045 7418 8193 14170 476 3494 -6966 93...

output:

54204
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAABAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #170:

score: 0
Accepted
time: 289ms
memory: 4932kb

input:

80000 4306
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -...

output:

35872
BBBBBBABBBBBBBBBBBBBBBBBBBBBBBABBBABBABBBBBBBBBBABBBBBBBBABBBBBBBBBBBBBBBBABBBBBBBBBABBBBBBBBBBBABBBBBBBBBBBBBBBBABBBBABBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBABBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBABBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBABBBBBBBB...

result:

ok correct answer and good plan!

Test #171:

score: 0
Accepted
time: 276ms
memory: 4932kb

input:

80000 40000
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 ...

output:

18484
ABABABABABABABABABABABAABABABABBABABABABAABBABABABABBABABABABABABABABABAABABBABAABABABABABABABBABABABBABBBABABBABABABABABABABABAABABABABABABABABBABABABABABAABBAABAABABABBABABBBABBABABABABABABABABAABBABABABABABAABABABABABBAABBABABABBABABAABABABAABABABABABBBABABABABABABABABABABABAABABABABABABABB...

result:

ok correct answer and good plan!

Test #172:

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

input:

80000 40000
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 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 #173:

score: 0
Accepted
time: 301ms
memory: 4800kb

input:

80000 40000
40001 40000 39999 39998 39997 39996 39995 39994 39993 39992 39991 39990 39989 39988 39987 39986 39985 39984 39983 39982 39981 39980 39979 39978 39977 39976 39975 39974 39973 39972 39971 39970 39969 39968 39967 39966 39965 39964 39963 39962 39961 39960 39959 39958 39957 39956 39955 39954 ...

output:

31012
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #174:

score: 0
Accepted
time: 549ms
memory: 6076kb

input:

80000 40000
1 1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 1 ...

output:

0
BBBBABAAAABAAAAAAAABBABABAAAABAABBAABBBBAAABABBAAABBBBAAAABAABABBBABABBABAAABABABAAABBBBABAAABBBBABBBBABBAAAABABAAAAAAAAAAABBBAAAAABBAABBBBAABBBAAABABBABBABBBAAABBABAABBBBBABBAABBAAABBBBAABABBAAABAABAABAABABABBBBAAABAAAAABAABBABBBBABBABBAABBABABABABBABBAABAABAABBBAABABAAAABAAAAAABAAAAABBBAABBABBAB...

result:

ok correct answer and good plan!

Test #175:

score: 0
Accepted
time: 384ms
memory: 6528kb

input:

80000 40000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

999999997
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #176:

score: 0
Accepted
time: 290ms
memory: 7128kb

input:

80000 40000
0 1000000000 -999999997 1000000000 -999999995 1000000000 -999999993 1000000000 -999999991 1000000000 -999999989 1000000000 -999999987 1000000000 -999999985 1000000000 -999999983 1000000000 -999999981 1000000000 -999999979 1000000000 -999999977 1000000000 -999999975 1000000000 -999999973 ...

output:

999999997
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...

result:

ok correct answer and good plan!

Test #177:

score: 0
Accepted
time: 788ms
memory: 9936kb

input:

80000 46417
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 10...

output:

80000000000000
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Subtask #9:

score: 1
Accepted

Test #178:

score: 1
Accepted
time: 398ms
memory: 5108kb

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:

39002
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBABBBBABBBBBBBBABBBBABBAABABABBABBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #179:

score: 0
Accepted
time: 367ms
memory: 5180kb

input:

100000 32886
5333 -3595 -1881 -8757 3537 -793 8663 8013 -91 -7691 -4715 8299 -1897 1414 -7739 2513 8661 -2279 -6923 -8860 1912 -2346 -9288 7771 4557 -3350 -6539 -919 -3837 -7992 -9004 -4877 6627 9457 1921 5647 -7696 -325 -2407 -7104 3516 2446 -2096 522 8191 5832 -1365 9613 7629 5280 -2933 -2037 -261...

output:

40458
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBABBBBBBBABBABBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #180:

score: 0
Accepted
time: 381ms
memory: 5056kb

input:

100000 50008
8249 9637 -7746 -3930 -2461 -401 -1387 1974 6078 -5563 2988 -2510 3588 7029 -2 -1499 4397 6689 -3774 2579 9643 5991 -4648 -6042 8763 -1317 -4275 -5758 -4319 1214 -8699 2682 4482 8610 -3795 -2933 3360 -2687 -6961 -6567 -2713 9893 5332 539 -639 8405 -686 -5376 -7881 -4157 -6091 -9479 -435...

output:

38963
BBBBBBBBBBBBBBBABBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBABBABAABBABAAAABABABBAABABBBABBBBBBBBBAABBAABBAABAABBAABBAAAABAABABBBABBBAAAAABBAABBAABBAAABBAAABBBAABBBBBAABAAABBBABAAAABABBBBBABABBABAAABABBBBAABBABABBBBBBBBBABABBABBBBAABBBAAABAABBAAAAABBAABBBABBABBABBAABBBABBBABAABAAAAAAABAA...

result:

ok correct answer and good plan!

Test #181:

score: 0
Accepted
time: 354ms
memory: 5180kb

input:

100000 67154
2210 -854 -2480 1492 736 4339 4487 7151 5043 -3435 -8185 -6115 1869 3094 -3071 -5511 6116 6582 6189 7950 1385 -3942 522 1897 -8763 -4737 -3762 9319 -1319 -1847 5864 -6873 3798 8358 -165 -8626 2895 2004 7976 -6181 133 -910 -2634 1066 -3401 -7898 -8077 -4441 8302 6407 -325 -6590 -6679 -13...

output:

42108
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAA...

result:

ok correct answer and good plan!

Test #182:

score: 0
Accepted
time: 402ms
memory: 5172kb

input:

100000 89863
-6956 176 4452 -2161 211 719 -2436 1112 6864 -2768 113 6799 -2111 5227 -8131 -7772 9056 -729 2134 -3468 -1930 7877 7423 -1856 -6818 9227 -4980 4480 5998 2416 696 -3036 -5551 7511 -9363 2200 -3789 -4706 3422 -171 5240 6027 -6878 4805 3897 -9673 931 -7758 9071 -5356 -3483 8230 6115 4833 -...

output:

37321
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #183:

score: 0
Accepted
time: 140ms
memory: 5108kb

input:

100000 50244
-10000 -9832 -9704 -9985 -9447 -9886 -7370 -4297 -9992 -9759 -9824 -9991 -8494 -9908 -9980 -9995 -9393 -9979 -9316 -9550 -9606 -9972 -9154 -9623 -7528 -9100 -9945 -9727 -9341 -9976 -9998 -9997 -9018 -9964 -9946 -9996 -9973 -9455 -9939 -9968 -7792 -8588 -7852 -9907 -9344 -9731 -9652 -981...

output:

0
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #184:

score: 0
Accepted
time: 129ms
memory: 5032kb

input:

99999 49747
-6700 -9819 -8819 -9940 -9659 -9040 -9415 249 3413 -7978 -7378 -9320 -9212 -8735 -8541 -9864 -7834 -4106 -9925 -9518 -9108 -9899 -9018 -9930 -8492 -9706 -9538 -57 -9422 -9806 -9868 -9907 -9763 -3419 -8994 -2192 -297 -3940 -9506 -8704 -9410 -9781 -9949 -9958 -9106 -6751 -8495 -5430 -9996 ...

output:

4515
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #185:

score: 0
Accepted
time: 156ms
memory: 5052kb

input:

99999 49733
-9263 4651 2459 -9355 -2072 5580 -2336 -4557 -9800 -5729 -9702 -155 -2078 -5869 4309 -4129 -6168 -2724 -1469 -9671 3506 -8180 -9500 -9730 -3665 -4571 -5891 -8887 -5391 4407 -5962 -6022 -9054 -2577 -1736 -3259 -3282 2146 211 -9455 -6701 -7909 -6520 -9915 -6271 -8634 -4145 -2171 1163 -5042...

output:

12257
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #186:

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

input:

100000 49896
3570 8187 8791 9520 -500 3426 5579 8451 9886 9585 1577 -2608 6214 -4993 448 6305 9420 8871 8528 8412 9694 4655 3635 8694 4422 3953 -1087 6165 1144 9668 3235 6892 7887 2888 -3890 9384 7542 5635 7596 4989 3944 8591 5963 1762 9553 9480 1384 9331 8392 4040 8516 9230 3953 8646 -571 5840 9899...

output:

256308456
BBBBAAAABBAAAABABABBBABBBBAABBAAABABBBBBABABBBABABBBABAABBABABBBABBAAAABABBAAABBABBBABBBABABBBBABBABABAAABBBBAAAAABBABBBBAAAABAAABBBABBAABBBAABBAABBAAAAAABBBBABBBBAABBBBBAAABAAABBAAAAAABAAABAABBBBBBABABBBABABABABAAABBBAAAAABABAABBAAAABABBBABABBBAABBBBBBAABAABABBBABBABBBBBBBBBAABBBABBABBBBB...

result:

ok correct answer and good plan!

Test #187:

score: 0
Accepted
time: 714ms
memory: 8240kb

input:

100000 49882
9224 4652 8020 7252 9880 9718 9377 8445 9513 7611 9007 9047 9989 9944 9643 9936 9038 9538 5729 9682 8598 7224 9988 9558 5943 9769 9343 9597 8063 9788 8343 9012 9952 6855 9418 9986 9810 8236 9063 9096 9969 9958 9901 7240 8694 4479 6168 8973 9028 9922 9909 8318 9982 9993 9921 9907 9760 95...

output:

792996579
AAAABABABAABBBABBBABAABBABAAABAABABBBBAABBABBAAAAABABBBBABBBABAAAABBBABABAAABBBBABABABABBBAAAABBAABBBBAAABBABBAABBABABABAAAABBABAAAAABBABBABABABBBBBBBABAABABBBBBABABBABBABABBABABBBAABBBAABBBBABBBABAAAAABAAAAAAAABAAAABABAABBBBBBBBAAABABBBBABAAABBABBBBAAABBABABABAABBABABBBBABBAAABBAABAAABBAA...

result:

ok correct answer and good plan!

Test #188:

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

input:

99999 50045
10000 10000 10000 9998 9999 10000 10000 10000 9986 10000 10000 10000 10000 10000 10000 10000 10000 9994 9996 9999 10000 10000 10000 9999 10000 10000 10000 10000 10000 10000 10000 10000 10000 9999 10000 10000 10000 9988 10000 9998 10000 9999 10000 9998 10000 10000 9999 9998 9996 9994 1000...

output:

999515772
BBBABBBBABBBBBBBBABABBBABBBBBBBBBABBBABABBBABBBAAABBBBABBBBBBAABBBBABBBBBBBABBBABBBBBABBBBBBABABBBBBABBBBBBBBBBBBBBBBBBBBAABBABBBBBBABABBBBBBBBBBBBBBBBBBBAAABBBABBABBBBBBBBABBBBBABBBBBBABBBBBBABABABBBBBBBBBBABBBBBBABBBBABBBBBAABBBBBBBBBABBBBBBABBBBBBBABBBABABBBBBBBBBBBBBBABBABABBBBBBBBABBB...

result:

ok correct answer and good plan!

Test #189:

score: 0
Accepted
time: 370ms
memory: 5148kb

input:

100000 11
-10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10...

output:

0
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #190:

score: 0
Accepted
time: 413ms
memory: 5180kb

input:

100000 99986
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

0
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #191:

score: 0
Accepted
time: 353ms
memory: 5188kb

input:

100000 13762
-10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 ...

output:

0
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #192:

score: 0
Accepted
time: 343ms
memory: 5180kb

input:

100000 85297
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

0
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #193:

score: 0
Accepted
time: 359ms
memory: 5168kb

input:

100000 50000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

0
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #194:

score: 0
Accepted
time: 238ms
memory: 5052kb

input:

100000 50000
-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 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 #195:

score: 0
Accepted
time: 842ms
memory: 6772kb

input:

100000 50000
10000 10000 10000 10000 10000 9999 9999 9999 9999 9999 9998 9998 9998 9998 9998 9997 9997 9997 9997 9997 9996 9996 9996 9996 9996 9995 9995 9995 9995 9995 9994 9994 9994 9994 9994 9993 9993 9993 9993 9993 9992 9992 9992 9992 9992 9991 9991 9991 9991 9991 9990 9990 9990 9990 9990 9989 99...

output:

7753
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #196:

score: 0
Accepted
time: 727ms
memory: 6616kb

input:

100000 50000
0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 0 1 1 0 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 0 0 0...

output:

0
ABAABBABABBBBBBBBABAABAAAAABAABBBBBBBBAAAABABABBBBAAAABBABABBAABABBABAAAABABAAABBBBBBBBABAABBAABABBABAAAABABBAAAABBBAAABABBABBAAABBAAAAABBBABAAAABAABBABBAAABBABBBABBAABBAAAAAABBBABBAABBAAAAAABAAAAAABABBBBAAABBBABBAABBAABABBABAAAAAABABABABBABBBABAABAAAAAAAAAAABBBBAAAABABABAABABAAABBABAABBABBBBAABAB...

result:

ok correct answer and good plan!

Test #197:

score: 0
Accepted
time: 1051ms
memory: 11356kb

input:

100000 63563
10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000...

output:

1000000000
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Subtask #10:

score: 1
Accepted

Test #198:

score: 1
Accepted
time: 355ms
memory: 5172kb

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:

3372235692
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBABBBBBABBABBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBAABBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #199:

score: 0
Accepted
time: 375ms
memory: 5176kb

input:

100000 32893
550712587 -726403112 774522485 -186644628 -406631970 -446925424 494789934 544223279 -872423367 -575161627 -996123234 183414197 768047181 84060108 -713771364 -690813171 -814261999 581935103 416998997 402817066 777892981 -655990508 -214166909 -904646696 -736756076 -604006198 963545245 883...

output:

4141014867
BBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBABBBBBBABABBBBABBABBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #200:

score: 0
Accepted
time: 356ms
memory: 5056kb

input:

100000 50134
-966852823 -711755659 -841935372 193724155 -616809238 136339879 581068922 -457974031 609499204 564505032 -961876242 -850041361 -169397078 220720396 -556857846 593074520 453154582 -23471095 -898933388 -426684313 5722818 -975126263 739185208 310384776 -290189468 -53202708 -668391982 -5263...

output:

4436273738
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAAAABAAAAABAAABBAABBAABBAABBBBAAAABBBABBBBBAAABABABBBBBBAABABBBABAAABAAABABABAABAABAAABAAABBAAAABABABAABBBABBAA...

result:

ok correct answer and good plan!

Test #201:

score: 0
Accepted
time: 325ms
memory: 5164kb

input:

100000 66797
174714919 153368309 -975060072 184326086 2099767 -569384166 493587755 -23698347 -906538387 -248161559 43923330 -104248308 745675018 -127992312 86235256 853532129 -106344199 4785937 587812920 722424067 -740039764 -317692099 837981131 476385173 -355272365 910512622 988660140 800308849 320...

output:

4030693811
AAAAAAAAAAAAAAABAAAAAAABABAAAAAAAAABAAAABAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #202:

score: 0
Accepted
time: 331ms
memory: 5192kb

input:

100000 89769
166759175 -343633743 -570127686 -874909646 -719858078 -324814801 892286172 -930289513 -835487817 -85064819 -459886764 862296135 -391130389 494847560 -927764954 137419819 -327147042 375949658 -728119465 -618857889 -657522661 851522642 -599240193 229473730 91294243 -738045037 723059684 -6...

output:

3791798018
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #203:

score: 0
Accepted
time: 126ms
memory: 5124kb

input:

99999 49957
-830015302 -975820285 -999545070 -720364098 -963764030 -881279471 -763492611 -986117142 -997281962 -788796181 -839375640 -999975465 -999761678 -983203352 -990990365 -996122586 -900265687 -951381779 -999194309 -942814445 -972262507 -984778107 -981890846 -994513612 -947507295 -946843598 -9...

output:

0
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #204:

score: 0
Accepted
time: 154ms
memory: 4960kb

input:

100000 50120
-626224641 390989928 -464085969 -90804409 -865911461 -838144859 -807098804 -857988644 119218206 -918615961 -952150672 -920923072 -825988401 -302254081 -981068669 -944055186 -678370567 -492119477 -256855913 -925145042 -794735882 -777118098 -994886675 -399756678 -999390754 -897760950 -826...

output:

611894569
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #205:

score: 0
Accepted
time: 128ms
memory: 5056kb

input:

99999 50228
-612387793 -883556103 -870750704 -868970573 -593477270 -678293831 -349318124 -28741692 -921615180 -898184969 24090271 -451332349 -66945051 -610840585 -847723019 -463154068 -867866607 485238631 -918315247 -506205830 -921188481 305761828 -549501989 -390984818 -393039589 -596734418 -1307312...

output:

889932508
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #206:

score: 0
Accepted
time: 654ms
memory: 8180kb

input:

99999 50038
-326096691 107788743 -626501034 454311842 860075090 653066966 875527904 843949766 946827308 587101435 300929626 281350250 978284005 985686733 915277357 160134685 416160616 -227483169 803438310 415661839 608734748 -165737004 -364135452 634327493 987901629 685657621 -136775666 233218645 -2...

output:

26139213502643
AAABBBBBBABAABBAAABBAAAABAAAAAABABABBBABAAAAABAABABBAABAAAABAAABBABBBABBBBABBABBAABBBABBABAAABBBBBAABAAABAAAAABBBBABABABAABBBABBBBAAABBAABAABAABBAAABAAABAABABAAAAAABABBABABBAABAAABBABABBBBAAABBBAABABABBBBBBBABAABBABBBBAAABABAABABABAAABAAAABAAABBBAABABABABBBABABAAAAAABBAABBABBAAAAABBBB...

result:

ok correct answer and good plan!

Test #207:

score: 0
Accepted
time: 732ms
memory: 8256kb

input:

100000 50024
959780937 984137434 921954544 896504112 968794829 407304840 929661376 251928710 873819198 964491444 978228862 898818877 998958463 855867564 981561560 996887770 984550120 978615403 919234645 921315531 863761397 886146349 845089314 940404242 949550751 995920731 847801385 991585528 6315789...

output:

79336251145139
BBAABAAABBBBBAAABABBBAABBBABBBAAAAAABAABABAAAABAAABAAAABAAABBAABBAABABBAAAABABBAABABABABBBAAAABBAAABAABBBBABBAABABBAABBAAABAABBBBABAABBABABBBBAAAABAABBBBABAAAABBBBAAABBABABABBBABBBAABAABABAAABAAABBBBABBBAAAAAAAAAAABBAAABAABBBBABBABBBBABABBAABBBBBAAAABAABAAAABBAAAABBBABBBBBBBBBBABAAABA...

result:

ok correct answer and good plan!

Test #208:

score: 0
Accepted
time: 740ms
memory: 8272kb

input:

100000 49880
999994022 999996797 999295104 1000000000 1000000000 999306983 999995406 999999597 999999289 999998708 999999999 999750694 999884220 999540129 999999903 999999997 999958586 999990279 999998170 999998816 999999992 999997470 999999297 999967301 999985009 999999646 999980794 999947444 99999...

output:

99953252349949
BBBBBAAABABAAABBAAAABBBBABAABAAABAABBAAABABAABBBBBAAABBBAABBBAAAABBBBBBAABAABBBBABBABABBAABAAABAABBAABBABAABAABBABBAAAABAABBABBBAABABBAABAABABBAABABABBBBBBAABABBBAABAAABBABBBABBAAAABBBBAABBBAABABBAAAAAABAAAAAAAAABAAAAAABABBABBABAAAABABBAABAAABABABAABBAAABBABBBBBBBAAABBAABBAAAAABBBBAAB...

result:

ok correct answer and good plan!

Test #209:

score: 0
Accepted
time: 390ms
memory: 5192kb

input:

100000 99850
14202 14904 14977 13569 14719 12915 4850 -1089 14727 13406 14914 14452 14780 14017 6622 10658 14564 12174 14832 8259 9770 6257 1764 14680 7751 6330 9876 12329 14164 11677 14746 13942 13562 12474 10206 13723 13918 15000 12939 11331 12352 14349 1634 7093 7846 7867 13864 5256 14125 5270 10...

output:

7446577
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #210:

score: 0
Accepted
time: 371ms
memory: 5172kb

input:

100000 5
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -10...

output:

187606048
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #211:

score: 0
Accepted
time: 358ms
memory: 5244kb

input:

100000 2697
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 ...

output:

43431
BBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBABBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #212:

score: 0
Accepted
time: 365ms
memory: 5244kb

input:

100000 489
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -...

output:

116640
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #213:

score: 0
Accepted
time: 691ms
memory: 5172kb

input:

100000 50000
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000...

output:

14794
BABAABABABABAABABABAABABAABABABABABABABABABAABBABABABABABABABABAABABABABABABABABAABBAABBAABABBAABABABABABABABAABBABBBABAAABABBAABABABBABAABABABBABABABABABABABABABABABABABABABABABABAABABBABABABBABAABABBAAABABABBBABABABABBBAABABABABABABABABABABABABABABABABABABAABABABABABABABABABBABAABAABABABAABA...

result:

ok correct answer and good plan!

Test #214:

score: 0
Accepted
time: 248ms
memory: 5052kb

input:

100000 50000
1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -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
BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...

result:

ok correct answer and good plan!

Test #215:

score: 0
Accepted
time: 353ms
memory: 5040kb

input:

100000 50000
50001 50000 49999 49998 49997 49996 49995 49994 49993 49992 49991 49990 49989 49988 49987 49986 49985 49984 49983 49982 49981 49980 49979 49978 49977 49976 49975 49974 49973 49972 49971 49970 49969 49968 49967 49966 49965 49964 49963 49962 49961 49960 49959 49958 49957 49956 49955 49954...

output:

38764
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #216:

score: 0
Accepted
time: 709ms
memory: 6596kb

input:

100000 50000
0 0 1 0 0 0 1 0 0 0 0 1 1 0 1 1 0 0 1 1 0 1 0 0 1 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 1 0 1 1 0 0 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 0 0 0 1 1 0 1 0 1 1 0 1 1 0 0 0 1 0 0 1 0 1 1 1 0 0...

output:

0
AABAAABAAAABBABBAABBABAABABAAAABBABABBABAABBAABBABBABABAAAABABBBAAAAAABABBAAABBBBBBABBBBABABABBBBBAAAABABABAAAABABABBAAAABBABABBABBAAABAABABBBAABBABBBAABBBBABAABABBABBBBBABABBAABABBBBBAABBBBBBBBBBBBAABBBABBAAAABAAAABABBAAABAABBBAAAABBBABABAABABABABABBBBAAAAABAABABAABBBBABAAABAAAAAABABBAABAABAABBBB...

result:

ok correct answer and good plan!

Test #217:

score: 0
Accepted
time: 476ms
memory: 6560kb

input:

100000 50000
50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000...

output:

999999997
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct answer and good plan!

Test #218:

score: 0
Accepted
time: 347ms
memory: 7232kb

input:

100000 50000
999999997 0 999999995 0 999999993 0 999999991 0 999999989 0 999999987 0 999999985 0 999999983 0 999999981 0 999999979 0 999999977 0 999999975 0 999999973 0 999999971 0 999999969 0 999999967 0 999999965 0 999999963 0 999999961 0 999999959 0 999999957 0 999999955 0 999999953 0 999999951 0...

output:

999999997
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...

result:

ok correct answer and good plan!

Test #219:

score: 0
Accepted
time: 995ms
memory: 11408kb

input:

100000 68847
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 1...

output:

100000000000000
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

ok correct answer and good plan!

Test #220:

score: 0
Accepted
time: 371ms
memory: 4924kb

input:

100000 49987
-6443511 639764931 -65025205 593482617 536727017 625344601 651787316 -11443120 -79788957 -674212534 -840170316 -877251788 395721653 14937462 -40448565 149211077 -78601844 -579537237 -534275588 -352971152 -149546083 655881520 -974882314 -200975764 -181970903 -334756357 415719380 -2010150...

output:

4864708263
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAABABBBABBBABAABBABABABBABAABAAABAAABBAABAABBAAAABBAAAABABBBAABABABAABAAAABABBBBBAAABAAAAAAABBABBBBBABAABAABBAAABBBAABBBBAABABBBAABBABBBBBABABBBBBABAAABBBABBAAABABAABBABAAABABBBABAABBABABABABAABBA...

result:

ok correct answer and good plan!