QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#418174#3091. Japanese Knowledgeby_chanceAC ✓4435ms30848kbC++143.1kb2024-05-23 11:32:372024-05-23 11:32:39

Judging History

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

  • [2024-05-23 11:32:39]
  • 评测
  • 测评结果:AC
  • 用时:4435ms
  • 内存:30848kb
  • [2024-05-23 11:32:37]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef vector<int> poly;
const int N=6e5+5;
const int P=998244353,_G=3,invG=(P+1)/3;
int qpow(int a,int b=P-2){
    int c=1;
    for(;b;b>>=1,a=1ll*a*a%P)
        if(b&1)c=1ll*c*a%P;
    return c;
}
int rev[N<<2];
void NTT(poly&f,int op){
    int n=f.size();
    for(int i=0;i<n;i++)if(i<rev[i])swap(f[i],f[rev[i]]);
    for(int p=2;p<=n;p<<=1){
        int len=p>>1,tG=qpow(op==1?_G:invG,(P-1)/p);
        for(int k=0;k<n;k+=p){
            int buf=1;
            for(int l=k;l<k+len;l++){
                int tmp=1ll*buf*f[len+l]%P;
                f[len+l]=(f[l]-tmp+P)%P;f[l]=(f[l]+tmp)%P;
                buf=1ll*buf*tG%P;
            }
        }
    }
    if(op==-1){
        int invn=qpow(n);
        for(int i=0;i<n;i++)f[i]=1ll*f[i]*invn%P;
    }
}
poly times(poly f,poly g){
    int n=f.size(),m=g.size();
    for(m+=n,n=1;n<=m;n<<=1);f.resize(n);g.resize(n);
    for(int i=0;i<n;i++)rev[i]=(rev[i>>1]>>1)|((i&1)?(n>>1):0);
    NTT(f,1);NTT(g,1);for(int i=0;i<n;i++)f[i]=1ll*f[i]*g[i]%P;NTT(f,-1);
    return f;
}
int n,a[N],fac[N],ifac[N],inv[N];poly f;
void init(int n){
    inv[1]=fac[0]=ifac[0]=1;
    for(int i=1;i<=n;i++)fac[i]=1ll*fac[i-1]*i%P;
    for(int i=2;i<=n;i++)inv[i]=1ll*(P-P/i)*inv[P%i]%P;
    for(int i=1;i<=n;i++)ifac[i]=1ll*ifac[i-1]*inv[i]%P;
}
poly solve(int l,int r,poly f,int d){
    if(l==r){int sum=0;for(int x:f)sum=(sum+x)%P;return poly{sum};}
    poly g{},tf{},tg{},F{},G{},fx{},h{};
    int mid=(l+r)>>1;fx.resize(a[r]-a[mid]+1);
    for(int i=0;i<=a[r]-a[mid];i++)fx[i]=f[i+a[mid]-d];
    g=solve(mid+1,r,fx,a[mid]);tf.clear();tg.clear();
    int n=r-mid,m=a[mid]-d;tf.resize(m+1);tg.resize(n+1);
    g.resize(n+1);for(int i=n-1;i>=0;i--)g[i+1]=g[i];g[0]=0;
    if(m==0){tg=g;goto label;}
    F.resize(m+1);G.resize(m+n);
    for(int i=1;i<m;i++)F[i]=1ll*f[i]*ifac[i-1]%P;F[0]=F[m]=0;
    for(int i=0;i<=m+n-1;i++)G[i]=fac[m+n-1-i];F=times(F,G);
    for(int i=1;i<=n;i++)tg[i]=(tg[i]+1ll*F[i+m]*ifac[n-i]%P)%P;
    F.resize(n+1);G.resize(n+1);
    for(int i=0;i<=n;i++)G[i]=1ll*fac[n+m-1-i]*ifac[n-i]%P;
    for(int i=1;i<=n;i++)F[i]=g[i];F[0]=0;F=times(F,G);
    for(int i=1;i<=n;i++)tg[i]=(tg[i]+1ll*F[i+n]*ifac[m-1]%P)%P;
    F.resize(n+1);G.resize(m+n);
    for(int i=1;i<=n;i++)F[i]=1ll*g[i]*ifac[i-1]%P;F[0]=0;
    for(int i=0;i<=m+n-1;i++)G[i]=fac[m+n-1-i];F=times(F,G);
    for(int i=1;i<=m;i++)tf[i]=(tf[i]+1ll*F[i+n]*ifac[m-i]%P)%P;
    F.resize(m+1);G.resize(m+1);
    for(int i=0;i<=m;i++)G[i]=1ll*fac[m+n-1-i]*ifac[m-i]%P;
    for(int i=1;i<m;i++)F[i]=f[i];F[0]=F[m]=0;F=times(F,G);
    for(int i=1;i<=m;i++)tf[i]=(tf[i]+1ll*F[i+m]*ifac[n-1]%P)%P;
    tf[m]=(tf[m]+g[0])%P;tg[n]=(tg[n]+f[0])%P;
    label:h=solve(l,mid,tf,d);h.resize(r-l+1);
    for(int i=mid;i<=r;i++)h[i-l]=(h[i-l]+tg[i-mid])%P;
    return h;
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",a+i),--a[i];
    init(555555);f.resize(a[n]+1);
    for(int i=1;i<=a[n];i++)f[i]=1;f=solve(1,n,f,0);f.push_back(1);
    for(int i=n-1;i>=0;i--)f[i]=(f[i+1]+f[i])%P;
    for(int i=0;i<=n;i++)printf("%d ",f[i]);printf("\n");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3976ms
memory: 29936kb

input:

250000
1 2 2 3 3 4 4 4 5 7 8 9 9 11 13 14 15 17 18 18 20 21 22 24 27 27 28 29 29 29 29 29 30 30 32 32 33 33 33 34 34 37 37 38 38 39 40 40 41 42 42 43 43 47 49 50 53 54 56 56 57 58 59 60 60 62 62 62 63 63 65 68 68 70 70 72 72 73 74 75 76 78 79 79 80 81 81 81 83 86 86 86 87 88 89 93 93 93 93 94 96 96 ...

output:

874857284 874857284 225003251 573393571 921783891 233503878 505042238 738154618 121879422 839988113 85030389 40777713 523376251 977835578 798030745 602005291 469597788 503477929 90478992 864840949 47108394 402729843 896853986 492354092 563628842 854931084 701122709 321739601 788268065 538738458 8018...

result:

ok single line: '874857284 874857284 225003251 ...5 703713661 304300057 249999 1 '

Test #2:

score: 0
Accepted
time: 4125ms
memory: 29384kb

input:

250000
1 1 3 3 4 5 6 7 9 9 10 11 11 13 13 14 14 15 15 15 17 18 18 18 20 20 20 21 21 22 22 23 25 26 27 28 29 30 30 31 31 34 35 35 37 37 38 38 39 40 40 43 43 45 45 46 46 47 47 49 50 54 54 54 54 59 60 62 65 66 67 69 69 71 71 71 72 73 73 74 75 77 79 80 80 81 82 82 85 85 86 86 86 86 88 88 90 92 93 93 93 ...

output:

497902564 497902564 497902564 707013567 378897039 511797333 107470096 299411233 224627943 478634210 120717744 702160195 312013837 102009401 330974938 552319604 452596601 696751263 992030266 441485729 159933440 513942326 640432623 637883962 762084389 804138145 908257502 822381137 887710583 556531303 ...

result:

ok single line: '497902564 497902564 497902564 ...67 10019365 304550057 250000 1 '

Test #3:

score: 0
Accepted
time: 4142ms
memory: 30068kb

input:

250000
1 2 5 6 7 7 7 8 8 10 11 11 12 12 14 15 16 19 20 20 21 21 21 22 23 24 24 24 25 25 25 27 27 27 30 31 31 34 36 37 38 40 43 48 48 51 52 53 54 55 59 59 63 63 65 67 67 69 70 71 72 72 77 77 78 78 80 81 82 84 85 87 90 90 93 94 95 95 96 96 99 100 102 104 104 104 104 106 108 110 110 111 112 112 114 115...

output:

618388156 618388156 198985595 777827387 697663131 231943297 930048726 626068865 913570538 644945775 816595825 875064293 419540343 311265849 904155272 102158806 936609807 544984245 91652270 736720415 27251604 628309097 373393904 592774933 75441907 832917751 479128336 525063424 939037976 774968180 841...

result:

ok single line: '618388156 618388156 198985595 ...539 9269368 304550054 250000 1 '

Test #4:

score: 0
Accepted
time: 4014ms
memory: 29708kb

input:

250000
3 5 6 7 8 8 8 9 11 11 13 14 14 15 16 18 19 19 20 24 25 25 26 26 26 27 27 28 30 32 33 37 38 38 38 39 40 40 41 43 44 45 47 47 49 50 50 51 52 52 54 60 63 63 65 67 67 68 68 72 73 73 75 75 76 76 76 78 79 81 81 82 83 83 85 86 86 87 87 88 89 89 92 93 93 94 97 99 102 102 102 102 102 102 104 105 105 1...

output:

684871272 15993296 639156557 557872349 434015355 622656954 173820868 572976006 497330131 331958323 473856590 734539062 165842379 626578296 437521527 622725910 529631089 202823484 40213154 811122182 180127758 770981373 341785717 347485449 715718483 899146008 862180117 217332803 574988621 774243166 90...

result:

ok single line: '684871272 15993296 639156557 5...296 9769364 304550056 250000 1 '

Test #5:

score: 0
Accepted
time: 4058ms
memory: 28840kb

input:

250000
3 4 5 5 7 8 9 9 10 11 12 12 13 14 14 14 15 16 17 19 20 20 20 21 22 22 22 25 26 29 29 30 31 32 37 38 39 39 39 41 41 42 42 44 44 44 45 45 46 47 48 48 49 50 51 51 52 53 55 56 56 56 57 57 58 59 61 62 65 66 68 68 70 70 70 71 74 75 75 75 76 76 77 78 79 81 82 82 85 85 89 90 92 93 94 96 98 98 99 100 ...

output:

148667291 809374822 242722735 445199736 125220804 985933977 680266190 796878099 870697963 671659664 76714723 518095724 777891955 862129488 901167586 157838876 392733571 94464968 310514850 829180307 587972439 44520090 936110993 406765462 339640566 658713086 531090232 492379497 593153596 190444844 515...

result:

ok single line: '148667291 809374822 242722735 ...313 9769366 304550056 250000 1 '

Test #6:

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

input:

250000
1 2 2 2 2 2 4 7 7 8 9 10 12 13 13 16 18 18 19 19 21 22 23 23 28 28 28 30 31 32 34 34 35 35 36 38 40 42 46 46 47 48 48 50 50 51 52 53 53 54 54 55 55 56 59 59 60 61 62 63 65 65 66 66 68 69 69 69 70 71 71 72 73 74 75 75 76 82 82 83 84 84 84 85 85 87 88 89 90 94 94 97 99 100 100 101 101 101 102 1...

output:

305579936 305579936 925249719 546675149 168100579 787770362 409195792 30621222 269988570 260433279 133335145 128581527 111833827 976091467 939842892 717224541 238514037 544858790 689572532 607759513 45393488 627834457 340415224 481194383 605047318 914724762 498583656 848343588 326221517 481918581 70...

result:

ok single line: '305579936 305579936 925249719 ...311 9769366 304550056 250000 1 '

Test #7:

score: 0
Accepted
time: 4036ms
memory: 28244kb

input:

250000
2 7 8 9 10 11 12 12 12 12 14 18 19 20 21 22 22 24 24 24 24 26 26 28 29 29 30 30 31 33 33 33 34 34 35 36 37 37 40 40 41 42 45 46 46 46 47 47 48 48 50 51 52 53 55 58 58 59 59 60 60 60 63 63 64 65 65 65 66 68 69 71 71 74 74 76 77 79 80 83 86 87 88 89 90 90 90 93 96 96 96 99 99 100 101 102 102 10...

output:

7368068 319910528 632452988 946021042 286133707 263078619 935204465 563556290 256098032 935921870 32731030 818266101 919021964 557956922 966173993 82231359 716724809 628702921 351454629 174027179 65636810 289186968 175106418 418498584 864363080 676676443 378982487 388390080 375265683 506719408 17093...

result:

ok single line: '7368068 319910528 632452988 94...8 789807840 303550063 249996 1 '

Test #8:

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

input:

250000
4 5 6 6 6 7 7 8 9 10 10 11 12 12 12 15 15 16 16 19 19 19 21 23 24 26 27 28 29 30 31 31 34 37 38 38 39 39 40 40 41 42 42 44 45 46 48 48 52 52 54 54 55 57 58 58 59 60 60 60 61 61 62 62 64 65 65 66 67 67 69 70 71 72 72 74 74 75 75 75 77 77 79 79 82 83 83 84 85 87 87 87 87 88 90 93 94 94 95 96 97...

output:

996951445 27259662 141221991 847847117 657899372 600632703 230813260 86784837 155556901 334381327 892329133 105168561 44232387 554387400 557398342 860869776 716807225 399072567 530478787 656302252 708835157 850208438 992413777 586955537 674806222 513020472 238268719 272507253 186479792 536422393 202...

result:

ok single line: '996951445 27259662 141221991 8...310 9769364 304550056 250000 1 '

Test #9:

score: 0
Accepted
time: 4089ms
memory: 28364kb

input:

250000
2 3 4 5 5 6 7 8 8 8 8 9 9 9 10 10 11 11 12 12 14 14 15 17 19 21 22 23 25 25 26 28 29 31 32 35 39 40 40 42 42 43 43 43 44 46 47 49 50 50 50 52 52 53 53 54 55 55 56 56 59 59 61 62 62 62 64 65 66 66 67 69 69 70 70 70 73 73 73 74 74 75 80 81 81 82 83 85 85 88 88 88 90 91 92 94 95 99 100 101 101 1...

output:

573468021 62678692 550133716 846294688 951161608 694473323 904213033 799675312 986199167 460434979 439903608 206600674 167494776 152987413 8210032 547834451 948584199 632566551 717368447 250417981 555069997 211857883 274953212 178786931 157907648 123252205 615229724 793736882 327382820 406261477 507...

result:

ok single line: '573468021 62678692 550133716 8...2 703713661 304300057 249999 1 '

Test #10:

score: 0
Accepted
time: 4048ms
memory: 29104kb

input:

250000
1 3 3 3 4 4 5 6 6 6 7 8 8 8 9 10 11 11 12 13 13 15 16 16 18 18 19 21 21 22 22 24 29 30 30 31 33 33 33 33 35 35 36 36 36 39 41 45 47 48 49 49 49 52 54 54 55 55 56 56 56 57 57 58 59 61 62 64 65 68 68 69 70 70 70 71 72 73 74 78 79 80 82 82 82 83 85 85 89 90 91 92 93 94 96 96 97 98 98 98 99 100 1...

output:

778197942 778197942 538594941 348471133 207826518 116661096 74974867 557761935 43527698 5510613 636087737 846774727 65475551 33732199 614508276 591194360 879415256 169195616 756835235 399582507 929633940 476349037 827871570 366861516 528948760 260618910 616985648 268271135 475507000 218512693 641149...

result:

ok single line: '778197942 778197942 538594941 ...304 9769366 304550056 250000 1 '

Test #11:

score: 0
Accepted
time: 4048ms
memory: 30360kb

input:

250000
1 1 1 2 3 3 3 5 5 6 6 6 9 11 12 12 15 16 18 18 18 19 20 23 23 23 25 25 25 26 27 28 29 29 29 31 31 32 35 36 37 40 40 41 41 41 41 43 44 44 45 46 46 46 46 52 52 56 56 57 58 60 60 63 64 65 66 72 72 72 73 74 75 75 77 79 79 79 80 80 82 82 83 83 83 83 89 90 92 93 95 96 96 100 102 102 104 105 107 107...

output:

170070110 170070110 170070110 170070110 678936298 189558133 121982554 476209561 253994801 453582627 226604467 513621365 51146569 362867296 283993451 468049876 905958128 441606963 986292881 619744961 939510340 361325280 694936315 923016233 640762173 126837751 415780179 713731425 196683732 892440268 9...

result:

ok single line: '170070110 170070110 170070110 ...311 9769366 304550056 250000 1 '

Test #12:

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

input:

250000
1 1 3 3 3 4 4 5 6 6 7 8 9 10 11 15 17 19 19 20 21 21 22 26 26 26 26 28 29 30 31 31 35 36 37 40 43 43 44 44 44 44 46 49 50 51 52 54 55 58 59 59 59 60 62 63 63 64 64 65 65 66 67 69 69 72 72 73 74 76 76 76 77 79 81 82 83 83 83 86 87 87 90 91 91 94 94 94 99 100 104 106 106 108 109 111 111 112 112...

output:

340278772 340278772 340278772 628423583 360647809 535195803 153823212 214774389 438096745 543837691 252044638 160664174 747297711 912023734 513197462 906761803 672643127 503652799 138245200 165813554 238356408 862540202 503318483 86717612 316293228 370215750 563863952 249718529 703917082 193415718 6...

result:

ok single line: '340278772 340278772 340278772 ...313 9769366 304550056 250000 1 '

Test #13:

score: 0
Accepted
time: 4009ms
memory: 29932kb

input:

250000
1 3 3 3 3 3 4 6 6 10 10 10 11 12 12 13 15 15 16 16 19 22 23 25 26 27 30 30 31 31 31 32 34 34 35 35 37 38 38 39 39 39 40 41 42 45 45 49 49 50 51 52 55 57 58 58 59 62 63 64 64 65 65 66 66 67 67 67 70 70 70 71 71 72 73 74 74 74 75 75 77 80 80 83 86 88 88 89 89 90 91 92 98 99 99 100 103 105 108 1...

output:

818308801 818308801 329102496 976888916 765179355 692218166 758005349 962540904 307580478 934340135 991058527 49350097 653936946 888181523 915040257 849837065 149703018 575486474 691195259 724050997 611647922 983280339 825804639 519987257 287059685 501866774 75567715 490553287 635239864 282761939 83...

result:

ok single line: '818308801 818308801 329102496 ...90 95363546 303800060 249997 1 '

Test #14:

score: 0
Accepted
time: 4098ms
memory: 30244kb

input:

250000
1 4 4 6 6 9 11 12 14 14 15 19 21 22 25 26 26 27 27 29 29 29 31 34 34 35 36 38 40 45 45 46 46 48 49 50 52 53 54 55 55 55 57 59 61 63 63 63 64 65 65 65 65 66 66 68 68 69 69 70 70 71 72 73 75 75 76 77 81 83 83 86 86 89 89 91 96 97 98 100 103 104 104 105 106 106 108 110 110 111 112 113 114 114 11...

output:

840665968 840665968 859000880 931377686 351987142 411508710 404133146 105014503 733476341 924996172 689144729 179791510 557957959 917853221 885867220 873719311 583921914 899579545 19937652 412099194 366346929 556812695 402461235 221558190 315764488 865056437 979065641 751722308 167843454 651445258 5...

result:

ok single line: '840665968 840665968 859000880 ...70 10019365 304550057 250000 1 '

Test #15:

score: 0
Accepted
time: 4130ms
memory: 29140kb

input:

250000
2 4 4 4 9 9 10 11 12 13 14 16 17 18 19 19 19 21 23 23 23 23 24 27 28 29 29 30 31 31 31 32 34 34 36 36 37 38 39 41 41 41 43 44 44 46 47 48 48 48 50 52 52 53 53 53 54 55 57 63 65 65 66 69 70 71 72 72 72 73 73 73 74 75 78 79 81 83 83 86 87 88 90 91 92 92 93 93 93 94 102 102 103 103 103 103 104 1...

output:

833354567 966396268 101193616 143833183 854100644 993537321 321928889 595549729 397682363 25934989 723427565 107726882 505612311 863049621 678458689 662603047 277545868 392442937 375297729 198777691 987212139 122232753 93499453 676664771 477623609 116708129 524291316 973604825 123684097 279642401 77...

result:

ok single line: '833354567 966396268 101193616 ...259 9769336 304550056 250000 1 '

Test #16:

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

input:

250000
2 4 5 11 13 14 18 18 19 20 21 22 23 25 26 26 27 28 28 29 31 32 33 34 35 35 35 36 37 40 40 41 42 42 43 43 46 47 48 49 49 49 50 51 51 51 53 55 56 59 61 62 62 62 63 64 64 65 65 67 67 68 68 69 72 72 72 74 77 80 80 82 82 82 82 84 84 85 85 86 86 86 86 87 87 88 88 89 89 89 90 90 90 90 92 93 95 96 96...

output:

80904116 186981897 293059678 713131343 425663566 405611727 619454768 25195193 793491763 538286419 731244197 101116435 494887034 776480712 466139485 702003699 520889467 240963809 31705935 782079400 330354984 537209783 708295930 494441974 354105157 55245338 480468291 510743360 819304165 593967049 3991...

result:

ok single line: '80904116 186981897 293059678 7...65 10019366 304550057 250000 1 '

Test #17:

score: 0
Accepted
time: 4074ms
memory: 30828kb

input:

250000
1 1 1 1 1 3 4 6 7 8 8 10 11 12 13 13 14 16 16 17 18 19 21 22 24 26 27 30 31 32 32 35 36 37 38 40 40 41 42 42 43 44 44 44 44 46 47 49 50 50 52 52 53 56 56 56 57 60 61 61 63 64 64 65 65 65 66 66 67 69 70 71 74 75 75 76 76 76 77 78 78 78 80 80 80 82 83 83 87 88 88 89 90 91 92 92 95 97 97 98 98 1...

output:

197352061 197352061 197352061 197352061 197352061 197352061 662404608 692141794 286563619 13643152 441353462 77561543 811783127 379760908 552202296 102101758 201915154 987880179 970840671 94111220 792006944 385905838 120122740 899305439 607365353 620637199 891084311 958356952 780797150 604213194 479...

result:

ok single line: '197352061 197352061 197352061 ...55 10019366 304550057 250000 1 '

Test #18:

score: 0
Accepted
time: 4048ms
memory: 29492kb

input:

250000
2 5 7 7 8 11 11 12 12 14 14 15 15 17 17 17 18 18 19 20 20 20 20 23 23 24 26 26 27 27 28 29 30 31 33 33 33 34 34 35 36 37 39 41 43 43 44 45 45 46 47 47 49 49 49 52 54 56 56 57 60 61 62 62 63 63 65 66 66 66 67 67 70 70 71 72 72 73 73 73 77 78 78 79 79 80 82 83 84 84 86 86 88 89 90 93 94 95 95 9...

output:

705681742 967454519 230982943 686078644 118796321 868503687 843682292 651199758 907824885 714673511 289318185 662598149 334876596 143286453 26597721 393255180 261042222 765052024 616575302 724977490 707042539 61692504 268441840 199959942 680513253 941839204 905934999 496448633 656761598 802409731 44...

result:

ok single line: '705681742 967454519 230982943 ...313 9769366 304550056 250000 1 '

Test #19:

score: 0
Accepted
time: 4044ms
memory: 28588kb

input:

250000
4 5 5 5 6 6 7 7 7 7 11 11 12 12 13 13 13 16 18 18 18 19 19 21 22 22 24 25 26 27 29 35 36 39 39 40 41 42 43 43 46 47 47 47 47 48 51 52 52 54 57 61 62 62 64 64 66 66 68 69 70 71 71 73 73 75 75 76 76 77 77 79 81 82 82 83 83 83 85 85 85 86 86 87 88 88 89 89 90 91 92 92 93 93 93 94 100 101 102 102...

output:

690058567 149288662 188861449 838434296 131175865 175136784 165539176 377754071 170812700 246500682 915474799 363379771 195404186 290877231 936304578 257911189 929111982 402221289 175953395 784145759 558304255 827649790 687050064 506900933 130198265 16693887 155183687 721832452 49226484 892497157 68...

result:

ok single line: '690058567 149288662 188861449 ...1 703463661 304300056 249999 1 '

Test #20:

score: 0
Accepted
time: 4100ms
memory: 30012kb

input:

250000
1 3 6 10 11 12 12 14 14 15 16 20 23 24 24 24 25 25 26 27 29 29 31 33 34 36 37 37 37 37 37 38 38 40 42 43 43 49 49 49 50 52 53 55 55 58 59 60 63 63 64 64 65 65 67 69 71 71 72 72 72 73 73 74 74 76 76 77 79 79 79 81 82 83 84 85 86 86 89 90 91 92 93 94 94 94 95 97 98 99 101 102 102 104 107 109 10...

output:

136956717 136956717 855152131 576777303 300076586 238917040 441012874 88568342 791898051 292625318 691697984 545771851 426388168 208345223 593099318 919700117 405090153 987547942 77081905 823397858 524506503 577250083 446763154 184590268 761668000 551706725 375218991 673661775 508215800 240571935 80...

result:

ok single line: '136956717 136956717 855152131 ...70 10019365 304550057 250000 1 '

Test #21:

score: 0
Accepted
time: 4060ms
memory: 29144kb

input:

250000
2 3 4 6 8 9 10 10 12 12 13 16 20 21 22 23 23 24 24 25 25 25 29 30 32 34 36 39 40 40 41 42 43 43 43 44 44 49 49 50 50 50 51 51 53 54 54 55 57 59 61 64 65 65 65 66 67 67 67 67 69 69 70 71 72 75 75 76 76 77 79 82 83 84 84 85 85 86 87 87 88 90 90 90 92 92 93 93 93 95 96 98 98 102 105 106 106 106 ...

output:

11496119 487136644 962777169 592470420 374460750 300024990 360439971 452043560 305579452 413786315 122671343 621275496 599850646 879082177 954554030 553019998 158603372 906123292 946877815 744781550 90864762 762640892 816153757 151296456 428244427 970749001 280417114 453164121 139514084 413385621 91...

result:

ok single line: '11496119 487136644 962777169 5...338 9769350 304550056 250000 1 '

Test #22:

score: 0
Accepted
time: 4038ms
memory: 29152kb

input:

250000
3 5 5 5 6 9 9 10 10 10 11 11 12 15 15 15 16 17 17 19 20 21 22 23 23 24 25 27 27 27 28 29 30 31 35 35 36 36 37 38 38 39 40 41 41 42 43 44 47 47 47 47 47 47 47 51 52 52 52 53 54 57 59 60 61 64 69 69 70 70 72 73 74 77 77 78 78 81 81 82 82 83 84 84 85 86 86 87 88 90 90 91 91 91 92 95 95 98 98 99 ...

output:

519359242 374804729 324736137 369153466 850786689 655384127 206445508 466977614 943005575 550050333 476094812 450777929 268172230 551394214 849565453 254644720 345890005 399139355 366495038 293853539 50054736 215362949 306491259 159916091 671832462 197712011 780258718 703183667 463692824 603612335 3...

result:

ok single line: '519359242 374804729 324736137 ...824 7519381 304550047 250000 1 '

Test #23:

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

input:

250000
1 3 3 4 4 6 9 10 10 11 11 12 12 13 15 15 16 16 16 16 17 18 18 19 19 21 24 26 26 28 29 33 34 35 35 39 39 45 47 49 50 50 50 52 53 53 54 56 57 59 60 61 64 64 64 65 67 68 68 69 69 70 70 71 71 72 74 75 76 76 79 80 81 82 82 82 83 86 86 87 87 88 90 91 92 93 93 94 94 95 95 96 97 98 98 98 98 99 99 99 ...

output:

177108172 177108172 828920747 633760464 589871676 697254383 385175086 81144639 212673896 216256782 616849522 116128105 11388472 32322221 976535147 923649280 364032239 497041384 38521957 619109960 656831376 629761782 380273455 90713002 784308126 172881945 203132820 857977429 417572732 816655310 81155...

result:

ok single line: '177108172 177108172 828920747 ...5 702213672 304300051 249999 1 '

Test #24:

score: 0
Accepted
time: 3971ms
memory: 29228kb

input:

250000
2 3 3 4 4 5 7 8 8 9 9 9 9 10 12 13 19 20 20 20 21 21 21 23 25 25 26 26 27 28 28 28 29 30 31 32 32 33 35 37 37 38 39 41 43 43 46 46 46 46 47 48 49 50 50 50 51 51 52 52 52 53 53 55 56 57 57 58 58 58 59 61 61 62 63 63 64 65 66 67 70 71 73 74 74 76 77 77 80 81 82 82 83 84 84 84 85 85 86 87 88 89 ...

output:

360119011 386719972 413320933 924119435 920871125 403576003 960170638 185614187 666087572 838613081 980520486 394133968 496098576 834169631 905122996 682557073 749312212 863358494 707838598 517100327 199411704 498887297 955603497 874250857 957898359 616280538 423241964 83579138 388354665 761765308 4...

result:

ok single line: '360119011 386719972 413320933 ...70 10019366 304550057 250000 1 '

Test #25:

score: 0
Accepted
time: 4110ms
memory: 28896kb

input:

250000
1 2 3 3 4 5 6 6 8 9 9 13 13 14 14 16 16 17 17 17 19 20 20 20 20 20 21 22 22 23 24 28 28 29 29 32 34 36 38 39 40 40 41 42 42 44 44 44 44 45 45 47 47 47 47 48 48 49 49 50 54 54 54 55 55 55 57 57 61 62 62 63 64 65 66 66 66 67 68 68 68 70 72 72 74 76 78 79 79 81 84 86 86 89 89 90 91 94 96 97 97 9...

output:

672525284 672525284 248901896 823522861 309161060 702305199 6466572 640580348 32359931 813024664 834856299 744849089 577671997 341608317 471440645 661442087 582856356 845513059 413221183 504490145 4776181 156803644 789272773 42725873 80497779 638694474 272567162 455261482 155203072 670834921 2670909...

result:

ok single line: '672525284 672525284 248901896 ...727 8519374 304550051 250000 1 '

Test #26:

score: 0
Accepted
time: 4040ms
memory: 30000kb

input:

250000
1 1 2 3 5 6 12 12 13 14 14 14 14 15 16 17 18 20 21 22 22 24 24 25 25 25 29 31 32 33 35 37 38 38 42 43 43 44 45 45 47 48 49 50 50 52 54 57 58 58 61 62 62 63 63 63 63 64 64 65 66 66 67 67 68 70 70 71 71 72 72 72 74 75 76 76 76 77 77 79 80 81 82 85 87 87 87 91 91 92 93 93 93 98 98 99 99 99 100 1...

output:

889559445 889559445 889559445 636939111 384318777 952242422 344221340 90245119 681905223 574150639 532108838 990196265 972249388 340907545 288572893 55912517 366470496 343942650 614705398 869502367 233549702 239007656 534427337 863784613 787611248 581483937 539445816 580588414 682495258 594207874 60...

result:

ok single line: '889559445 889559445 889559445 ...3 702963664 304300054 249999 1 '

Test #27:

score: 0
Accepted
time: 4062ms
memory: 29344kb

input:

250000
1 2 3 4 5 6 8 8 8 9 13 15 17 18 19 21 23 23 24 27 31 32 32 32 36 37 39 40 41 42 48 49 49 50 50 51 51 52 55 55 57 58 59 60 60 60 61 61 61 62 62 63 63 64 64 64 65 66 66 66 66 67 67 67 68 68 68 69 69 71 76 77 77 78 80 81 82 82 82 83 83 84 85 86 87 87 90 91 92 93 95 96 96 96 96 97 97 98 98 99 99 ...

output:

847503496 847503496 104000508 358741873 195799147 613416683 90615976 101151580 178038947 908287486 879562907 614560036 252910437 46226166 752948746 21428099 814543231 867217991 902571698 131739245 812224835 318409001 173157612 897623958 697680796 840008347 564229397 684940721 105944526 671692867 739...

result:

ok single line: '847503496 847503496 104000508 ...70 10019365 304550057 250000 1 '

Test #28:

score: 0
Accepted
time: 4046ms
memory: 29072kb

input:

250000
1 1 1 2 3 4 4 6 8 9 9 9 12 13 14 14 15 17 17 17 18 18 19 20 21 21 22 23 23 23 24 25 25 26 27 29 30 31 32 37 37 38 39 41 41 41 42 44 44 44 48 49 50 52 52 53 54 55 58 60 63 64 65 67 68 68 69 70 72 73 77 82 82 83 83 85 85 86 86 86 87 89 91 91 95 97 98 100 100 103 103 103 104 105 106 106 106 106 ...

output:

946350240 946350240 946350240 946350240 227566394 507026901 789712826 77379816 490087540 154918255 193687277 325492831 477955624 401969712 871436473 696569461 749511917 940895842 738076316 534594112 876415608 681548656 103328786 26962613 160440106 629795467 571241701 250222497 800135410 560773725 67...

result:

ok single line: '946350240 946350240 946350240 ...7 399163607 304050057 249998 1 '

Test #29:

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

input:

250000
1 1 2 2 3 5 5 7 8 10 11 12 14 14 17 18 22 23 23 24 30 31 33 33 34 35 35 35 39 40 42 42 47 47 48 48 50 51 52 55 56 56 57 58 60 60 60 61 62 63 64 65 65 66 67 69 71 74 75 76 76 76 77 77 79 81 81 83 84 85 85 85 87 88 88 88 89 91 92 93 95 95 97 97 98 99 99 100 101 101 101 101 101 102 102 102 105 1...

output:

184114737 184114737 184114737 520129805 856144873 193915588 93567617 555100960 371009953 307320105 108855039 495725198 164402620 943859411 143638503 996431296 224143367 989916472 1732529 617839527 432225086 513760531 497975065 453242049 662066304 909774284 224306023 457441192 490711719 872132832 392...

result:

ok single line: '184114737 184114737 184114737 ...67 10019365 304550057 250000 1 '

Test #30:

score: 0
Accepted
time: 4163ms
memory: 29292kb

input:

250000
3 4 4 4 5 6 7 8 8 9 9 10 11 12 12 14 14 15 16 17 19 19 20 22 23 24 28 28 28 29 30 32 32 32 33 33 34 34 37 38 38 40 41 43 43 45 45 48 48 49 49 50 50 50 50 51 52 52 52 53 53 53 54 54 54 54 55 55 56 57 57 60 60 61 62 62 63 65 66 67 67 67 68 68 68 68 69 70 70 73 74 74 74 76 77 78 78 80 81 86 87 8...

output:

869843189 632073169 207900662 595570021 557220967 851481927 240492622 481125832 345892605 614164022 958110139 821616341 425981420 904153024 38057035 38464494 882332512 682319022 649341227 274149835 975542829 839431709 729735299 32162635 211579077 523445744 530338005 873094816 695518770 312187379 875...

result:

ok single line: '869843189 632073169 207900662 ...65 10019366 304550057 250000 1 '

Test #31:

score: 0
Accepted
time: 4135ms
memory: 29812kb

input:

250000
1 1 3 4 4 4 4 5 6 6 7 10 10 11 11 13 14 14 15 15 17 22 23 24 24 24 26 27 29 29 29 30 30 31 33 35 37 38 42 42 43 43 44 48 49 49 51 52 53 56 56 57 57 58 58 59 59 60 60 61 61 62 63 63 63 67 67 69 70 71 74 74 74 74 75 75 77 78 80 80 80 82 82 83 84 85 85 87 88 91 92 93 96 97 97 98 101 101 104 104 ...

output:

294821246 294821246 294821246 943788227 419761072 719228487 751963034 425981628 647545537 326427323 368888254 707010810 298698683 78238028 915636949 577720632 685590914 708830169 853224383 180726002 885146264 534803026 57575107 144901541 791219898 691178346 963505167 273607006 608247244 669813737 82...

result:

ok single line: '294821246 294821246 294821246 ...388 9769336 304550056 250000 1 '

Test #32:

score: 0
Accepted
time: 4078ms
memory: 30176kb

input:

250000
3 3 4 4 4 6 7 7 7 8 8 8 9 11 16 16 17 18 20 21 23 23 27 28 29 31 32 32 33 33 35 36 38 40 41 41 43 43 44 44 49 50 50 50 51 51 51 52 52 53 53 53 60 61 61 65 65 67 67 67 67 67 68 69 71 71 71 72 73 74 74 76 77 79 79 80 80 81 82 82 83 87 88 88 90 92 95 97 97 97 99 100 108 109 110 113 118 118 119 1...

output:

523412074 345779127 332014349 482117740 796089300 480367565 737879777 775064472 796604539 66445685 352927477 389715207 856455357 912511957 259204778 741083242 81069217 291632455 397211722 3022790 660902705 314076933 486061285 34255808 490150640 398374129 232361245 81514596 940967743 308826231 631140...

result:

ok single line: '523412074 345779127 332014349 ...310 9769364 304550056 250000 1 '

Test #33:

score: 0
Accepted
time: 4272ms
memory: 30108kb

input:

250000
1 2 2 6 7 10 10 11 12 16 16 17 17 18 18 18 18 19 22 22 23 23 24 26 28 33 35 36 40 40 41 42 43 46 46 47 48 50 51 52 54 54 56 56 56 56 57 58 58 58 58 58 59 59 63 64 65 65 65 66 67 69 70 71 72 73 74 74 76 76 78 79 79 79 80 81 81 84 84 88 88 89 89 89 92 93 93 94 95 95 97 97 98 99 99 100 100 101 1...

output:

478452685 478452685 271364996 64277307 855433971 820695353 835772919 146214361 543026926 555857215 297837197 990186790 308661239 698325942 650719471 326256022 226230687 78513943 448695339 738983960 527026434 142784667 906327314 230743671 866864909 895645478 440862993 912157491 150761815 997090219 52...

result:

ok single line: '478452685 478452685 271364996 ...304 9769366 304550056 250000 1 '

Test #34:

score: 0
Accepted
time: 4065ms
memory: 28468kb

input:

250000
1 2 2 3 5 7 9 11 11 12 13 14 14 14 16 18 18 19 22 23 24 27 28 29 30 30 31 34 37 37 40 41 42 42 43 43 43 43 43 43 43 44 45 45 48 53 53 53 54 55 58 58 60 61 64 65 67 67 68 70 70 72 72 75 75 75 78 78 78 79 79 83 83 85 85 86 87 87 87 90 91 93 94 94 94 95 96 96 97 97 99 100 101 101 102 103 103 105...

output:

492365904 492365904 445462032 398558160 351654288 211942755 977667914 946039744 77539232 994162726 433324173 270498256 177319016 419043438 856180596 668883601 361347397 758933017 515030858 684189532 770280858 655041480 339300765 9094299 614134102 20532184 33248768 607637358 219947405 946546043 49713...

result:

ok single line: '492365904 492365904 445462032 ...288 9769366 304550056 250000 1 '

Test #35:

score: 0
Accepted
time: 4161ms
memory: 28944kb

input:

250000
1 1 5 7 7 9 10 10 11 12 13 16 16 17 17 18 18 19 20 21 21 22 22 22 25 25 26 27 28 29 29 29 30 30 31 31 32 33 35 35 36 37 38 39 39 40 40 41 43 43 44 44 44 45 48 48 48 49 50 54 54 55 56 58 60 61 66 66 67 67 68 69 69 69 70 71 71 73 76 76 77 78 78 79 80 80 80 80 82 82 82 84 86 87 89 90 91 92 92 93...

output:

896509860 896509860 896509860 658851527 388955137 28959753 498957828 702262146 565260405 3944749 804826720 439549747 898698131 931747068 179644430 786951466 909671006 154305796 546741588 952580659 115018083 857389917 465767704 550302417 367036056 841242540 862721043 400524199 148973726 191361807 626...

result:

ok single line: '896509860 896509860 896509860 ...6 703463661 304300056 249999 1 '

Test #36:

score: 0
Accepted
time: 4111ms
memory: 29608kb

input:

250000
1 2 3 4 4 4 5 6 8 8 10 10 11 13 15 16 19 19 20 21 22 22 24 25 26 26 27 27 27 29 30 30 31 31 33 34 35 37 38 39 41 41 41 43 49 49 50 50 52 54 54 55 55 55 56 56 57 61 61 62 62 65 66 66 67 67 68 68 69 69 70 71 71 74 74 75 75 76 76 77 77 78 79 80 80 82 83 87 88 88 90 91 94 95 96 97 100 102 102 104...

output:

337480861 337480861 354031257 370581653 105083656 555781619 684682554 452037826 816343153 739605547 747006152 930411538 421404550 857292569 500240436 563491734 377646238 954468522 178514200 917750388 84753108 715499820 537056082 232828615 635934059 970140412 55077550 640129704 251247501 277504364 82...

result:

ok single line: '337480861 337480861 354031257 ...0 789557844 303550062 249996 1 '

Test #37:

score: 0
Accepted
time: 4028ms
memory: 29292kb

input:

250000
2 2 2 7 7 10 13 13 15 15 16 17 18 18 18 18 18 19 19 26 27 27 29 29 30 30 30 31 32 32 34 34 36 37 38 38 39 39 39 41 41 42 43 43 44 46 46 46 48 51 51 56 56 56 56 58 58 59 60 60 61 61 63 64 64 65 66 69 69 71 71 72 73 77 77 78 79 79 80 81 81 82 83 84 85 86 86 87 87 89 93 95 97 99 99 99 101 101 10...

output:

579170382 785463668 991756954 199805887 406099173 863618638 899649617 324211999 866740817 740189932 300957165 836232523 650765301 862280794 982679294 269353454 534480679 827816851 383759403 626631584 418955170 23696662 471822187 820049822 494341638 9139367 741450708 878959645 25867763 658946291 6977...

result:

ok single line: '579170382 785463668 991756954 ...9 703713642 304300057 249999 1 '

Test #38:

score: 0
Accepted
time: 4059ms
memory: 30128kb

input:

250000
1 2 4 5 6 8 9 9 9 9 11 12 12 14 17 20 22 22 23 23 25 26 28 29 30 31 33 33 40 40 40 41 42 43 44 45 45 45 45 46 46 48 48 50 51 51 52 53 54 55 55 57 58 58 59 61 62 63 65 67 67 67 69 69 71 71 72 73 73 74 74 77 78 79 79 80 84 86 86 87 88 90 91 91 92 94 95 95 95 95 96 96 96 100 100 100 101 103 104 ...

output:

318422840 318422840 179241009 40059178 163383765 938812339 759453763 399494144 19463774 326047814 737163919 45986112 944212089 798228430 995543666 307985326 619049152 467335786 783481355 418662534 809054783 244464500 756325828 24126715 445031110 512171848 564449967 302128237 357956997 428614203 8333...

result:

ok single line: '318422840 318422840 179241009 ...9 399413604 304050058 249998 1 '

Test #39:

score: 0
Accepted
time: 4072ms
memory: 29668kb

input:

250000
1 2 2 3 4 4 5 7 7 8 11 12 13 13 14 16 17 18 18 19 24 24 24 25 26 27 28 28 28 28 29 29 29 30 30 32 33 34 34 34 36 36 36 36 36 38 39 43 44 44 45 45 47 48 49 49 51 52 53 56 58 62 62 62 64 65 65 66 66 67 68 69 70 72 72 75 76 78 78 79 81 83 84 84 86 86 87 87 89 89 90 91 91 91 92 93 94 94 94 96 96 ...

output:

860084092 860084092 641353161 422622230 203891299 241819946 536408171 548704580 738002132 565349433 502478782 35317465 461403711 648449217 727713537 745013746 856104734 668966308 63152809 671891013 711326262 445819235 228657635 574786414 673433444 849091431 166862244 643955427 665304728 331098896 50...

result:

ok single line: '860084092 860084092 641353161 ...352 9769350 304550056 250000 1 '

Test #40:

score: 0
Accepted
time: 4055ms
memory: 29992kb

input:

250000
1 4 5 5 6 7 7 12 13 13 13 14 14 14 14 16 16 17 17 18 18 19 19 19 19 20 22 22 22 25 25 25 27 27 29 29 30 31 33 34 35 37 37 38 41 43 44 45 46 48 48 48 51 51 51 52 52 52 53 53 54 56 57 58 60 60 62 63 63 70 70 70 70 71 72 72 73 76 76 79 79 79 81 83 83 84 84 84 88 91 91 92 93 94 97 97 98 98 99 101...

output:

907388713 907388713 790847597 370086650 444790102 816397830 498564128 711890766 890949578 918317539 363878783 880768892 777273573 731324430 126359854 199939128 38309589 961806374 892256675 166143199 28489017 908757201 205367181 506782924 582473292 910966642 783638730 129358228 52235330 808490295 453...

result:

ok single line: '907388713 907388713 790847597 ...4 703713661 304300057 249999 1 '

Test #41:

score: 0
Accepted
time: 4038ms
memory: 28916kb

input:

250000
3 4 5 6 8 9 10 13 15 15 15 16 19 20 23 23 24 25 27 27 27 28 29 30 30 31 31 32 33 33 33 33 35 35 36 37 37 37 38 38 38 38 42 44 44 47 50 50 54 55 55 55 57 57 58 60 61 61 64 64 64 65 66 67 67 69 71 72 72 72 73 74 75 76 78 79 80 80 81 81 83 84 88 89 89 91 92 93 94 96 97 97 98 99 100 102 102 102 1...

output:

415714061 569110816 485064931 163576406 145031256 969815496 345760234 135852142 510366245 88464828 835883939 670060686 646806058 466999067 734095669 48091117 408957371 856847438 307079232 21234610 661253101 805276744 17972445 783800161 741833322 55368136 606254744 730387813 442412405 209630158 14384...

result:

ok single line: '415714061 569110816 485064931 ...67 10019365 304550057 250000 1 '

Test #42:

score: 0
Accepted
time: 4099ms
memory: 30848kb

input:

250000
1 2 2 4 5 9 10 10 10 10 12 12 13 13 15 15 15 17 17 17 18 19 19 20 23 24 25 27 28 29 29 30 33 34 35 36 36 38 40 43 44 44 46 46 47 48 49 50 50 51 51 58 58 59 61 62 62 63 64 65 65 66 66 68 69 69 71 71 78 78 81 82 83 84 85 87 90 93 93 96 96 98 98 100 100 101 102 104 108 108 109 109 111 111 111 11...

output:

85135932 85135932 974915135 866449985 757984835 29871689 121855103 477190927 187242654 986214479 686746176 602318206 957220027 322926549 257891528 670232817 888793027 186152409 405141242 489540346 469333367 465937760 873515934 710649255 523301034 316353678 316008590 674024620 709505237 65103873 3851...

result:

ok single line: '85135932 85135932 974915135 86...311 9769366 304550056 250000 1 '

Test #43:

score: 0
Accepted
time: 4109ms
memory: 30564kb

input:

250000
1 2 3 5 5 5 6 6 7 8 9 9 11 13 14 18 19 20 20 21 22 22 23 23 24 25 27 28 28 28 31 32 32 32 33 34 34 35 37 39 40 41 42 43 44 44 44 46 48 50 50 52 55 55 55 55 57 58 58 59 60 60 61 65 66 68 68 71 73 75 77 78 81 83 84 84 87 87 88 88 90 90 91 92 92 93 93 94 98 99 100 100 102 103 103 104 104 105 105...

output:

21732961 21732961 344722461 667711961 209270851 965887837 93944952 818425532 453981980 387379296 88028959 969548876 268879801 897311402 490574184 586015741 778530230 605082434 545904247 101963294 474558338 784418471 835432617 245731539 789321348 617432922 36792355 161232182 875472030 625331085 33492...

result:

ok single line: '21732961 21732961 344722461 66...70 10019365 304550057 250000 1 '

Test #44:

score: 0
Accepted
time: 4071ms
memory: 30528kb

input:

250000
1 5 6 6 8 9 10 10 13 14 14 16 16 16 17 17 18 20 21 21 21 23 23 23 24 25 25 27 27 32 33 38 40 42 43 44 45 45 45 46 47 48 48 49 52 52 53 53 53 53 54 55 56 56 56 57 58 58 59 60 61 61 61 62 63 64 64 65 65 67 67 71 71 72 72 73 73 75 76 77 77 77 77 78 78 78 78 80 80 80 81 82 84 84 85 86 87 87 89 90...

output:

897652165 897652165 914689349 476298714 704088162 192453071 998042413 88977684 758958894 83506085 664030562 878971333 715513553 772359449 386478949 235230656 173379193 401582535 432835606 507001125 188825972 192740328 465780776 452840271 897507457 242533017 993752678 108606510 623206882 638109847 73...

result:

ok single line: '897652165 897652165 914689349 ...1 702963667 304300054 249999 1 '

Test #45:

score: 0
Accepted
time: 4380ms
memory: 28724kb

input:

250000
2 3 4 4 5 6 7 8 9 9 10 10 11 15 17 19 21 23 26 27 27 28 29 30 31 34 36 36 36 36 38 40 40 42 42 44 44 46 49 49 49 49 50 50 51 53 54 54 56 58 59 61 63 64 64 65 66 66 66 66 67 67 68 72 72 72 72 73 75 75 75 76 77 77 77 78 79 80 81 81 81 82 83 84 85 85 87 87 88 88 89 89 89 90 91 92 92 93 95 95 97 ...

output:

989630126 351013293 710640813 905857657 936663825 938849788 49961664 402278630 174177306 577842226 748068729 617020674 939923350 471691581 165455185 306079474 959939869 660596971 739247580 987298126 258645421 344530730 254677276 199393999 881112034 622505649 210035781 164779762 58217054 93857350 592...

result:

ok single line: '989630126 351013293 710640813 ...42 94613518 303800057 249997 1 '

Test #46:

score: 0
Accepted
time: 4136ms
memory: 29224kb

input:

250000
1 1 1 2 4 4 4 6 7 7 8 9 9 12 12 14 14 15 16 16 16 17 18 19 20 20 21 21 22 22 22 23 24 24 24 26 28 29 30 32 32 33 33 33 36 36 37 37 39 39 41 42 45 47 47 48 48 49 49 49 49 52 54 54 54 58 59 62 62 65 66 69 69 69 71 72 73 73 73 74 75 75 76 76 76 77 79 79 80 80 81 83 86 86 87 89 91 91 92 94 94 94 ...

output:

669001106 669001106 669001106 669001106 876932423 86619387 636621799 556693960 871323230 608508263 792736419 972906340 302147704 614129685 862580514 892416495 567059534 30377197 892213195 965517253 964188028 469475798 434243852 278917227 525033390 580817780 90888184 308259803 59183935 126954230 9262...

result:

ok single line: '669001106 669001106 669001106 ...67 10019365 304550057 250000 1 '

Test #47:

score: 0
Accepted
time: 4435ms
memory: 29536kb

input:

250000
1 1 3 3 3 3 4 7 8 8 8 11 12 14 14 15 16 17 18 20 21 21 21 23 24 26 27 28 29 30 31 31 31 31 31 33 34 35 36 37 37 39 40 40 42 43 44 45 45 45 45 46 47 47 47 48 48 49 49 50 50 53 54 55 56 58 58 59 59 59 60 61 62 62 62 63 63 64 65 68 69 69 69 71 72 72 74 76 77 78 78 79 79 80 80 83 85 85 86 87 88 8...

output:

220855913 220855913 220855913 95744222 674801824 959784366 950691848 647524270 50281632 584623005 681474401 494946650 408740210 340185353 840162080 43142300 486483868 886576310 866388772 699369424 530991855 442908951 106351755 609312744 334201708 656670186 857140712 30507461 547889698 708052394 6233...

result:

ok single line: '220855913 220855913 220855913 ...310 9769364 304550056 250000 1 '

Test #48:

score: 0
Accepted
time: 4027ms
memory: 30420kb

input:

250000
1 1 2 3 8 10 12 13 13 14 14 14 14 15 17 17 18 20 21 22 23 23 24 24 25 25 28 28 28 28 29 31 33 33 33 33 35 39 40 42 42 44 46 46 47 48 50 52 52 53 53 53 54 54 56 57 58 58 61 62 62 62 63 63 64 64 65 69 71 73 73 75 75 77 78 80 81 81 81 82 82 83 84 84 85 85 86 87 88 89 90 91 93 96 96 97 97 97 98 9...

output:

470018137 470018137 470018137 141274932 810776080 534645571 311127758 869404379 765972401 673832443 899723051 946180802 951007037 917244573 372974571 503736487 776548921 57581126 425539917 288040823 231619531 384866773 866302344 14338203 112848323 79395568 972639738 258965039 129819217 788994664 482...

result:

ok single line: '470018137 470018137 470018137 ...70 10019366 304550057 250000 1 '

Test #49:

score: 0
Accepted
time: 4029ms
memory: 29988kb

input:

250000
1 3 3 5 6 7 9 9 9 9 12 13 15 16 16 17 17 17 20 20 21 22 24 25 26 26 26 28 28 30 30 30 32 32 32 33 34 34 36 36 37 38 41 42 43 44 45 46 46 46 57 65 66 67 67 67 68 69 72 74 75 78 79 81 82 85 85 85 86 87 87 88 88 89 90 91 91 91 92 92 93 96 98 98 99 99 99 100 100 102 103 104 104 107 107 107 109 11...

output:

146823954 146823954 287056733 987733234 252364751 77439990 690239352 45080970 811031180 465805045 356309586 831257903 414252540 688091307 781056323 472905304 181115082 251754188 171278531 67483485 658360095 192924201 615862332 587933273 240917351 946866147 212821945 598948215 911373251 525133857 846...

result:

ok single line: '146823954 146823954 287056733 ...7 703463656 304300056 249999 1 '

Test #50:

score: 0
Accepted
time: 4070ms
memory: 29700kb

input:

250000
2 3 3 5 5 8 8 9 9 10 12 13 13 13 14 15 16 18 18 20 21 23 23 25 26 27 27 27 30 31 31 32 33 34 34 34 35 38 40 40 41 41 41 41 42 42 42 42 44 45 46 46 49 49 54 54 55 55 56 57 58 59 59 59 60 60 61 64 64 66 67 67 68 69 71 71 71 71 73 74 75 79 79 79 79 81 83 83 84 85 85 85 85 85 93 94 94 96 98 98 99...

output:

18947790 24990229 31032668 20570361 991847661 948375862 468465507 978755212 761234254 942708689 64986117 118519698 563609658 786012056 488229640 577975127 210625689 699191640 376452482 995126646 279737540 378976249 259990661 219453262 274516921 918554693 233079961 339419285 202475096 976534715 64038...

result:

ok single line: '18947790 24990229 31032668 205...70 10019365 304550057 250000 1 '