QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#253153#7214. Random ArithmeticSolitaryDream#AC ✓221ms34796kbC++171.0kb2023-11-16 19:11:112023-11-16 19:11:11

Judging History

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

  • [2023-11-16 19:11:11]
  • 评测
  • 测评结果:AC
  • 用时:221ms
  • 内存:34796kb
  • [2023-11-16 19:11:11]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i=(s),_t=(t); i<=_t; ++i)
#define DOR(i,s,t) for(int i=(s),_t=(t); i>=_t; --i)
typedef long long ll;
const int N=2005;
const int Mod=1e9+7;
ll Fast(ll x,int b) {
    ll t=1;
    for(; b; b>>=1,x=x*x%Mod) if(b&1) t=t*x%Mod;
    return t;
}
ll f[N][N];
ll g[N];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    ll inv2=Fast(2,Mod-2);
    f[1][1]=1;
    FOR(i,2,n) FOR(j,1,i) {
        f[i][j]=f[i-1][j-1]*(j*(j-1)/2)%Mod*inv2+f[i-1][j]*((i-j)*(i-j-1)/2)+f[i-1][j]*(j*(i-j))%Mod*inv2;
        f[i][j]%=Mod;
        f[i][j]=f[i][j]*Fast(i*(i-1)/2,Mod-2)%Mod;
    }
    g[0]=1;
    FOR(i,1,n) {
        int x;
        cin >> x;
        DOR(j,i-1,0) {
            g[j+1]=(g[j+1]+g[j]*x)%Mod;
        }
    }
    ll res=0;
    FOR(i,1,n) {
        res=(res+f[n][i]*g[i])%Mod;
        // cerr << i << ' ' << f[n][i] << endl;
    }
    cout << res << '\n';
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
1 1

output:

500000005

result:

ok 1 number(s): "500000005"

Test #2:

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

input:

3
1 2 3

output:

250000008

result:

ok 1 number(s): "250000008"

Test #3:

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

input:

2
0 0

output:

0

result:

ok 1 number(s): "0"

Test #4:

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

input:

5
4 8 6 6 2

output:

900000447

result:

ok 1 number(s): "900000447"

Test #5:

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

input:

5
0 4 8 8 6

output:

900000208

result:

ok 1 number(s): "900000208"

Test #6:

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

input:

5
7 0 8 2 7

output:

16666794

result:

ok 1 number(s): "16666794"

Test #7:

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

input:

5
70 31 19 33 19

output:

593601779

result:

ok 1 number(s): "593601779"

Test #8:

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

input:

5
84 75 15 86 56

output:

598726006

result:

ok 1 number(s): "598726006"

Test #9:

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

input:

5
10 86 22 94 84

output:

577792129

result:

ok 1 number(s): "577792129"

Test #10:

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

input:

5
234 844 870 315 329

output:

841580719

result:

ok 1 number(s): "841580719"

Test #11:

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

input:

5
831 20 544 850 934

output:

456333885

result:

ok 1 number(s): "456333885"

Test #12:

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

input:

5
46 515 901 448 458

output:

123213251

result:

ok 1 number(s): "123213251"

Test #13:

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

input:

5
666396 587634 584488 26138 853730

output:

339316457

result:

ok 1 number(s): "339316457"

Test #14:

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

input:

5
881129 22851 211220 709425 27339

output:

178012579

result:

ok 1 number(s): "178012579"

Test #15:

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

input:

5
21178 495067 431134 837213 163950

output:

257304267

result:

ok 1 number(s): "257304267"

Test #16:

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

input:

5
541525028 612557269 278260901 162573916 351219705

output:

367291952

result:

ok 1 number(s): "367291952"

Test #17:

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

input:

5
618658691 305494426 20549203 295524864 599845100

output:

735938660

result:

ok 1 number(s): "735938660"

Test #18:

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

input:

5
138243290 661995095 394241286 133508520 184906983

output:

587970803

result:

ok 1 number(s): "587970803"

Test #19:

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

input:

10
1 9 5 10 9 2 3 0 3 8

output:

282549555

result:

ok 1 number(s): "282549555"

Test #20:

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

input:

10
5 3 9 3 4 0 10 1 0 9

output:

711715

result:

ok 1 number(s): "711715"

Test #21:

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

input:

10
6 3 10 0 3 4 0 6 2 5

output:

406818002

result:

ok 1 number(s): "406818002"

Test #22:

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

input:

10
62 65 20 53 87 84 61 68 38 46

output:

963300483

result:

ok 1 number(s): "963300483"

Test #23:

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

input:

10
7 100 98 88 28 33 4 54 85 38

output:

331898991

result:

ok 1 number(s): "331898991"

Test #24:

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

input:

10
51 67 9 67 60 94 16 84 41 8

output:

288281193

result:

ok 1 number(s): "288281193"

Test #25:

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

input:

10
979 399 460 97 912 441 201 975 168 999

output:

173923980

result:

ok 1 number(s): "173923980"

Test #26:

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

input:

10
123 186 491 970 967 134 433 284 569 306

output:

401823145

result:

ok 1 number(s): "401823145"

Test #27:

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

input:

10
950 594 513 763 712 899 285 602 660 225

output:

525403475

result:

ok 1 number(s): "525403475"

Test #28:

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

input:

10
474003 615160 553337 411499 486927 871203 882749 328739 4758 712802

output:

464266861

result:

ok 1 number(s): "464266861"

Test #29:

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

input:

10
133408 498405 35787 617398 451184 215676 858095 915003 779438 353916

output:

953141014

result:

ok 1 number(s): "953141014"

Test #30:

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

input:

10
274315 826152 962056 785613 415442 40965 314257 575949 997933 401849

output:

20340434

result:

ok 1 number(s): "20340434"

Test #31:

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

input:

10
973577511 924860842 135145374 333683082 866710766 260390187 469183413 342124177 106180997 379641830

output:

592890083

result:

ok 1 number(s): "592890083"

Test #32:

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

input:

10
505612806 932485514 595099252 245657996 663983240 885296179 45095048 530062200 861812068 712025387

output:

405886751

result:

ok 1 number(s): "405886751"

Test #33:

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

input:

10
226600945 940110186 202536774 305116556 240143141 215234878 104926818 644371294 101363271 118037870

output:

161752374

result:

ok 1 number(s): "161752374"

Test #34:

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

input:

15
3 8 7 2 8 5 3 5 1 3 4 2 9 7 3

output:

956465387

result:

ok 1 number(s): "956465387"

Test #35:

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

input:

15
10 8 0 7 2 5 3 10 2 4 5 8 3 7 5

output:

524573774

result:

ok 1 number(s): "524573774"

Test #36:

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

input:

15
8 6 8 2 2 3 4 6 1 0 1 9 8 9 8

output:

366804158

result:

ok 1 number(s): "366804158"

Test #37:

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

input:

