QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#536062#8628. 最大连续和strcmp100 ✓664ms25268kbC++142.4kb2024-08-28 18:09:592024-08-28 18:10:01

Judging History

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

  • [2024-08-28 18:10:01]
  • 评测
  • 测评结果:100
  • 用时:664ms
  • 内存:25268kb
  • [2024-08-28 18:09:59]
  • 提交

answer

#include <bits/stdc++.h>
#define X first
#define Y second
#define rep(i, a, b) for(int i = a; i <= b; i++)
#define pb push_back
using namespace std;
using ld = long double;
typedef long long int ll;
using pii = pair<int, int>;
constexpr int maxn = 4e5 + 10, B = 233, mod = 1e9 + 7;
const ll inf = 1145141919810520131L;
int n, m, p = 0, L = 1, R = 0; ll a[maxn], b[maxn], c[maxn], d[maxn];
struct Node { int cnt; ll mx, sum; Node() { mx = -inf, sum = cnt = 0; } } t[maxn];
#define ls(x) (x << 1)
#define rs(x) (x << 1 | 1)
#define mx(x) (t[x].mx)
#define cnt(x) (t[x].cnt)
#define sum(x) (t[x].sum)
#define mid (l + r >> 1)
inline void up(int x) { 
	mx(x) = max(mx(ls(x)), mx(rs(x)));
	cnt(x) = cnt(ls(x)) + cnt(rs(x)); sum(x) = sum(ls(x)) + sum(rs(x));
}
void mdf(int l, int r, int v, int w, int x) {
	if (l == r) return cnt(x) += w, sum(x) += c[l] * w, mx(x) = (cnt(x) ? c[l] : -inf), void();
	v <= mid ? mdf(l, mid, v, w, ls(x)) : mdf(mid + 1, r, v, w, rs(x)); up(x);
}
ll qry(int l, int r, int s, int x) {
	if (l == r) {
		int pl = s + 1, pr = min(m, s + cnt(x)), u = s;
		if (pl <= pr) u = lower_bound(b + pl, b + pr + 1, c[l], greater<ll>()) - b - 1;
		//cout << l << " " << r << " " << L << " " << R << " " << u << " " << b[u] << " " << c[l] << " " << s << " " << d[u] + (ll)(s + cnt(x) - u) * c[l] << "\n";
		return d[u] + (ll)(s + cnt(x) - u) * c[l];
	}
	return s + cnt(ls(x)) <= m && mx(ls(x)) < b[s + cnt(ls(x))] ? qry(mid + 1, r, s + cnt(ls(x)), rs(x)) : qry(l, mid, s, ls(x)) + sum(rs(x));
}
ll solve(int l, int r, int pl, int pr) {
	if (l > r) return -inf;
	while (R < max(mid, pl) - 1) mdf(1, p, a[++R], 1, 1);
	while (L > mid) mdf(1, p, a[--L], 1, 1);
	while (R > max(mid, pl) - 1) mdf(1, p, a[R--], -1, 1);
	while (L < mid) mdf(1, p, a[L++], -1, 1);
	ll ans = -inf; int u = 0;
	while (R < pr) {
		mdf(1, p, a[++R], 1, 1);
		ll w = qry(1, p, 0, 1);
		if (w > ans) ans = w, u = R;
	}
	return max({ ans, solve(l, mid - 1, pl, u), solve(mid + 1, r, u, pr) });
}
int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), c[++p] = a[i];
	for (int i = 1; i <= m; i++) scanf("%lld", &b[i]);
	sort(b + 1, b + m + 1, greater<ll>());
	for (int i = 1; i <= m; i++) d[i] = d[i - 1] + b[i];
	sort(c + 1, c + p + 1), p = unique(c + 1, c + p + 1) - c - 1;
	for (int i = 1; i <= n; i++) a[i] = lower_bound(c + 1, c + p + 1, a[i]) - c;
	printf("%lld\n", solve(1, n, 1, n));
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 20
Accepted

Test #1:

score: 20
Accepted
time: 2ms
memory: 20500kb

input:

497 404
917535854 939575385 985070918 788445476 990228874 890712076 973415095 975904486 794872088 958037942 894373426 975435251 821587328 898697908 848044776 985486749 977595334 985578214 961966222 967928299 846072308 998679302 989797646 987698522 755351683 893841487 986707387 832412612 973338351 92...

output:

483851132608

result:

ok 1 number(s): "483851132608"

Test #2:

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

input:

496 13
975537796 867824005 731905698 995044734 980663118 979671628 948113905 961691035 916377605 973634815 963676914 968266658 845279779 967647040 977551474 953069751 898164359 800993445 967373577 926295172 961939352 971469513 966783255 983637364 942997390 909279266 924009236 991590090 999500351 997...

output:

464615676533

result:

ok 1 number(s): "464615676533"

Test #3:

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

input:

494 199
926827016 952344126 978952774 984160671 764453527 987217588 966884035 829168774 892004441 970379925 925734206 998053653 983696512 931554802 998190181 975325858 956456983 952308401 845098341 900126151 893590537 890004652 961645284 920444541 812442265 884028508 876051681 993154406 984329290 99...

output:

463658462826

result:

ok 1 number(s): "463658462826"

Test #4:

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

input:

496 435
975646956 814674762 933529180 904994688 992678370 946706784 839906774 902317711 845422273 972194139 813046404 976785034 926131373 974302545 966840750 924436144 999089868 920682206 984450286 892340175 836194192 986242403 984116213 957559067 968849870 990168285 992136115 901729940 991291097 92...

output:

463114056080

result:

ok 1 number(s): "463114056080"

Test #5:

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

input:

497 489
898057732 989350547 954829689 790197266 859303628 983031071 956944099 939660671 949124411 946421616 976130798 981356584 915782576 979122086 904840012 980931407 999980689 967703811 841746659 908116108 923941319 940951715 845271665 973944748 977355661 979677029 882851568 989147339 892312893 99...

output:

468369265315

result:

ok 1 number(s): "468369265315"

Test #6:

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

input:

496 272
726660517 988027147 641363792 893562116 549283098 782136280 899598073 596901908 739451367 873639418 552800606 703209382 900348150 994027130 724992439 912230131 973506276 724878823 952223459 873259274 972970499 404285830 905899171 820178381 955212498 445875007 700057246 902325804 639224576 63...

output:

458091940524

result:

ok 1 number(s): "458091940524"

Test #7:

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

input:

490 223
439120519 836751136 983682873 964431861 636949330 689735411 385164421 987116695 938125692 722862070 205619236 867761402 842681679 767751623 964270927 770725068 517405838 856820462 951312608 819473134 992226812 643047101 967409521 941853731 632454709 695808935 911367302 981984788 916120947 76...

output:

426229223625

result:

ok 1 number(s): "426229223625"

Test #8:

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

input:

481 132
835595156 681662205 991389219 964689424 984331285 622719180 643002953 861572373 452059382 959871719 526907681 510233909 996061844 915035116 861927997 960409110 972413672 820764693 891367410 980338714 887679775 696912724 145341355 863681485 857026243 928884034 571306267 893026670 821828400 72...

output:

407092001521

result:

ok 1 number(s): "407092001521"

Test #9:

score: 20
Accepted
time: 4ms
memory: 20032kb

input:

495 396
792108807 988116882 993430688 646570027 744353493 939746552 764749385 850820381 912542822 905528475 602526359 792011347 719629521 970537265 857896451 731783358 813613412 592113897 916099093 996240514 834276312 845805166 951874573 658126641 851091218 872259565 870073547 776430057 425576801 95...

output:

408031495738

result:

ok 1 number(s): "408031495738"

Test #10:

score: 20
Accepted
time: 4ms
memory: 19328kb

input:

461 247
391372183 695346715 991402090 902646167 775594916 896725173 757297041 646856690 994028068 828803678 910322516 965710977 941604590 886440221 957935863 761236333 669009487 995655163 871361848 977615683 796633010 976776285 816265478 864414212 819773056 388783099 780222345 887743482 857535582 95...

output:

368869407315

result:

ok 1 number(s): "368869407315"

Test #11:

score: 20
Accepted
time: 2ms
memory: 19924kb

input:

487 334
996281271 862464604 622744320 814499773 754628021 851460680 918694626 39285382 650964328 831886931 929713122 578688377 924893457 842180700 748582354 941122642 550959196 750369461 865176891 531329055 557571901 812575496 658603095 337458635 820011582 824870862 586941807 472406148 820075350 864...

output:

453838728864

result:

ok 1 number(s): "453838728864"

Test #12:

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

input:

493 72
907831353 571218453 435958224 943107973 557600940 927246770 880201908 101455028 740762214 814956609 468651801 630674133 575848868 -116604518 628657047 915488065 831931284 787078668 983078731 300536627 721552796 952014617 432770864 165812699 998937307 966960444 915191314 941801284 719412168 77...

output:

355272500499

result:

ok 1 number(s): "355272500499"

Test #13:

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

input:

496 255
998713362 180066866 934188786 786211914 887099152 768935168 928203690 589812295 426156018 292836387 -467893109 447047134 316891941 18356045 -45277721 473671229 987123183 946497643 106990737 -75033507 519450404 928327604 658416390 887127703 -296029611 126420130 946877185 230361952 681073211 1...

output:

312356286990

result:

ok 1 number(s): "312356286990"

Test #14:

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

input:

479 236
-313122148 -426574095 674458385 604324937 591256414 560462865 -621113053 516353462 828266938 -582302937 907236038 954900038 962966676 -215448454 85560851 376227000 -192784574 942773596 -516410153 44326228 237427256 81122647 611042704 986071460 748795250 858284392 716087257 564632850 99167608...

output:

180319805621

result:

ok 1 number(s): "180319805621"

Test #15:

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

input:

457 231
306159981 697396736 877656289 776668303 -240030450 624990360 142298458 764210618 820932501 853942279 626019848 961200573 517128714 394862481 207231691 998003063 487733250 571427117 831892676 655665372 850639673 346775450 411747592 643104720 127294795 934342584 -58923091 402324981 987575927 9...

output:

276008599754

result:

ok 1 number(s): "276008599754"

Test #16:

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

input:

496 6
-933688337 38619567 118597697 125121684 -708544757 -663304796 -889641463 320428847 315063502 -999749701 -988894490 -673635545 -831159616 -654935670 222099837 173112793 180560458 389171870 -281457718 -919789933 -632124252 443134587 -798537127 -586929942 -922568428 -803390902 -159804784 -5091063...

output:

8262243011

result:

ok 1 number(s): "8262243011"

Test #17:

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

input:

500 168
-650635678 -850850912 -708800712 -285715966 -711195026 -827269654 -672629771 -706637171 -478130086 -740787488 -310431832 -432550205 -887070947 -788652522 -361220625 -488343691 -231945683 -959450880 -452805056 -893514879 51974114 -2384377 -954629320 -624401795 -946080197 443751543 -364024858 ...

output:

116216458334

result:

ok 1 number(s): "116216458334"

Test #18:

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

input:

477 214
-719990948 -669486096 -756533330 -1655250 -811273933 -850987570 -358027378 -852733569 -436580218 -759427203 -763207772 -870791180 -520377039 -860253103 -649625851 -876796170 -788443639 -688204863 -607707866 443861344 -246028680 -904089187 -761268066 -784526445 -935139850 -649937306 -99329569...

output:

20387620616

result:

ok 1 number(s): "20387620616"

Test #19:

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

input:

495 26
-898758488 -412437944 -506327126 -88683121 -895477751 -902081002 -940819018 8208920 -810397811 -922405042 -939550091 -936409427 -537998390 -314752672 -619473213 -934541312 -910086480 -287606446 -687470794 -292673023 -494139923 -712542161 -697857233 -792835541 -443206745 -864178619 -856223497 ...

output:

702738541

result:

ok 1 number(s): "702738541"

Test #20:

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

input:

496 86
-784392819 -413361783 -959542957 -759228646 -467712077 -115772347 -929891936 -386870348 -506823714 -906750776 -915372779 -752463256 -119629587 -895299124 -880284517 -537927390 -902117310 -684347435 -749515914 -815583179 31243673 -283874921 -49062903 -891291906 93099457 -920002198 -947366831 -...

output:

805086346

result:

ok 1 number(s): "805086346"

Test #21:

score: 20
Accepted
time: 4ms
memory: 20232kb

input:

486 484
-895424149 -918033993 -803885890 -797415008 -855236287 -846264011 -904538470 -900153042 -822640990 -866356034 -952067144 -893444302 -889418808 -839585251 -987356464 -730401344 -895427431 -737358162 -685475821 -508041967 -751675055 -559236420 -858149297 -991549117 -518756667 -898234311 -98592...

output:

435314825228

result:

ok 1 number(s): "435314825228"

Test #22:

score: 20
Accepted
time: 2ms
memory: 20484kb

input:

