QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#701573#84. Know your AliensTheZoneAC ✓1ms3904kbC++203.1kb2024-11-02 14:23:042024-11-02 14:23:08

Judging History

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

  • [2024-11-02 14:23:08]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3904kb
  • [2024-11-02 14:23:04]
  • 提交

answer

#include <bits/stdc++.h>

#define fi first
#define se second
#define forn(i,n) for(ll i=0; i<n; ++i)
#define for1(i,n) for(ll i=1; i<=n; ++i)
#define fore(i,l,r) for(ll i=l; i<=r; ++i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " "<< x<< el

using namespace std;

typedef long long ll;


int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string s;
    cin>>s;
    ll tam = s.size();
    vector<ll> coef;
    coef.reserve(tam);
    char cur ;
    if(s[0]=='A') cur='A';
    else cur = 'H';
    for1(i,tam-1){
        if(s[i]!=cur) {
            coef.pb(2*i+1);
            cur = s[i];
        }
    }
    if(coef.size()==0){
        cout<<coef.size()<<endl;
        if(s[0]=='A'){
            cout<<-1<<endl;
        } else{
            cout<<1<<endl;
        }
        return 0;
    }
    if(coef.size()==1){
         cout<<coef.size()<<endl;
        if(s[0]=='A'){
            cout<<1<<" "<<-coef[0]<<endl;
        } else{
            cout<<-1<<" "<<coef[0]<<endl;
        }
        return 0;
    }
    ll c[coef.size()+1]={0};
    c[0]= -coef[0];
    c[1]= 1;
    ll res[coef.size()+1]={0};

    for(int i= 1; i<coef.size(); ++i){
        for (int pos = 0; pos < coef.size()+1; pos++){
            //Vamos a multiplicar cada termino del polinomio2
            ll p2[2];
            p2[0]=(-coef[i]);
            p2[1]=1;
            for (int ter = 0; ter < 2; ter++){
            //Voy a explicar luego del código
                res[pos + ter] += c[pos] * p2[ter];
            }
        }
        forn(i,coef.size()+1){
            c[i]=res[i];
            res[i]=0;
        }
    }
//    forn(i,coef.size()+1){
//        d(i);
//        d(c[i]);
//    }
    cout<< coef.size()<<el;
    for(int i=coef.size(); i>= 0 ; --i){
        if(coef.size()%2==1){
           if(s[0]=='A'){
                cout<< c[i]<< " ";
           } else{
                cout<< -c[i]<< " ";
           }
        }
        else {
            if(s[0]=='H'){
                cout<< c[i]<< " ";
           } else{
                cout<< -c[i]<< " ";
           }
        }

    }
    cout<<endl;
}










































































































































































































































































































































































































































































詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3560kb

input:

AHAHAHAHAHAHAHAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

16
-1 288 -38200 3094560 -171186652 6848858016 -204728792840 4657440696480 -81357378048518 1092842347300704 -11226645052106120 87056405155006560 -498090011547450204 2025608594653312992 -5498705533259238840 8855805158351474400 -6332659870762850625 

result:

ok 2 lines

Test #2:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
-1 24203 -211366970 802534334470 -1244463802545429 505689101974870047 

result:

ok 2 lines

Test #3:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
1 -13147 60912894 -114635142026 73241692943873 -13707304092268059 

result:

ok 2 lines

Test #4:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
-1 22337 -178421426 607588242298 -790259356440813 197637578982677925 

result:

ok 2 lines

Test #5:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
1 -20009 132370726 -330443533974 300804726549465 -56380159698933825 

result:

ok 2 lines

Test #6:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
1 -20117 140230094 -436684625542 607866360457905 -293309922157642341 

result:

ok 2 lines

Test #7:

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

input:

HHHHHAAHHHHHHHHHHAAAAHHAAAAAHHHHHHHHAAHAAAHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

11
-1 619 -170075 27311369 -2839558218 199961850606 -9687235073270 320960330387666 -7073267682216901 97781283589358935 -754194552945839775 2435703915741067125 

result:

ok 2 lines

Test #8:

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

input:

AAAHHHHAAAAAAAAAAHHAHHHHHHHHHHAAAHAAAAHHAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

11
1 -575 146787 -21896349 2113129386 -137907506646 6174544978598 -188188763270746 3784950182806053 -47091337682476059 318537450345140775 -857853983028267225 

result:

ok 2 lines

Test #9:

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

input:

AHHHHAAHHHHHHHAAAAAHHAAAAHHHHHHHHHHHHHHHAHHHHHAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

12
-1 642 -182036 30009302 -3186606717 228177917812 -11210873006928 377125717188492 -8510810887417419 123451984434529962 -1064358669544119324 4690340667512993790 -7219569395164987575 

