UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#214991#2481. 或KXG100602ms5200kbC++11622b2024-11-25 19:21:222024-11-25 23:03:29

answer

#include <cstdio>
#include <algorithm>
using namespace std;
int n, k, x;
long long mul = 1;
long long a[200010], pre[200010], suf[200010];
int main() {
    scanf("%d%d%d", &n, &k, &x);
    for (int i = 1; i <= k; i++) {
        mul *= x;
    }
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
        scanf("%lld", &a[i]);
        pre[i] = pre[i - 1] | a[i];
    }
    for (int i = n; i >= 1; i--) {
        suf[i] = suf[i + 1] | a[i];
    }
    for (int i = 1; i <= n; i++) {
        ans = max(ans, (a[i] * mul) | pre[i - 1] | suf[i + 1]);
    }
    printf("%lld\n", ans);
    return 0;
}

详细

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

5 1 7
0 8 1048584 1572872 524296

output:

12058680

result:

ok single line: '12058680'

Test #2:

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

input:

5 1 4
266252 262153 266249 9 262144

output:

1331257

result:

ok single line: '1331257'

Test #3:

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

input:

5 1 3
262280 8388620 42205192 33554440 41943052

output:

126615708

result:

ok single line: '126615708'

Test #4:

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

input:

5 1 5
72353802 340805641 273680394 271583243 69748747

output:

1979279407

result:

ok single line: '1979279407'

Test #5:

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

input:

5 1 6
84165274 556269848 84673192 69222560 69484808

output:

3355199418

result:

ok single line: '3355199418'

Test #6:

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

input:

5 1 3
606143041 607191138 536870912 77628003 612466691

output:

1840611947

result:

ok single line: '1840611947'

Test #7:

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

input:

5 1 8
268468225 33557000 809500676 268470532 268438284

output:

6744476461

result:

ok single line: '6744476461'

Test #8:

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

input:

5 1 3
6817368 541738269 805322758 537542681 806093397

output:

2960050015

result:

ok single line: '2960050015'

Test #9:

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

input:

5 1 4
92293679 75499622 830777890 362031721 17072134

output:

3616991983

result:

ok single line: '3616991983'

Test #10:

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

input:

5 1 6
847251150 37750148 813697674 306187520 830479940

output:

5364531166

result:

ok single line: '5364531166'

Subtask #2:

score: 10
Accepted

Test #11:

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

input:

5 3 4
4194308 0 4 0 4194304

output:

272630020

result:

ok single line: '272630020'

Test #12:

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

input:

5 2 7
201854976 67108864 144707584 69210112 75501568

output:

9892990976

result:

ok single line: '9892990976'

Test #13:

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

input:

5 7 3
9437184 276891776 269484161 67593 276889728

output:

605570702729

result:

ok single line: '605570702729'

Test #14:

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

input:

5 4 5
1131008 65552 16400 9437184 41959952

output:

26234407696

result:

ok single line: '26234407696'

Test #15:

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

input:

5 2 6
38174856 32768 167936008 134381576 134267016

output:

6079562152

result:

ok single line: '6079562152'

Test #16:

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

input:

5 8 3
134251648 75533316 84969482 345014282 285248644

output:

2263983688910

result:

ok single line: '2263983688910'

Test #17:

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

input:

5 4 8
354464515 335589658 268546313 268505728 69219201

output:

1452222296987

result:

ok single line: '1452222296987'

Test #18:

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

input:

5 7 3
176562432 730533888 864485648 843972864 25829376

output:

1890790093744

result:

ok single line: '1890790093744'

Test #19:

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

input:

5 1 4
12588041 823286799 268719247 7370758 291928077

output:

3590290623

result:

ok single line: '3590290623'

Test #20:

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

input:

5 1 5
575037452 889864196 369938440 903360544 349577222

output:

5368705086

result:

ok single line: '5368705086'

Subtask #3:

score: 10
Accepted

Test #21:

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

input:

10 5 3
0 0 32776 8 33587200 33587200 33554432 32768 33554432 32768

output:

8161689608

result:

ok single line: '8161689608'

Test #22:

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

input:

10 1 5
1056 5242912 71303168 71304224 1536 4194304 72353280 72353312 72351776 72352800

output:

365960864

result:

ok single line: '365960864'

Test #23:

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

input:

10 2 4
545390608 268599312 32784 268533760 268501008 98321 805306384 813858817 537067537 537002000

output:

13835665425

result:

ok single line: '13835665425'

Test #24:

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

input:

10 2 3
33554693 34603141 33689920 33685508 33558789 4329728 1184005 5243268 33554821 38801411

output:

382898655

result:

ok single line: '382898655'

Test #25:

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

input:

10 5 2
135268608 142607360 537923840 147905536 542133504 536877088 546328576 146850080 143709472 134...

output:

18167291168

result:

ok single line: '18167291168'

Test #26:

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

input:

10 7 7
135827520 135823376 134976528 134905936 135988304 660496 234512 134287424 1115216 536908800

output:

442167619214416

result:

ok single line: '442167619214416'

Test #27:

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

input:

10 1 3
8751628 57864 12928012 37938692 4696076 12747272 575014404 4433920 578996228 37988360

output:

1741684236

result:

ok single line: '1741684236'

Test #28:

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

input:

10 5 4
192938904 37758592 700450576 184820864 54797312 25297424 545391248 595592728 142614928 700580...

output:

717995534232

result:

ok single line: '717995534232'

Test #29:

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

input:

10 6 7
542459632 567773856 10584610 597853426 51514928 573867584 3350610 43231856 545473136 24526880

output:

70337404338162

result:

ok single line: '70337404338162'

Test #30:

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

input:

10 4 8
71845378 5275682 272637984 348668960 277390596 348767268 282191138 281568294 1081382 273237764

output:

1428560799526

result:

ok single line: '1428560799526'

Subtask #4:

score: 10
Accepted

Test #31:

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

input:

20 2 7
4 0 16777216 16777220 4 16777220 4 16777216 0 4 16777216 16777220 16777220 4 0 16777220 16777...

output:

822083780

result:

ok single line: '822083780'

Test #32:

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

input:

20 2 7
0 517 4128 37 37 4613 33 549 4129 4100 549 4644 548 4 1 0 4612 4 4129 4612

output:

228069

result:

ok single line: '228069'

Test #33:

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

input:

20 10 7
2097408 280 69206016 8397080 67108864 67117072 8448 77602833 10486033 77594889 75497472 7549...

output:

21920879650286361

result:

ok single line: '21920879650286361'

Test #34:

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

input:

20 7 6
402655296 134479872 393216 672008256 402915328 134613056 537790464 402786368 671352896 402655...

output:

225471794997312

result:

ok single line: '225471794997312'

Test #35:

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

input:

20 10 7
48243216 73925122 8921602 270866 180887680 210509968 213917840 8921106 48243346 73400320 209...

output:

60426495360722834

result:

ok single line: '60426495360722834'

Test #36:

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

input:

20 1 5
276837256 70018 8491946 276865698 25199496 16851384 16875787 32794 8463155 12953 276828714 25...

output:

1468658687

result:

ok single line: '1468658687'

Test #37:

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

input:

20 8 6
2144 18360336 26216769 524784 537008 25176449 17834464 8921265 9973857 8403200 9965680 536704...

output:

44034114124273

result:

ok single line: '44034114124273'

Test #38:

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

input:

20 1 7
2443080 544558872 175375192 578224592 574031376 704988880 709951576 135401296 67391440 703203...

output:

5351370712

result:

ok single line: '5351370712'

Test #39:

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

input:

20 8 7
3334417 17162757 1106181 290627840 26682496 290776192 277192981 13926785 290883221 7784337 12...

output:

1711777469425621

result:

ok single line: '1711777469425621'

Test #40:

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

input:

20 7 2
134267076 335560708 138794629 138527428 68503173 323228869 324370560 234930309 387204612 4059...

output:

63350109893

result:

ok single line: '63350109893'

Subtask #5:

score: 10
Accepted

Test #41:

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

input:

20 10 5
262144 263168 262144 262144 1024 268435456 262144 1024 262144 262144 262144 0 262144 2686986...

output:

2624010268435456

result:

ok single line: '2624010268435456'

Test #42:

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

input:

20 3 8
67175488 256 67110272 1472 67174656 256 66560 1216 67175680 67110016 67109184 67109248 671091...

output:

34461124032

result:

ok single line: '34461124032'

Test #43:

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

input:

20 3 7
526096 17310464 16777488 16777472 1792 9728 17310720 17310992 17310480 16777216 532480 1280 5...