488 246
-313311000 -960231854 -812666552 -330842050 -535931879 -985388614 -794860137 -979990915 -635093776 -973855770 -831598293 -803751405 -423513613 -839407265 -317219399 -996878400 -906555179 -974381660 -914824152 -742863055 -800370245 -974597766 -726845366 -882142483 -934489842 -656133651 -80767...

output:

179230944009

result:

ok 1 number(s): "179230944009"

Test #23:

score: 20
Accepted
time: 4ms
memory: 21440kb

input:

496 459
-939255344 -926912303 -642418223 -667809425 -891920612 -781225664 -927164548 -561068134 -885783023 -702008889 -976803004 -924212478 -413435691 -762521751 -253808291 -982156287 -898921992 -921290091 -921942779 -863488654 -946353135 -956814042 -533299333 -816545326 -662247210 -981131156 -99282...

output:

34951943968

result:

ok 1 number(s): "34951943968"

Test #24:

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

input:

500 302
-493431618 -677323871 -924687063 -483182864 -871510109 -580361880 -801555458 -638077584 -738789285 -842145891 -990865398 -856752584 -67677016 -753626370 -697998062 -896773173 -914560089 -926742893 -556129066 -951488633 -906646248 -534674026 -651039816 -733016632 -665629691 -394501083 -838765...

output:

1549585910

result:

ok 1 number(s): "1549585910"

Test #25:

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

input:

500 468
-999452671 -956377240 -841520046 -667304682 -913912446 -875365463 -955946457 -966723472 -697574514 -600951169 -234845656 -985026539 -103070463 -962259855 -731507799 -762798845 -675316894 -832704913 -828275582 -679716323 -975959471 -915642013 -601410260 -915472981 -763923828 -556913779 -90629...

output:

221022788

result:

ok 1 number(s): "221022788"

Test #26:

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

input:

493 127
-997302663 -949411198 -994016331 -987048681 -620565350 -961290066 -942675276 -782668341 -972247629 -971446966 -940214148 -981116023 -830414015 -986934780 -995700692 -811130304 -943099505 -938379807 -920959816 -988076696 -936985688 -856818232 -914481193 -966318221 -987747949 -948884288 -89160...

output:

116693689661

result:

ok 1 number(s): "116693689661"

Test #27:

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

input:

496 279
-921839635 -915247468 -607973702 -992986261 -826114315 -996323348 -950182550 -883207866 -994434247 -947141846 -921853305 -794879448 -982658561 -861115701 -988641608 -968041800 -896821480 -688277817 -978019293 -919460766 -947908059 -995766620 -949297203 -961777011 -972441046 -981479046 -91652...

output:

206139221719

result:

ok 1 number(s): "206139221719"

Test #28:

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

input:

497 94
-928741134 -971913060 -944774187 -888318981 -975672453 -857960653 -989514979 -934185109 -994942497 -820096443 -905465743 -990548185 -904460759 -888051312 -940880854 -981230832 -983000129 -943873695 -976872665 -902903242 -902581305 -731368746 -995869282 -951028626 -918065732 -990048310 -978589...

output:

5261762361

result:

ok 1 number(s): "5261762361"

Test #29:

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

input:

487 275
-991622382 -790342891 -928212953 -983040443 -957020484 -993204686 -821911262 -792638057 -929896026 -974789633 -777415316 -971098472 -950400651 -900881890 -977133576 -950827424 -907828247 -931934256 -955715664 -909712328 -857655212 -813667729 -990215131 -836879859 -953821640 -971616583 -75119...

output:

350460202

result:

ok 1 number(s): "350460202"

Test #30:

score: 20
Accepted
time: 3ms
memory: 21332kb

input:

496 161
-918172379 -994898747 -891843540 -986244396 -985677374 -897455184 -996575291 -730665069 -768125341 -990407257 -979552537 -994481326 -974132598 -809583016 -996637728 -903188406 -907873331 -958378099 -995795233 -983031481 -964145102 -992507094 -923042393 -649322772 -857803430 -929138772 -86168...

output:

-502000194

result:

ok 1 number(s): "-502000194"

Test #31:

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

input:

500 500
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -100...

output:

500000000000

result:

ok 1 number(s): "500000000000"

Test #32:

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

input:

500 0
-705868120 437944801 -994664067 -945123199 235636099 -580472208 301040695 849655790 -28866864 669222862 -329010858 620645775 -746647813 379130864 299907933 -140797390 -373540198 172740593 531140065 -793928319 73759090 869528397 801867581 -329154244 245008607 863877142 904027120 -875163747 7238...

output:

25685887295

result:

ok 1 number(s): "25685887295"

Test #33:

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

input:

106 500
-973296305 -991270071 -999777741 -945419919 -921696259 -982669544 -992045606 -981404943 -984753830 -880902613 -967549531 -971988671 -991259570 -997515081 -995674660 -999679388 -993723521 -984057435 -999387958 -999382496 -987396940 -992111297 -994335472 -993575210 -997674041 -987019963 -97904...

output:

105728405567

result:

ok 1 number(s): "105728405567"

Test #34:

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

input:

78 500
-979003243 -783182055 -797906251 -791612407 -707996068 -980039454 -674883344 -898500732 -785918263 232920289 -782302693 -875333230 -534949572 -971893158 -368945772 -900477684 -530952239 -125000175 -480788471 -807687824 -951814036 -974306406 -901065420 -696566877 -615952020 -680152514 -8357593...

output:

74585672077

result:

ok 1 number(s): "74585672077"

Test #35:

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

input:

379 500
81445644 978254865 -83001343 407942121 872382989 296007807 948950287 607967134 887745502 978081016 668949034 -244895071 747137177 753977515 981953535 369793121 566921076 458860912 673489527 249588863 299250886 529302875 476309668 129175311 386968100 212213275 -77401903 619011822 610248010 88...

output:

360900628422

result:

ok 1 number(s): "360900628422"

Subtask #2:

score: 30
Accepted

Dependency #1:

100%
Accepted

Test #36:

score: 30
Accepted
time: 3ms
memory: 20364kb

input:

1967 481
960158889 986941651 946048616 999722353 921474155 980060696 990075278 917433264 913442510 869984420 911613313 780063576 991137069 942018535 987522854 919724378 909450946 986733135 938211578 989518379 987125164 969066537 803288983 781749396 977165586 914760637 978951785 786564842 940128815 9...

output:

1878963439313

result:

ok 1 number(s): "1878963439313"

Test #37:

score: 30
Accepted
time: 8ms
memory: 20944kb

input:

1998 68
980110773 990384396 931811504 985022248 834438376 999189833 967932077 999889061 976913472 998168028 997848728 959733348 998637891 999727117 968721849 951286061 905085594 831095342 750833717 955138834 973793842 878673458 918325168 934873899 958905417 825992012 992712112 912263795 840239685 99...

output:

1876011817844

result:

ok 1 number(s): "1876011817844"

Test #38:

score: 30
Accepted
time: 2ms
memory: 19816kb

input:

1994 1447
982755043 944751805 940206958 925141492 970211760 915881871 973619608 979349148 958140592 762488176 962909441 864210002 830605876 926019545 996835310 995100204 951066285 997381009 943309263 909553127 937030925 929812837 941225934 773930341 919231065 974618611 918895875 908287213 926652444 ...

output:

1892100071205

result:

ok 1 number(s): "1892100071205"

Test #39:

score: 30
Accepted
time: 4ms
memory: 20484kb

input:

1998 203
996230183 956543040 999518630 872218479 942197165 989084992 987042361 967162304 996679678 996109808 997450715 927513067 833971473 958567818 849238315 969558276 906711069 981743572 940332901 958882708 990109151 981515760 933945700 968374907 980095501 947358993 988296996 982431426 973745078 8...

output:

1876947189120

result:

ok 1 number(s): "1876947189120"

Test #40:

score: 30
Accepted
time: 4ms
memory: 21552kb

input:

1998 1475
965419675 938591734 981831723 907212420 903107043 994705261 950080097 967059888 999311953 996994018 997168770 979404125 945729584 999379019 928984424 972033440 984819879 997850473 799919147 900448166 855363709 984270050 964225291 967417776 955835275 832730645 929072582 949669915 965698566 ...

output:

1871226174895

result:

ok 1 number(s): "1871226174895"

Test #41:

score: 30
Accepted
time: 4ms
memory: 19820kb

input:

1962 1144
842548725 827282677 847832652 715791992 112614192 485046978 945773454 60989372 614242743 945831111 634309634 651604907 706418615 873794708 355711197 695844362 389024808 971621173 686041503 940117821 902546976 806242090 739175594 679504481 589485016 611650073 933953671 891576974 822827170 4...

output:

1804805516201

result:

ok 1 number(s): "1804805516201"

Test #42:

score: 30
Accepted
time: 4ms
memory: 19848kb

input:

1993 944
993261394 598376143 959216364 893666909 913852934 976931878 690756676 823049592 912249025 743271270 864330022 559238557 358779428 595964939 725902010 869455193 833426766 643685902 523047066 945897902 814125892 774244113 896278994 932905503 131290426 898696000 412637085 728936925 345956680 7...

output:

1670812413609

result:

ok 1 number(s): "1670812413609"

Test #43:

score: 30
Accepted
time: 4ms
memory: 19700kb

input:

1990 1524
867422753 985863693 914226166 930736108 590306279 876256621 799378541 501518190 871383427 903580361 978938201 993336845 865074482 931357991 969046166 970794838 700407755 691095973 999737354 990234982 894623532 916926453 631942801 817638026 987796137 901082374 886493500 867747306 909137856 ...

output:

1644255417664

result:

ok 1 number(s): "1644255417664"

Test #44:

score: 30
Accepted
time: 8ms
memory: 20204kb

input:

1990 1814
884308096 428336395 809952056 988424697 968926806 531693306 804652877 996609936 628832580 756634761 948049502 776388942 891543380 670578485 694810908 618499966 880317657 790908603 898536488 916506346 681111642 743660354 181619630 929311587 694688217 902127580 970327269 828665064 845661937 ...

output:

1615363911472

result:

ok 1 number(s): "1615363911472"

Test #45:

score: 30
Accepted
time: 4ms
memory: 21048kb

input:

1999 643
612475887 910066440 572930568 745481768 888345747 937310737 549535515 892907022 498074183 966597557 419177212 845578771 953301653 978769410 723489919 935499105 699092055 898555711 882561710 808463737 855033221 941298957 914024309 768523668 820754903 925347007 923929056 912228451 986356619 8...

output:

1668088236213

result:

ok 1 number(s): "1668088236213"

Test #46:

score: 30
Accepted
time: 4ms
memory: 19784kb

input:

1990 848
277718378 698756806 808094068 842827032 811883240 469520094 558528948 747769870 881449402 872970156 739279494 960631656 853053706 850130305 599125838 852939527 834773352 819725882 603456375 397985036 277293171 450987742 819001202 846987967 977069016 450929207 874507240 950999831 983181555 9...

output:

1785792859364

result:

ok 1 number(s): "1785792859364"

Test #47:

score: 30
Accepted
time: 4ms
memory: 21136kb

input:

2000 1046
737138364 685760661 584040104 525506876 753688938 259787156 768500846 893340398 985392573 630259364 590568334 736933612 141358297 -350163936 876840049 735395532 493244119 924377302 662900404 616854383 878228570 986713828 900191276 847999029 698596533 479852941 854009565 807378111 872239007...

output:

1665357764010

result:

ok 1 number(s): "1665357764010"

Test #48:

score: 30
Accepted
time: 4ms
memory: 19968kb

input:

1993 414
346474939 862863806 -294092189 268392073 656495340 444579331 60896568 879799612 -694624689 627107206 910420440 908496438 729679006 447913194 -733118666 662428753 315201168 195329053 523437563 -388070214 899429417 220490088 735169078 649444308 961131717 807873079 941788594 988199229 70576820...

output:

1319139012658

result:

ok 1 number(s): "1319139012658"

Test #49:

score: 30
Accepted
time: 4ms
memory: 19512kb

input:

1985 811
-434186608 -109280817 307572083 -244859482 63637186 336209580 331309432 683786241 603996883 446492309 907608037 242030211 204081140 969701447 727635495 -159882211 508628649 56490917 782763126 263526098 488301372 803142876 -215661754 35364782 767148505 619581380 -540391486 84663043 176230644...

output:

721248122867

result:

ok 1 number(s): "721248122867"

Test #50:

score: 30
Accepted
time: 4ms
memory: 20476kb

input:

1981 72
861257128 999690615 611368574 199937368 523825525 298081621 -220186146 590601516 468161289 -171899546 713181450 490757951 830283943 225984256 396857396 -220160944 399438502 544358979 749637347 188683605 717328124 248235904 31486272 29138321 579549183 545414202 821568737 810175041 -219796022 ...

output:

978280843795

result:

ok 1 number(s): "978280843795"

Test #51:

score: 30
Accepted
time: 4ms
memory: 20792kb

input:

1967 414
836965195 364096046 -727892857 630511541 854456911 189795648 723481760 -799365017 179852594 438242319 -907891877 190060178 -195662209 -374450327 374163652 -428696329 -510212123 -869247039 878000902 293917527 -240772514 657415415 -701811534 -599418955 116069837 806442407 421652486 -839709585...

output:

682063918460

result:

ok 1 number(s): "682063918460"

Test #52:

score: 30
Accepted
time: 8ms
memory: 20976kb

input:

1999 485
-247715268 -430131435 -29198496 -919963084 -445632238 -804340162 -733547158 -629490999 -515885607 -692381125 -963351274 152356387 -902211270 -469879401 -130853165 -937438382 -212937045 -998651459 -403350151 -560204441 -723711951 -810729248 -715137009 -901219352 -403833305 -799718550 -985090...

output:

305168246498

result:

ok 1 number(s): "305168246498"

Test #53:

score: 30
Accepted
time: 8ms
memory: 21336kb

input:

1999 1218
-942917756 -316092372 -334791608 -493735909 -153317245 -142208832 -476714117 -870488879 -987913544 -273634916 -517506553 -702448815 -835556773 -362568548 -601563598 -847572843 -629084274 -318641059 -949818880 -910197603 -904727741 -971767448 -702400627 -844005675 -755725074 -958233769 -903...

output:

96718573963

result:

ok 1 number(s): "96718573963"

Test #54:

score: 30
Accepted
time: 8ms
memory: 20392kb

input:

1990 1486
-470045430 210053428 -714182799 -753815710 143806523 -192188051 -944989546 -618602827 -932408198 -92674394 73550900 -50143534 -502673713 477720574 -718490345 -852526022 241820263 -787421281 -947341123 -954556383 -557425487 -556544223 631239598 18865796 -260659919 -909929149 120831006 56549...

output:

20169870109

result:

ok 1 number(s): "20169870109"

Test #55:

score: 30
Accepted
time: 4ms
memory: 20292kb

input:

1992 53
649349116 -268377368 -848083538 -56468593 592860402 434472968 -440995039 689743140 621150496 572387015 -153745521 285379444 634539446 -995741373 -230065021 829764553 714312435 934685369 930196307 601847791 351366773 -659171418 900465512 -285899100 886740219 -337731504 275640829 -36525617 -76...

output:

39475104776

result:

ok 1 number(s): "39475104776"

Test #56:

score: 30
Accepted
time: 4ms
memory: 19484kb

input:

1983 571
-919722778 -690571684 -768199760 -744831768 -825506206 -614870836 -945467893 -748961408 -458322795 -401050089 -921952296 -976719227 -774079066 -725411795 -934426554 -985191787 -851290389 -569246769 -632700615 -789048528 -735859960 -474155864 -948166566 -661473704 -717327254 -759771468 -1918...

output:

524025907896

result:

ok 1 number(s): "524025907896"

Test #57:

score: 30
Accepted
time: 4ms
memory: 19968kb

input:

1999 1117
-532527395 -742137235 -898869303 -729865930 -936562431 -843495594 -966394975 -883001591 -797875109 -887017439 -986802470 -920802150 -961386699 -683186897 -667146485 -822980101 -728481916 -782537470 -995653405 -902996866 -439455441 -816753861 -317078592 -896417484 -878989738 -795846738 -748...

output:

586544605460

result:

ok 1 number(s): "586544605460"

Test #58:

score: 30
Accepted
time: 4ms
memory: 21324kb

input:

1996 1272
-410823591 -265580268 -534602652 -719855756 -506119362 -682436395 -921337475 -484917927 -208113025 -341100538 -690250769 -526951739 -969476546 -643460849 -701244702 -949222246 -669191839 -132549856 -830808707 -665706135 -943798192 -641044068 -816352944 -502631689 20516611 -913788176 -36488...

output:

670066534763

result:

ok 1 number(s): "670066534763"

Test #59:

score: 30
Accepted
time: 7ms
memory: 20064kb

input:

1982 646
-587885815 -969349130 -651269788 -698430646 -783503600 -968468079 -737412762 -996577678 -998891381 -866784619 -517415348 -902986006 -858965695 -938291052 -612359798 -966764685 -650439988 -884329858 -639854295 -547449190 -731854675 -639921717 -708370879 -946277518 -794637336 -980257949 -9330...

output:

208781251

result:

ok 1 number(s): "208781251"

Test #60:

score: 30
Accepted
time: 8ms
memory: 19988kb

input:

1976 81
-906942557 -952155477 -801077039 -769938210 -637141089 -275061912 -917580370 -480738196 -919676650 -758165874 -725306031 -766023600 -768228004 -898040811 -890212041 -897036620 -867153615 -879238015 -892994908 -845654997 -837875837 -517119292 -688681307 -206601018 -861129830 -624167097 -78529...

output:

335215306

result:

ok 1 number(s): "335215306"

Test #61:

score: 30
Accepted
time: 4ms
memory: 20516kb

input:

1999 1094
-951715848 -944024692 -999935303 -955405482 -937225548 -964346427 -954407679 -906075652 -998195073 -978947040 -963923284 -934940456 -952119618 -996344191 -962470704 -944977384 -944479127 -582890715 -913752930 -912446176 -951103299 -948828179 -964480562 -949759189 -988529742 -957299173 -963...

output:

987812599371

result:

ok 1 number(s): "987812599371"

Test #62:

score: 30
Accepted
time: 4ms
memory: 20640kb

input:

1996 1562
-880538785 -732087456 -956112262 -941656429 -980201521 -768925325 -872657137 -986586882 -917440781 -793920801 -933269032 -877160667 -948606930 -954258971 -785493673 -863578433 -982425912 -967520338 -970016038 -924717399 -992970508 -924619743 -862726159 -973310567 -957740648 -993705090 -942...

output:

1168988030619

result:

ok 1 number(s): "1168988030619"

Test #63:

score: 30
Accepted
time: 4ms
memory: 19760kb

input:

1998 177
-891127178 -948397781 -977655896 -928341381 -991806439 -929432406 -914748777 -961573301 -951933995 -748728513 -801970526 -987908743 -936535303 -811945324 -967391904 -959346504 -972168968 -990017468 -725385106 -737839618 -969354021 -951123893 -830863574 -985400397 -975321721 -963957635 -8757...

output:

48896083660

result:

ok 1 number(s): "48896083660"

Test #64:

score: 30
Accepted
time: 5ms
memory: 20536kb

input:

1994 67
-892173484 -969652336 -858299089 -948575776 -890516430 -704627881 -954872472 -939735937 -956813766 -899347751 -892140181 -883522832 -938103287 -823024693 -877232050 -872603348 -980342514 -967325144 -994818729 -991633968 -953675180 -886337453 -910170622 -899176325 -939993732 -951557378 -82159...

output:

761045593

result:

ok 1 number(s): "761045593"

Test #65:

score: 30
Accepted
time: 3ms
memory: 19624kb

input:

2000 1871
-986802933 -881489686 -946510697 -883223843 -913755720 -998257087 -462550760 -885324812 -929160799 -926365342 -903331002 -934295393 -827592518 -841192871 -916531514 -962837858 -970863253 -996908342 -935777198 -994618308 -853662106 -775175464 -967993431 -976712807 -930124182 -929985787 -950...

output:

-421853101

result:

ok 1 number(s): "-421853101"

Test #66:

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

input:

2000 2000
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1...

output:

2000000000000

result:

ok 1 number(s): "2000000000000"

Test #67:

score: 30
Accepted
time: 2ms
memory: 17556kb

input:

2000 0
421396092 -420198994 -248060140 208224561 -460473748 464826490 -293926525 -807566884 -996229071 -42049434 504586427 -15293165 170469651 -417962071 574148883 -805686447 -385430283 -429474003 -184196538 -261509772 21519584 -323991355 443223823 -912001390 -356948026 868749206 78904481 156756969 ...

output:

34126413905

result:

ok 1 number(s): "34126413905"

Test #68:

score: 30
Accepted
time: 3ms
memory: 19828kb

input:

1551 2000
-972444077 -983971207 -986752506 -967946586 -983736209 -989739676 -987346466 -990983052 -986544378 -989946229 -999597205 -994924958 -977798234 -984158869 -981064400 -999945502 -994821128 -960235120 -997299033 -994484588 -997045212 -990734141 -976646198 -995393258 -980688728 -999686924 -999...

output:

1533462008807

result:

ok 1 number(s): "1533462008807"

Test #69:

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

input:

1182 2000
-877597156 -924834448 -635220891 -986396713 -954783771 -412237439 -518437672 -683471670 -798403199 -169247323 -801738686 -711142063 -987527745 -620190178 -395668147 -195737491 -947438727 -873779661 -919872535 -746987100 -478691758 -312406840 -426188181 -537869304 -362680304 -264210724 -514...

output:

967358094462

result:

ok 1 number(s): "967358094462"

Test #70:

score: 30
Accepted
time: 3ms
memory: 20076kb

input:

1312 2000
159036736 -333565955 988852293 554082865 627198827 94139215 534202540 607837724 -336112897 -378006797 637490660 305818807 129165648 961068152 983504442 471782579 128853137 -222342656 721771813 648737724 581475208 472234254 833583658 832628113 938963497 -377532416 966658711 796397705 605024...

output:

1260852024931

result:

ok 1 number(s): "1260852024931"

Subtask #3:

score: 50
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #71:

score: 50
Accepted
time: 664ms
memory: 24592kb

input:

99983 11205
879618051 934034954 893087852 996635460 764445474 834609894 994581688 889879253 898198258 980259160 925585852 867650415 957976554 961113699 869939386 970770805 955998993 994374580 999041860 999445061 993994460 944419530 745932766 962684567 971328213 980457114 983644494 965204567 93148962...

output:

94812833196408

result:

ok 1 number(s): "94812833196408"

Test #72:

score: 50
Accepted
time: 640ms
memory: 22492kb

input:

99996 2086
910674058 983047128 901371389 981126580 982882851 965931143 989455840 901453831 970748598 985894682 974931958 967742959 977527531 925441502 859645651 922859638 944097636 984657501 955286972 908238428 971742804 998436779 965125851 986209155 913746394 874879995 978743364 988872102 965609830...

output:

94276713759116

result:

ok 1 number(s): "94276713759116"

Test #73:

score: 50
Accepted
time: 654ms
memory: 24616kb

input:

99989 25532
959301671 957798802 898393911 928563675 950171011 999753922 965307128 905908902 816926730 936003588 896738133 977436411 973407274 994413575 868584503 957486018 994714765 925143246 942517964 731504082 960288788 957576119 998596125 898946058 988573156 997484704 824243954 897749433 99464604...

output:

94005528501190

result:

ok 1 number(s): "94005528501190"

Test #74:

score: 50
Accepted
time: 656ms
memory: 24996kb

input:

99979 43169
988727728 960466216 950509990 984081200 506285082 961740013 897234557 958886280 961638968 876657387 967697338 982052191 982207817 845307114 974664689 905577002 979741218 996178442 997594217 945395520 991464686 907785898 954792407 960308489 933725946 841508834 772975352 964647473 92398648...

output:

93691611313798

result:

ok 1 number(s): "93691611313798"

Test #75:

score: 50
Accepted
time: 652ms
memory: 20176kb

input:

99982 63886
957464002 889519806 996818601 897143068 838254584 973121444 907013683 960900202 826665864 995546330 912536536 772797339 978384564 800422154 957923966 934425952 824481312 912431734 854221282 970971577 998089929 983590247 990815753 973716557 900937492 965302634 831390858 998292875 96166947...

output:

93545943838273

result:

ok 1 number(s): "93545943838273"

Test #76:

score: 50
Accepted
time: 660ms
memory: 25212kb

input:

99998 89939
693066653 770904956 72115616 911733154 822390998 921386434 736221384 992511238 986457872 881448770 540801301 989978367 715401289 828600674 968155286 933259457 815412185 749261644 976293647 209934600 926534037 952454863 803860055 849000977 636095689 477512283 582658374 824607222 812066692...

output:

95208225398665

result:

ok 1 number(s): "95208225398665"

Test #77:

score: 50
Accepted
time: 643ms
memory: 25228kb

input:

99973 1904
972086701 374963196 863488579 943309547 810484974 937928200 449420666 868177614 621551126 878068785 671858872 699643102 710781555 836907920 870636506 831580400 931004972 876028030 863051124 969421766 842870553 770561257 901740803 962813867 957979801 627918936 943970998 931734677 980940123...

output:

80904289092168

result:

ok 1 number(s): "80904289092168"

Test #78:

score: 50
Accepted
time: 639ms
memory: 20416kb

input:

99996 19390
663016760 864741743 904306846 692047173 875177754 808160454 904965448 884642038 550026513 726417349 885977516 854244031 977247751 996687792 978453789 982405252 757843280 857678441 807353649 884378856 758928807 889028850 967310797 708993198 765290716 764744348 740285774 530043513 77953355...