15
17 98 83 19 7 94 62 58 33 65 39 94 22 57 85

output:

170035742

result:

ok 1 number(s): "170035742"

Test #38:

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

input:

15
28 32 94 20 71 54 6 88 57 57 48 52 48 90 0

output:

995965994

result:

ok 1 number(s): "995965994"

Test #39:

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

input:

15
5 79 5 55 1 3 17 17 2 61 81 76 86 90 16

output:

437004653

result:

ok 1 number(s): "437004653"

Test #40:

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

input:

15
832 566 35 162 803 335 118 231 724 16 424 471 817 96 192

output:

998556839

result:

ok 1 number(s): "998556839"

Test #41:

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

input:

15
659 354 66 344 167 99 279 231 124 316 696 355 322 289 924

output:

784861907

result:

ok 1 number(s): "784861907"

Test #42:

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

input:

15
184 141 88 208 222 793 511 548 215 616 596 558 517 871 353

output:

375630811

result:

ok 1 number(s): "375630811"

Test #43:

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

input:

15
651119 393688 896252 155888 884868 766489 604433 203416 10759 436144 815495 895196 659670 859356 875746

output:

582673504

result:

ok 1 number(s): "582673504"

Test #44:

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

input:

15
792025 758435 341018 805604 849126 110962 60594 789681 266938 484077 371301 273810 364228 747805 207385

output:

846645117

result:

ok 1 number(s): "846645117"

Test #45:

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

input:

15
932932 604681 786470 973818 813384 936938 554441 450627 3933 87507 407923 170923 105785 673938 58209

output:

570792882

result:

ok 1 number(s): "570792882"

Test #46:

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

input:

15
864046464 4412205 320752380 928419761 984134399 984170792 487698920 558118844 46096899 757041229 409850778 268752408 618603150 48902625 989739474

output:

605812869

result:

ok 1 number(s): "605812869"

Test #47:

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

input:

15
880001894 307004169 928189904 692911029 928890520 945513272 63610556 41024158 285648104 163053712 213807504 345597908 499320932 188714355 266222717

output:

823241175

result:

ok 1 number(s): "823241175"

Test #48:

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

input:

15
117069898 167145195 535627426 604885943 652534067 570419263 123442326 860365961 41279173 495437269 944135303 906363543 527522360 402380803 26626094

output:

724357258

result:

ok 1 number(s): "724357258"

Test #49:

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

input:

20
6 6 5 5 2 7 0 5 3 6 10 4 1 8 8 2 5 4 3 3

output:

900759082

result:

ok 1 number(s): "900759082"

Test #50:

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

input:

20
8 6 2 9 1 5 8 10 3 9 0 3 2 7 3 8 5 10 3 10

output:

532626499

result:

ok 1 number(s): "532626499"

Test #51:

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

input:

20
6 4 6 5 4 5 6 4 5 3 3 0 8 7 5 9 7 5 1 10

output:

14004939

result:

ok 1 number(s): "14004939"

Test #52:

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

input:

20
78 75 94 4 13 6 51 28 52 78 3 26 52 42 1 18 95 72 54 91

output:

818049626

result:

ok 1 number(s): "818049626"

Test #53:

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

input:

20
89 44 4 39 89 56 63 47 32 37 2 62 78 42 17 72 51 36 85 56

output:

103395195

result:

ok 1 number(s): "103395195"

Test #54:

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

input:

20
78 90 16 8 19 16 75 77 89 97 45 19 48 74 44 36 40 100 26 20

output:

147394023

result:

ok 1 number(s): "147394023"

Test #55:

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

input:

20
194 886 826 704 826 197 704 381 870 21 547 538 383 849 840 79 569 417 456 717

output:

104004881

result:

ok 1 number(s): "104004881"

Test #56:

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

input:

20
712 682 475 496 500 891 555 691 579 321 438 430 889 732 261 24 627 462 990 193

output:

264870270

result:

ok 1 number(s): "264870270"

Test #57:

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

input:

20
166 469 498 368 245 663 406 620 360 629 719 935 394 933 0 279 615 498 452 678

output:

885163692

result:

ok 1 number(s): "885163692"

Test #58:

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

input:

20
132552 605875 773252 94785 585854 700237 76885 634902 886797 529478 94049 311501 822982 179078 341285 96230 920174 971388 454570 949729

output:

725019207

result:

ok 1 number(s): "725019207"

Test #59:

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

input:

20
310457 933622 181019 300684 587795 526211 607730 221165 142976 577411 168355 690116 564539 105210 710609 648596 661140 995256 387220 128842

output:

343874650

result:

ok 1 number(s): "343874650"

Test #60:

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

input:

20
451363 298368 663470 468899 552053 351500 63892 807429 879971 662342 167977 587230 306097 993660 42248 719461 402105 500624 875369 308641

output:

450576354

result:

ok 1 number(s): "450576354"

Test #61:

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

input:

20
493162110 617798000 877433677 466634030 451772649 258200693 594895022 186381220 506683101 268620545 878383595 136682117 936239838 463837203 458594696 348575459 292838957 234184881 137896917 577469970

output:

301744765

result:

ok 1 number(s): "301744765"

Test #62:

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

input:

20
582746469 920389964 484871199 378608944 249045124 514510465 170806657 374319242 409797816 601004101 977307613 697447752 964441266 46099870 735077940 827691257 918442412 640113130 823033027 654106845

output:

917800571

result:

ok 1 number(s): "917800571"

Test #63:

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

input:

20
451218253 780530990 944825077 438067504 193801244 844449165 746718294 488628337 501865375 933387658 560151765 774293252 992642694 259766319 642964963 675403274 396562219 898557734 65718199 25711011

output:

86621323

result:

ok 1 number(s): "86621323"

Test #64:

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

input:

100
0 10 10 0 0 9 2 10 3 4 2 9 6 6 7 10 3 3 9 1 2 5 10 6 7 6 7 9 10 0 0 1 8 3 5 10 6 9 10 4 7 1 4 1 5 2 4 1 1 9 8 6 1 8 8 4 8 1 3 6 6 8 2 0 6 0 4 4 5 3 3 1 6 8 5 0 3 7 0 5 9 1 2 2 6 7 8 5 3 7 4 1 2 4 5 8 6 6 10 8

output:

259998854

result:

ok 1 number(s): "259998854"

Test #65:

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

input:

100
7 9 2 8 5 5 3 2 7 7 5 1 6 10 9 7 4 2 5 0 6 0 1 5 3 10 10 8 6 1 3 1 0 10 3 4 4 6 5 8 2 0 7 7 4 6 5 10 4 0 6 6 10 6 1 3 9 2 7 8 6 4 2 5 7 1 6 10 8 3 7 7 3 9 7 1 7 8 7 4 10 9 3 10 9 10 7 0 0 4 6 9 7 4 7 6 0 9 8 7

output:

270617125

result:

ok 1 number(s): "270617125"

