QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#74132#2122. Wystawa [A]wind_cross2 4012ms14052kbC++205.1kb2023-01-30 20:56:042023-01-30 20:56:07

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-30 20:56:07]
  • 评测
  • 测评结果:2
  • 用时:4012ms
  • 内存:14052kb
  • [2023-01-30 20:56:04]
  • 提交

answer

#pragma GCC optimize(2)
#pragma GCC optimize("Ofast", "inline", "-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include<bits/stdc++.h>
using namespace std;
inline char nc()
{
    static char buf[1000005],*l,*r;
    return l==r&&(r=(l=buf)+fread(buf,1,1000005,stdin),l==r)?EOF:*l++;
}
template <class code>inline code read(const code &a)
{
    code x=0;short w=0;char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=nc();}
    while(isdigit(ch)) {x=(x<<3)+(x<<1)+(ch^48);ch=nc();}
    return w?-x:x;
}
void print(__int128 x){
    if(x<0)putchar('-'),x=-x;
    if(x>=10)print(x/10);
    putchar(x%10+48);
}
int a[100005],b[100005],n,k,xz[100005],c[100005];
long long xd[400005],tag[400005];
int xd1[400005];
void push_down(int root){
    if(!tag[root])return;
    int lc=root<<1,rc=root<<1|1;
    tag[lc]+=tag[root];tag[rc]+=tag[root];
    xd[lc]+=tag[root];xd[rc]+=tag[root];
    tag[root]=0;
}
void upd1(int root,int x,int zl,int zr,int v){
    if(zl==zr){
        xd1[root]=v;
        return;
    }
    int mid=(zl+zr)>>1;
    if(x<=mid)upd1(root<<1,x,zl,mid,v);
    else upd1(root<<1|1,x,mid+1,zr,v);
    xd1[root]=max(xd1[root<<1],xd1[root<<1|1]);
}
int cx1(int root,int l,int r,int zl,int zr){
    if(zl>r||zr<l)return -2e9;
    if(zl>=l&&zr<=r)return xd1[root];
    int mid=(zl+zr)>>1;
    return max(cx1(root<<1,l,r,zl,mid),cx1(root<<1|1,l,r,mid+1,zr));
}
void upd(int root,int l,int r,int zl,int zr,int v){
    if(zl>r||zr<l)return;
    if(zl>=l&&zr<=r){
        xd[root]+=v;
        tag[root]+=v;
        return;
    }
    push_down(root);
    int mid=(zl+zr)>>1;
    upd(root<<1,l,r,zl,mid,v);upd(root<<1|1,l,r,mid+1,zr,v);
    xd[root]=max(xd[root<<1],xd[root<<1|1]);
}
long long cx(int root,int l,int r,int zl,int zr){
    if(zl>r||zr<l)return -1e18;
    if(zl>=l&&zr<=r)return xd[root];
    push_down(root);
    int mid=(zl+zr)>>1;
    return max(cx(root<<1,l,r,zl,mid),cx(root<<1|1,l,r,mid+1,zr));
}
int ef(int root,int zl,int zr,long long v1,long long v2,int v3){
    if(zl==zr){
        
        // if(zl==15)printf("%lld\n",cx(1,1,zl,1,n)-cx1(1,zl,n,1,n)-cx(1,zl+1,n,1,n));
        if(max(v1,xd[root])-max(v3,xd1[root])<=v2){
            
            return zl;
        }
        return 0;
    }
    push_down(root);
    int mid=(zl+zr)>>1,lc=root<<1,rc=root<<1|1;
    long long n1=max(v1,xd[lc]),n2=max(v2,xd[rc]),n3=max(v3,max(xd1[rc],b[mid]));
    if(n1-n3<=n2){
        int fx=ef(root<<1|1,mid+1,zr,n1,v2,v3);
        if(fx==0)return mid;
        return fx;
    }else return ef(root<<1,zl,mid,v1,n2,max(v3,xd1[rc]));
}
int ef1(int root,int l,int r,int zl,int zr,int hg){
    if(zl>r||zr<l||xd1[root]<hg)return -1;
    if(zl==zr)return zl;
    int mid=(zl+zr)>>1;
    if(zl>=l&&zr<=r){
        if(xd1[root<<1]==hg)return ef1(root<<1,l,r,zl,mid,hg);
        return ef1(root<<1|1,l,r,mid+1,zr,hg);
    }
    if(r<=mid)return ef1(root<<1,l,r,zl,mid,hg);
    else if(l>mid)return ef1(root<<1|1,l,r,mid+1,zr,hg);
    int fx=ef1(root<<1,l,r,zl,mid,hg);
    if(fx==-1)return ef1(root<<1|1,l,r,mid+1,zr,hg);
    return fx;
}
long long getz(int x){
    if(x==0)return 1e18;
    // printf("%lld %lld %lld ",cx(1,1,x,1,n),cx1(1,x,n,1,n),cx(1,x+1,n,1,n));
    return max(cx(1,1,x,1,n)-cx1(1,x,n,1,n),cx(1,x+1,n,1,n));
}
int check(long long x){
    memset(xd,0,sizeof(xd));
    memset(xd1,0,sizeof(xd1));
    memset(tag,0,sizeof(tag));
    int sc=0;
    for(int i=1;i<=n;i++)c[i]=max(b[i]-a[i],0),xz[i]=0;
    for(int i=1;i<=n;i++){
        upd(1,1,i,1,n,b[i]);
        upd1(1,i,1,n,c[i]);
        while(xd[1]>x&&sc<i){
            int wz=ef(1,1,n,-1e18,-1e18,-2e9);
            --wz;
            // if(wz<i)while(cx1(1,wz,n,1,n)!=c[wz])++wz;
            // printf("%d %d\n",wz,cx1(1,wz,n,1,n));
            if(wz<0)wz=1;
            wz=ef1(1,wz,i,1,n,cx1(1,wz,n,1,n));
            while(wz<i&&getz(wz)>getz(wz+1))++wz;
            wz=ef1(1,wz,i,1,n,cx1(1,wz,n,1,n));
            // printf("%d %d %d %d %lld %lld\n",wz,i,c[wz],cx1(1,wz,n,1,n),xd[1],getz(wz+1));
            upd(1,1,wz,1,n,-c[wz]);c[wz]=-2e9;upd1(1,wz,1,n,c[wz]);xz[wz]=1;
            ++sc;
        }
        if(xd[1]>x||sc>k)return -1;
    }
    return sc;
}
signed main()
{
    // freopen("text.in","r",stdin);
    // freopen("text.out","w",stdout);
    n=read(n),k=read(k);
    int fg=0;
    for(int i=1;i<=n;i++)a[i]=read(a[i]);
    for(int i=1;i<=n;i++){
        b[i]=read(b[i]);
        fg+=(a[i]<=b[i]);
    }
    int op=0;
    if(fg<k){
        op=1;
        k=n-k;
        for(int i=1;i<=n;i++)swap(a[i],b[i]);
    }
    long long l=0,r=1e14,kx=1e14;
    while(l<=r){
        long long mid=(l+r)>>1;
        if(check(mid)!=-1)kx=mid,r=mid-1;
        else l=mid+1;
    }
    printf("%lld\n",kx);
    // return 0;
    int sy=k-check(kx);
    for(int i=1;i<=n;i++){
        if(xz[i]){
            if(!op)putchar('A');
            else putchar('B');
        }else if(a[i]<=b[i]&&sy){
            if(!op)putchar('A');
            else putchar('B');
            --sy;   
        }else{
            if(op)putchar('A');
            else putchar('B');
        }
    }
    return 0;
}