result:

ok 2 lines

Test #10:

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

input:

HAAAAAAAHHAAHHHHHHAHHHHHHHHAAHAAAAAHHHHHHHAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

12
1 -572 145318 -21632436 2095621395 -138687423960 6400194177572 -206265837649384 4568116062228119 -66910559121944748 601202792041216470 -2832614555442516900 4569333067537363125 

result:

ok 2 lines

Test #11:

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

input:

AAHAAAAAAAHHHHAHAHHAAHAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

12
-1 412 -76014 8289492 -593684139 29325609624 -1020151658996 25037796813608 -426874685352135 4875330273447564 -34848668150864190 137110324070808900 -221332391136982125 

result:

ok 2 lines

Test #12:

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

input:

HAHAHAHAHAHAHAHAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

16
1 -288 38200 -3094560 171186652 -6848858016 204728792840 -4657440696480 81357378048518 -1092842347300704 11226645052106120 -87056405155006560 498090011547450204 -2025608594653312992 5498705533259238840 -8855805158351474400 6332659870762850625 

result:

ok 2 lines

Test #13:

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

input:

AHHHAAAAHHHHHHAAHHHHAHHHHHHHAAAHHAAAAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

12
-1 516 -118422 15931500 -1393715715 83110370856 -3442038889988 98914131973848 -1934769837109239 24700076433968148 -190359997337720070 761773315996034172 -1103965491468903525 

result:

ok 2 lines

Test #14:

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

input:

HHHHHAAAAHAAAHHHHHHHAHHHHHHHHAAAAAAAHHAAAHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

11
-1 545 -130967 18271423 -1639888218 99139372410 -4107427386206 116275774635214 -2197450287405781 26322256574863445 -179244606237662427 523319284495570563 

result:

ok 2 lines

Test #15:

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

input:

HHHAAHHHAAAHAAHAAAAAAHAAAAAHAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

12
1 -406 73652 -7881842 553216845 -26778587100 914626749488 -22153015666148 376479705223819 -4361592664337134 32544461435871900 -139613679328696650 258598646194494375 

result:

ok 2 lines

Test #16:

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

input:

HAHHHHHHAAHAHHHHAAHHHAAAAAAAAAAAHHHHHHHAAHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

13
-1 527 -122750 16685530 -1472547099 88822846461 -3753656881556 111996157192540 -2343707643830695 33645246960464537 -317260844321113614 1817614202549829930 -5476692831742352925 6407858725259866875 

result:

ok 2 lines

Test #17:

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

input:

HHAAHHAAHHAHAAAAHHHHHHHHHHAAAHHHHHHHHAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

13
-1 497 -109198 14003686 -1166325371 66460583155 -2660126253556 75583133332964 -1521687000018343 21391697252011143 -203491363609522206 1235080019474489430 -4260068761477816125 6248246040514603125 

result:

ok 2 lines

Test #18:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
-1 17887 -110979990 309313202570 -394757054298089 185667364278415383 

result:

ok 2 lines

Test #19:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
1 -28339 291134110 -1306956880954 2463270011976289 -1614617709637625875 

result:

ok 2 lines

Test #20:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
-1 18233 -117640374 319589640262 -333025402281545 110268904239050625 

result:

ok 2 lines

Test #21:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
1 -15847 79316382 -158183043506 132746083770209 -38244039915422055 

result:

ok 2 lines

Test #22:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
1 -19263 146339658 -546883073006 1002718799088885 -719300274816640275 

result:

ok 2 lines

Test #23:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

4
-1 79984 -2399040086 31980803439824 -159872034396480105 

result:

ok 2 lines

Test #24:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
-1 20119 -159693358 624396609378 -1201540069879569 910089555070847175 

result:

ok 2 lines

Test #25:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
-1 22831 -197923526 787635011546 -1320933675894585 509740194941616375 

result:

ok 2 lines

Test #26:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHAAAAAAAAAAAA...

output:

7
1 -2907 3512329 -2277324619 852148072075 -183277191421177 20911459348176747 -973433404230010465 

result:

ok 2 lines

Test #27:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

6
1 -15236 88478785 -241828438520 308288139960379 -151735148008954244 6968120543061512835 

result:

ok 2 lines

Test #28:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
-1 16787 -108429014 333421785826 -479587096064553 249046077002247819 

result:

ok 2 lines

Test #29:

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

input:

HHHHHAAHHHHHHHHHHAAAAHHAAAAAHHHHHHHHAAHAAAHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

11
-1 619 -170075 27311369 -2839558218 199961850606 -9687235073270 320960330387666 -7073267682216901 97781283589358935 -754194552945839775 2435703915741067125 

result:

ok 2 lines