Test #66:

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

input:

100
10 7 8 9 7 3 0 5 5 9 0 10 7 5 2 2 2 10 8 10 10 1 4 0 1 8 7 8 5 2 5 1 1 8 9 5 4 1 9 9 4 8 7 6 3 0 5 10 10 4 2 1 0 1 7 4 6 0 10 8 1 4 10 5 4 0 0 8 6 2 4 2 4 5 1 0 3 8 4 10 2 2 10 2 0 7 4 7 4 10 3 2 2 3 9 3 7 10 2 2

output:

231634254

result:

ok 1 number(s): "231634254"

Test #67:

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

input:

100
81 88 44 29 98 91 94 87 91 31 90 27 25 18 17 42 92 27 11 18 16 0 95 5 33 79 20 75 47 95 48 100 51 94 61 100 17 30 83 49 5 50 7 51 4 40 46 45 54 60 30 97 43 61 95 9 32 57 79 48 57 39 12 12 23 59 89 61 81 79 93 11 74 98 83 14 61 46 7 46 30 12 85 51 37 19 50 45 44 26 77 6 66 56 43 23 73 11 62 92

output:

192652178

result:

ok 1 number(s): "192652178"

Test #68:

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

input:

100
24 84 85 100 19 49 88 0 22 37 15 56 96 32 43 38 27 14 79 30 79 30 13 41 62 22 23 66 35 42 90 33 6 50 84 3 41 65 69 99 12 93 83 15 16 84 30 36 90 72 4 90 72 15 68 32 83 81 82 62 5 34 42 15 89 100 45 83 48 33 87 44 21 32 46 45 54 53 84 65 78 81 26 40 95 85 83 45 15 69 58 58 90 34 32 29 89 77 79 68

output:

969752138

result:

ok 1 number(s): "969752138"

Test #69:

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

input:

100
35 58 4 26 42 6 81 47 10 77 97 74 67 90 91 68 52 91 81 53 52 25 20 100 13 76 15 46 81 81 65 21 85 40 85 74 66 10 44 72 98 34 56 46 96 60 26 72 92 95 23 49 67 13 40 87 89 38 42 78 53 29 6 17 88 29 91 49 27 54 91 55 1 32 42 30 81 82 93 50 69 94 67 74 52 16 49 45 31 1 5 20 57 23 53 46 83 9 96 45

output:

569950624

result:

ok 1 number(s): "569950624"

Test #70:

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

input:

100
618 836 796 163 378 762 816 438 188 604 210 279 527 1000 280 382 82 17 6 974 897 101 631 715 180 366 593 918 855 564 167 597 172 152 637 126 100 706 288 991 685 105 11 516 932 419 187 856 693 654 287 544 30 632 680 298 27 361 309 418 684 783 601 810 135 570 333 44 113 512 243 884 845 700 21 569 ...

output:

919210522

result:

ok 1 number(s): "919210522"

Test #71:

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

input:

100
183 201 331 68 142 271 215 138 211 543 522 833 868 707 322 86 704 427 467 703 390 500 350 493 263 626 704 543 988 313 210 60 662 931 51 844 800 903 863 259 231 435 230 430 845 418 902 784 597 607 169 995 312 735 204 2 355 855 821 315 266 838 544 896 815 59 276 225 142 388 436 771 196 364 611 279...

output:

578502803

result:

ok 1 number(s): "578502803"

Test #72:

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

input:

100
361 185 246 601 898 393 614 840 234 785 524 776 137 414 992 109 254 765 936 432 256 526 70 351 726 950 504 859 430 436 874 215 144 709 85 631 181 797 126 147 468 384 140 353 750 728 244 411 819 933 58 127 593 458 658 318 994 276 945 205 857 964 797 593 486 929 909 477 791 644 629 651 174 28 502 ...

output:

434019233

result:

ok 1 number(s): "434019233"

Test #73:

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

input:

100
842576 939917 32288 430662 81109 305801 99581 973070 620581 934927 407559 86415 823706 437224 123032 382957 242622 914553 81312 870054 613331 858318 502578 623664 868085 536771 367378 392717 91658 51442 399261 676015 552484 168901 82312 126237 144084 790428 780528 245849 529068 980398 964256 573...

output:

733005742

result:

ok 1 number(s): "733005742"

Test #74:

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

input:

100
314791 603648 197076 604272 910144 17752 368745 336608 918759 45640 489845 660614 407398 458060 26007 63077 623158 280184 544763 476385 24519 839601 159342 548137 721134 994764 631437 607190 340565 801355 219166 151679 120698 419755 69308 175133 528129 525691 947265 766232 881735 926159 384326 4...

output:

310670034

result:

ok 1 number(s): "310670034"

Test #75:

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

input:

100
750009 268064 843364 740882 220678 248887 193406 700147 660753 749538 609814 234812 510275 35079 928299 224014 3008 683500 489714 638216 398025 783201 259922 953426 499499 452071 933180 339476 626470 70452 445889 108845 688914 670609 500805 704845 986858 260268 113315 324298 789900 908919 767398...

output:

294362431

result:

ok 1 number(s): "294362431"

Test #76:

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

input:

100
652221851 845340868 613536607 608266625 678559956 851582809 13994284 381530148 39098335 20699325 231683009 245050437 855892175 362492092 542694312 346542296 17357626 115282364 241066500 411142758 89147361 708706706 922886778 370626626 684913669 379051236 356922192 113686684 305791974 32789741 30...

output:

420369794

result:

ok 1 number(s): "420369794"

Test #77:

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

input:

100
8722519 219032950 115083774 561924728 307774242 977294418 226847547 782032251 706964477 77295205 267105786 841125967 116866600 120566339 112103560 878830823 12638021 818727600 628107560 844560463 738291015 458397030 84041093 464201217 719135172 200779275 591123910 366876283 700095967 474404397 7...

output:

664805595

result:

ok 1 number(s): "664805595"

Test #78:

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

input:

100
996626970 961321253 248034722 294470257 936988528 103006027 513555527 35050708 669797910 576342022 81415989 805797716 893920893 26124232 50109029 968668413 523998282 890769054 678712132 277978167 166322094 397040198 876599190 189179588 900840321 169990959 898954555 177614945 651949023 399939186 ...

output:

662037724

result:

ok 1 number(s): "662037724"

Test #79:

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

input:

200
10 9 7 2 6 9 1 4 1 4 3 8 10 6 8 0 5 8 7 0 10 4 9 6 8 6 5 4 6 3 4 8 7 9 5 2 5 10 9 8 0 2 9 9 4 4 6 5 9 3 3 7 8 8 4 1 2 1 10 0 2 6 6 3 0 5 0 1 3 5 10 4 4 1 0 4 3 6 5 5 6 9 7 9 7 9 4 5 1 1 1 1 7 9 6 3 8 5 3 0 5 5 2 2 0 5 3 3 1 10 4 10 8 3 3 2 5 2 3 6 0 8 0 2 8 6 5 6 4 8 9 1 3 10 8 3 1 6 1 1 10 3 6 ...