output:

83588301199738

result:

ok 1 number(s): "83588301199738"

Test #79:

score: 50
Accepted
time: 644ms
memory: 25244kb

input:

100000 51666
976809860 974021726 482740252 165115116 748288460 961011191 709832481 242569389 816597809 625532797 -6077022 971865531 108503021 641414871 916397145 819740573 985100128 952790807 940977706 508639628 654870138 842573650 942105640 934476760 597599693 835583215 924728987 931576642 84570500...

output:

75169036737343

result:

ok 1 number(s): "75169036737343"

Test #80:

score: 50
Accepted
time: 654ms
memory: 20036kb

input:

99990 72477
995805700 560218704 766959560 954695202 998541770 304289001 907284441 636588287 585079627 700598211 804097488 392160392 595924333 877619918 957772860 763903085 826992448 893302793 972629257 937981199 904540563 690090003 890086284 907259656 928238772 971150998 873785005 741164743 94514956...

output:

77738172740437

result:

ok 1 number(s): "77738172740437"

Test #81:

score: 50
Accepted
time: 661ms
memory: 25268kb

input:

99999 11859
592560090 521518186 388268379 678438265 392564195 761445346 649095479 960375542 599872051 845723903 842860883 798639447 798969742 676182727 349562827 170364101 936703316 401025942 965823766 973305813 220093390 842045836 985390659 584513359 473549717 993576066 773366361 718348011 89085698...

output:

76387598739788

result:

ok 1 number(s): "76387598739788"

Test #82:

score: 50
Accepted
time: 658ms
memory: 24740kb

input:

99982 16344
246192184 784397600 52249665 444783941 727324948 -151253459 784592725 775987747 852450949 -246346968 109774782 -203217448 255864737 784126695 140658313 179516021 480235224 -47330386 222461652 385716960 867319041 599890789 680958955 871163527 945713155 527023613 418460088 90675311 9433296...

output:

64731739636212

result:

ok 1 number(s): "64731739636212"

Test #83:

score: 50
Accepted
time: 663ms
memory: 20408kb

input:

99990 87144
794797694 565343924 166262358 973856900 412001516 937521688 841784782 797776705 583528957 937481639 392044781 644880613 940054363 98545297 246667189 752170464 672950632 636177815 889263617 961280690 365531628 939416799 899978277 602327483 569001151 819384360 908887774 11334365 952597262 ...

output:

85816211671900

result:

ok 1 number(s): "85816211671900"

Test #84:

score: 50
Accepted
time: 652ms
memory: 23628kb

input:

99998 45646
773905875 772387152 655142691 420196406 570446755 418495386 467669186 975946707 353417410 661835525 699432229 637781629 374461391 239943133 487040210 233722042 768732316 367024892 -242628107 985369349 439598644 578070325 -149529067 833982380 -27144889 -36123121 121699460 464703352 729252...

output:

51119320169153

result:

ok 1 number(s): "51119320169153"

Test #85:

score: 50
Accepted
time: 646ms
memory: 21420kb

input:

99997 40480
993422744 247783136 504462335 952786908 874827610 271498354 601892011 574009370 420794232 237427080 696563660 774429972 529018977 808969563 -34698511 717489588 646894764 506382164 125544639 963782932 423559376 -113239035 994504702 774061761 -222606038 959284710 349182965 966983918 915717...

output:

60188972216801

result:

ok 1 number(s): "60188972216801"

Test #86:

score: 50
Accepted
time: 659ms
memory: 24024kb

input:

99998 93998
-352472626 645964660 -938310530 -849969278 -138392081 565919854 -245315315 -118511204 -796637957 -604388336 -481244185 194730484 -115646343 624130630 795233054 776512917 -98434375 592067606 -520000700 -948333024 390576401 858784188 -677820283 -585033099 700411971 1391718 -846379311 -7398...

output:

92549218249617

result:

ok 1 number(s): "92549218249617"

Test #87:

score: 50
Accepted
time: 636ms
memory: 19944kb

input:

99979 19347
-480850294 -770381776 -597876986 37420064 -262331654 -788404125 -668147208 -908945630 -763134353 -886916369 -889573348 -563380641 -869419086 -445729447 -212829186 -659221721 -962000204 200515186 -531710482 -45084760 -777213540 -708171024 -421304995 -872816722 -811104618 -916714010 -81284...

output:

10556892918543

result:

ok 1 number(s): "10556892918543"

Test #88:

score: 50
Accepted
time: 638ms
memory: 23864kb

input:

100000 71601
-907051798 -189503390 -825561680 -533650330 -996243249 -167049866 -471791357 -681989274 -864755735 -671065349 -802513201 -902667087 -822953783 -729336633 -769744977 -725685762 -849379396 -363798681 -965308183 -276680519 -917217173 -917661252 -878863596 -723736660 -161219271 -256116388 -...

output:

30226487178792

result:

ok 1 number(s): "30226487178792"

Test #89:

score: 50
Accepted
time: 571ms
memory: 21380kb

input:

99999 71122
-798655106 -770224636 -795198110 -746316063 -262849761 20896902 -261979305 -485686979 36697674 -606853857 -869814819 -389021882 -319309644 620912947 326130635 -170411882 -64405233 -165786620 -242943437 -685959418 111358072 -380908667 -941194309 -993261223 -818839013 -968755696 -192254252...

output:

30451153750

result:

ok 1 number(s): "30451153750"

Test #90:

score: 50
Accepted
time: 505ms
memory: 21324kb

input:

99976 57435
-388134271 -400554975 242552429 -301978468 -902265860 -595100553 156319851 -191409987 -994998740 -910985625 -916492772 -983956234 -972103718 -774972461 -910691813 -862982943 -672222699 -478187744 -99596101 -625522238 -967441252 745283240 172737533 -377822777 -101742557 59944394 -96199543...

output:

1973026943

result:

ok 1 number(s): "1973026943"

Test #91:

score: 50
Accepted
time: 619ms
memory: 20512kb

input:

99996 48778
-754132535 -793632740 -994448082 -550760359 -718934814 -411765152 -704807632 61394469 -820087834 -752890747 -800500224 -229043914 -817669765 -777357925 -822403766 -834021625 -861134937 -936450796 -521149485 -331199749 -808584377 -858865916 -989934839 -841834598 -418700539 -981057649 -922...

output:

44733123133645

result:

ok 1 number(s): "44733123133645"

Test #92:

score: 50
Accepted
time: 621ms
memory: 21420kb

input:

99978 51296
-927402067 -910694934 -997922959 -980083679 -902772084 -782599178 -750616802 -972599371 -923414055 -934939760 -995534148 -914767971 -763844732 -966908999 -958371573 -162264949 -920188387 -998019928 -967010694 -923663765 -802875866 -859359782 -904043611 -882520001 -942937684 -838802595 -8...

output:

36855924990397

result:

ok 1 number(s): "36855924990397"

Test #93:

score: 50
Accepted
time: 606ms
memory: 23632kb

input:

99991 58425
-885636924 -509947789 -678922756 -795413385 -864121458 -738935635 -996149355 -986377594 -608836358 -922807887 -926629943 -914768027 -931175756 -955669725 -845251688 -926507338 -574203397 -999396353 -980943077 -987633400 -943038041 -846118097 -647964302 -931985747 -846648909 -916080433 -6...

output:

14620922285805

result:

ok 1 number(s): "14620922285805"

Test #94:

score: 50
Accepted
time: 553ms
memory: 21372kb

input:

99996 68490
-920722866 -611307971 -944585825 -824061560 -817218609 -614437123 -760333695 -810689296 -987678188 -911416113 -470464259 -992578200 -898735664 -799742327 -892316234 -973870088 -583787447 -823066078 -860686452 -353567714 -988699763 -773449211 -636769975 -962252578 -892863919 -835144771 -9...

output:

13976120219

result:

ok 1 number(s): "13976120219"

Test #95:

score: 50
Accepted
time: 491ms
memory: 22632kb

input:

99983 85791
-981257318 -428099166 -705646408 -740460163 -953095051 -931222634 -766447305 -867548804 -852664699 -825587509 -916940414 -998160916 -670384104 -937251473 -766066052 -489652873 -959700449 -654183247 -660000057 -883877199 -551296399 -567359938 -654983669 -755112649 -990737562 -466682360 -8...

output:

580224541

result:

ok 1 number(s): "580224541"

Test #96:

score: 50
Accepted
time: 619ms
memory: 23728kb

input:

99983 83221
-812043857 -995601938 -884535317 -946568654 -963830331 -979324389 -905105821 -869298640 -810248120 -904557819 -865367012 -989964926 -867132478 -943387915 -823567177 -999307816 -807897585 -950580532 -941539955 -952104192 -932162862 -988404972 -983613400 -866671302 -787156449 -986142566 -6...

output:

75640345738116

result:

ok 1 number(s): "75640345738116"

Test #97:

score: 50
Accepted
time: 590ms
memory: 21308kb

input:

99994 24078
-994419936 -986513370 -987801553 -992966258 -835559212 -883691635 -999480400 -980170227 -974489859 -884027167 -740526402 -969766604 -896464139 -977416997 -987351612 -992843520 -978783819 -809794911 -870359078 -870923833 -949930724 -906186353 -926203886 -877532905 -865299437 -967299323 -8...

output:

14778623065559

result:

ok 1 number(s): "14778623065559"

Test #98:

score: 50
Accepted
time: 596ms
memory: 25120kb

input:

99994 69154
-948934236 -804061914 -989708045 -632739750 -878015006 -936616407 -941653807 -914075086 -881161216 -899436030 -915387383 -936008192 -936029165 -950380678 -939335438 -982240545 -918154723 -945128473 -813882860 -997354091 -956025823 -971958096 -873385685 -886038352 -890936555 -784123710 -9...

output:

17256518779195

result:

ok 1 number(s): "17256518779195"

Test #99:

score: 50
Accepted
time: 542ms
memory: 25000kb

input:

99983 96174
-924506855 -997689631 -884248024 -933545444 -748241340 -913663965 -948360121 -993964377 -930126127 -746434461 -999627866 -949182872 -998177898 -837032490 -872790051 -963035410 -945205269 -985667040 -877505926 -925979470 -937682863 -909630379 -924162133 -961438919 -972523723 -989381933 -9...

output:

15922405921

result:

ok 1 number(s): "15922405921"

Test #100:

score: 50
Accepted
time: 485ms
memory: 23540kb

input:

99999 48083
-970286475 -879794855 -975200874 -983550121 -995156045 -927930312 -899134268 -984502859 -995264834 -979792512 -904362434 -958629118 -934468833 -835101025 -969344709 -984920862 -949799356 -982577121 -952798803 -887181938 -999294058 -791892774 -949139345 -885546715 -949302180 -988960002 -5...

output:

-99014256

result:

ok 1 number(s): "-99014256"

Test #101:

score: 50
Accepted
time: 53ms
memory: 23332kb

input:

100000 100000
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -100000000...

output:

100000000000000

result:

ok 1 number(s): "100000000000000"

Test #102:

score: 50
Accepted
time: 658ms
memory: 23052kb

input:

100000 0
619218907 -438075771 193052217 -566259021 -285381439 480034871 728391797 -933640958 -663596670 -549007202 -604831067 -904513998 209720511 -75448813 603973312 197390202 662705421 -130854155 -771399791 166957360 -464775356 -127265293 966641076 24300918 152130662 -930841754 -237788952 -3325522...

output:

209424548739

result:

ok 1 number(s): "209424548739"

Test #103:

score: 50
Accepted
time: 353ms
memory: 24864kb

input:

64335 100000
-999537098 -997039745 -991630086 -975174096 -958303681 -947813366 -999067383 -988918632 -999337678 -926727633 -999228886 -988822283 -965454700 -988809324 -985314389 -995364957 -986781821 -969449198 -971169061 -961720193 -996200883 -986294602 -983451656 -953569191 -986892888 -956408521 -...

output:

63795635552065

result:

ok 1 number(s): "63795635552065"

Test #104:

score: 50
Accepted
time: 227ms
memory: 21376kb

input:

43573 100000
-866543696 -790325794 -981285005 -524821746 -823028532 -939897059 -946711361 -653742256 -909749685 -754291617 -552290882 -703443881 -345804887 -822628331 -466967692 -795679907 -656296832 -687945864 -980908532 -759025721 -265460493 -392609549 -738855530 -843482555 -523850841 -290354161 -...

output:

38202459228165

result:

ok 1 number(s): "38202459228165"

Test #105:

score: 50
Accepted
time: 223ms
memory: 22480kb

input:

41522 100000
-205705867 749488943 140358466 745404780 840655526 608687061 973128787 933021409 629701074 524831958 970987999 -192565412 417794524 625928818 562210687 906987157 817163710 250645718 942647496 754017947 924301389 549904211 921119286 429521100 430928947 768128906 599973204 816045245 13257...

output:

40558063412845

result:

ok 1 number(s): "40558063412845"