QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#330007#5554. Breeding BugsSoyTonyAC ✓347ms9020kbC++143.3kb2024-02-17 10:36:082024-02-17 10:36:10

Judging History

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

  • [2024-02-17 10:36:10]
  • 评测
  • 测评结果:AC
  • 用时:347ms
  • 内存:9020kb
  • [2024-02-17 10:36:08]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int maxn=755;
const int maxm=1e6+10;
const int inf=0x3f3f3f3f;

inline int read(){
    int x=0,w=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}
    while(c<='9'&&c>='0'){x=(x<<3)+(x<<1)+c-'0';c=getchar();}
    return x*w;
}

inline int q_pow(int A,int B,int P){
    int res=1;
    while(B){
        if(B&1) res=1ll*res*A%P;
        A=1ll*A*A%P;
        B>>=1;
    }
    return res;
}
inline bool check(int A,int P){
    int D=P-1,pw=q_pow(A,D,P);
    if(pw!=1) return false;
    while(!(D&1)){
        D>>=1,pw=q_pow(A,D,P);
        if(pw==P-1) return true;
        else if(pw!=1) return false;
    }
    return true;
}
inline bool Miller_Rabin(int P){
    if(P>14){
        for(int A:{2,3,5,7,11,13}){
            if(!check(A,P)) return false;
        }
        return true;
    }
    else{
        for(int A:{2,3,5,7,11,13}){
            if(P==A) return true;
        }
        return false;
    }
}

int t;
int n;
int a[maxn];
bool mark[maxn];
int S,T;
struct edge{
    int to,nxt,w;
}e[maxm];
int head[maxn],cnt;
inline void add_edge(int u,int v,int w){
    e[++cnt].to=v,e[cnt].nxt=head[u],head[u]=cnt,e[cnt].w=w;
    e[++cnt].to=u,e[cnt].nxt=head[v],head[v]=cnt,e[cnt].w=0;
}
int cur[maxn];
int dis[maxn];
queue<int> q;
int dfs(int u,int rest){
    if(u==T) return rest;
    int flow=0;
    for(int i=cur[u],v,w;i&&rest;i=e[i].nxt){
        cur[u]=i;
        v=e[i].to,w=e[i].w;
        if(dis[u]+1==dis[v]&&w){
            int k=dfs(v,min(rest,w));
            flow+=k,rest-=k;
            e[i].w-=k,e[i^1].w+=k;
        }
    }
    if(!flow) dis[u]=-1;
    return flow;
}
inline int MF(){
    int flow=0;
    while(1){
        memcpy(cur,head,sizeof(head));
        memset(dis,-1,sizeof(dis));
        dis[S]=0;
        q.push(S);
        while(!q.empty()){
            int u=q.front();
            q.pop();
            for(int i=head[u],v,w;i;i=e[i].nxt){
                v=e[i].to,w=e[i].w;
                if(dis[v]==-1&&w){
                    dis[v]=dis[u]+1;
                    q.push(v);
                }
            }
        }
        if(dis[T]==-1) return flow;
        flow+=dfs(S,inf);
    }
}

int ans;