output:

188766686

result:

ok 1 number(s): "188766686"

Test #80:

score: 0
Accepted
time: 3ms
memory: 7868kb

input:

200
2 0 2 3 0 3 9 7 2 8 8 7 0 10 2 9 4 8 5 10 10 10 9 1 4 5 9 2 2 4 9 5 10 8 3 7 6 6 10 9 6 8 9 9 3 8 7 10 3 3 3 10 6 7 9 1 7 6 4 10 8 0 2 9 1 2 5 7 1 3 6 10 1 0 2 6 5 7 4 3 1 6 5 4 10 10 4 5 9 0 2 2 10 6 8 7 4 4 1 7 10 6 2 1 5 6 1 1 6 8 6 10 0 6 6 8 8 0 10 1 3 5 6 9 9 6 5 9 5 8 0 6 1 8 9 4 7 2 7 6 ...

output:

171829418

result:

ok 1 number(s): "171829418"

Test #81:

score: 0
Accepted
time: 3ms
memory: 6160kb

input:

200
10 7 5 0 8 1 6 1 6 9 1 9 2 1 6 6 4 9 8 9 1 1 4 5 7 7 0 2 2 2 8 4 7 3 9 9 6 3 4 9 0 5 1 10 3 4 7 10 6 9 3 9 7 2 3 2 7 5 2 8 8 0 2 9 6 3 0 5 0 10 0 5 1 7 7 3 2 7 8 10 5 8 5 9 1 8 1 8 5 3 4 2 3 7 10 5 0 5 3 0 1 9 10 6 2 6 9 0 4 5 6 4 1 7 6 7 10 1 9 3 6 10 7 9 4 1 10 10 7 6 1 3 0 1 4 7 9 6 5 1 6 3 3...

output:

354087901

result:

ok 1 number(s): "354087901"

Test #82:

score: 0
Accepted
time: 3ms
memory: 5904kb

input:

200
25 56 55 64 62 40 5 16 70 34 100 85 85 50 0 40 59 24 86 85 32 8 56 57 83 31 89 17 11 94 9 30 87 52 94 92 99 40 98 15 61 79 56 21 81 30 20 42 50 99 82 34 94 27 29 55 51 91 83 42 75 98 79 40 31 7 82 68 4 59 88 34 52 7 3 7 42 68 36 68 58 72 56 57 53 100 69 48 3 86 4 76 38 73 2 76 6 44 78 26 77 10 1...

output:

20900547

result:

ok 1 number(s): "20900547"

Test #83:

score: 0
Accepted
time: 3ms
memory: 7984kb

input:

200
36 63 97 1 51 98 32 30 69 63 13 13 55 31 59 2 17 78 43 96 39 37 73 15 34 52 92 64 22 98 84 52 98 75 16 27 56 52 84 100 36 10 30 85 37 63 39 11 29 89 34 60 55 82 34 9 68 4 54 24 56 93 77 54 64 37 60 91 73 45 25 68 66 41 67 27 35 76 45 87 5 52 64 57 77 99 58 15 8 17 86 38 95 62 24 92 22 76 95 3 45...

output:

611426658

result:

ok 1 number(s): "611426658"

Test #84:

score: 0
Accepted
time: 3ms
memory: 7724kb

input:

200
91 59 48 28 6 56 93 78 0 37 6 31 37 56 40 32 19 54 11 85 1 44 91 39 62 97 95 55 78 80 25 18 54 99 39 98 70 87 26 4 43 85 5 15 49 39 35 80 99 44 42 53 51 69 7 65 85 62 80 72 71 19 6 56 63 79 5 56 52 55 19 68 46 52 63 46 28 4 20 61 53 64 5 46 35 97 25 15 14 17 43 56 96 40 45 98 16 65 79 91 25 76 6...

output:

834457358

result:

ok 1 number(s): "834457358"

Test #85:

score: 0
Accepted
time: 3ms
memory: 7948kb

input:

200
143 632 438 336 433 835 668 438 597 904 110 783 24 200 11 637 69 61 167 68 624 443 946 593 27 826 5 222 772 429 768 828 900 391 489 907 779 556 465 349 143 760 233 354 54 322 460 552 670 351 142 870 160 127 336 70 947 500 878 952 801 886 164 631 823 306 781 207 590 82 721 640 544 113 696 589 587...

output:

874796220

result:

ok 1 number(s): "874796220"

Test #86:

score: 0
Accepted
time: 3ms
memory: 7808kb

input:

200
630 616 353 870 197 965 376 138 612 153 795 726 675 908 681 341 691 471 8 178 117 159 666 371 801 148 115 847 905 179 812 991 381 177 911 313 779 132 658 236 380 88 142 649 968 321 803 480 892 297 32 10 433 859 861 83 274 612 1 230 391 321 418 327 192 176 716 768 619 648 604 519 585 95 905 292 5...

output:

251940636

result:

ok 1 number(s): "251940636"

Test #87:

score: 0
Accepted
time: 3ms
memory: 6024kb

input:

200
195 982 888 783 953 86 775 149 945 92 796 288 634 305 723 54 622 802 469 908 983 184 4 538 876 480 916 154 45 309 855 73 562 956 945 721 859 639 922 203 546 418 60 572 182 631 517 417 796 560 915 143 714 962 315 407 913 34 132 119 974 66 361 413 865 46 348 639 648 524 797 406 944 760 486 932 566...

output:

611003743

result:

ok 1 number(s): "611003743"

Test #88:

score: 0
Accepted
time: 3ms
memory: 6184kb

input:

200
983482 304663 440057 118060 82366 131090 593427 115516 395260 982859 444866 946531 83762 363356 492355 973007 983589 900738 13962 49167 25438 369900 929050 51428 981477 266336 724871 798736 465229 296296 774747 431654 4581 882772 631127 150194 923169 735485 518894 795812 363915 117660 172425 175...

output:

319809981

result:

ok 1 number(s): "319809981"

Test #89:

score: 0
Accepted
time: 3ms
memory: 7740kb

input:

200
455698 931395 604844 810170 874402 880726 861906 922872 655753 649072 527151 520729 148955 384192 357647 133942 364124 304052 477413 693183 436627 795000 66629 419719 797526 724329 470430 975525 751134 527710 39153 425819 572796 133625 99623 161407 381897 507746 647946 353193 235081 618920 59249...

output:

63040146

result:

ok 1 number(s): "63040146"

Test #90:

score: 0
Accepted
time: 3ms
memory: 7800kb

input:

200
890915 151309 288130 946781 184936 111861 131069 286410 916932 797470 646436 650426 770332 923528 297621 776380 226160 707368 940863 818015 884815 738600 723393 344192 650574 700136 772173 189996 39 277622 821376 864486 141011 383793 48934 210303 840625 723825 776999 911260 624746 564680 975568 ...