詳細信息

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 18ms
memory: 11360kb

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

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

input:

1 0
2
3

output:

3
B

result:

ok correct answer and good plan!

Test #4:

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

input:

1 1
2
3

output:

2
A

result:

ok correct answer and good plan!

Test #5:

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

input:

1 0
-2
-3

output:

0
B

result:

ok correct answer and good plan!

Test #6:

score: 0
Accepted
time: 11ms
memory: 11860kb

input:

1 1
-2
-3

output:

0
A

result:

ok correct answer and good plan!

Test #7:

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

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

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

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

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

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

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
ABAAAABBBBBBBAAB

result:

ok correct answer and good plan!

Test #13:

score: 0
Accepted
time: 11ms
memory: 12296kb

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
ABABBABABBBAAABA

result:

ok correct answer and good plan!

Test #14:

score: 0
Accepted
time: 11ms
memory: 12000kb

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
BAABBAAABABBAABA

result:

ok correct answer and good plan!

Test #15:

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

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
ABBABBBAAAABAAAA

result:

ok correct answer and good plan!

Test #16:

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

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

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

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

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

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
AAAAAAAABBBBBBBB

result:

ok correct answer and good plan!

Test #21:

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

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

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

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

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

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

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

input:

3 1
-3 -1 0
0 1 -2