int main(){
    // freopen("cooking.in","r",stdin);
    // freopen("cooking.out","w",stdout);
    t=1;
    while(t--){
        n=read();
        for(int i=1;i<=n;++i) a[i]=read();
        S=n+1,T=n+2;
        for(int i=1;i<=n+2;++i) head[i]=0;
        cnt=1;
        bool vis1=false;
        ans=0;
        for(int i=1;i<=n;++i){
            mark[i]=false;
            if(a[i]==1){
                if(vis1){
                    mark[i]=true;
                    continue;
                }
                vis1=true; 
            }
            ++ans;
            if(a[i]&1) add_edge(S,i,1);
            else add_edge(i,T,1);
        }
        for(int i=1;i<=n;++i){
            if(mark[i]) continue;
            for(int j=i+1;j<=n;++j){
                if(mark[j]) continue;
                if(Miller_Rabin(a[i]+a[j])){
                    if(a[i]&1) add_edge(i,j,inf);
                    else add_edge(j,i,inf);
                }
            }
        }
        ans-=MF();
        printf("%d\n",ans);
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

8
1 2 3 4 5 6 7 8

output:

4

result:

ok single line: '4'

Test #2:

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

input:

5
7 13 2 2 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
1 1

output:

1

result:

ok single line: '1'

Test #4:

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

input:

3
1 2 1

output:

1

result:

ok single line: '1'

Test #5:

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

input:

749
636 51 149 35 143 172 595 226 743 512 547 310 622 304 729 540 110 241 169 201 690 167 47 493 689 162 491 104 354 592 44 358 331 301 373 716 351 630 389 253 224 292 671 440 192 613 150 588 485 549 624 75 282 535 695 426 78 640 408 119 203 580 309 587 357 707 115 720 606 565 434 590 741 133 420 51...

output:

375

result:

ok single line: '375'

Test #6:

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

input:

749
1815 1771 2013 1986 1919 1845 2073 1740 1583 1586 1834 1928 1861 1475 1366 1472 1382 1600 1621 1653 1424 1623 1556 1524 1817 1850 1770 1427 1358 1979 1420 1449 1852 1365 1806 1455 1810 1947 1726 1819 2072 1898 1557 2071 2026 1481 1359 1523 1643 2033 1510 1573 1935 1622 1350 1487 1743 1559 1641 1...

output:

375

result:

ok single line: '375'

Test #7:

score: 0
Accepted
time: 81ms
memory: 4348kb

input:

749
9999669 9999743 9999352 9999704 9999476 9999703 9999438 9999803 9999984 9999633 9999569 9999608 9999275 9999350 9999967 9999873 9999761 9999300 9999764 9999474 9999962 9999288 9999472 9999573 9999480 9999315 9999720 9999757 9999671 9999835 9999700 9999758 9999426 9999755 9999766 9999904 9999957 ...

output:

375

result:

ok single line: '375'

Test #8:

score: 0
Accepted
time: 74ms
memory: 4388kb

input:

749
5939005 140 116 4682136 1761602 154 228 158570 7679414 3670019 17 145 185 9406644 141 9287622 9987191 195 165 7738619 93 8893114 130 9154550 777182 1567373 6572984 2491452 3621298 234 6 138 8537635 83 1229997 1480689 3145258 201471 138 250 8844984 27 1605725 6171522 8026356 131 9987869 191 13 30...

output:

378

result:

ok single line: '378'

Test #9:

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

input:

749
2332958 6180895 7905522 235 115 244 161 9034571 1362164 623051 612462 2571102 42 128 10 111 2956605 9373811 8469417 39 36 96 7530501 40 4790237 2793893 7453444 3762528 7430632 1745194 8733280 9592746 91 9 115 211 1948966 3882472 169 8398684 4034077 175 49 842557 8404493 101 4379660 3376505 44248...

output:

374

result:

ok single line: '374'

Test #10:

score: 0
Accepted
time: 68ms
memory: 4628kb

input:

749
134 5500115 6816197 177 113 39 118 24 95 104 127846 1350242 136 4 142 2941199 6401410 86 454850 244 8902332 115 666972 5265264 166 9291560 32 1678385 1076606 9074495 1505045 46 246 172832 70 8414011 9842934 5110562 2429042 108 3267283 118 8782469 78 8163037 9693554 194 4 245 4168276 7701806 6876...

output:

387

result:

ok single line: '387'

Test #11:

score: 0
Accepted
time: 69ms
memory: 4420kb

input:

749
142 3157863 176 7385582 18 136 93 996229 5259293 16 3251236 173 2213931 2363274 33 3356459 161 1125309 5986003 25 4 188 5858614 100 5634872 2722753 253 4451160 3225247 159 213 203 227 162 2473119 154 125 56 4688436 159 5278056 8605375 9945750 49 8659797 162 90 218 5970119 66 10649 33 4151196 46 ...

output:

385

result:

ok single line: '385'

Test #12:

score: 0
Accepted
time: 74ms
memory: 5948kb

input:

749
2712081 71 236 143 3211032 9722089 180 203 4533157 178 225 26976 7749575 1262900 643082 4795550 5672222 8012648 102 2645098 3694416 6086260 4398225 5703990 4274780 6874662 83 101 203 136 65 231 4038831 6748776 165 9691431 55 81419 3683567 3296282 7416791 1036452 83 121 2453752 4972444 9674832 14...

output:

378

result:

ok single line: '378'

Test #13:

score: 0
Accepted
time: 74ms
memory: 5856kb

input:

749
8339940 9296039 137 9317307 221 2128061 54 6 23 7179362 46 130 8737515 6724928 4941224 216 118 7397608 140 162 856319 9131313 151 6447330 54 145 8765664 244 5669004 3498881 210 132 7563480 176 2467428 678196 152 216 2841428 739831 9816377 2973634 9838285 223 8800877 233 4484218 5627771 4395985 1...

output:

384

result:

ok single line: '384'

Test #14:

score: 0
Accepted
time: 74ms
memory: 4436kb

input:

749
149 124 3605219 1420789 33 7843555 170 186 4291835 8077969 2614124 165 106 521324 35 9 15 7438705 7709424 5610921 12 186 117 7578827 254 5689552 101 8575532 3817548 19 1243187 40 2326755 145 141 251 84 48 169 110 40 1905983 9366846 929982 6026857 122 6633524 968001 103 202 8343291 227 1944018 22...

output:

379

result:

ok single line: '379'

Test #15:

score: 0
Accepted
time: 74ms
memory: 4352kb

input:

749
100 8287048 45 4197216 26 1950491 98 4304791 245 184 142 2712028 134995 45 123 18 2656141 8805691 28 120 8297367 5882622 216 56 123 85 239 802637 3584661 3641679 220 230 3864526 9175642 113 4926485 8779305 1498095 5025013 66 31 126 66 4065967 162 4188980 3530125 167 142 6841207 1618728 1710360 6...

output:

376

result:

ok single line: '376'

Test #16:

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

input:

749
3912636 802328 6855875 244 7342189 209 3250851 4050800 73 779981 2509585 7580357 76 5721513 9738941 9878939 6122795 6732681 239 565510 6098832 495615 152 56 6126945 543165 131 117 4670324 4488986 138 3519388 218 101 17698 118 1380490 184 95 218 195 3414098 7990084 253 166 5527193 2246323 8250955...

output:

402

result:

ok single line: '402'

Test #17:

score: 0
Accepted
time: 73ms
memory: 4356kb

input:

749
8682473 3384807 8359398 95 9101649 8272198 24 178 100 138 194 86 24 7563420 2090794 161 245889 6465662 9354963 200 229 251 8445960 251 6747505 163281 8791794 7309904 5313071 3888038 186 130 5550908 9744515 5518855 206 4434937 3810863 151 5 253 4889695 244 173 6734404 2865039 77 5373531 2230077 6...

output:

376

result:

ok single line: '376'

Test #18:

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

input:

749
145 255 2511242 210 31 130 252 3256468 107 125 1061011 2565811 8724242 122 4273255 8617164 216 2535664 3139976 14 3081472 44 330526 1820598 70 210 5627971 31 116 8216077 2686919 209 6355398 15 4432645 1280401 3018645 9509416 222 5749004 3987238 5711665 249 2152389 9531460 70 2250180 52 153 92572...

output:

378

result:

ok single line: '378'

Test #19:

score: 0
Accepted
time: 75ms
memory: 4396kb

input:

749
186 30 8025614 9733608 95 35 3879624 141 3083486 2478248 100 493791 3364932 81 8269147 193 79 187848 9457098 9125572 7747079 192 4529365 32 5266146 113 4730363 7596358 9354008 60 2407988 222 4 136 8546916 138 226 658725 3939610 110 281204 6893629 228 223 4318669 3590988 3522406 59 5054612 299843...

output:

379

result:

ok single line: '379'

Test #20:

score: 0
Accepted
time: 74ms
memory: 4420kb

input:

749
250 2151714 3525079 157 68 33 126 15 9034268 7223315 7163195 6939192 2987411 39 2945590 7540421 8072687 210 9437680 7410254 100 205 210 5467325 51 7987980 126 231 4411190 5240608 164 3529829 7623941 5522379 110 40 6558055 3496921 173 245 1268345 1246377 5814442 253 252 1817302 1343448 166 472086...

output:

389

result:

ok single line: '389'

Test #21:

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

input:

749
166 106 228 8037675 126 148 26 79 105 2365998 59 115 6566394 197 173 156 2201741 9166937 218 2439759 18 158 4367175 4576683 168 180 185 5617949 5350059 5 81 28 7325306 19 4224943 9697848 224 2207235 134 158 55578 123 2982034 188 152 8640550 1195621 170 4473548 36 9206138 5436165 8414383 5328135 ...

output:

374

result:

ok single line: '374'

Test #22:

score: 0
Accepted
time: 73ms
memory: 4308kb

input:

749
206 2298800 8273789 210 5020800 8003138 1717932 418281 37 79 153 112660 1726363 11 7171359 52 37 3070655 6034023 1895717 6664792 4401253 117 178 206 2626427 8 199 765962 8286478 8230927 4072807 53 3669476 53 15 5854917 229 1122528 41 121 162 58 171459 18 115 221 49 3212942 5794045 1144622 111 98...

output:

389

result:

ok single line: '389'

Test #23:

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

input:

749
2 2 2 2 2 2 2 1 2 1 2 2 1 2 2 2 1 1 1 1 2 2 1 1 1 2 1 2 2 2 1 1 2 1 1 2 1 2 1 2 2 1 2 1 1 1 1 2 2 1 2 1 1 2 1 2 1 1 2 1 1 2 1 2 2 1 1 1 1 1 2 2 1 2 2 1 2 2 1 2 1 1 2 2 2 1 2 1 1 2 2 1 2 1 2 2 2 2 1 1 2 1 2 1 1 1 1 1 1 1 2 2 2 2 2 1 2 1 1 2 1 2 2 2 2 1 1 1 1 1 2 1 1 1 2 1 2 1 2 2 2 1 2 2 2 2 1 2 ...

output:

374

result:

ok single line: '374'

Test #24:

score: 0
Accepted
time: 7ms
memory: 8032kb

input:

749
2 3 5 2 5 3 3 2 2 2 3 5 3 3 5 5 3 2 2 3 5 3 5 5 3 2 2 5 5 3 2 2 3 2 5 5 3 2 2 3 2 3 3 5 2 5 2 2 3 3 3 5 3 2 2 2 3 5 3 2 2 2 5 2 2 5 5 5 3 5 2 2 5 5 3 3 3 5 3 3 2 3 3 3 5 2 3 5 5 2 3 2 5 3 3 5 3 3 3 5 2 3 3 2 2 5 3 3 5 5 2 3 5 2 2 2 2 3 3 5 5 2 5 2 3 2 3 2 2 2 3 5 3 3 5 3 3 2 5 5 2 2 2 3 5 2 3 3 ...

output:

491

result:

ok single line: '491'

Test #25:

score: 0
Accepted
time: 5ms
memory: 8264kb

input:

749
2 5 5 3 2 3 5 5 2 5 2 2 5 2 2 3 2 5 3 3 2 2 2 5 2 5 2 3 2 3 2 5 2 3 3 5 3 5 3 3 5 2 3 2 2 5 2 2 2 2 2 2 2 2 2 2 2 3 5 2 2 3 2 2 3 2 5 5 2 2 2 5 5 5 2 2 2 5 3 5 2 5 2 2 5 2 2 2 2 3 2 3 2 2 5 2 3 3 2 2 5 3 3 3 3 5 2 5 2 2 3 5 2 2 3 2 2 2 5 3 5 5 2 2 2 2 3 2 3 3 3 2 2 2 2 2 5 3 5 2 2 3 5 2 3 2 3 3 ...

output:

383

result:

ok single line: '383'

Test #26:

score: 0
Accepted
time: 117ms
memory: 6916kb

input:

749
8817 30847 29857 15367 64 21190 26872 3142 5329 37402 622 21820 1810 8839 9682 7009 8209 12619 16807 33982 1264 2737 31144 3127 2584 9514 19480 2277 22450 24577 23737 177 10357 39010 2959 27304 7677 21592 33172 36757 11127 15087 637 3217 49162 10687 1887 9289 11554 919 6027 229 7930 24280 23764 ...

output:

376

result:

ok single line: '376'

Test #27:

score: 0
Accepted
time: 121ms
memory: 7220kb

input:

749
5951 46148 662 38261 6509 5618 47105 10728 3011 23558 24152 7475 22502 10152 1908 6299 3992 14648 612 32 26462 16709 15875 4328 18755 24059 33095 25115 28368 7079 13262 14262 38711 15359 4742 38798 10922 3152 7542 6792 2018 27848 11958 28811 31691 3131 15749 5621 26165 2432 5909 13232 38672 1686...

output:

375

result:

ok single line: '375'

Test #28:

score: 0
Accepted
time: 124ms
memory: 7248kb

input:

749
40082 431 31898 25385 7661 24872 261 6605 11975 1772 26471 11516 8786 5606 48725 1545 16688 5115 5331 15128 35966 2061 46811 41585 9341 7221 38495 29246 15632 9741 285 12645 19575 5522 4178 24422 5312 25625 13586 191 38231 31976 45548 37892 8411 8915 10892 27605 14625 15842 38981 8918 891 3225 4...

output:

375

result:

ok single line: '375'

Test #29:

score: 0
Accepted
time: 147ms
memory: 5144kb

input:

749
665072 4348295 425867 5297702 1817022 5293379 6064037 1112882 5939054 7550822 597347 8629187 7972862 3895649 505584 2177975 1920494 6934302 7169927 7096607 4227605 1625492 4859537 4870812 6478145 419654 1845377 3730535 461519 3773267 1171902 7915574 491219 1047407 3549569 5302574 1179074 1611962...

output:

375

result:

ok single line: '375'

Test #30:

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

input:

749
5437390 111300 1634629 317490 2926549 328159 2929792 5910241 3623980 905910 3056119 1935499 236110 4407828 59650 4282008 2940448 3006799 792232 9055369 5506051 1947961 4672528 651472 5486101 5232799 6615738 5004121 94792 277590 5553229 1902852 2621052 1363699 4274161 1632499 1348018 835351 65018...

output:

375

result:

ok single line: '375'

Test #31:

score: 0
Accepted
time: 146ms
memory: 5900kb

input:

749
2431145 6459776 1691646 1227461 4924446 896843 1454723 7693283 3042575 1013723 632891 2451818 3461246 2292488 1216298 3770408 454698 7233503 6766025 5069888 6396173 8816816 2800316 4990811 1294391 8336783 5681543 1653126 751976 8187371 3008636 4485533 6060155 1621668 2190605 7390085 2470028 1600...

output:

375

result:

ok single line: '375'

Test #32:

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

input:

499
6106404 4182908 180377 5124722 6665789 7267164 6232975 7280886 4337586 1154399 8065214 538673 9213224 4931018 8159290 2505624 1736190 1873001 3219119 1360768 6764800 7392585 1045973 2424623 5584252 3284074 3592680 9768207 4556048 4175526 8183955 4328184 3394108 4300749 8734130 2270922 1371042 29...

output:

356

result:

ok single line: '356'

Test #33:

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

input:

499
2013917 8399426 8383957 711026 6665904 1801413 4212743 7667353 1563880 9508350 5055783 2938456 1420474 597196 7098902 4861061 1824713 8373075 9222318 2465260 2078220 3487165 170713 7552076 3664375 3857312 5104701 8178526 8064615 4021518 3548850 6425637 2588875 7883832 2063342 8254970 8405006 157...

output:

256

result:

ok single line: '256'

Test #34:

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

input:

499
8663167 4628832 3192083 216731 6220205 45354 2308163 4681181 3661493 1097231 5021346 2125421 7705421 8453634 3550235 8195599 2174748 7044552 7637568 4755972 33906 1656871 8406600 8855737 4726103 9196559 9575333 6286649 1912428 1098066 7276536 2512362 104297 8344411 1557211 3321029 3430577 164826...

output:

264

result:

ok single line: '264'

Test #35:

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

input:

499
6291510 1967953 2070815 4695581 6781427 3244170 5672219 6820026 653477 9281226 6096228 808061 6953429 5688563 449287 8766803 4588296 920053 7095246 3338527 3841745 4699728 5860056 1639937 5921129 8279748 9354978 556554 5643767 6654450 5524998 8181725 1656696 8176842 221683 4746851 1967707 361058...

output:

261

result:

ok single line: '261'

Test #36:

score: 0
Accepted
time: 144ms
memory: 6620kb

input:

749
9998146 9990307 9998050 9975346 9985120 9975271 9994030 9986437 9993283 9995293 9996691 9982027 9976183 9998917 9993430 9999876 9995410 9995520 9992776 9978871 9996466 9989881 9997021 9993541 9997987 9977236 9998580 9989346 9991387 9976936 9978331 9980641 9978190 9978076 9990286 9982483 9994843 ...

output:

375

result:

ok single line: '375'

Test #37:

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

input:

749
9999278 9999910 9993783 9999304 9999936 9999514 9996581 9999992 9999674 9997685 9997839 9999382 9995525 9999762 9999270 9999788 9999832 9999414 9999503 9999362 9994901 9996005 9999506 9997475 9999338 9997523 9999618 9995441 9996651 9999736 9999258 9999646 9999766 9997829 9999374 9999960 9999968 ...

output:

375

result:

ok single line: '375'

Test #38:

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

input:

749
9999998 9999998 9999998 9999998 9998369 9999998 9999998 9999998 9999998 9999998 9999998 9999998 9999998 9996411 9999998 9999998 9995391 9999998 9994961 9999998 9999633 9995255 9999998 9995403 9999998 9995981 9999998 9999998 9994919 9994953 9999998 9999998 9996785 9999911 9997253 9999998 9996795 ...

output:

375

result:

ok single line: '375'

Test #39:

score: 0
Accepted
time: 102ms
memory: 4400kb

input:

749
3980498 5847674 9639248 2926742 8166507 941204 2771841 5462330 813020 8949254 8875649 3622589 2415221 4642041 547967 740720 1755410 5717570 9897224 8767191 625919 5666891 8167724 4345100 1121847 4546557 7995927 3922221 7299257 2214244 570074 5048324 62741 876209 5971157 5491043 7690079 2134017 7...

output:

384

result:

ok single line: '384'

Test #40:

score: 0
Accepted
time: 107ms
memory: 4484kb

input:

749
7688801 3658961 8570504 8584619 53354 8405430 427778 5180142 3345120 353333 2966633 5969453 863507 2090766 4844483 5263181 9100853 3006506 1898046 3151436 3872714 3555032 6786804 3315558 1905452 4295681 8192585 7468628 6747899 3925859 7384574 1225298 1216806 8799719 9266129 7626947 3528335 37722...

output:

401

result:

ok single line: '401'

Test #41:

score: 0
Accepted
time: 112ms
memory: 4444kb

input:

749
2020273 5997169 3287149 7452277 8254813 2562991 901159 3943450 102700 476656 5774740 4405320 1255488 7068180 3252978 5873922 409831 8831530 4695541 9836827 3532810 5744051 9422208 6358291 5331220 1877128 2262073 8120731 7229083 6499260 1395301 3896710 4335709 7806709 9078343 4800186 1187886 9097...

output:

377

result:

ok single line: '377'

Test #42:

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

input:

749
9930867 7300598 2580096 8389343 3501501 9644652 366438 3228965 1293424 9756938 2046666 9864460 4565935 3761222 4807524 2066503 7960263 6577322 7353140 5480202 6600166 9380422 5482824 8920602 8242729 7380402 4707130 1907350 7569266 891778 8481856 3871973 4109302 5499258 9770068 2492247 2893761 64...

output:

720

result:

ok single line: '720'

Test #43:

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

input:

749
3624116 9467508 5287962 5910195 4914191 8126121 2291757 8137048 1357416 4390 4888928 9967728 4608564 9864969 7866171 8609331 214537 1876128 2284423 7945136 9905448 7032084 631582 2835317 1308572 1235651 9284901 2623735 3000962 6728977 4487704 5012177 3875624 8492043 814546 7654973 3939435 897457...

output:

704

result:

ok single line: '704'

Test #44:

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

input:

749
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

2

result:

ok single line: '2'

Test #45:

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

input:

749
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

3

result:

ok single line: '3'

Test #46:

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

input:

749
2047 1993 2189 1941 2051 2857 2133 2767 107 329 683 1465 1785 2533 2521 325 739 1773 491 2013 1737 2821 1549 925 1623 1631 851 1325 2755 987 307 1491 393 2293 77 2679 1277 1853 171 1039 2265 433 2299 1341 953 1749 723 411 143 2459 1695 1585 157 2001 727 1915 627 399 1731 2665 129 961 19 689 471 ...

output:

749

result:

ok single line: '749'

Test #47:

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

input:

749
1485 817 167 291 2035 1189 1505 1087 249 2531 799 1387 2059 979 2055 565 2365 1873 407 175 2165 551 673 1411 2025 2653 2557 2007 1999 1013 1271 1577 1307 2109 201 1477 299 1581 2665 1807 39 1925 2563 975 1071 1995 1749 1203 1625 219 2297 1217 1357 2369 397 1335 793 1533 2247 2253 2833 207 1127 1...

output:

749

result:

ok single line: '749'

Test #48:

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

input:

749
2367 383 2457 2409 695 929 727 875 1539 2261 2521 1251 2943 131 2107 667 2859 1535 1349 2503 805 1953 1579 295 1419 365 2675 1591 729 1481 1181 257 2849 2559 2935 353 239 915 1611 1279 1521 731 901 1881 2141 2713 2411 1543 867 2575 1507 305 2577 369 1915 2727 2425 1321 2445 2281 2275 1575 1569 1...

output:

749

result:

ok single line: '749'

Test #49:

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

input:

749
36612 548398 647164 322250 56840 485302 562610 531710 92072 195514 522194 515680 484980 604258 285666 411472 298720 13182 86520 148916 320510 151342 274980 597448 343362 613126 341750 634636 652160 78668 451972 492678 574214 611440 15650 347722 37944 317052 558570 305820 134784 433540 543910 461...

output:

749

result:

ok single line: '749'

Test #50:

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

input:

749
91983 388531 117747 309151 454495 284489 379513 355917 38475 176457 312959 525141 343055 444463 420859 151317 295455 365605 546223 229763 85209 303909 250085 522769 484993 349207 233203 260343 134959 231785 543409 58017 303963 423305 488363 159145 299491 320965 403091 231565 157519 60737 58973 3...

output:

749

result:

ok single line: '749'

Test #51:

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

input:

749
131860 320634 65440 182248 280218 379576 10684 527048 146678 579628 294982 538884 400764 514094 399770 31522 212962 337504 317990 112270 83622 459174 178624 131738 240744 177690 485896 217886 78916 259366 572336 419644 282480 229688 650400 20208 253972 479444 284244 228324 117714 112100 612150 1...

output:

749

result:

ok single line: '749'

Test #52:

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

input:

749
9999411 9999525 9999195 9999487 9998739 9998637 9998995 9998535 9998587 9999979 9999721 9999271 9998913 9999193 9998751 9999835 9999705 9998721 9998973 9999861 9998681 9999463 9998583 9999245 9999637 9999789 9999065 9998855 9999325 9999871 9998857 9999891 9998985 9999421 9998605 9998955 9998783 ...

output:

749

result:

ok single line: '749'

Test #53:

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

input:

749
23656 24926 24196 23696 23544 24216 23556 24662 24388 24068 23612 24092 23970 24498 24948 24180 23802 24602 24658 23582 24720 24070 24972 24134 23682 23966 23724 23938 24094 24976 23998 24624 24284 23864 24932 24774 24266 23964 24286 24562 24666 24632 24660 24354 24368 23554 23700 24206 23990 24...

output:

749

result:

ok single line: '749'

Test #54:

score: 0
Accepted
time: 60ms
memory: 4464kb

input:

749
1074 7 406 30 118 64874 31126 508520 47495 5 113 448 15 4025 2067902 77749 4 556 117 1 3598394 2 804 148 6041 179157 3 118 22 3920 5 490480 556 614318 12491 952430 16 3 25166 167095 1 249 2251 1655 5 206 3025 195 119990 40 452677 7095 3151 895744 1 1788430 249 109764 28 197788 39 5602 374026 908...

output:

369

result:

ok single line: '369'

Test #55:

score: 0
Accepted
time: 60ms
memory: 4488kb

input:

749
1012 102727 248 27601 985 2794621 786071 1065746 1481774 263 862 36221 14 2 74372 5577 1587 32138 230187 837 702489 1933533 114065 266 725800 398 451 113 1727 82345 103 712950 11136 1504 15 3171 361370 32 783 1540 216 14958 2607071 243 2588364 44458 48 227 10554 371708 367 569 4133260 244322 485...

output:

377

result:

ok single line: '377'

Test #56:

score: 0
Accepted
time: 59ms
memory: 4364kb

input:

749
31 329 237 1 4179627 7 53128 1 881552 17 81 2097 103 9 137 91777 40 317675 371786 118391 229 14 51145 566059 32 45 46 251512 14838 212 518348 597 91731 186 157 10281 11228 31036 72 92 1751 90583 53753 1200313 1 436317 203612 239930 1162 194 6 3037062 28988 19 1832591 17136 486 14125 6 19389 3837...

output:

368

result:

ok single line: '368'

Test #57:

score: 0
Accepted
time: 59ms
memory: 5884kb

input:

749
176365 4534 1083089 17145 560560 856 251 3 5 204331 811389 29 2835540 7603 151822 7982 470 16 1403 785 115403 79746 2839 641 5145 8 7 492834 296 380716 1 30523 30 81 1790598 16 9133 18020 1 10 52 309471 61 117 90 60 1168 2993733 1464683 251651 3528 2343405 664967 618527 51676 8 56427 44497 1 421...

output:

363

result:

ok single line: '363'

Test #58:

score: 0
Accepted
time: 56ms
memory: 4352kb

input:

749
1370648 104609 10991 12012 20 2860009 138598 7054 15778 183825 54811 29 1664 456 914 27 142 185237 4 1110 74777 2709 47846 9 258887 10431 47 1 2209325 120 11 34 59202 1556 4 31 68919 661 28 460 51150 550 1628 233 47199 1 3 2650 6 1539253 118397 2 492906 3955902 82 29708 256187 522871 17 55027 62...

output:

365

result:

ok single line: '365'

Test #59:

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

input:

742
2368175 1145568 4054687 7275074 7370078 9548901 6234676 6645701 360961 4974023 1003634 9843627 2205299 9588824 5391142 5419726 3776814 3276024 8889045 7480503 9375626 3735110 1148950 7404214 311928 971204 4897469 2255266 4947818 4364508 6514547 5746243 8189735 6598043 9882686 8304068 7868561 423...

output:

388

result:

ok single line: '388'

Test #60:

score: 0
Accepted
time: 85ms
memory: 4460kb

input:

741
8777192 53453 7164546 473107 9373736 3503153 8114019 6891575 4091627 6573800 9306710 5883146 510969 7597727 7936623 8509665 3311421 9226259 7096997 6559407 1248032 6933727 683060 3195392 7704117 9718842 5073533 1879235 7195130 6634208 8893038 8716412 7170392 157896 8381639 5977431 9084082 877714...

output:

389

result:

ok single line: '389'

Test #61:

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

input:

742
9547417 4925987 3032747 2743650 4086399 4983133 7431955 4948823 1662685 500109 7300397 9694968 8792415 2103822 8741066 5868618 4224610 6545847 4530327 3382548 8732577 1501313 258979 5512258 3426992 7242036 604742 3168971 4861732 4378430 4655150 3305582 5031502 8865603 9240636 370833 6789701 9753...

output:

387

result:

ok single line: '387'

Test #62:

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

input:

745
9567775 5524716 8397584 9370504 4628368 6557242 1782714 3130187 1880324 6205368 3991271 4913197 7736153 8888141 8051317 5272640 5362582 9729283 4041464 296510 8368310 7874636 3151880 1039960 4317526 4901135 157784 6656057 9587933 6980536 1240399 4006295 4385721 4675037 4298919 4854239 1111934 56...

output:

402

result:

ok single line: '402'

Test #63:

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

input:

746
7501600 6298617 6284766 5751856 335537 3846485 5096852 8702316 9944578 7566306 4648849 2458906 4334899 8561549 6640680 4235227 4611408 6039086 7506187 179888 942622 2385835 8823562 6015113 3110853 3919811 3008315 2409087 3423078 9256219 4321800 4079809 4063831 941690 1496544 4786625 5982374 9683...

output:

389

result:

ok single line: '389'

Test #64:

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

input:

743
4779252 6147510 2364325 3049230 3447901 1991812 7112857 6150757 1361804 1100317 4078690 5316165 9524913 4962801 291473 9985675 7685453 6764728 5967753 8649465 3988852 6494763 7564550 5228083 5625807 9609825 6598582 1272931 8619200 7906917 7690911 5397437 6064340 9938098 9926988 1398851 3475730 4...

output:

392

result:

ok single line: '392'

Test #65:

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

input:

749
8941423 8065219 5861349 8594783 4931805 9684515 1333579 6669063 6349881 4841355 7759001 6712803 5075673 8440811 4116971 8547739 3910257 9441511 9293391 511203 8301063 1085309 8829839 235609 542149 1920507 5790647 7991439 1894201 5813565 5342559 9076069 5587539 2638645 3192121 7394213 3272961 329...

output:

743

result:

ok single line: '743'

Test #66:

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

input:

749
9136061 3977471 547583 5701483 2810491 3569231 1286753 9482243 6441211 4966061 7424473 4543117 1964321 6756821 6991655 8920427 3811877 2835971 9605351 518687 7387711 2284387 8690891 1418303 5391511 9598805 2393881 9616601 6023381 2173453 5258321 1515557 2409023 4736027 7629011 4541815 9159383 96...

output:

748

result:

ok single line: '748'

Test #67:

score: 0
Accepted
time: 48ms
memory: 4052kb

input:

749
8279397 772489 9346717 9826641 2855987 8691013 1870585 5740905 3644943 137167 9308915 4550951 9581671 1517037 8210819 9967347 9880077 4421131 6039075 2886771 2936673 2785383 7979157 1287989 5658037 9005449 9959553 5378627 3479897 8145425 3517005 8821497 8726699 8490129 3885407 3629901 1652835 69...

output:

742

result:

ok single line: '742'

Test #68:

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

input:

749
7356618 5499966 1620944 4401414 3960408 2978400 5554200 1494134 6422260 9674170 9807976 1943808 4903950 790572 2290762 9645012 1194474 6263686 2526546 1524294 3779864 8528908 9649622 3306836 5624264 5258552 6343098 3638384 3748966 4167420 449076 602646 3883928 796896 6066186 7189368 9725916 5455...

output:

738

result:

ok single line: '738'

Test #69:

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

input:

749
9155461 2260955 1382683 1237819 2637869 7160297 8671879 6930451 7780683 8279525 1405743 8620963 6772137 4162495 3129091 8301115 7799653 2962931 3740193 711429 2729221 3705989 4639963 446877 8618937 8952151 1218537 4045287 6750265 9060903 4564613 9424173 12207 8073319 2368497 4114419 4599487 5829...

output:

733

result:

ok single line: '733'

Test #70:

score: 0
Accepted
time: 69ms
memory: 4648kb

input:

749
9378509 138 7214737 6103995 9254827 1 40 22 1213218 135 9707229 2741409 5479393 143 227 367250 3998604 5243451 33 12 4243379 123 9523190 9067675 85 50 173 1625791 191 8219329 4826115 7544281 5998185 54 622592 203 1710153 61 3524817 169 7428752 3929468 8683039 144 20 1521992 847911 8919100 676357...

output:

373

result:

ok single line: '373'

Test #71:

score: 0
Accepted
time: 74ms
memory: 6264kb

input:

749
5019849 95 114 7788378 157 6924062 161 220 6921842 182 53 5223257 73 182 9247232 31 755208 201 211 5073562 4507648 11 70 31 191 6545474 7845472 146 5914441 1200460 4049752 6743818 8226483 9453454 4930460 1435781 3961632 46 838558 5745363 191 113 69 123 5651230 9153963 1469546 4181538 83 1005710 ...

output:

373

result:

ok single line: '373'

Test #72:

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

input:

749
8145801 2704942 192 7834861 36 68 3173666 149 2462742 237 6652494 6630559 4244268 171 210 4317491 6867336 99 3779864 4180401 192 2520896 138 167 17 5869144 3238906 55 6742103 9585294 119 42 4293463 2283206 236 8479265 3311490 5282419 132 6341527 147 4870269 5555194 18 2195655 169 89 1927251 8166...

output:

373

result:

ok single line: '373'

Test #73:

score: 0
Accepted
time: 74ms
memory: 4596kb

input:

749
111 5525620 68 10 4925989 692953 6249130 5449541 437770 9473389 1193036 172 4328048 23 2618352 215 2190588 50 2245807 756763 240 241 9484282 7373265 8326704 59 5727240 240 3651576 5957261 221 71 778261 3894470 104 78 181 187 172 33 8676758 2529982 80 3760745 255 1 1752424 199791 197 6690682 9404...

output:

374

result:

ok single line: '374'

Test #74:

score: 0
Accepted
time: 73ms
memory: 6480kb

input:

749
70 2345235 86 9258088 78 86 8542422 8537070 6790381 4649689 103 77 134288 6345821 183 172 1272301 6162949 73 136 9316661 5 5948846 155 76 200 2265083 21 134 192 7147130 3769794 4942468 5598678 2458374 724531 3355972 2586360 1290478 7568261 209 6196084 6993664 8 189 3621505 149642 6550286 9957826...

output:

374

result:

ok single line: '374'

Test #75:

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

input:

749
105 6609238 9428348 4942181 6821944 4862820 176 96 8321898 100 194 4535732 4327697 112 122 238 191 45 128 8731009 5363947 7938253 64 69 253 7494456 24 131 3720008 148 125 9637756 3697215 212 3948677 4137669 247 6954445 6445214 5190871 246 6544344 196 223 110 110 137 122 225 176 179 9098079 157 6...

output:

375

result:

ok single line: '375'

Test #76:

score: 0
Accepted
time: 55ms
memory: 6388kb

input:

749
119072 28 7 68331 166434 1963308 6969 967 21918 3 25013 113774 233 7087 3 179 11116 2573946 134823 615284 1 5952 8635 5 1337 105 57946 976 209946 2887 9 7 54515 6 733536 19749 136 59 32900 187702 160 117819 2 2 31 117 1127466 1847 3363 240159 2 1263388 48610 951265 134 90 1270 84 3005 2 3380 983...

output:

357

result:

ok single line: '357'

Test #77:

score: 0
Accepted
time: 56ms
memory: 4404kb

input:

749
3216 6422 216220 7 177130 511352 111 8950 101281 1998 510706 57 238731 19 2484264 3 1501341 1 63 1057 74 1739671 140 2937 20 3606766 7873 8 637092 2886487 3654 27619 471944 75 221 2089925 2 1956 405805 92 931 3660 5 1447 1990436 2211701 23 3992560 30 15768 2 635136 121 99038 10836 2144 22661 224...

output:

358

result:

ok single line: '358'