output:

473943741

result:

ok 1 number(s): "473943741"

Test #91:

score: 0
Accepted
time: 3ms
memory: 7972kb

input:

200
36773501 147932831 220974130 372757893 475832431 476488800 589905920 569468170 278649540 58115589 35639735 953299718 736609957 944754760 450581335 899287022 642961081 521210613 483751672 782746925 138244286 877089069 616965685 723437806 925649468 822134484 963021242 212950449 694300953 760581215...

output:

646775081

result:

ok 1 number(s): "646775081"

Test #92:

score: 0
Accepted
time: 3ms
memory: 7856kb

input:

200
729710659 521624914 722521298 621383288 252530363 602200409 729130255 969970274 241482972 409678761 997433585 917971467 145068028 702829007 388586804 431575548 638241476 224655848 313243670 216164629 787387941 815732237 557007427 300932531 959870971 791346169 197222958 171172757 646154009 833599...

output:

542158774

result:

ok 1 number(s): "542158774"

Test #93:

score: 0
Accepted
time: 3ms
memory: 6184kb

input:

200
86211327 263913216 560504953 206445171 881744649 432944726 89467162 517956022 277945333 908725579 811743788 514046996 774638675 313419608 957996054 816380429 781005517 854246366 68880950 649582334 362902666 901859050 13129034 394507122 510172339 244477988 136457384 129395064 40458001 275214305 9...

output:

179653400

result:

ok 1 number(s): "179653400"

Test #94:

score: 0
Accepted
time: 10ms
memory: 11904kb

input:

500
4 10 2 1 4 0 10 7 3 10 7 1 4 8 6 2 5 3 0 4 5 7 2 8 6 9 9 1 10 8 3 2 2 0 7 9 7 0 2 10 6 2 0 9 1 0 2 4 8 10 5 4 10 7 9 1 1 4 2 10 5 0 7 6 4 8 7 10 6 8 4 3 4 7 7 9 2 4 8 3 5 9 2 6 7 3 6 3 8 0 9 5 3 1 4 7 1 6 5 2 1 1 5 9 1 9 8 2 5 1 10 5 1 0 2 4 8 4 3 1 1 4 7 0 3 3 1 0 1 1 8 10 0 2 5 8 0 7 9 0 1 0 9...

output:

341684336

result:

ok 1 number(s): "341684336"

Test #95:

score: 0
Accepted
time: 10ms
memory: 12020kb

input:

500
3 8 9 2 1 8 8 10 2 0 6 3 4 7 0 8 4 4 3 1 9 3 6 7 1 7 2 1 9 6 4 0 2 10 1 10 9 5 0 10 3 8 0 2 3 4 3 1 0 1 1 7 10 2 4 0 1 9 5 6 0 0 1 7 8 3 2 5 4 9 0 7 1 7 1 8 2 5 2 4 4 0 10 0 2 4 3 7 5 8 10 9 1 0 6 7 9 8 10 9 5 0 5 3 7 3 6 7 0 9 3 0 1 2 2 10 10 1 0 7 3 2 10 6 1 7 3 7 2 10 4 8 3 8 7 9 9 3 6 5 9 4 ...

output:

985802120

result:

ok 1 number(s): "985802120"

Test #96:

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

input:

500
10 9 5 10 6 3 1 4 3 1 1 3 5 2 4 8 5 4 10 1 8 5 7 2 5 10 7 7 8 7 7 0 6 8 10 4 9 4 8 4 5 5 1 0 3 0 3 2 3 4 10 0 8 6 9 1 8 8 9 10 8 6 1 3 9 1 3 3 7 5 4 1 8 3 6 6 9 5 1 0 6 6 6 1 5 2 0 3 10 7 1 6 6 4 1 5 5 7 9 8 8 3 9 2 0 10 3 10 1 6 2 1 5 3 4 1 3 10 7 8 6 7 0 7 9 2 8 8 3 2 6 6 5 5 1 0 0 0 1 4 5 3 1...

output:

701627826

result:

ok 1 number(s): "701627826"

Test #97:

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

input:

500
36 49 89 80 99 9 84 95 52 13 73 69 85 15 93 11 72 60 79 1 26 86 48 79 20 69 16 11 38 12 46 54 17 6 12 88 98 91 33 15 19 63 69 30 63 21 12 44 27 70 58 60 65 39 19 9 86 95 8 71 97 27 79 56 78 42 93 24 45 73 17 4 98 90 56 78 97 1 54 10 41 16 73 63 91 97 96 69 85 77 54 60 89 35 80 56 87 76 49 44 60 ...

output:

120832337

result:

ok 1 number(s): "120832337"

Test #98:

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

input:

500
81 12 40 7 88 67 78 42 84 53 55 87 56 29 17 41 29 36 47 24 89 82 32 37 71 24 20 59 83 17 20 8 73 97 2 57 56 92 19 31 26 95 43 61 8 54 97 79 6 82 66 19 60 26 93 43 2 7 34 19 33 22 9 59 43 72 38 46 13 94 22 38 11 90 52 97 57 41 29 29 31 29 13 52 14 96 62 2 90 8 80 10 90 24 0 73 70 75 32 20 6 19 24...

output:

896134475

result:

ok 1 number(s): "896134475"

Test #99:

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

input:

500
92 18 48 78 43 14 71 56 83 93 81 15 26 54 65 82 66 79 15 13 84 10 51 28 100 67 23 17 72 66 63 31 84 64 25 60 47 37 74 4 1 36 85 25 88 30 93 81 8 4 51 12 11 80 98 64 41 32 27 0 14 83 40 73 42 13 84 12 25 2 16 38 92 56 14 49 39 37 38 38 12 98 55 51 5 95 28 2 94 41 60 73 13 13 56 79 97 97 50 98 9 5...

output:

642110284

result:

ok 1 number(s): "642110284"

Test #100:

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

input:

500
331 3 140 873 598 295 912 684 488 120 555 763 920 176 222 154 492 877 13 505 185 490 446 845 324 951 240 745 301 105 641 227 685 370 67 557 34 779 239 431 759 737 373 9 875 278 915 196 997 668 654 926 213 19 688 950 92 480 498 633 708 566 468 394 657 651 496 471 479 109 597 519 781 617 344 714 1...

output:

521292121

result:

ok 1 number(s): "521292121"

Test #101:

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

input:

500
516 989 55 406 362 424 620 376 512 743 557 14 189 566 263 797 42 596 785 234 50 826 166 695 708 273 970 51 434 855 374 700 175 156 109 273 105 355 814 319 995 748 664 933 780 277 940 125 910 613 464 58 494 743 212 654 421 274 630 522 290 1 102 782 328 520 439 342 509 366 480 398 131 282 235 345 ...

output:

684791168

result:

ok 1 number(s): "684791168"

Test #102:

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

input:

500
2 663 281 311 117 554 18 458 535 682 868 950 530 893 313 509 974 997 245 34 536 232 887 473 171 223 79 677 566 605 37 473 657 625 523 680 805 552 77 286 160 77 573 847 2 587 281 53 814 567 354 199 767 855 666 978 749 697 141 793 252 747 355 868 690 9 71 895 149 925 673 666 180 955 817 676 120 36...

output:

728101612

result:

ok 1 number(s): "728101612"

Test #103:

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

input:

500
961699 843403 775728 660389 975140 682326 518097 874307 606929 200654 73915 600188 789936 67072 6457 111603 688672 490841 367411 587878 854943 236096 763279 148359 841519 936534 723350 423609 547570 474675 827208 623205 954741 23011 758387 146699 928974 163150 622310 593694 831457 121944 390118 ...

output:

354090019

result:

ok 1 number(s): "354090019"

Test #104:

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

input:

500
433915 63316 940515 833998 804174 913462 787261 237846 348923 386052 156201 212070 411312 87908 871750 754040 69207 857158 868546 712710 266131 661197 863860 35149 694568 393841 62091 637396 833476 780772 572430 580371 41455 273865 226882 195596 350017 898414 751362 151761 702622 548521 254690 5...

output:

9291603

result:

ok 1 number(s): "9291603"

Test #105:

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

input:

500
906816 727048 623801 970609 114708 626098 574239 119884 647101 15265 238486 786270 476505 664243 811724 914977 893560 260472 813496 319041 639636 604796 482939 478122 547616 407332 326150 370368 82381 530684 836152 56036 609670 6218 176879 688309 771746 632991 917414 672144 573788 531281 674761 ...

output:

284453577

result:

ok 1 number(s): "284453577"

Test #106:

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

input:

500
158268721 318290493 748319408 961198991 88988219 245192325 465124473 838540736 808350310 423862478 447735705 520272707 673730595 733011961 395354979 221310499 3691577 444028069 391676356 86512268 138051417 612658198 215508063 970824188 163936730 635304362 412722169 920807162 196038588 91665071 1...

output:

841796644

result:

ok 1 number(s): "841796644"

Test #107:

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

input:

500
219802098 60578795 881270356 209824385 791831434 370903934 309381515 386526485 697329025 480458358 114562262 411315528 450784887 638569854 333360448 606115380 293939264 516069524 294797281 519929973 82162362 846268658 303033451 211882424 714238098 235919826 646923886 173996760 295375290 38579608...

output:

670436788

result:

ok 1 number(s): "670436788"

Test #108:

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

input:

500
207706547 434270878 719254012 794886269 568529365 496615543 301122204 492061296 660162458 979505176 297468685 375987276 711759313 396644101 50253342 990920261 952783171 293143687 976805634 953347677 731306017 932395472 464187767 305457016 748459601 57647865 249721823 132219068 542195638 45881451...

output:

216937137

result:

ok 1 number(s): "216937137"

Test #109:

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

input:

1000
5 5 2 8 6 3 10 10 0 10 8 1 7 9 5 3 4 6 9 8 1 1 1 2 6 9 2 8 0 1 6 6 1 0 8 1 3 3 0 1 9 4 4 4 7 2 4 6 10 10 8 4 6 4 6 6 10 3 3 1 2 9 1 10 6 4 0 5 8 0 9 4 9 8 7 0 1 0 8 2 10 7 5 10 0 5 2 6 0 10 3 9 6 8 9 10 7 6 1 2 8 8 9 5 0 10 8 10 6 6 5 3 5 6 10 9 4 2 1 4 3 4 9 1 4 3 3 7 10 3 3 0 1 3 3 7 2 9 7 5 ...

output:

240199136

result:

ok 1 number(s): "240199136"

Test #110:

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

input:

1000
5 2 0 5 8 4 0 1 7 3 0 6 9 1 9 1 2 7 4 1 1 8 10 2 7 7 7 7 3 10 9 3 5 0 10 3 10 9 0 4 9 6 3 7 7 4 2 0 4 3 5 9 4 2 3 8 6 6 5 5 2 4 10 6 0 3 7 7 10 10 1 7 10 5 2 1 8 1 3 1 3 8 9 10 4 0 0 4 7 7 6 7 0 9 4 3 2 7 2 2 10 8 6 0 10 6 1 4 3 10 4 3 4 5 5 7 4 8 3 0 8 9 8 2 9 6 2 0 8 2 5 5 8 5 0 5 5 2 3 6 8 1...

output:

331899694

result:

ok 1 number(s): "331899694"

Test #111:

score: 0
Accepted
time: 57ms
memory: 20300kb

input:

1000
6 10 4 0 8 5 6 5 9 1 2 4 9 7 1 3 0 7 0 4 2 5 7 8 7 2 5 3 6 7 5 3 0 5 0 1 10 2 1 2 0 8 9 4 9 1 0 8 3 1 7 2 4 10 1 1 2 6 6 8 0 4 3 5 5 0 4 4 10 6 9 4 5 0 5 0 7 6 0 2 10 10 1 9 3 8 6 2 1 3 6 0 6 2 5 10 5 1 2 5 3 10 5 5 10 0 4 8 10 6 4 10 2 7 3 3 9 2 5 2 4 1 3 7 6 3 0 0 6 5 2 3 7 1 4 0 2 8 1 3 9 5 ...

output:

794993792

result:

ok 1 number(s): "794993792"

Test #112:

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

input:

1000
2 84 7 37 55 27 58 44 53 42 24 58 63 58 89 4 23 29 37 63 30 95 59 54 10 58 70 73 43 23 83 20 71 54 92 50 14 41 51 47 29 63 70 51 84 44 42 89 14 22 45 89 1 93 5 15 83 93 49 20 53 86 100 28 99 51 56 77 44 51 73 32 61 60 9 69 19 31 32 87 95 17 84 48 36 99 23 73 38 21 24 34 64 63 22 28 60 72 34 44 ...

output:

863862619

result:

ok 1 number(s): "863862619"

Test #113:

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

input:

1000
37 27 53 11 4 39 88 34 23 40 81 85 95 74 53 27 20 4 70 80 82 54 100 93 30 27 79 71 8 28 79 90 18 87 16 31 35 56 86 3 46 45 39 61 63 18 6 62 54 18 5 83 68 70 50 45 73 98 54 71 78 19 27 36 47 32 97 1 45 47 97 10 82 48 3 95 41 37 54 71 65 56 55 31 49 7 5 67 31 60 60 39 92 55 76 96 83 55 81 6 66 7 ...

output:

200596864

result:

ok 1 number(s): "200596864"

Test #114:

score: 0
Accepted
time: 57ms
memory: 20072kb

input:

1000
16 38 55 43 64 84 85 80 16 73 50 21 61 68 6 17 62 35 68 96 90 82 39 9 50 6 21 23 41 89 9 59 44 19 18 79 10 73 18 27 30 27 9 81 52 27 14 59 70 36 44 100 91 48 95 31 97 46 16 90 24 86 66 32 62 14 4 93 46 87 19 44 91 92 97 8 30 66 65 87 1 95 4 2 63 83 8 60 81 87 28 12 42 47 38 40 82 71 50 67 93 44...

output:

95046612

result:

ok 1 number(s): "95046612"

Test #115:

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

input:

1000
887 905 1 765 663 832 376 307 863 456 262 702 660 107 407 785 758 123 871 500 651 687 52 139 931 933 95 933 198 594 282 83 301 424 81 652 401 782 166 773 970 942 919 620 736 846 226 82 281 873 194 483 586 489 121 266 479 900 946 505 191 694 912 470 577 521 179 755 419 456 631 711 199 970 914 84...

output:

118725958

result:

ok 1 number(s): "118725958"

Test #116:

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

input:

1000
674 555 795 129 736 993 686 398 162 356 837 207 543 839 662 153 492 586 347 226 310 621 931 669 80 344 10 859 63 576 521 120 548 586 552 321 624 577 222 851 623 241 756 52 647 746 923 67 281 45 210 604 780 145 202 185 618 779 169 622 294 258 732 539 687 969 341 613 989 624 689 481 621 953 935 9...

output:

170797339

result:

ok 1 number(s): "170797339"

Test #117:

score: 0
Accepted
time: 57ms
memory: 18344kb

input:

1000
89 585 667 184 429 224 686 107 780 628 349 712 744 268 607 148 537 739 832 644 969 563 809 517 222 376 4 466 620 176 62 459 723 445 641 1000 465 762 581 929 285 471 665 556 169 710 238 743 598 520 536 415 975 803 983 486 384 347 704 668 778 814 243 918 804 416 885 788 567 164 754 179 662 627 64...

output:

252076832

result:

ok 1 number(s): "252076832"

Test #118:

score: 0
Accepted
time: 57ms
memory: 20252kb

input:

1000
507724 405434 198087 293585 534563 113040 315593 66303 161739 513171 713829 906508 216566 446073 963351 477495 100979 949712 803005 747063 665882 879308 524057 568295 503020 232053 910720 910877 895754 981067 430523 123404 603879 357990 791431 522380 548323 161264 598551 341801 961512 716610 88...

output:

136679970

result:

ok 1 number(s): "136679970"

Test #119:

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

input:

1000
872470 813202 403986 257843 397536 606886 901857 284798 284354 68977 573943 129565 105015 259213 515716 737646 124847 882362 945120 159169 621280 305094 951823 719371 751086 627230 279054 321445 659107 356552 148478 613186 317749 388305 815388 376147 11878 899630 667013 176647 617274 999463 332...

output:

295054350

result:

ok 1 number(s): "295054350"

Test #120:

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

input:

1000
718716 295653 572201 222101 222826 100047 488120 21793 332287 105599 989557 871123 31147 590852 105765 478612 148715 815012 680417 608276 576679 731566 786405 832762 443652 984723 129574 657332 903962 138856 867120 65283 30933 937121 320161 674417 956935 600997 253973 11494 273035 207632 776342...

output:

219291528

result:

ok 1 number(s): "219291528"

Test #121:

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

input:

1000
470572295 27691320 771944928 960610185 438355861 288705168 844996308 14900006 463492737 978172664 495428591 707906958 844032730 228110528 118650790 103493735 756603040 450873374 666497098 458659650 358115866 879008587 223164392 867327952 319051187 222465150 990360028 249216185 431545709 4403086...

output:

419786083

result:

ok 1 number(s): "419786083"

Test #122:

score: 0
Accepted
time: 52ms
memory: 20228kb

input:

1000
478196967 635128844 683919842 905366306 768294561 864616804 327901622 918014722 500909002 708500462 56194225 441141094 615248241 504593771 597766588 24064481 15047643 136009484 890617619 507756576 526498229 15538431 870942864 108063750 393538215 976047845 794656501 195274226 85708254 904271728 ...

output:

456895870

result:

ok 1 number(s): "456895870"

Test #123:

score: 0
Accepted
time: 57ms
memory: 20128kb

input:

1000
485821639 947599075 743378402 850122427 393200552 440528440 147243424 10082280 833292558 807424480 133039725 321858876 197510908 412480795 150511313 649667936 420975893 821145594 262221786 556853501 883833436 635988412 76270397 717395769 836621463 582146894 893920266 583783206 887354446 8843146...

output:

607085231

result:

ok 1 number(s): "607085231"

Test #124:

score: 0
Accepted
time: 221ms
memory: 34312kb

input:

2000
2 8 9 3 0 1 4 10 2 1 0 3 1 4 7 8 9 1 1 7 1 7 4 8 10 2 6 8 10 4 8 5 6 6 6 9 7 2 5 3 3 10 7 2 9 9 6 3 4 3 3 4 4 10 0 5 5 3 8 7 1 6 8 10 8 1 1 3 0 8 6 10 7 8 2 10 8 0 3 0 0 0 6 3 3 5 10 9 8 7 5 10 7 7 0 10 4 5 4 9 10 1 10 4 4 4 9 8 1 3 4 6 9 8 6 0 8 0 5 9 6 10 1 8 10 3 3 10 0 3 6 5 0 10 5 4 8 1 1 ...

output:

924679420

result:

ok 1 number(s): "924679420"

Test #125:

score: 0
Accepted
time: 212ms
memory: 34308kb

input:

2000
4 0 6 8 9 10 9 5 7 4 9 1 0 3 2 10 1 4 0 0 1 7 4 8 1 1 8 7 10 10 4 5 8 4 4 10 0 1 10 8 2 5 3 0 9 0 2 9 9 10 5 0 4 6 5 7 8 0 7 5 10 10 4 5 8 8 1 4 9 6 1 10 7 1 7 8 0 2 0 1 8 6 7 7 3 1 0 7 4 4 3 4 5 0 6 3 7 8 4 1 6 2 7 5 2 9 10 0 7 7 4 0 6 4 6 9 8 8 8 1 0 4 1 9 2 0 1 7 9 9 5 3 10 0 6 10 0 5 1 2 4 ...

output:

976000183

result:

ok 1 number(s): "976000183"

Test #126:

score: 0
Accepted
time: 216ms
memory: 34796kb

input:

2000
2 8 10 6 5 10 3 5 7 5 7 2 0 9 4 1 10 4 6 4 2 4 1 7 1 10 7 3 5 5 7 2 4 0 9 1 1 7 7 2 10 7 2 1 7 6 1 6 5 1 3 5 2 5 5 4 4 7 8 7 10 1 8 5 4 1 9 2 2 5 0 10 9 7 10 10 7 7 6 0 1 4 3 4 5 8 10 5 5 4 8 8 9 1 8 8 4 4 7 4 5 9 6 8 0 5 1 6 5 0 3 3 4 5 3 8 0 2 3 5 7 7 7 8 3 0 3 3 0 3 4 5 6 6 6 3 4 5 8 5 10 8 ...

