QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#88311#5435. Clamped Sequencefzj2007AC ✓168ms3488kbC++141.6kb2023-03-15 20:51:572023-03-15 20:52:00

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-15 20:52:00]
  • 评测
  • 测评结果:AC
  • 用时:168ms
  • 内存:3488kb
  • [2023-03-15 20:51:57]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
namespace IO{
	template<typename T>inline bool read(T &x){
		x=0;
		char ch=getchar();
		bool flag=0,ret=0;
		while(ch<'0'||ch>'9') flag=flag||(ch=='-'),ch=getchar();
		while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar(),ret=1;
		x=flag?-x:x;
        return ret;
	}
	template<typename T,typename ...Args>inline bool read(T& a,Args& ...args){
	    return read(a)&&read(args...);
	}
	template<typename T>void prt(T x){
		if(x>9) prt(x/10);
		putchar(x%10+'0');
	}
	template<typename T>inline void put(T x){
		if(x<0) putchar('-'),x=-x;
		prt(x);
	}
	template<typename T>inline void put(char ch,T x){
		if(x<0) putchar('-'),x=-x;
		prt(x);
		putchar(ch);
	}
	template<typename T,typename ...Args>inline void put(T a,Args ...args){
	    put(a);
		put(args...);
	}
	template<typename T,typename ...Args>inline void put(const char ch,T a,Args ...args){
	    put(ch,a);
		put(ch,args...);
	}
	inline void put(string s){
		for(int i=0,sz=s.length();i<sz;i++) putchar(s[i]);
	}
	inline void put(const char* s){
		for(int i=0,sz=strlen(s);i<sz;i++) putchar(s[i]);
	}
}
using namespace IO;
#define N 5005
int n,d,m,w[N];
long long ans,b[N];
inline long long calc(int l,int r){
	for(int i=1;i<=n;i++){
		if(w[i]>r) b[i]=r;
		else if(w[i]>=l) b[i]=w[i];
		else b[i]=l; 
	}
	long long res=0;
	for(int i=2;i<=n;i++) res+=abs(b[i]-b[i-1]);
	return res;
}
int main(){
	read(n,d);
	for(int i=1;i<=n;i++) read(w[i]);
	for(int k=1;k<=n;k++){
		ans=max(ans,calc(w[k],w[k]+d));
		ans=max(ans,calc(w[k]-d,w[k]));
	}
	put('\n',ans);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3284kb

input:

8 3
3 1 4 1 5 9 2 6

output:

15

result:

ok 1 number(s): "15"

Test #2:

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

input:

2 1
-1000000000 1000000000

output:

1

result:

ok 1 number(s): "1"

Test #3:

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

input:

2 1000000000
-1000000000 1000000000

output:

1000000000

result:

ok 1 number(s): "1000000000"

Test #4:

score: 0
Accepted
time: 62ms
memory: 3328kb

input:

5000 10000
-10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10000 10000 -10...

output:

49990000

result:

ok 1 number(s): "49990000"

Test #5:

score: 0
Accepted
time: 63ms
memory: 3332kb

input:

5000 10000
10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 1...

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 159ms
memory: 3324kb

input:

5000 2897
8987 9710 547 6523 -4484 8892 7360 7473 -5435 8122 -1396 -9963 -1884 -5758 -2930 2867 -260 -3947 -7915 -2428 4137 -1202 -1874 7205 -2852 -6126 -9346 -8662 2294 -4453 -2430 2424 9434 -112 2906 -169 -9489 -1977 68 -9072 2785 -2258 9710 271 8817 6251 3120 4765 -8449 -6625 2617 -3931 -4024 144...

output:

7111087

result:

ok 1 number(s): "7111087"

Test #7:

score: 0
Accepted
time: 105ms
memory: 3332kb

input:

5000 6321
-5894 5183 -3582 7556 -2937 2854 -5688 1422 -7283 5712 -3719 3700 -8585 2577 -703 1839 -8871 9819 -1080 6964 -7192 1664 -9414 1863 -3638 7843 -6700 9064 -4209 7225 -2617 180 -9771 401 -3029 7485 -3877 3095 -4176 5830 -1954 8879 -9515 4671 -9834 395 -3489 6706 -5316 9004 -3536 546 -5360 686...

output:

26696461

result:

ok 1 number(s): "26696461"

Test #8:

score: 0
Accepted
time: 63ms
memory: 3248kb

input:

5000 1224
-9995 -9993 -9992 -9990 -9987 -9979 -9977 -9969 -9965 -9963 -9959 -9956 -9944 -9944 -9931 -9930 -9929 -9927 -9926 -9924 -9923 -9921 -9917 -9917 -9907 -9901 -9899 -9890 -9885 -9876 -9871 -9867 -9859 -9859 -9859 -9854 -9854 -9841 -9841 -9836 -9836 -9834 -9831 -9829 -9823 -9823 -9822 -9818 -9...

output:

1224

result:

ok 1 number(s): "1224"

Test #9:

score: 0
Accepted
time: 61ms
memory: 3484kb

input:

5000 1000000
-1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 1000000 -1000000 100000...

output:

4999000000

result:

ok 1 number(s): "4999000000"

Test #10:

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

input:

5000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000...

output:

0

result:

ok 1 number(s): "0"

Test #11:

score: 0
Accepted
time: 165ms
memory: 3304kb

input:

5000 187598
115918 -727930 454749 -650387 -131030 -583797 907610 -314887 -494840 -116261 406466 734257 -410787 342451 -14930 831297 314447 -433165 -777692 -609353 -434131 518832 320933 -199305 154559 932798 930259 214168 -930213 -34688 247952 503849 21404 311008 -785124 -503509 -476434 -654305 -2049...

output:

477553294

result:

ok 1 number(s): "477553294"

Test #12:

score: 0
Accepted
time: 103ms
memory: 3304kb

input:

5000 771022
-433847 99241 -927062 676808 -285169 89911 -510718 955902 -571570 492726 -139309 477186 -547729 353570 -725526 425661 -48956 239263 -322769 706571 -439634 141317 -391906 398130 -314133 863417 -600052 439135 -352487 753429 -139934 14119 -561827 258290 -54747 419167 -669228 189453 -373567 ...

output:

3125424072

result:

ok 1 number(s): "3125424072"

Test #13:

score: 0
Accepted
time: 63ms
memory: 3488kb

input:

5000 964263
-999875 -999003 -998711 -998242 -997924 -997483 -997289 -997020 -997006 -996326 -995855 -995273 -994500 -994316 -994065 -994038 -993391 -992800 -992573 -991083 -990368 -990156 -990045 -990029 -989806 -988798 -987858 -986711 -986697 -986484 -985989 -985838 -985087 -984605 -983535 -983207 ...

output:

964263

result:

ok 1 number(s): "964263"

Test #14:

score: 0
Accepted
time: 168ms
memory: 3308kb

input:

5000 470574
-780515 -565052 540227 331334 -814359 813817 146460 -468526 -757891 710807 -753613 885094 -727795 373597 712366 -262537 148313 -172412 979620 -921670 -746243 -317334 -673027 190226 844027 -537371 -81273 -545282 -18126 -273706 -492037 439079 69269 -523256 -263698 -564222 -357935 -520341 -...

output:

1146273041

result:

ok 1 number(s): "1146273041"

Test #15:

score: 0
Accepted
time: 108ms
memory: 3304kb

input:

5000 553999
-383027 159712 -632376 301503 -328868 532550 -798606 839794 -952568 547489 -131306 300856 -567633 559760 -931367 903728 -455406 78693 -933438 114173 -107792 402731 -901237 217199 -256503 295296 -661728 482029 -277184 759196 -711481 598907 -575679 97357 -500627 75038 -734531 924348 -35588...

output:

2371523741

result:

ok 1 number(s): "2371523741"

Test #16:

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

input:

5000 859344
-999811 -999297 -998112 -997262 -997043 -996924 -996891 -996031 -994416 -994412 -993847 -993651 -992769 -992318 -992260 -991391 -990815 -990515 -990165 -990137 -989941 -988550 -988458 -988186 -987523 -987484 -987204 -986704 -986611 -986563 -986215 -985492 -985440 -985164 -984845 -984387 ...

output:

859344

result:

ok 1 number(s): "859344"

Test #17:

score: 0
Accepted
time: 150ms
memory: 3328kb

input:

5000 753551
224979 632678 597334 347907 -462837 -823422 448533 342983 979058 -490498 -850469 -865995 -108024 -728183 -588710 -293147 10551 116713 -297921 -268837 -23504 846501 333014 -385392 -466507 -7540 -29583 695269 795887 452425 796347 -590839 -819644 544407 -805496 -624935 725714 -386377 238167...

output:

1803811669

result:

ok 1 number(s): "1803811669"

Test #18:

score: 0
Accepted
time: 103ms
memory: 3312kb

input:

5000 826108
-506082 830836 -68098 345647 -202707 920622 -435431 472585 -132184 27988 -523678 177442 -7098 222566 -399388 649621 -459957 320586 -971439 698215 -650533 307030 -658607 442217 -194639 174723 -537732 420706 -437605 6790 -835034 530710 -246859 977996 -195240 232084 -443806 733902 -952063 5...

output:

3315584633

result:

ok 1 number(s): "3315584633"

Test #19:

score: 0
Accepted
time: 58ms
memory: 3312kb

input:

5000 1000000000
-1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000...

output:

4999000000000

result:

ok 1 number(s): "4999000000000"

Test #20:

score: 0
Accepted
time: 65ms
memory: 3324kb

input:

5000 1000000000
1000000000 1000000000 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:

0

result:

ok 1 number(s): "0"

Test #21:

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

input:

5000 910901608
974118216 -282189310 -464236812 467039630 667895423 339508537 58260393 -703766496 504826455 441618514 -585508328 -193759450 688197130 -930698882 707075173 -451731589 606780952 806202619 -564168107 -344313708 886153476 -454490978 83456751 819316128 -226033791 783846069 962016852 238052...

output:

2128823805323

result:

ok 1 number(s): "2128823805323"

Test #22:

score: 0
Accepted
time: 103ms
memory: 3484kb

input:

5000 588985032
-704516451 414923169 -800677127 619447000 -954729615 770758266 -931762534 27272397 -833725026 154169079 -381582191 554896373 -49834568 764715246 -331924701 905310019 -528047434 864484999 -214861685 766061970 -562403736 80706965 -595249774 34395027 -360037043 474169316 -539009420 82267...

output:

2506122577084

result:

ok 1 number(s): "2506122577084"

Test #23:

score: 0
Accepted
time: 63ms
memory: 3332kb

input:

5000 601396656
-999577358 -999572921 -999156132 -998988445 -998338146 -998211256 -998038945 -997994998 -997887793 -997649517 -997432096 -997288560 -997167770 -996929006 -996844659 -996262442 -995862352 -995756615 -993977725 -993848654 -993812317 -993269602 -989945601 -989714100 -989656489 -989620707...

output:

601396656

result:

ok 1 number(s): "601396656"

Test #24:

score: 0
Accepted
time: 160ms
memory: 3484kb

input:

5000 445151880
335388608 -983864855 357393521 770062647 827744974 -545526108 -534435204 605024122 -705912204 103448158 -738139305 364727297 281430261 -172675238 -281961119 413948381 346099745 270519920 730104458 -238273774 -905802314 376152823 -861548777 -961050775 231905794 595917998 -448202969 926...

output:

1105209149106

result:

ok 1 number(s): "1105209149106"

Test #25:

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

input:

5000 828268008
-366185717 43537035 -969463670 432669463 -708658333 371181544 -146705690 908422240 -102114887 558802051 -121266478 784840669 -751154229 248289004 -97630641 526604485 -878715075 172827431 -503917793 96759109 -566567161 123043111 -77255051 851430049 -729995131 664063215 -245947835 82485...

output:

3298927875333

result:

ok 1 number(s): "3298927875333"

Test #26:

score: 0
Accepted
time: 66ms
memory: 3340kb

input:

5000 494515929
-998443173 -997962724 -997811093 -997050271 -996647991 -996462586 -996187002 -995098290 -994915961 -994693384 -993157827 -992556757 -992377058 -991828368 -991720044 -990191984 -989488632 -989460779 -989428746 -989426749 -989005160 -988154542 -988098377 -987732188 -987725414 -986059452...

output:

494515929

result:

ok 1 number(s): "494515929"

Test #27:

score: 0
Accepted
time: 159ms
memory: 3480kb

input:

5000 389467560
-355218502 19492307 832179059 -631947044 935717022 274471954 872869200 156904530 83349139 -477811990 571172633 -538728871 117753184 -247675975 -732940325 -425404355 -747605841 -265162779 24377021 -427201133 -402790810 39821003 -49644095 91606703 984812673 113022632 -153390083 -6280921...

output:

965641468960

result:

ok 1 number(s): "965641468960"

Test #28:

score: 0
Accepted
time: 104ms
memory: 3328kb

input:

5000 813212099
-657788296 843272324 -351105712 788755663 -67494572 830255812 -614845562 473640368 -597118733 888267739 -542061284 259243988 -826115211 952166002 -157248546 455415682 -622531587 525875941 -290925573 189728869 -214519619 892913421 -133331337 840915923 -793676784 517885652 -999986637 88...

output:

3237694465547

result:

ok 1 number(s): "3237694465547"

Test #29:

score: 0
Accepted
time: 65ms
memory: 3336kb

input:

5000 114665788
-999286112 -998152282 -997485461 -996872970 -995332021 -994074974 -993469937 -993449928 -992838402 -992125958 -991947766 -991222288 -991110913 -990463280 -990045856 -989777676 -989468122 -988330816 -988320935 -987948273 -987322041 -986975697 -986543825 -986501402 -986322561 -985650280...

output:

114665788

result:

ok 1 number(s): "114665788"

Test #30:

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

input:

5000 874411652
194976933 465563769 32193635 772502565 -494027113 -172755744 -391055418 -288669481 -840528542 240556775 260788433 -54815179 -872752599 234739783 684443371 30903482 -771724202 -855126172 606717231 -540287104 106645283 803757165 992220807 240529942 -193943268 -378326166 881651408 -91331...

output:

2040183592560

result:

ok 1 number(s): "2040183592560"

Test #31:

score: 0
Accepted
time: 104ms
memory: 3324kb

input:

5000 847462372
-950861343 471886190 -224924963 896945418 -116390581 430679090 -829788719 723386431 -865508595 997933419 -913149352 857784505 -822402163 67143539 -922954487 445306367 -46828155 834218374 -874948973 520426008 -923715753 893780370 -688965543 584322016 -458602163 707779551 -633296124 847...

output:

3352300330902

result:

ok 1 number(s): "3352300330902"

Test #32:

score: 0
Accepted
time: 64ms
memory: 3324kb

input:

5000 567593573
-998654597 -997986065 -997797313 -997747048 -997594750 -997554973 -996830553 -996448006 -995526815 -995274373 -994326039 -994171737 -994120317 -994083049 -994049315 -993853185 -993845423 -993576620 -993164480 -993025485 -992772535 -992730483 -992506156 -992235623 -991737473 -990264229...

output:

567593573

result:

ok 1 number(s): "567593573"

Test #33:

score: 0
Accepted
time: 165ms
memory: 3332kb

input:

5000 113694628
-738719969 -531079070 801946466 -924474419 -39210269 647242317 721281692 -979878864 -51267200 -45736079 108157456 503671568 668603031 992763426 -61503129 653493660 672627298 609191130 -393977499 975818243 314689493 172458051 99092782 755130334 853930905 -566254237 -528568413 -46792735...

output:

277833049878

result:

ok 1 number(s): "277833049878"

Test #34:

score: 0
Accepted
time: 104ms
memory: 3304kb

input:

5000 791778052
-907497900 141969253 -762307726 5135173 -870319300 326069660 -44731875 973132493 -428865748 402566390 -357866347 87728801 -155125602 550717297 -688660427 66600832 -766092016 847593515 -164005080 556155856 -632911886 936116516 -170970819 696324329 -123527542 602706157 -340234539 738808...

output:

3178168352142

result:

ok 1 number(s): "3178168352142"

Test #35:

score: 0
Accepted
time: 64ms
memory: 3332kb

input:

5000 20521357
-999187663 -998280139 -997236097 -996745278 -996700445 -996577391 -996389253 -996387735 -996215038 -995666505 -995561043 -995453766 -995208135 -994902710 -994107334 -993448574 -993417626 -993283795 -993242549 -992806581 -992376871 -991992860 -991644422 -991335284 -991243470 -991120216 ...

output:

20521357

result:

ok 1 number(s): "20521357"

Test #36:

score: 0
Accepted
time: 153ms
memory: 3488kb

input:

5000 647944900
-839392491 524155594 -966357789 -378361611 120639282 -237792328 128586095 572001545 737994143 -383906435 -287563313 -399784601 -33131132 -839147520 -755572127 -185859077 -177988496 368475725 605327771 -918141823 -887331709 -458841063 -845912746 -782146777 -688129512 950850398 61211767...

output:

1548618611132

result:

ok 1 number(s): "1548618611132"

Test #37:

score: 0
Accepted
time: 108ms
memory: 3308kb

input:

5000 531061028
-200570946 107019608 -341159685 523390346 -624248017 590056450 -259675032 559315043 -697255610 143635849 -392517926 981236610 -77783625 960662127 -117929878 687895299 -821792366 860968657 -748028479 886852995 -342108019 568387245 -21572315 144763130 -83420213 792600056 -47172954 70365...

output:

2286546295933

result:

ok 1 number(s): "2286546295933"

Test #38:

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

input:

5000 329284605
-999249854 -999184239 -998612561 -998571421 -998489875 -997121257 -997074680 -996411809 -995973992 -995869836 -995788174 -995588937 -995145648 -994978162 -994893658 -993141744 -993094177 -993009525 -992170293 -991990480 -990816698 -990238994 -990090960 -990071743 -989991681 -989961923...

output:

329284605

result:

ok 1 number(s): "329284605"

Test #39:

score: 0
Accepted
time: 64ms
memory: 3324kb

input:

5000 489344222
-500042665 -999989898 -500146695 -999935826 -500158346 -999825868 -500279159 -999793712 -500431418 -999680863 -500600082 -999585536 -500727592 -999481389 -501217506 -999402959 -501597835 -999222368 -501621759 -999194287 -501709537 -999080738 -502022604 -998912790 -502160222 -998746938...

output:

637592386642

result:

ok 1 number(s): "637592386642"

Test #40:

score: 0
Accepted
time: 64ms
memory: 3484kb

input:

5000 134132138
-846317925 -999955149 -846364709 -999881411 -846450416 -999838699 -846615832 -999655636 -846807959 -999546155 -846848663 -999536580 -847056505 -999393264 -847422498 -999253253 -847782475 -999020329 -847940298 -999017465 -848055708 -998933410 -848313913 -998826085 -848715898 -998546117...

output:

80109993750

result:

ok 1 number(s): "80109993750"

Test #41:

score: 0
Accepted
time: 65ms
memory: 3328kb

input:

5000 61979869
-928645245 -999925555 -929185526 -999892329 -929237454 -999779443 -929472261 -999751639 -929898154 -999644387 -929996623 -999431655 -930114631 -999295739 -930181835 -998397596 -930335233 -997937551 -930582511 -997891768 -930832048 -997738478 -930860061 -997543207 -930862903 -997400366 ...

output:

18641036098

result:

ok 1 number(s): "18641036098"

Test #42:

score: 0
Accepted
time: 67ms
memory: 3328kb

input:

5000 33201155
-999968336 -965847981 -999892741 -965987033 -999878722 -966052939 -999798659 -966101674 -999317846 -966253115 -999240961 -966318548 -999156683 -966371706 -999039425 -966555199 -999010257 -966562671 -999001137 -966716443 -998897990 -966756983 -998803999 -966788903 -998789697 -966857413 ...

output:

5010146413

result:

ok 1 number(s): "5010146413"

Test #43:

score: 0
Accepted
time: 64ms
memory: 3336kb

input:

5000 23613454
-999920554 -972953777 -999654372 -973052258 -999438236 -973126142 -999411734 -973523418 -999269874 -973944376 -999128774 -973966575 -999009130 -974031547 -998923161 -974084924 -998807510 -974235001 -998682300 -974760054 -998672789 -974896876 -998628257 -974989839 -998591895 -975155074 ...

output:

3414314234

result:

ok 1 number(s): "3414314234"

Test #44:

score: 0
Accepted
time: 65ms
memory: 3340kb

input:

5000 12719618
-999895953 -986490936 -999854722 -986788073 -999806081 -986834898 -999479089 -986850121 -999236402 -986930083 -999235339 -987001830 -999170008 -987004274 -999050484 -987317442 -998843725 -987413160 -998666245 -987451773 -998583298 -987624520 -998302224 -987641152 -998084820 -987656209 ...

output:

837046608

result:

ok 1 number(s): "837046608"

Test #45:

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

input:

5000 5695141
-999827605 -993504673 -999809111 -993523246 -999699850 -993664524 -999677541 -993843465 -999614451 -993894739 -999474055 -994094267 -999454372 -994105024 -999393405 -994159366 -999320319 -994256127 -999164040 -994264390 -999088720 -994317433 -998686660 -994415967 -998159411 -994721617 -...

output:

234454485

result:

ok 1 number(s): "234454485"

Test #46:

score: 0
Accepted
time: 61ms
memory: 3312kb

input:

5000 2931702
-999987389 -996727513 -999916329 -996780417 -999878693 -996811756 -999870037 -996819511 -999851947 -996914339 -999724782 -997000114 -999622024 -997049220 -999451519 -997263210 -999247077 -997502502 -998956633 -997540239 -998492365 -997575862 -998479096 -997781302 -998474707 -997909756 -...

output:

69053950

result:

ok 1 number(s): "69053950"

Test #47:

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

input:

5000 2442689
-999802061 -997697050 -999761234 -997731609 -999675876 -997742328 -999490901 -998044277 -999427362 -998240325 -999424629 -998337353 -999080118 -998573410 -998996362 -998661309 -998884239 -998839547 -998861952 -991662769 -989315757 -991634159 -989345259 -991600493 -989615425 -991296045 -...

output:

44468631

result:

ok 1 number(s): "44468631"

Test #48:

score: 0
Accepted
time: 64ms
memory: 3488kb

input:

5000 1202113
-999902027 -999136363 -999553618 -999167345 -999355440 -999198256 -999326606 -999198795 -999320521 -995901651 -995019478 -995304048 -995278488 -990800747 -991730984 -990863459 -991699197 -990898001 -991633379 -990990679 -991424060 -991330234 -991339254 -986687055 -987924608 -986953338 -...

output:

13961825

result:

ok 1 number(s): "13961825"

Test #49:

score: 0
Accepted
time: 64ms
memory: 3244kb

input:

5000 611123
-999859155 -999330197 -999778539 -999334525 -999764523 -997285784 -997717429 -997493286 -997675727 -997540459 -995764865 -995255510 -995754239 -995372031 -995384252 -993221157 -993666896 -993241736 -993337178 -991232578 -991857390 -991344020 -991645026 -991351944 -991631970 -989213023 -9...

output:

5885051

result:

ok 1 number(s): "5885051"

Test #50:

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

input:

5000 278032
-999806954 -999649774 -999771093 -998857605 -998724189 -998782878 -997684827 -997570010 -997612364 -997610822 -996769430 -996570913 -995616854 -995831270 -995739394 -994868415 -993782792 -993702501 -993725832 -993711881 -992555525 -991717619 -991671431 -991690400 -990823246 -990578256 -9...

output:

1429440

result:

ok 1 number(s): "1429440"

Test #51:

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

input:

5000 259402
-999596909 -999637609 -998774177 -998761543 -997829705 -997153455 -997238750 -996256595 -995521234 -995648322 -995568115 -994676035 -993826830 -993084539 -993168195 -993108764 -992436457 -992356563 -992383899 -991615524 -991654007 -990736651 -989827067 -989083696 -988240876 -988313617 -9...

output:

1062508

result:

ok 1 number(s): "1062508"