output:

5938020208

result:

ok single line: '5938020208'

Test #44:

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

input:

20 6 3
201335554 136839940 67633930 2106114 201853700 203950860 134228234 535308 134744320 201326600...

output:

148682800942

result:

ok single line: '148682800942'

Test #45:

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

input:

20 9 5
19136528 94405196 10748424 67108884 67404309 94404673 86278224 77627981 218104401 153354257 1...

output:

442945308045917

result:

ok single line: '442945308045917'

Test #46:

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

input:

20 2 2
38404257 131072 34603265 306839809 339869889 272630112 106430465 302514561 105906336 37329321...

output:

1601832421

result:

ok single line: '1601832421'

Test #47:

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

input:

20 5 7
142610456 4138 71045120 143982624 3739706 67993616 145068146 212963342 76353560 143949902 321...

output:

3579284658046

result:

ok single line: '3579284658046'

Test #48:

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

input:

20 6 8
58890753 8425505 60596512 50790400 51251713 8524065 25532928 33995264 9443361 26915328 441120...

output:

15935127665441

result:

ok single line: '15935127665441'

Test #49:

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

input:

20 9 7
537407264 300458 536907424 42506880 546093448 579614978 537397120 9208704 579341730 545794440...

output:

23389555042221998

result:

ok single line: '23389555042221998'

Test #50:

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

input:

20 9 6
608174614 103293048 820781076 15483507 73400863 552100357 813973575 382222947 638066707 61947...

output:

8813158000785023

result:

ok single line: '8813158000785023'

Subtask #6:

score: 10
Accepted

Test #51:

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

input:

500 3 6
536879104 536879104 536879104 8 8200 8192 536879104 8 536870920 8192 536879112 536879104 536...

output:

116502767304

result:

ok single line: '116502767304'

Test #52:

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

input:

500 3 8
6664 4609 6656 6664 2568 6657 2056 2568 521 6144 6664 2569 2057 6656 6656 4617 4617 6664 460...

output:

3414537

result:

ok single line: '3414537'

Test #53:

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

input:

500 7 3
17833984 29427968 4270080 4202496 4270080 1124608 17834240 5310464 29433856 13631744 2202009...

output:

66672621824

result:

ok single line: '66672621824'

Test #54:

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

input:

500 8 7
151060608 152089600 553648128 152088704 9512064 679515136 25244800 537952384 563150976 68063...

output:

4020457579590784

result:

ok single line: '4020457579590784'

Test #55:

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

input:

500 6 4
12583936 149423104 147330048 142609408 31464448 29365248 17305600 165679104 19402752 2936012...

output:

680918522880

result:

ok single line: '680918522880'

Test #56:

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

input:

500 4 4
67815680 201328640 526336 67797248 3147840 203604288 136497472 136839168 68845632 201885952 ...

output:

52596296000

result:

ok single line: '52596296000'

Test #57:

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

input:

500 10 7
950019089 943729696 538970225 473966640 505416722 35678227 343944274 245375011 247483409 71...

output:

279024329574252147

result:

ok single line: '279024329574252147'

Test #58:

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

input:

500 5 3
62670297 19404992 44587009 62417041 45091160 9177296 28339521 19666133 19151872 20715792 516...

output:

15229485021

result:

ok single line: '15229485021'

Test #59:

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

input:

500 7 6
35432736 134711721 135275112 40743577 139854457 37433769 173441561 136458808 175966896 58027...

output:

49269423733753

result:

ok single line: '49269423733753'

Test #60:

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

input:

500 4 7
889487457 806661235 268708368 17884695 2562 353403510 822124544 805584917 604031603 35233179...

output:

2138859433975

result:

ok single line: '2138859433975'

Subtask #7:

score: 10
Accepted

Test #61:

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

input:

5000 4 6
268435456 0 64 268435520 268435520 66 268435458 268435520 66 2 64 268435456 268435456 64 64...

output:

348160872034

result:

ok single line: '348160872034'

Test #62:

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

input:

5000 5 4
16843840 16843840 16786432 65600 1024 9280 66560 73792 16777280 66560 1088 64 65536 1678643...

output:

17273267264

result:

ok single line: '17273267264'

Test #63:

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

input:

5000 8 4
17825921 17039360 134217729 152313856 151265280 17891456 1310848 18161793 150994944 1710502...