output:

404128249

result:

ok 1 number(s): "404128249"

Test #127:

score: 0
Accepted
time: 216ms
memory: 33688kb

input:

2000
14 90 59 75 44 52 18 92 85 48 15 43 33 83 13 0 60 16 5 74 37 90 43 12 61 35 73 64 99 72 24 76 15 77 81 20 72 86 5 98 3 95 21 49 96 20 95 24 84 79 88 82 97 80 78 48 100 50 52 34 0 80 30 30 30 48 1 42 22 72 66 77 9 27 72 99 69 38 52 5 42 97 24 71 26 97 91 84 9 31 4 96 31 52 66 78 77 4 96 21 18 65...

output:

868515623

result:

ok 1 number(s): "868515623"

Test #128:

score: 0
Accepted
time: 212ms
memory: 33992kb

input:

2000
82 1 95 5 94 97 48 82 44 81 74 12 66 99 67 90 23 81 70 91 78 84 84 51 82 82 82 51 31 32 20 11 75 9 16 34 48 69 72 87 20 76 81 91 85 95 1 31 33 97 58 76 31 58 56 0 90 22 14 53 59 47 68 38 12 73 42 34 57 33 90 43 29 48 66 13 91 67 63 22 45 69 40 54 7 6 61 67 70 93 40 1 15 44 97 12 9 77 31 83 45 1...

output:

554663930

result:

ok 1 number(s): "554663930"

Test #129:

score: 0
Accepted
time: 217ms
memory: 33992kb

input:

2000
27 45 63 80 87 7 79 27 14 79 31 39 32 81 31 46 20 11 36 85 97 11 24 0 12 61 24 4 86 37 51 14 22 42 8 38 69 17 4 32 37 58 83 0 64 3 32 26 38 93 18 59 53 69 67 87 13 60 8 3 5 81 7 13 50 55 50 59 59 40 13 78 4 69 93 28 80 28 7 6 82 74 12 69 87 25 75 60 18 87 20 41 43 36 94 46 8 60 67 44 39 48 30 7...

output:

62453524

result:

ok 1 number(s): "62453524"

Test #130:

score: 0
Accepted
time: 212ms
memory: 34568kb

input:

2000
373 890 537 297 426 962 776 1000 886 396 644 955 619 815 449 490 379 454 712 610 525 713 463 918 12 263 515 558 951 725 325 858 791 202 495 58 473 288 430 668 206 270 828 542 650 155 942 18 495 516 75 624 557 211 646 900 808 12 759 776 782 129 553 548 939 10 812 6 758 324 824 599 248 642 193 47...

output:

872491299

result:

ok 1 number(s): "872491299"

Test #131:

score: 0
Accepted
time: 216ms
memory: 34544kb

input:

2000
169 610 400 42 500 503 84 90 185 287 148 460 813 546 704 866 423 996 808 26 184 647 651 146 535 295 811 173 204 325 255 585 37 372 585 736 314 464 797 747 860 190 46 355 553 746 256 996 193 992 99 745 52 869 728 199 566 200 293 822 265 694 675 236 56 839 975 864 17 873 890 368 591 625 206 1000 ...

output:

919356706

result:

ok 1 number(s): "919356706"

Test #132:

score: 0
Accepted
time: 216ms
memory: 34024kb

input:

2000
957 259 201 717 193 354 13 809 485 258 660 965 13 976 649 854 468 148 292 754 843 962 529 676 996 707 114 90 70 306 796 614 205 231 683 716 855 267 464 197 522 491 885 478 75 18 961 361 193 164 425 556 247 906 436 118 712 762 207 946 359 249 496 615 165 286 517 348 588 39 637 447 12 299 226 515...

output:

546702492

result:

ok 1 number(s): "546702492"

Test #133:

score: 0
Accepted
time: 212ms
memory: 33584kb

input:

2000
979940 69164 325875 392512 845098 862675 65572 429842 459916 180068 796114 999206 800259 466909 903325 157616 481515 315343 266455 871894 39386 304407 180820 529768 319070 245544 174779 125348 144659 249478 175745 117569 172093 90344 259926 571276 970052 415026 727603 862184 832678 699369 30803...

output:

451876569

result:

ok 1 number(s): "451876569"

Test #134:

score: 0
Accepted
time: 221ms
memory: 34412kb

input:

2000
307686 514617 531774 394454 708072 838022 208019 648337 507849 216690 693228 778447 726392 798549 418691 380083 467699 247992 446254 765502 32469 248693 533903 606160 48635 84537 62297 498234 908014 69466 931386 607351 404463 676158 764700 868861 433607 116393 833064 734715 525438 945224 752226...

output:

953663894

result:

ok 1 number(s): "953663894"

Test #135:

score: 0
Accepted
time: 212ms
memory: 34180kb

input:

2000
228616 440884 699989 395710 533361 294183 794283 385332 111279 253997 71842 1504 614841 611688 971057 121048 491567 218326 625367 214608 987868 675166 923985 757235 296700 442030 430632 871804 152867 444952 687025 97131 118333 224972 307156 722628 415663 335575 383026 569561 181200 671893 19641...

output:

656428015

result:

ok 1 number(s): "656428015"

Test #136:

score: 0
Accepted
time: 216ms
memory: 34572kb

input:

2000
163509452 401383403 904895875 914268288 141199075 561900423 57849570 931481975 983875233 477219481 162255148 303982487 105007156 354780995 688060040 635782263 46850726 154318609 717101670 892077355 302226811 628698912 826769646 960902543 353272690 44193189 929594453 838842273 309769836 88192332...

output:

517506533

result:

ok 1 number(s): "517506533"

Test #137:

score: 0
Accepted
time: 213ms
memory: 34364kb

input:

2000
466101416 8820925 816870790 859024409 766105067 990328414 172158664 318516825 684855008 207547279 239100648 332183915 392302532 115184372 683255703 113902070 305295330 839454720 425142325 941174280 659562017 954181600 32097179 201638341 575243364 797775884 28858218 448463826 185044955 345886382...

output:

385101048

result:

ok 1 number(s): "385101048"

Test #138:

score: 0
Accepted
time: 208ms
memory: 33628kb

input:

2000
326242442 321291157 876329350 803780530 727447546 566240049 360096687 558068029 17238564 864020360 799866283 917934406 605968981 23071396 162371500 34472816 563739933 229623537 796746492 990271206 827944381 90711444 237424714 810970360 18326611 35278713 833154692 394521867 839207501 957333084 5...

output:

266259446

result:

ok 1 number(s): "266259446"

Extra Test:

score: 0
Extra Test Passed