Test #30:

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

input:

AAAHHHHAAAAAAAAAAHHAHHHHHHHHHHAAAHAAAAHHAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

11
1 -575 146787 -21896349 2113129386 -137907506646 6174544978598 -188188763270746 3784950182806053 -47091337682476059 318537450345140775 -857853983028267225 

result:

ok 2 lines

Test #31:

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

input:

AHHHHAAHHHHHHHAAAAAHHAAAAHHHHHHHHHHHHHHHAHHHHHAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

12
-1 642 -182036 30009302 -3186606717 228177917812 -11210873006928 377125717188492 -8510810887417419 123451984434529962 -1064358669544119324 4690340667512993790 -7219569395164987575 

result:

ok 2 lines

Test #32:

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

input:

HAAAAAAAHHAAHHHHHHAHHHHHHHHAAHAAAAAHHHHHHHAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

12
1 -572 145318 -21632436 2095621395 -138687423960 6400194177572 -206265837649384 4568116062228119 -66910559121944748 601202792041216470 -2832614555442516900 4569333067537363125 

result:

ok 2 lines

Test #33:

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

input:

AAHAAAAAAAHHHHAHAHHAAHAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

12
-1 412 -76014 8289492 -593684139 29325609624 -1020151658996 25037796813608 -426874685352135 4875330273447564 -34848668150864190 137110324070808900 -221332391136982125 

result:

ok 2 lines

Test #34:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

4
1 -79984 2399040086 -31980803439824 159872034396480105 

result:

ok 2 lines

Test #35:

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

input:

AHHHAAAAHHHHHHAAHHHHAHHHHHHHAAAHHAAAAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

12
-1 516 -118422 15931500 -1393715715 83110370856 -3442038889988 98914131973848 -1934769837109239 24700076433968148 -190359997337720070 761773315996034172 -1103965491468903525 

result:

ok 2 lines

Test #36:

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

input:

HHHHHAAAAHAAAHHHHHHHAHHHHHHHHAAAAAAAHHAAAHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

11
-1 545 -130967 18271423 -1639888218 99139372410 -4107427386206 116275774635214 -2197450287405781 26322256574863445 -179244606237662427 523319284495570563 

result:

ok 2 lines

Test #37:

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

input:

HHHAAHHHAAAHAAHAAAAAAHAAAAAHAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

12
1 -406 73652 -7881842 553216845 -26778587100 914626749488 -22153015666148 376479705223819 -4361592664337134 32544461435871900 -139613679328696650 258598646194494375 

result:

ok 2 lines

Test #38:

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

input:

HAHHHHHHAAHAHHHHAAHHHAAAAAAAAAAAHHHHHHHAAHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

13
-1 527 -122750 16685530 -1472547099 88822846461 -3753656881556 111996157192540 -2343707643830695 33645246960464537 -317260844321113614 1817614202549829930 -5476692831742352925 6407858725259866875 

result:

ok 2 lines

Test #39:

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

input:

HHAAHHAAHHAHAAAAHHHHHHHHHHAAAHHHHHHHHAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

13
-1 497 -109198 14003686 -1166325371 66460583155 -2660126253556 75583133332964 -1521687000018343 21391697252011143 -203491363609522206 1235080019474489430 -4260068761477816125 6248246040514603125 

result:

ok 2 lines

Test #40:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

0
-1

result:

ok 2 lines

Test #41:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

0
1

result:

ok 2 lines

Test #42:

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

input:

AH

output:

1
1 -3

result:

ok 2 lines

Test #43:

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

input:

HA

output:

1
-1 3

result:

ok 2 lines

Test #44:

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

input:

A

output:

0
-1

result:

ok 2 lines

Test #45:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
-1 17887 -110979990 309313202570 -394757054298089 185667364278415383 

result:

ok 2 lines

Test #46:

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

input:

H

output:

0
1

result:

ok 2 lines

Test #47:

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

input:

HHH

output:

0
1

result:

ok 2 lines

Test #48:

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

input:

AHHA

output:

2
-1 10 -21 

result:

ok 2 lines

Test #49:

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

input:

AHHHAH

output:

3
1 -23 159 -297 

result:

ok 2 lines

Test #50:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
1 -28339 291134110 -1306956880954 2463270011976289 -1614617709637625875 

result:

ok 2 lines

Test #51:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
-1 24037 -216441878 909790545422 -1765502876551017 1240157880821893005 

result:

ok 2 lines

Test #52:

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

input:

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

5
-1 23311 -184195254 554795736554 -449984687763785 58819818552282375 

result:

ok 2 lines

Test #53:

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

input:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

output:

5
1 -14677 57762994 -90378805186 57449843838733 -12160779031194409 

result:

ok 2 lines