output:

9986496602241

result:

ok single line: '9986496602241'

Test #64:

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

input:

5000 7 2
201334833 536936481 604315648 536936480 746651680 327729 545259536 8388608 8388608 53719862...

output:

96344553649

result:

ok single line: '96344553649'

Test #65:

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

input:

5000 10 4
18885206 4202640 20974160 543170758 2097878 553650326 555755654 16779474 553656404 5536503...

output:

587150707927766

result:

ok single line: '587150707927766'

Test #66:

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

input:

5000 3 4
17859956 554107396 17073668 1229604 16926497 19072580 17269312 16795221 556073508 540427524...

output:

36204699509

result:

ok single line: '36204699509'

Test #67:

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

input:

5000 6 4
10668192 78022318 69469244 69225114 75762238 2411686 75793546 78023326 2277428 75809840 134...

output:

319655243454

result:

ok single line: '319655243454'

Test #68:

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

input:

5000 8 7
8676225 335561061 270803296 8680375 77877296 77594902 77882086 268718708 343953904 67121845...

output:

1996476841260023

result:

ok single line: '1996476841260023'

Test #69:

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

input:

5000 9 3
286851378 17517184 268522276 16916502 269109504 353446576 269041722 353446668 354027806 337...

output:

6970549469182

result:

ok single line: '6970549469182'

Test #70:

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

input:

5000 3 5
74490019 337648263 22291074 90486788 17872896 352364704 292554758 354685092 289415811 70529...

output:

45097155567

result:

ok single line: '45097155567'

Subtask #8:

score: 10
Accepted

Test #71:

score: 10
Accepted
time: 15ms
memory: 5200kb

input:

200000 1 2
136 524288 524296 524416 136 128 524288 128 136 0 136 136 136 0 128 0 524424 0 524416 524...

output:

1573272

result:

ok single line: '1573272'

Test #72:

score: 0
Accepted
time: 17ms
memory: 5200kb

input:

200000 1 3
67108865 16777217 21037056 65537 20971521 1 16842753 16842753 67108865 83951617 65536 209...

output:

264437763

result:

ok single line: '264437763'

Test #73:

score: 0
Accepted
time: 20ms
memory: 5196kb

input:

200000 1 3
134418440 402788392 402718760 196664 135216 134217752 40 402853912 134807608 725000 40285...

output:

1479225528

result:

ok single line: '1479225528'

Test #74:

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

input:

200000 1 2
536871951 33794 537001993 671252488 537001990 131080 134217738 132103 134251523 671089675...

output:

2013760543

result:

ok single line: '2013760543'

Test #75:

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

input:

200000 1 3
796800 2762752 2100640 2229408 158880 2384896 2508960 2884640 3032480 2124192 2386304 402...

output:

11501536

result:

ok single line: '11501536'

Test #76:

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

input:

200000 1 2
940310800 805315088 139207268 805306416 939786292 675807568 134750244 138674964 809771636...

output:

2027710460

result:

ok single line: '2027710460'

Test #77:

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

input:

200000 1 2
538002688 22016 271872 538001984 2115392 572600384 571487552 36964096 16384 572588864 540...

output:

1719664576

result:

ok single line: '1719664576'

Test #78:

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

input:

200000 1 2
878103600 939967672 618053656 2411824 811994168 939689072 550817248 548456904 149340288 8...

output:

2113921016

result:

ok single line: '2113921016'

Test #79:

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

input:

200000 1 5
718277636 540311600 947126292 849710084 584420392 820347908 854656016 570426372 14943272 ...

output:

5368692028

result:

ok single line: '5368692028'

Test #80:

score: 0
Accepted
time: 27ms
memory: 5196kb

input:

200000 1 5
845562150 71840768 811598720 342492322 644228646 70140706 604387204 839398404 541746722 1...

output:

5368709054

result:

ok single line: '5368709054'

Subtask #9:

score: 10
Accepted

Test #81:

score: 10
Accepted
time: 22ms
memory: 5196kb

input:

200000 6 7
67108864 536870912 71303168 67108864 608174080 541065216 67108864 608174080 536870912 536...

output:

71551676317696

result:

ok single line: '71551676317696'

Test #82:

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

input:

200000 1 3
134807552 134746112 0 138940416 134808576 4194304 134217728 65536 529408 138478592 139006...

output:

417020928

result:

ok single line: '417020928'

Test #83:

score: 0
Accepted
time: 24ms
memory: 5200kb

input:

200000 1 5
33088 276824424 32888 268468560 268435768 276856848 8388880 268435560 268468288 33056 268...

output:

1384286200

result:

ok single line: '1384286200'

Test #84:

score: 0
Accepted
time: 20ms
memory: 5196kb

input:

200000 10 8
85004936 8388616 95945344 19988616 87625736 67179144 87036544 78709376 26738696 93913600...

output:

103095304147505800

result:

ok single line: '103095304147505800'

Test #85:

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

input:

200000 7 5
538970177 807403592 2105346 543199304 2099265 536883272 6297673 538980360 536883275 53900...

output:

63409823398863

result:

ok single line: '63409823398863'

Test #86:

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

input:

200000 1 4
538249216 1114634 303368448 302056203 268698368 839977729 327946 1377032 269551624 2819 3...

output:

4199886639

result:

ok single line: '4199886639'

Test #87:

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

input:

200000 4 7
369132098 369132592 101191270 343966362 369624602 109088380 42500230 268994662 335545360 ...

output:

907714494206

result:

ok single line: '907714494206'

Test #88:

score: 0
Accepted
time: 23ms
memory: 5196kb

input:

200000 4 8
440602628 303178244 674767104 438903040 3879686 287846916 321003522 274866182 274801412 8...

output:

4087659328262

result:

ok single line: '4087659328262'

Test #89:

score: 0
Accepted
time: 23ms
memory: 5196kb

input:

200000 2 6
559466891 21078031 5859468 5810311 542729250 18735 4827151 559505734 22079553 536871183 5...

output:

20166082559

result:

ok single line: '20166082559'

Test #90:

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

input:

200000 4 2
721760326 957367302 688211024 655619152 143672338 555188240 369136640 914403392 218562560...

output:

16106124662

result:

ok single line: '16106124662'

Subtask #10:

score: 10
Accepted

Test #91:

score: 10
Accepted
time: 15ms
memory: 5200kb

input:

200000 7 2
4 67108864 4 67108868 1 1 67108869 0 67108869 67108868 67108864 1 67108864 67108868 67108...

output:

8657044101

result:

ok single line: '8657044101'

Test #92:

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

input:

200000 10 5
268501120 553648130 268435456 285212800 16777346 536936450 805306496 822149250 805372034...

output:

8028801269596914

result:

ok single line: '8028801269596914'

Test #93:

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

input:

200000 7 6
570950536 34078976 67113352 603984000 34083200 67634048 537400200 264 603984256 537395720...

output:

178616942821256

result:

ok single line: '178616942821256'

Test #94:

score: 0
Accepted
time: 23ms
memory: 5196kb

input:

200000 2 6
1581056 33579296 1573156 102261028 1589540 100679684 67657728 101187584 35135780 67649572...

output:

3749570980

result:

ok single line: '3749570980'

Test #95:

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

input:

200000 9 7
16416 537395712 16785952 557896224 20971552 541606432 537088 17314304 20980256 536899616 ...

output:

22534613012969184

result:

ok single line: '22534613012969184'

Test #96:

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

input:

200000 9 2
32505858 697438224 17858560 685785088 756027408 136500226 676463618 84939792 211980288 62...

output:

394834670610

result:

ok single line: '394834670610'

Test #97:

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

input:

200000 7 2
539099673 537086483 150077961 101842961 713050138 106971137 570492931 706805770 780157441...

output:

100931162011

result:

ok single line: '100931162011'

Test #98:

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

input:

200000 1 4
673260672 545996800 680215680 679698560 950666240 447881216 436805632 144851072 540672000...

output:

4211078784

result:

ok single line: '4211078784'

Test #99:

score: 0
Accepted
time: 24ms
memory: 5192kb

input:

200000 5 3
307822885 852542780 839925788 306742272 35767337 547898652 548455684 303661113 537411601 ...

output:

208289133951

result:

ok single line: '208289133951'

Test #100:

score: 0
Accepted
time: 17ms
memory: 5200kb

input:

200000 10 4
72100161 269574208 811436225 273245440 609796440 609347800 72444048 272687313 542402625 ...

output:

921248965979609

result:

ok single line: '921248965979609'

Extra Test:

score: 0
Extra Test Passed