QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#293081#7964. 转化FamiglistmoAC ✓53ms22620kbC++171.4kb2023-12-28 21:29:212023-12-28 21:29:22

Judging History

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

  • [2023-12-28 21:29:22]
  • 评测
  • 测评结果:AC
  • 用时:53ms
  • 内存:22620kb
  • [2023-12-28 21:29:21]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=4e5+5;

char buf[1<<23],*p1=buf,*p2=buf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
int read(){
    int s=0,w=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')w=-1;ch=getchar();}
    while(isdigit(ch))s=s*10+(ch^48),ch=getchar();
    return s*w;
}

vector<int>vec;
int a[N],b[N],c[N];
int n;

signed main(){
    n=read();
    for(int i=1;i<=n;++i)a[i]=read();
    for(int i=1;i<=n;++i)b[i]=read();
    for(int i=1;i<=n;++i)c[i]=read();

    int fre=0,cst=0;
    for(int i=1;i<=n;++i)
        if(a[i]) fre+=min(a[i]+c[i],b[i]);
        else if(b[i]) cst+=min(c[i]+1,b[i])-1;

    for(int i=1;i<=n;++i)
        if(a[i]){
            if(!fre) printf("%lld ",a[i]+c[i]);
            else printf("%lld ",fre+cst+a[i]+c[i]-min(a[i]+c[i],b[i]));
        }else if(b[i]){
            if(!fre) printf("0 ");
            else printf("%lld ",fre+cst+c[i]-(min(c[i]+1,b[i])-1));
        }else{
            if(!fre) printf("0 ");
            else printf("%lld ",fre+cst+c[i]);
        }

    int ans=0,cnt=fre+cst;
    for(int i=1;i<=n;++i)
        if(a[i])ans+=a[i]+c[i];
        else if(b[i]&&fre)ans+=c[i];
        else if(c[i])vec.push_back(c[i]);

    sort(vec.begin(),vec.end());
    while(vec.size()&&fre&&cnt)
        ans+=vec.back(),vec.pop_back(),--cnt;

    printf("\n%lld\n",ans);
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 35ms
memory: 16216kb

input:

351493
0 37836791 46095966 46912389 21595941 0 3 86568894 3 0 0 0 0 39910208 0 2 4 86885825 1 67660833 0 24488082 52447896 0 67190942 70457491 11166998 90470470 11095822 0 0 5 47222930 2 49736354 0 0 0 77339472 0 5 3 0 25347727 0 3 2 0 48844622 0 65142757 1 73733079 80634668 46683173 0 31644647 9760...

output:

60073965049724 60073472376204 60073472376204 60073481727701 60073472376204 60073788737330 60073528128564 60073472376204 60073844358663 60073784179153 60073472376204 60073472376204 60073948665985 60073472376204 60073472376204 60073667185445 60073550333929 60073472376204 60073631548329 60073472376204 ...

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 44ms
memory: 21508kb

input:

351493
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 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:

389246793 773056414 285033292 35143062 150613 960166465 230310734 742299190 422307527 716629610 559282116 167517603 440667606 980062124 288964464 150613 37777273 995600801 890644898 919111990 697350089 651910449 818599875 248723392 345836780 145972754 169220149 798545767 375398590 724669763 34806631...

result:

ok 2 lines

Test #3:

score: 0
Accepted
time: 41ms
memory: 22012kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

599928111 417141936 854896025 376367102 774244714 431347641 604428665 574576714 470717519 508427611 661004235 780213577 84639091 782348432 977630323 52634924 626665121 482558683 636948807 603433753 409075001 417850332 684775391 679542511 719331660 492363039 456376909 467979366 476324957 877501995 64...

result:

ok 2 lines

Test #4:

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

input:

351493
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 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:

234262012 949494804 82908292 191866383 357435182 204774625 522310720 616383576 669531277 934418239 418093087 176599775 558496944 589988117 536611693 719041426 393842787 894965977 442976541 747100948 881012457 102085201 428412083 822550482 143067532 981918566 430936426 25974206 579590037 454042457 40...

result:

ok 2 lines

Test #5:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

128008403 324553663 567933292 352701143 783282673 190594692 301533599 364177284 279223184 982011115 93673715 984964467 694999373 151789026 608274793 364103610 722660414 902592001 505336386 710937535 144028291 977947521 939107253 81123640 489859775 616594062 747964503 257737750 184925226 573986693 69...

result:

ok 2 lines

Test #6:

score: 0
Accepted
time: 44ms
memory: 21264kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

135537378 771625312 536097501 20213016 535181834 389664567 646906761 439261845 604414717 122073351 544573434 555440990 473217959 753742657 427447196 328125403 663339101 361706486 617803180 381697 380150870 491441284 648366445 41765814 360790940 64770237 8269659 883453857 164022584 717730739 38863223...

result:

ok 2 lines

Test #7:

score: 0
Accepted
time: 44ms
memory: 21004kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

397895996 637995776 229045033 825330009 767600063 813818467 860123184 473916537 39383333 89515696 295009890 10782291 372810895 397106838 65300807 768273191 161781327 558687773 892380213 997363960 385764448 22703610 982241186 895750416 96016857 270822409 184030026 63955892 10774423 640378158 74099131...

result:

ok 2 lines

Test #8:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

937860890 34071976 153771718 177360430 75823376 355942669 817622492 33321178 780612344 710342440 867761534 819546823 849795236 387301401 347039271 721730011 293246843 210709301 905223131 575724303 974254853 803061206 526936739 665484693 827418578 936873247 622147268 618233327 71709769 20220377 61051...

result:

ok 2 lines

Test #9:

score: 0
Accepted
time: 53ms
memory: 22064kb

input:

351493
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

435339533 792017085 464874946 290155819 579911507 640903189 342715414 80024579 593597993 923890984 22164621 500092442 167224561 545848585 824255335 357704902 384102972 646689026 931844789 998355973 867635578 679726200 342953628 643482846 263712027 200418610 243247433 592213486 987760060 722168666 93...

result:

ok 2 lines

Test #10:

score: 0
Accepted
time: 49ms
memory: 22620kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 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:

833039146 386929609 340423205 531466641 871513381 539735531 38851078 625200748 836156601 380070044 502844392 663920285 81812085 967432557 346664249 48454327 694363639 920398413 737128643 210103788 316873705 207959069 968250648 934731855 693334060 101169019 756029280 262208629 321830512 391991139 594...

result:

ok 2 lines

Test #11:

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

input:

351493
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

405088761 101567444 728951605 827202557 592729186 993933762 544207082 573547807 740785481 642283084 508301387 658596714 880081299 428702910 647742423 871485073 922595409 61803352 111880604 980556804 700313131 970944731 12619655 901675021 72919073 456429643 363561947 63108889 918585697 104003852 2815...

result:

ok 2 lines

Test #12:

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

input:

351493
88714965 71401825 0 2 65340397 4 0 25757289 0 0 79287460 33735256 89924335 0 0 0 46887462 53594628 73153573 5 4 8609832 0 0 84289549 47034696 3 2 1 0 0 0 10442427 83297278 0 83254899 81067526 86290766 0 0 76225443 93238820 25579442 1 99813770 0 0 57496765 56462270 0 45359891 4 95456406 4 0 0 ...

output:

60022238291213 60022283200411 60022238291213 60022334747309 60022238291213 60022486742140 60022382662050 60022252019465 60022540104218 60022617440125 60022278693895 60022243103919 60022238291213 60022238291213 60022608660168 60022654651589 60022238291213 60022238291213 60022238291213 60022432128879 ...

result:

ok 2 lines

Test #13:

score: 0
Accepted
time: 42ms
memory: 21528kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

702564817 100823161 976824880 722677204 270342297 390544606 288764811 178799230 128949266 500213679 986185297 203792722 708410305 995195713 913017351 793311928 757650203 842297357 769532267 528585592 587492728 435998502 275323368 605638584 736013380 483281328 708700007 341410096 246645414 929757076 ...

result:

ok 2 lines

Test #14:

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

input:

351493
5 6 6 6 7 8 4 4 4 0 7 1 3 7 1 8 0 2 4 0 8 3 3 1 7 8 6 1 1 7 1 3 0 6 8 8 8 2 3 1 2 4 4 0 0 6 6 0 4 3 0 6 6 3 4 8 7 8 8 2 8 0 0 1 4 3 0 3 5 5 3 1 8 7 2 6 2 4 2 0 6 3 2 3 3 6 6 1 3 6 6 2 0 7 0 3 6 1 3 7 5 8 0 3 1 6 7 3 1 4 2 1 2 3 2 0 6 8 8 8 1 4 5 0 6 0 8 4 5 2 5 6 8 0 8 0 7 5 2 4 7 6 2 5 2 8 0...

output:

1229990 1229992 1229990 1229996 1229996 1229995 1229993 1229996 1229994 1229990 1230004 1229998 1229994 1229998 1229995 1229993 1229990 1229995 1229991 1229992 1229996 1229995 1229991 1229992 1229998 1230005 1229990 1229990 1229990 1230003 1229993 1229994 1229990 1229997 1229991 1230000 1230004 1229...

result:

ok 2 lines

Test #15:

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

input:

351493
5 0 1 7 6 2 3 2 5 0 3 1 2 7 4 1 4 5 3 8 3 1 2 2 3 8 6 1 3 2 8 1 4 3 6 0 3 1 4 5 2 1 0 5 1 0 7 6 3 4 2 3 5 8 3 6 8 3 3 4 6 4 3 8 3 4 0 8 6 5 8 8 7 4 8 5 1 6 6 2 0 2 8 7 8 2 4 5 4 7 0 8 3 6 3 0 5 7 1 4 3 2 4 5 0 4 2 7 0 8 6 6 5 8 3 4 2 3 7 0 6 5 8 4 5 6 7 2 0 8 7 5 1 5 5 5 2 6 6 7 0 5 7 4 7 8 8...

output:

1228102 1228093 1228093 1228103 1228102 1228093 1228095 1228097 1228096 1228093 1228093 1228093 1228093 1228095 1228101 1228093 1228099 1228098 1228093 1228104 1228096 1228098 1228097 1228093 1228093 1228103 1228098 1228093 1228093 1228095 1228103 1228094 1228095 1228097 1228098 1228093 1228093 1228...

result:

ok 2 lines

Test #16:

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

input:

351493
4 8 1 3 4 8 2 6 3 6 7 1 2 4 3 5 3 2 3 0 6 4 5 8 0 5 1 6 2 4 7 0 6 2 1 4 3 3 5 5 4 5 7 0 2 3 3 4 4 2 8 7 3 7 3 8 8 3 4 6 4 4 1 0 6 4 1 4 5 5 6 7 4 2 6 4 7 4 1 1 0 6 6 8 5 4 3 5 5 3 0 2 7 3 8 2 4 4 2 3 3 6 1 8 7 7 5 2 1 8 5 4 0 0 0 6 0 0 1 6 4 3 6 8 0 1 6 3 0 2 3 5 4 4 8 2 4 5 8 7 3 1 3 7 7 6 2...

output:

1229901 1229913 1229900 1229901 1229911 1229912 1229900 1229903 1229900 1229912 1229905 1229902 1229901 1229904 1229904 1229908 1229904 1229900 1229908 1229900 1229905 1229907 1229901 1229902 1229900 1229901 1229906 1229907 1229903 1229909 1229909 1229900 1229911 1229900 1229903 1229905 1229901 1229...

result:

ok 2 lines

Test #17:

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

input:

351493
3 8 3 1 8 5 2 7 8 4 0 2 3 6 8 6 4 5 3 1 4 2 4 0 0 2 5 7 3 5 2 2 0 7 5 3 7 8 0 4 1 7 3 2 3 7 4 1 0 5 1 8 0 3 2 3 0 4 1 2 8 6 8 1 2 7 0 7 3 3 7 6 8 1 5 7 5 7 7 0 1 1 6 3 1 2 2 0 0 0 6 7 7 8 5 1 0 4 1 5 6 5 1 0 2 8 2 5 1 4 5 5 2 4 8 7 7 3 6 7 2 6 6 5 7 8 6 2 2 1 8 5 2 0 7 3 3 8 3 8 5 2 7 6 0 4 1...

output:

1230269 1230272 1230268 1230263 1230276 1230270 1230266 1230273 1230271 1230266 1230271 1230265 1230272 1230272 1230270 1230270 1230268 1230263 1230272 1230268 1230267 1230264 1230267 1230263 1230269 1230266 1230268 1230277 1230272 1230268 1230265 1230263 1230263 1230271 1230270 1230263 1230265 1230...

result:

ok 2 lines

Test #18:

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

input:

351493
4 5 0 0 7 7 1 5 2 2 7 2 0 4 4 7 6 3 5 4 0 7 6 1 0 0 0 1 8 1 7 6 5 6 2 3 5 6 7 4 7 0 8 4 0 5 6 2 2 4 6 1 5 4 1 0 1 8 6 7 5 5 0 0 3 5 0 6 4 4 5 3 8 1 7 4 3 7 2 5 8 4 8 5 7 1 5 0 5 4 2 0 7 8 0 0 2 4 7 0 7 6 5 1 4 4 8 6 1 7 5 0 2 4 2 8 6 1 1 7 3 5 5 0 4 4 0 7 7 5 2 7 8 6 2 0 4 0 1 2 8 5 2 0 6 2 1...

output:

1229959 1229954 1229955 1229950 1229956 1229954 1229953 1229955 1229950 1229953 1229953 1229955 1229950 1229957 1229951 1229962 1229950 1229961 1229958 1229954 1229950 1229956 1229959 1229950 1229950 1229950 1229950 1229956 1229961 1229950 1229959 1229959 1229958 1229964 1229950 1229950 1229954 1229...

result:

ok 2 lines

Test #19:

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

input:

351493
2 6 5 1 8 7 3 2 1 8 2 6 2 8 0 2 3 7 8 1 5 6 4 4 8 1 1 6 0 3 5 6 0 6 4 1 3 1 2 3 2 0 8 8 7 2 7 2 2 7 3 0 1 1 3 3 0 4 1 0 0 8 0 6 4 1 3 1 7 0 6 7 2 0 4 5 4 5 5 2 8 6 0 4 8 7 8 6 1 6 7 0 3 7 8 0 4 7 2 6 1 2 8 4 1 0 7 1 6 0 6 6 8 0 8 4 1 5 0 2 3 4 1 1 5 4 6 2 7 2 4 0 2 8 2 4 6 0 6 7 3 4 2 8 8 5 1...

output:

1230484 1230484 1230487 1230488 1230487 1230482 1230483 1230480 1230480 1230484 1230480 1230491 1230481 1230492 1230481 1230481 1230481 1230488 1230486 1230481 1230480 1230484 1230480 1230485 1230484 1230480 1230483 1230486 1230480 1230483 1230484 1230485 1230480 1230490 1230489 1230480 1230480 1230...

result:

ok 2 lines

Test #20:

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

input:

351493
2 8 0 0 3 2 4 1 2 8 3 4 5 5 1 7 7 6 0 1 6 4 5 6 6 2 6 6 8 0 7 6 3 4 4 0 5 8 6 4 1 2 0 7 7 1 2 7 7 4 6 8 5 0 0 5 6 1 4 4 2 3 7 0 0 6 6 2 3 0 6 4 2 4 3 1 2 4 6 4 7 3 6 4 1 8 8 7 5 4 5 4 4 3 1 5 8 6 0 6 7 7 5 8 7 3 5 2 8 0 3 7 8 6 0 5 0 8 7 6 1 5 5 1 2 5 6 7 5 7 1 4 3 6 6 0 7 3 4 1 7 8 5 2 8 2 1...

output:

1228876 1228879 1228880 1228872 1228874 1228874 1228882 1228872 1228878 1228885 1228872 1228876 1228872 1228876 1228872 1228875 1228878 1228885 1228878 1228875 1228876 1228876 1228877 1228878 1228872 1228881 1228881 1228879 1228883 1228878 1228878 1228881 1228872 1228878 1228876 1228877 1228881 1228...

result:

ok 2 lines

Test #21:

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

input:

351493
3 8 6 8 8 3 2 6 2 3 7 1 7 1 1 0 3 5 2 7 8 5 2 2 4 4 1 6 7 1 4 8 2 5 7 2 1 7 3 5 5 6 7 3 7 2 6 6 3 1 3 2 8 7 8 0 8 4 5 4 7 7 0 8 8 7 8 2 2 1 0 5 0 3 0 1 4 3 1 8 7 8 2 6 2 7 3 3 2 5 2 0 5 4 5 1 8 7 8 6 0 6 1 3 3 4 1 7 4 0 5 3 3 5 5 0 1 0 4 6 7 6 5 1 6 1 2 1 1 0 0 8 8 1 2 4 6 2 1 1 4 8 5 1 7 3 1...

output:

1230342 1230351 1230355 1230353 1230357 1230347 1230350 1230351 1230344 1230346 1230347 1230342 1230345 1230343 1230342 1230347 1230349 1230342 1230345 1230348 1230354 1230347 1230346 1230343 1230349 1230342 1230345 1230346 1230351 1230342 1230349 1230350 1230346 1230349 1230353 1230343 1230342 1230...

result:

ok 2 lines

Test #22:

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

input:

351493
3 4 4 6 3 5 5 2 5 4 4 2 6 5 6 5 1 4 6 5 8 2 5 6 6 8 7 4 1 7 8 4 2 4 6 1 1 6 1 2 2 5 0 4 8 8 2 1 1 5 4 4 2 6 0 6 8 8 3 1 6 4 7 0 4 3 7 3 7 7 4 2 1 1 1 3 2 6 1 5 1 0 3 5 1 7 3 2 6 1 5 4 0 6 8 3 0 5 1 3 5 8 2 0 1 0 2 1 0 0 2 2 7 0 4 2 1 6 7 6 7 2 7 7 7 8 8 4 3 1 7 4 0 1 5 5 8 8 8 2 1 2 4 1 6 5 4...

output:

1230186 1230188 1230181 1230183 1230185 1230185 1230186 1230186 1230190 1230188 1230181 1230182 1230188 1230187 1230190 1230184 1230181 1230181 1230186 1230191 1230189 1230189 1230188 1230185 1230188 1230195 1230190 1230188 1230183 1230185 1230188 1230182 1230184 1230186 1230187 1230182 1230181 1230...

result:

ok 2 lines

Test #23:

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

input:

351493
20138791 56505669 75448938 68038887 2 19817702 0 0 58824287 2 18588664 0 90023872 1 0 53069029 78494334 5 46293666 0 81657444 4311788 26187235 31611918 88735334 43533783 90652492 4 0 0 87327487 80669704 5 0 0 16628151 4 41101081 46363502 58495526 2 14352549 31269734 0 46837984 67021181 619512...

output:

60097059550492 60097059550492 60097067026117 60097059550492 60097535371841 60097059550492 60097059550492 60097159686810 60097059550492 60097206287052 60097075625702 60097499210690 60097126619088 60097329333874 60097059550492 60097083850847 60097059550492 60097503285585 60097059550492 60097456043459 ...

result:

ok 2 lines

Test #24:

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

input:

351493
1 0 5 8 1 0 5 0 1 2 4 8 1 3 3 7 8 0 1 5 3 2 6 2 1 3 4 7 2 0 8 2 8 1 6 6 3 8 3 0 5 0 1 6 6 8 3 6 4 6 5 4 1 0 3 5 3 7 1 6 5 2 7 3 0 0 8 1 5 6 2 6 6 3 0 1 5 7 4 8 2 4 5 6 0 7 3 3 4 1 4 2 0 7 8 1 4 3 6 3 2 8 4 3 1 4 5 3 6 8 2 5 4 8 8 0 0 6 3 1 2 0 4 1 3 5 1 8 8 0 6 0 2 3 5 5 0 7 1 4 4 7 4 8 8 8 4...

output:

1229491 1229491 1229497 1229492 1229488 1229488 1229496 1229488 1229488 1229493 1229494 1229494 1229493 1229492 1229495 1229488 1229496 1229488 1229497 1229488 1229492 1229491 1229494 1229488 1229496 1229491 1229492 1229495 1229488 1229488 1229499 1229488 1229500 1229488 1229500 1229495 1229490 1229...

result:

ok 2 lines

Test #25:

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

input:

351493
645930059 55749478 676371200 351523100 81431091 700014738 356088159 176228025 21088801 536152845 694096725 613287585 717427068 414086833 31406693 701986322 71931266 136270093 161213858 378704215 126566287 330130140 90105440 324092360 685591748 949458352 737924747 918411781 843462309 505472609...

output:

161047909406618 161047735155882 161047977700984 161048564182411 161048552949310 161048120951700 161048756358220 161047735155882 161048437688734 161047735155882 161048229603384 161049207990649 161049158902136 161048562975512 161048271442288 161047860002947 161047735155882 161048122221187 161048526724...

result:

ok 2 lines

Test #26:

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

input:

351493
503796980 348887886 156309456 818736592 119770062 381109303 771556516 91088797 543393080 19489843 703849165 897566311 48080158 441722623 628332233 43770327 877633736 338268009 226216429 896989570 312215091 828388503 183540111 107367598 70290897 263574309 275194238 209080071 212197952 12238647...

output:

161136470041459 161136207984955 161135769419560 161136872645535 161135769419560 161136536288077 161136452811083 161135853623886 161136211965250 161136519691032 161137281689790 161137221314086 161135769419560 161135769419560 161136680690912 161136319979808 161136024881608 161136722441757 161135769419...

result:

ok 2 lines

Test #27:

score: 0
Accepted
time: 30ms
memory: 15336kb

input:

351493
638359507 710512386 586309796 429953147 626585722 581997690 590465254 883093988 22466889 422631387 723177894 849673502 248334263 885560936 705927543 544427868 208492211 317595037 510223178 454799843 872848696 423142724 878762523 447032069 161139972 521484949 990172628 650692378 386131328 1830...

output:

161167108138824 161166778218110 161166963745195 161167240843251 161166329833365 161166545178276 161166631845918 161167305051248 161166528073587 161166230323725 161166945558544 161166353932168 161166530225076 161167564947224 161167367363553 161166916278894 161166463661926 161167081792990 161166230323...

result:

ok 2 lines

Test #28:

score: 0
Accepted
time: 30ms
memory: 15620kb

input:

351493
957247391 91391213 743967434 349776143 354405002 555396908 284121072 54935846 459674961 452960862 835101215 346254681 99416808 11746483 292397271 255681445 805831049 516686422 979467073 214582316 752343273 750166557 127515159 743438280 92238233 193454884 15734669 716510593 770323292 714057605...

output:

161021819351607 161022401994076 161022391506038 161022208958948 161022210410835 161023143861552 161021971775137 161022414086211 161022281232140 161022488454141 161022582378032 161021930905770 161022122635399 161021742354741 161022437273854 161021742354741 161022475504565 161021742354741 161023311084...

result:

ok 2 lines

Test #29:

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

input:

351493
510813397 629098418 416229235 152149921 490255651 310725810 620997496 312093877 861122645 820470640 446074892 989098732 696692466 868508122 56588826 494305360 57400929 805739174 771460025 307679935 901760105 430743532 313557172 464259702 243245076 493270614 363779212 455036886 571979408 28009...

output:

161034819476934 161034874961513 161034108556261 161034197607941 161035107656955 161034873253054 161034340711556 161034335740692 161034528755153 161034576480090 161034063805957 161035632094084 161034952846312 161035663455978 161034713034652 161034029901345 161034123845481 161034270649161 161035085541...

result:

ok 2 lines

Test #30:

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

input:

351493
274172732 546963623 523309979 570676260 50124777 320477938 69663576 74580170 388872177 304102466 634313386 327452537 137853275 94214133 431889868 290389171 119067522 57463807 377022469 263871882 103484455 63009017 763815726 735661409 193433063 545911723 517940343 905450509 451267312 50281896 ...

output:

160816530128258 160816954766654 160817580929496 160817864560292 160817135964471 160816984087822 160816530128258 160817222587086 160817165644195 160816539568740 160816757591104 160816809987899 160816530128258 160816530128258 160817627661718 160816925005745 160816667358948 160817068634137 160816796583...

result:

ok 2 lines

Test #31:

score: 0
Accepted
time: 30ms
memory: 16908kb

input:

351493
444661843 633144184 423413092 843095784 52410726 739562582 361471295 51808966 267242930 951998475 348770913 557906963 884699973 880693791 357034183 460899894 882620793 72701162 372233642 371247966 258835166 831730464 875620920 708949314 307080962 908139702 576672272 188367100 536559186 398112...

output:

161149106105713 161149695879330 161149313869604 161150082817968 161148765517365 161149937934029 161149643774624 161149332196260 161148896149395 161149840492070 161149432138152 161149711459048 161150176293959 161149326051471 161148765517365 161149505972027 161149020845688 161149078027049 161148765517...

result:

ok 2 lines

Test #32:

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

input:

351493
51523407 764997046 705775390 222410175 534971094 518589652 102718372 362655594 980301449 667623338 746617423 113236879 998151801 640391968 562574580 475302529 713439698 387654646 228765615 652973021 348722283 216106503 548804523 618124998 875911086 872429358 240120651 572712711 351035851 6903...

output:

161056196936779 161056571241506 161057030815070 161056742692239 161056809254360 161056289718823 161056201539019 161056100250125 161056690945612 161057017784899 161056220525359 161055906845533 161056661774878 161057196120874 161056856110552 161056995013564 161056647398722 161056151777136 161055906845...

result:

ok 2 lines

Test #33:

score: 0
Accepted
time: 38ms
memory: 15224kb

input:

351493
907524375 867688382 361858195 879000653 510086615 429174915 80028332 245704574 2431848 231536704 48571706 438755228 578918038 549256840 206912755 653379215 589525927 419241985 96227275 509395625 108963379 142446193 34771657 127787108 55726238 586970896 444129758 205025908 240012894 418810440 ...

output:

161178294968671 161177807573093 161177302486231 161177376842267 161177836136162 161177536727851 161177466857105 161177753160760 161178062039433 161177912475131 161177302486231 161177590658788 161178723183764 161177934779917 161177994132684 161177880289698 161177991481393 161177867606978 161177798923...

result:

ok 2 lines

Test #34:

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

input:

351493
83588454 0 30896436 32412518 30462179 2 50852082 15275931 30897880 5 22473220 0 43960671 0 5 58170045 4 0 63257458 0 1 38629580 0 95467309 44032777 0 0 40820802 4565910 68040880 3434223 0 35507653 4 0 39758445 10947269 0 0 78928668 1 48748635 19608116 33974051 33755846 43081421 75023900 50626...

output:

59976002037711 59976132530345 59976002037711 59976002037711 59976002037711 59976122967159 59976010238667 59976003234058 59976002037711 59976245060273 59976002037711 59976327472271 59976002037711 59976002037711 59976060400879 59976002037711 59976055769759 59976064723403 59976002037711 59976003532554 ...

result:

ok 2 lines

Test #35:

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

input:

351493
726815436 670659152 577495766 898135729 652269175 959498165 122454799 538860130 365573765 196337276 562126053 636565717 430265308 480558230 861785711 576553280 923171586 315019131 828841940 172162494 980122326 240359933 167754790 8904289 602619679 383543786 20757014 628912169 240403441 775475...

output:

161259578533029 161260544324102 161259746848400 161260497094829 161260198642554 161260306280171 161260279475881 161259725345300 161259770298663 161259491849024 161259888196615 161260571876189 161259739848377 161260593796049 161259802532354 161259938309652 161260457261967 161259491849024 161260984609...

result:

ok 2 lines

Test #36:

score: 0
Accepted
time: 41ms
memory: 20892kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

724283394 844158 65838838 932085174 400547427 404224977 452303340 973962334 414248755 520038686 473598975 258394266 697799355 519497927 951048499 34955810 356984137 240143248 412968593 125815933 510745439 381526516 532595691 653294056 713237302 484304474 83422090 784916379 45948572 494367092 2380594...

result:

ok 2 lines

Test #37:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

579936011 867969461 206517805 746405338 912422948 171878325 991157942 213299249 913155575 218323037 745597839 775213656 939346457 99099497 688073143 898672933 989841968 144732853 491389036 248304379 408042956 492525365 816154841 218987358 962697984 663017424 171532324 257022585 632361200 869032841 6...

result:

ok 2 lines

Test #38:

score: 0
Accepted
time: 49ms
memory: 21748kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

454625965 716401906 331046846 56276936 707626947 109775237 604790317 720573511 360271142 980101322 321116595 49044690 488495878 25452006 665721438 404512566 388289765 749521359 600887460 10158431 848646192 488402484 157279043 478682882 388066807 371766460 38016800 306714584 936111009 641614071 70482...

result:

ok 2 lines

Test #39:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

678558893 386113253 246730682 146081663 397114526 58311195 581094160 578656854 651977839 361964541 855498677 294465152 481617125 728434043 994778215 423191353 842288002 227842052 407666525 586650924 328763542 213205879 704992060 474580513 44906118 769536543 302981620 432775200 593727777 892396571 95...

result:

ok 2 lines

Test #40:

score: 0
Accepted
time: 42ms
memory: 20832kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

209227190 915863198 563598761 466859802 175513749 566233119 49146596 549290169 414672387 730443999 377088912 389059890 184287570 902611407 267531923 912981440 58214059 263225348 144785430 16025822 273882636 317626863 624880994 37581097 683212654 881686218 432694324 761080897 178403969 512786266 2343...

result:

ok 2 lines

Test #41:

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

input:

351493
0 0 0 95190850 0 0 9342729 0 0 18686098 1229569 0 5804081 51519899 66062976 0 0 0 0 0 0 73024294 86529835 0 0 20732714 0 98224101 2905545 50357812 79319217 437047 0 0 0 0 0 0 0 6802758 0 0 0 0 0 0 0 0 0 15400677 0 3659413 6098454 9932599 0 89080897 0 0 0 0 0 55847893 0 0 0 0 0 0 0 0 0 2401771...

output:

0 0 0 352814583 0 0 206901995 0 0 41996359 16839718 0 44672706 343568986 275768350 0 0 0 0 0 0 218226177 131869559 0 0 283130300 0 301195062 204495434 88233570 329650004 190085855 0 0 0 0 0 0 0 41743793 0 0 0 0 0 0 0 0 0 176053484 0 177101219 276419626 116112824 0 330686541 0 0 0 0 0 221978137 0 0 0...

result:

ok 2 lines

Test #42:

score: 0
Accepted
time: 42ms
memory: 20040kb

input:

351493
90271402 0 0 0 0 46576098 69684766 0 0 94835883 0 0 0 0 0 0 319384 97886862 0 0 0 0 16863176 0 0 0 26338223 0 42309967 0 0 75453920 64555551 0 0 0 47533390 0 0 0 69035441 0 0 0 0 0 45025289 0 0 0 0 0 0 0 0 55083801 0 0 0 0 0 74046051 82747059 0 0 26136554 0 0 0 0 0 37523913 82380934 34029245 ...

output:

254373161 0 0 0 0 294395142 355503495 0 0 294699419 0 0 0 0 0 0 290177256 322826823 0 0 0 0 183780296 0 0 0 152444658 0 106179082 0 0 193830261 324378115 0 0 0 109894224 0 0 0 318704570 0 0 0 0 0 280093195 0 0 0 0 0 0 0 0 66007239 0 0 0 0 0 102775746 189245401 0 0 166456458 0 0 0 0 0 83661029 199164...

result:

ok 2 lines

Test #43:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

745020699 435614120 305889434 470897517 871250236 350701876 395649353 194095080 991089120 531845626 511767873 927793088 93486027 912410574 53685184 548962879 838218698 507736547 272521245 305176407 242189486 712107058 851139025 311151932 154765183 121918109 534409727 526601973 43054142 986712570 101...

result:

ok 2 lines

Test #44:

score: 0
Accepted
time: 30ms
memory: 17692kb

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

679956977 670307724 257954262 228029014 8925093 305052984 174220289 805666671 117239386 668966280 589212913 905530303 380703542 774689387 995459785 912526109 562559207 311303967 382041949 335717815 839623251 499234909 955551080 361244158 568294396 642390924 19799299 352788583 478244853 219461818 268...

result:

ok 2 lines

Test #45:

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

input:

351493
0 9879781 91773069 73181502 94141851 0 56485391 5 65186151 5 57886725 0 94259088 42189439 0 6507846 9247006 5 40375240 0 63458447 0 99750265 9702149 37130980 0 1 88368541 0 0 0 55442006 0 3 59192089 0 0 85583987 0 0 0 0 74218618 3 81788991 73366684 92563893 0 1 1 85910218 0 24506887 6126108 0...

output:

60072060226594 60072066238406 60072060226594 60072060226594 60072060226594 60072060226594 60072108191532 60072319414272 60072060226594 60072154423177 60072060226594 60072304125158 60072060226594 60072060226594 60072060226594 60072060226594 60072060226594 60072090527259 60072060226594 60072060226594 ...

result:

ok 2 lines

Test #46:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

285711582 781998713 625239344 273684283 379557774 555834216 122983231 912950307 405365559 303743928 168367678 37737256 586855888 867623939 46265676 83277591 567698061 725466265 960658189 334812770 580401211 367431818 387838757 995881742 395951141 74065885 397593542 854406813 679486779 438231758 7526...

result:

ok 2 lines

Test #47:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

531042430 424239830 478519747 150910981 417505823 928343474 884655444 194788787 390564054 807947961 654841792 87250276 300964579 484494997 104043758 76702735 223304100 440866284 629429637 659384887 703603904 741376873 311515029 6232968 104763126 357182929 714548563 619037389 39816434 66297938 792298...

result:

ok 2 lines

Test #48:

score: 0
Accepted
time: 37ms
memory: 20052kb

input:

351493
0 0 0 0 0 0 0 71619861 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 73280284 0 0 0 0 0 26869629 0 25089194 0 99034685 64614811 0 0 91546233 0 67412509 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 79820165 0 19496340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7954559 0 0 0 0 8319381...

output:

0 0 0 0 0 0 0 114265177 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 334749457 0 0 0 0 0 232147358 0 282121060 0 289338012 118970771 0 0 122427163 0 327433173 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 278188607 0 157670337 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 184035550 0 0 0 0 12...

result:

ok 2 lines

Test #49:

score: 0
Accepted
time: 37ms
memory: 21080kb

input:

351493
0 0 0 0 0 0 76087080 85336388 0 26929628 0 0 0 0 0 77232347 0 0 89103440 0 0 0 0 0 0 30830614 80886772 0 0 0 3433426 80138424 0 32529299 0 0 0 15432377 0 0 0 72626402 0 0 0 61998503 0 0 0 0 0 0 0 0 0 58500123 78786525 0 0 0 0 0 88813464 53936890 0 0 0 0 0 0 0 41055492 0 0 0 0 53953856 0 31175...

output:

0 0 0 0 0 0 366394796 173315849 0 105733724 0 0 0 0 0 86592297 0 0 272913112 0 0 0 0 0 0 198249923 316386832 0 0 0 94834843 143652312 0 33994627 0 0 0 79011215 0 0 0 100372620 0 0 0 77662814 0 0 0 0 0 0 0 0 0 218667309 190945676 0 0 0 0 0 173817134 215948862 0 0 0 0 0 0 0 59403583 0 0 0 0 83160455 0...

result:

ok 2 lines

Test #50:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 4 0 4 1 1 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 3 0 0...

output:

914500711 571730863 882723735 396888977 837648447 722031188 116959317 435951537 74686996 213649076 825762872 718445720 425368016 150613 100906563 150613 924681591 150613 150613 150613 707384133 489619289 482426571 925495775 914353083 905265458 19827809 817689465 666229123 150613 41470203 888502525 3...

result:

ok 2 lines

Test #51:

score: 0
Accepted
time: 43ms
memory: 21736kb

input:

351493
0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 4 1 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0...

output:

231600294 888790597 678261823 796097422 197803942 487946379 150616 924067649 657291481 165591944 259877655 847771439 551208326 618529316 883215087 461839930 290314419 256067975 994779424 286963394 150616 469127034 318152538 834645958 214404369 322590516 107961177 500656688 973841798 552438658 263842...

result:

ok 2 lines

Test #52:

score: 0
Accepted
time: 49ms
memory: 21820kb

input:

351493
0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 3 0 0 0 2 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0...

output:

841968630 150604 766630749 30503256 722478886 237117061 297963423 607649279 816044550 430414480 334481928 624935813 519914935 487133384 472645948 972083518 134194870 829416712 978738431 870924776 565670422 7660464 150604 737227218 431565674 99672380 938980498 661564719 181522883 820011799 488577438 ...

result:

ok 2 lines

Test #53:

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

input:

351493
0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 10 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 ...

output:

454342069 339752886 447449555 619815017 191162513 646064353 313784507 582556306 535788961 119085875 391248866 842612089 150613 767766495 53942228 112559127 611953749 50057970 907998486 943002822 834415326 217896106 658313015 113658055 585982443 150613 60628127 150613 383820334 228972081 752195955 54...

result:

ok 2 lines