output:

0
BAB

result:

ok correct answer and good plan!

Subtask #2:

score: 0
Wrong Answer

Test #28:

score: 1
Accepted
time: 16ms
memory: 12864kb

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
ABABABBABBBBAAABBBBABBBBBBBBBABBBBBBBBBBBBBBBBABBBBBBBABBBBBBBBBBBBBBBBAABAABBBB

result:

ok correct answer and good plan!

Test #29:

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

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
BABABABBABABBBAAABAAABBBABABABAAAAAAABABBBABBBBBBBBBBBBBBBBBBBBABBABAABBBBBBBBBB

result:

ok correct answer and good plan!

Test #30:

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

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
BBAAABBAABBBBAABAAAABAABABBBBBBBAABAABABBABABABAAAAABBBAAAAAAABAAABAAABABAAABBAB

result:

ok correct answer and good plan!

Test #31:

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

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
BABBABBBAAAABBABAABBBBBAAAAAAAABAAABBAAAABBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

result:

ok correct answer and good plan!

Test #32:

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

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

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
BABABBABABBBABABAABAABABAABAAAAABAAABBAAAAAAABABAABBABABBAABBAABABBBBBBBBBBBBBB

result:

ok correct answer and good plan!

Test #34:

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

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
ABABBAAABAAABBAABBBBAABABAAAAABAAAABABBAABAABABBABBABBBABBBBBBBBBBBBBBBBBBBBBBBB

result:

ok correct answer and good plan!

Test #35:

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

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
ABBABBBBABAAABBBAABBBBABBBBBBBBBBAABAABBABBAAAAAABBABBABBABABAAAABBABABAAAAAAAAB

result:

ok correct answer and good plan!

Test #36:

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

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

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

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
ABABAAABABAABAABBABBBAABABABAABBAABBAABABBAABAABAABABBAAAAABAAABAABABABBAABBBAAB

result:

ok correct answer and good plan!

Test #39:

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

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

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: -1
Wrong Answer
time: 11ms
memory: 11848kb

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:

13430
BBBABBABABBBBAABBBBABBBBBBBBBBBBBAABBABABBABBABBBABBBBBBBBBBABABABBBBBBBBBBBBABA

result:

wrong answer read 13430 but the jury's answer is 13365

Subtask #3:

score: 0
Wrong Answer

Test #49:

score: 0
Wrong Answer
time: 17ms
memory: 12204kb

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:

1480772
BBBBBBABBBBBBBBBBBBBBABBBABBBBBBABBBBBBBBBBBBBBABBBBABBAABBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABABBABBBBABBABBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBABBBABBBBBBBBBBBBBBBBABBBBBBABBABBBBABBBBBBBBBABBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBB...

result:

wrong answer read 1480772 but the jury's answer is 1451726

Subtask #4:

score: 0
Wrong Answer

Test #70:

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

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

result:

ok correct answer and good plan!

Test #71:

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

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

result:

ok correct answer and good plan!

Test #72:

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

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

result:

ok correct answer and good plan!

Test #73:

score: -1
Wrong Answer
time: 42ms
memory: 11576kb

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

result:

FAIL WTF you have a better plan???

Subtask #5:

score: 0
Wrong Answer

Test #91:

score: 1
Accepted
time: 102ms
memory: 12196kb

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

result:

ok correct answer and good plan!

Test #92:

score: -1
Wrong Answer
time: 111ms
memory: 11752kb

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

result:

FAIL WTF you have a better plan???

Subtask #6:

score: 0
Wrong Answer

Test #113:

score: 1
Accepted
time: 395ms
memory: 12224kb

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

result:

ok correct answer and good plan!

Test #114:

score: -1
Wrong Answer
time: 294ms
memory: 13356kb

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

result:

FAIL WTF you have a better plan???

Subtask #7:

score: 0
Wrong Answer

Test #134:

score: 1
Accepted
time: 471ms
memory: 13448kb

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

result:

ok correct answer and good plan!

Test #135:

score: 0
Accepted
time: 583ms
memory: 13584kb

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

result:

ok correct answer and good plan!

Test #136:

score: 0
Accepted
time: 769ms
memory: 13040kb

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

result:

ok correct answer and good plan!

Test #137:

score: 0
Accepted
time: 938ms
memory: 13832kb

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

result:

ok correct answer and good plan!

Test #138:

score: 0
Accepted
time: 800ms
memory: 13336kb

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

result:

ok correct answer and good plan!

Test #139:

score: 0
Accepted
time: 446ms
memory: 13640kb

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

result:

ok correct answer and good plan!

Test #140:

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

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

result:

ok correct answer and good plan!

Test #141:

score: 0
Accepted
time: 695ms
memory: 13420kb

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

result:

ok correct answer and good plan!

Test #142:

score: 0
Accepted
time: 2345ms
memory: 13296kb

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

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

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

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

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: -1
Wrong Answer
time: 543ms
memory: 13116kb

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:

29913
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

result:

wrong answer read 29913 but the jury's answer is 29115

Subtask #8:

score: 0
Wrong Answer

Test #156:

score: 1
Accepted
time: 845ms
memory: 13692kb

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

result:

ok correct answer and good plan!

Test #157:

score: 0
Accepted
time: 1496ms
memory: 13880kb

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

result:

ok correct answer and good plan!

Test #158:

score: 0
Accepted
time: 1197ms
memory: 13824kb

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

result:

ok correct answer and good plan!

Test #159:

score: 0
Accepted
time: 707ms
memory: 13564kb

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

result:

ok correct answer and good plan!

Test #160:

score: -1
Wrong Answer
time: 819ms
memory: 13712kb

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:

4112560299
BBBBABAABBABBAABABBABABBBBBBBBAAAABBBBBBAAAAAABABBAABABAABAABBBABBABABABABBBBBBABBBBAAAABAABAAABBBABBBBBBAABABBBBBAAAABAAABBBABBABBABABABBAAAAABAABBAABBBBBBBABABABBBBAAABBAAAABAABABBAAAAABBABABABBABABBBBBABBAABBBAAAABABBBAAABABBAABBABBAAABAABAAABAAAABAABBBBABBAABAAAAABAAABABBBABBBBBAABAAB...

result:

wrong answer read 4112560299 but the jury's answer is 3621845085

Subtask #9:

score: 1
Accepted

Test #178:

score: 1
Accepted
time: 1313ms
memory: 14048kb

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

result:

ok correct answer and good plan!

Test #179:

score: 0
Accepted
time: 1019ms
memory: 13904kb

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

result:

ok correct answer and good plan!

Test #180:

score: 0
Accepted
time: 1213ms
memory: 14024kb

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

result:

ok correct answer and good plan!

Test #181:

score: 0
Accepted
time: 764ms
memory: 13916kb

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

result:

ok correct answer and good plan!

Test #182:

score: 0
Accepted
time: 1174ms
memory: 13868kb

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

result:

ok correct answer and good plan!

Test #183:

score: 0
Accepted
time: 927ms
memory: 13868kb

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

result:

ok correct answer and good plan!

Test #184:

score: 0
Accepted
time: 1065ms
memory: 13844kb

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

result:

ok correct answer and good plan!

Test #185:

score: 0
Accepted
time: 1030ms
memory: 13864kb

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

result:

ok correct answer and good plan!

Test #186:

score: 0
Accepted
time: 3594ms
memory: 13864kb

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

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

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

result:

ok correct answer and good plan!

Test #189:

score: 0
Accepted
time: 923ms
memory: 13832kb

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

result:

ok correct answer and good plan!

Test #190:

score: 0
Accepted
time: 913ms
memory: 13944kb

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

result:

ok correct answer and good plan!

Test #191:

score: 0
Accepted
time: 904ms
memory: 14008kb

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

result:

ok correct answer and good plan!

Test #192:

score: 0
Accepted
time: 991ms
memory: 13828kb

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

result:

ok correct answer and good plan!

Test #193:

score: 0
Accepted
time: 914ms
memory: 13700kb

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

result:

ok correct answer and good plan!

Test #194:

score: 0
Accepted
time: 963ms
memory: 13312kb

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

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

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

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

result:

ok correct answer and good plan!

Subtask #10:

score: 0
Wrong Answer

Test #198:

score: 1
Accepted
time: 1375ms
memory: 13872kb

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

result:

ok correct answer and good plan!

Test #199:

score: -1
Wrong Answer
time: 1616ms
memory: 13808kb

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

result:

FAIL WTF you have a better plan???