QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#360191#3300. Cactus Competitionmazihang2022TL 24ms132564kbC++143.6kb2024-03-21 14:47:162024-03-21 14:47:17

Judging History

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

  • [2024-03-21 14:47:17]
  • 评测
  • 测评结果:TL
  • 用时:24ms
  • 内存:132564kb
  • [2024-03-21 14:47:16]
  • 提交

answer

#include<bits/stdc++.h>

#define ll long long

#define int long long

#define fir first

#define sec second

#define pii pair<int,int>

#define isz(v) (int)(v.size())

using namespace std;



const int maxn=200005;

const int logn=19;

const int inf=0x3f3f3f3f;



namespace Solve {

	struct ST {

		int a[maxn];

		int lg[maxn];

		int mi[logn][maxn];

		int mx[logn][maxn];

		void build(int n,int *v) {

			// cerr<<"build: "<<n<<" ";

			for(int i=1;i<=n;i++) {

				// cerr<<v[i]<<"? ";

				a[i]=v[i];

				mi[0][i]=a[i];

				mx[0][i]=a[i];

			}

			// cerr<<"\n";

			for(int i=2;i<=n;i++) {

				lg[i]=lg[i>>1]+1;

			}

			for(int i=1;(1<<i)<=n;i++) {

				for(int j=1;j+(1<<i)-1<=n;j++) {

					mi[i][j]=min(mi[i-1][j],mi[i-1][j+(1<<(i-1))]);

					mx[i][j]=max(mx[i-1][j],mx[i-1][j+(1<<(i-1))]);

				}

			}

			// cerr<<"build done\n";

		}

		int getmin(int l,int r) {

			if(l>r) {

				return inf;

			}

			int k=lg[r-l+1];

			return min(mi[k][l],mi[k][r-(1<<k)+1]);

		}

		int getmax(int l,int r) {

			if(l>r) {

				return -inf;

			}

			int k=lg[r-l+1];

			return max(mx[k][l],mx[k][r-(1<<k)+1]);

		}

	};

	int n,m;

	int a[maxn];

	int b[maxn];

	int mib=inf,mxb=-inf;

	bool vl[maxn];

	bool vr[maxn];

	void clear() {

		

	}

	void deal(int *a,int *b,int m,bool *v) {

		// cerr<<"deal: "<<n<<" "<<m<<"\n";

		// for(int i=1;i<=n;i++) {

		// 	cerr<<a[i]<<" ";

		// }

		// cerr<<"\n";

		// for(int i=1;i<=m;i++) {

		// 	cerr<<b[i]<<" ";

		// }

		// cerr<<"\n";

		// cerr<<"end\n";

		ST sta,stb;

		sta.build(n,a);

		stb.build(m,b);

		// cerr<<"wtf\n";

		auto solve=[&](int l,int r) {

			// cerr<<l<<" "<<r<<"?\n";

			vector<int> st;

			v[r]=true;

			st.push_back(r);

			for(int i=r-1;i>=l;i--) {

				while(isz(st)&&a[st.back()]<a[i]) {

					st.pop_back();

				}

				assert(isz(st));

				int mi=sta.getmin(i,st.back()-1);



				int t=1;

				while(t<=m&&b[t]+a[i]>=0) {

					t++;

				}

				t--;

				v[i]=v[st.back()]&&stb.getmax(1,t)+mi>=0;



				st.push_back(i);

			}

		};

		for(int i=n;i>=1;i--) {

			if(a[i]+mib>=0) {

				int j=i-1;

				while(j>=1&&a[j]+mib<0) {

					j--;

				}

				j++;

				solve(j,i);

				i=j;

			}

		}

	}

	void main(int tid) {

		cin>>n>>m;

		for(int i=1;i<=n;i++) {

			cin>>a[i];

		}

		for(int i=1;i<=m;i++) {

			cin>>b[i];

			mib=min(mib,b[i]);

			mxb=max(mxb,b[i]);

		}

		int t[maxn]={},cnt=0,pos=-1;

		for(int i=1;i<=m;i++) {

			t[++cnt]=b[i];

			if(b[i]==mxb) {

				pos=i;

				break;

			}

		}

		assert(pos!=-1);

		deal(a,t,cnt,vl);

		reverse(a+1,a+n+1);

		cnt=0;

		for(int i=m;i>=pos;i--) {

			t[++cnt]=b[i];

		}

		deal(a,t,cnt,vr);

		reverse(a+1,a+n+1);

		reverse(vr+1,vr+n+1);

		int ans=0;

		for(int i=1;i<=n;i++) {

			bool ok=false;

			for(int j=i;j<=n;j++) {

				if(a[j]+mxb<0) {

					break;

				}

				if(a[j]+mib>=0) {

					ok=true;

				}

				ans+=ok&&vl[i]&&vr[j];

			}

		}

		cout<<ans<<"\n";

	}

	void init() {

		

	}

}



signed main() {

#ifndef ONLINE_JUDGE

	freopen("data.in","r",stdin);

	freopen("data.out","w",stdout);

#endif

	ios::sync_with_stdio(false);

	cin.tie(0),cout.tie(0);

	int T=1;

//	cin>>T;

	Solve::init();

	for(int t=1;t<=T;t++) {

		Solve::main(t);

		Solve::clear();

	}

#ifndef ONLINE_JUDGE

	cerr<<"Time: "<<(1.0*clock()/CLOCKS_PER_SEC)*1000<<"ms\n";

#endif

}


详细

Test #1:

score: 100
Accepted
time: 12ms
memory: 132272kb

input:

3 3
-1 0 1
-1 0 1

output:

1

result:

ok single line: '1'

Test #2:

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

input:

3 3
-1 0 1
1 0 1

output:

5

result:

ok single line: '5'

Test #3:

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

input:

10 10
145195799 312862766 143966779 -11056226 -503624929 636383890 -182650312 -382759112 -290767690 377894950
-845235881 -418232930 -600566938 -957917357 -181139226 125255273 -175406945 740226783 -750456842 325848662

output:

0

result:

ok single line: '0'

Test #4:

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

input:

10 10
923415743 -503391272 885740174 329644337 -693052351 -53764994 731859967 -834732760 -57751504 151969590
553689579 313784278 -12090771 921222379 -378313551 819586787 -373658045 559813071 671861309 268258615

output:

13

result:

ok single line: '13'

Test #5:

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

input:

10 10
-123276196 264891802 609485405 -980113903 152483893 57563748 -454135131 618686452 545983457 236619926
648896419 838269531 -380077537 536463844 89691984 38425645 759165084 325716532 330825142 -472414030

output:

12

result:

ok single line: '12'

Test #6:

score: 0
Accepted
time: 4ms
memory: 132168kb

input:

10 10
982508669 144806400 -503165973 760719995 -249757698 -573349946 -974145393 -905114292 218260516 -582308724
-341366248 187422683 298181900 -305351333 -616330465 -358958909 499163196 -967112195 -892547772 -605274022

output:

1

result:

ok single line: '1'

Test #7:

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

input:

10 10
-46634296 998649898 637256009 858343376 -339756903 750734027 533317110 509238419 -386390857 573123021
281094131 -798662878 454769235 -725579556 448648301 -937460999 -94310392 -504422439 -566805692 -883657655

output:

2

result:

ok single line: '2'

Test #8:

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

input:

10 10
-448680004 -918586552 -352190179 959516158 674275159 -778874335 -736749389 -368418013 103878020 562512923
-493932809 -736960513 78543198 885372691 -119140562 627952281 733778437 115556860 -196686999 -530143800

output:

3

result:

ok single line: '3'

Test #9:

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

input:

10 10
438736217 -79057408 749090846 -106479211 -864134653 49806870 -724192950 -354806728 -230893984 130090227
-313678558 -493317070 -704907097 -240066585 275905249 -440144088 -697190358 608351624 783121279 -54163556

output:

1

result:

ok single line: '1'

Test #10:

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

input:

10 10
910467973 475480237 284540173 -490003419 -496858639 575308046 -772115835 -650286781 -946294433 -375903216
465208966 198897340 37926241 -452764487 81169636 803610511 943188813 773420180 248487883 -932609634

output:

0

result:

ok single line: '0'

Test #11:

score: 0
Accepted
time: 8ms
memory: 132144kb

input:

10 10
-717662422 899539843 686516865 -308859590 731187727 948271874 -278705921 533338789 378708586 -53953529
-819295682 -712753496 -588162402 -765119207 518537239 793210677 199564253 443460314 248599384 333581283

output:

14

result:

ok single line: '14'

Test #12:

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

input:

10 10
13154473 419018121 -416088051 751464183 -782740304 257733919 -917880927 -690282918 410240353 817939924
440852087 -846511822 -519300757 153508300 757901474 928246448 -132837037 -603019187 860960474 -381787006

output:

0

result:

ok single line: '0'

Test #13:

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

input:

10 10
-357608489 679822152 25019791 265926477 -309098231 -7866110 -344995594 54868813 319830921 627547981
-431127028 -396320203 -35574917 657270168 -452580497 -359511978 -443174072 195670048 -696354158 2633147

output:

0

result:

ok single line: '0'

Test #14:

score: 0
Accepted
time: 4ms
memory: 132204kb

input:

10 10
126298083 -169291689 736314121 784469908 642788743 -450191333 -98804016 -511077469 -691147937 -275067405
440527703 -329746015 -473928781 -114255013 -450714278 -903623369 888225605 -146644734 173060316 214649350

output:

0

result:

ok single line: '0'

Test #15:

score: 0
Accepted
time: 12ms
memory: 132208kb

input:

10 10
-631748556 73286407 324751086 157696597 846447361 -444570059 484021795 -258058046 -116283058 -158063251
712663587 -233692952 820220037 516771553 879333593 156354440 -36643636 -639052753 -790959020 950256682

output:

30

result:

ok single line: '30'

Test #16:

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

input:

20 10
-623445264 -424346675 38726811 -683309080 312098721 491569101 58067873 265188450 933087599 -786006093 -652539909 -790632832 780472328 -854541037 -851647529 130095820 35107516 -49396621 -476857996 -420750398
102904427 387758770 -297785914 -909492241 54351476 480814965 -450898650 532245762 14578...

output:

5

result:

ok single line: '5'

Test #17:

score: 0
Accepted
time: 8ms
memory: 130160kb

input:

20 10
-896420596 -203318573 177883279 273218889 -57519747 -45966158 -776510191 -517769446 453200208 481678849 182234053 -9041974 599680026 114185708 -42217888 -909337940 901125545 -573238491 923694668 317307691
-39965725 441117134 808874018 742445820 195129663 -895470087 -362043267 -116187269 768684...

output:

5

result:

ok single line: '5'

Test #18:

score: 0
Accepted
time: 4ms
memory: 132204kb

input:

20 10
-353233765 531419122 -565785466 -974734316 -965779178 -574407138 -468557050 143840293 -215604312 -616224273 -898730647 860935752 160786259 790117305 493435217 142732932 -298131838 151928054 -491642434 354879620
-793096213 -805492095 -608815122 348634111 -671513949 992581086 -838707020 58016785...

output:

9

result:

ok single line: '9'

Test #19:

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

input:

20 10
-701460484 808554993 -999153824 -785817990 -733107864 102913155 -574790819 366838774 386927511 368140655 -817331097 -532497190 -875689404 26653738 514253474 -613613559 138082391 199526495 -340809187 -265988736
139281656 -212060959 990432379 509453538 322401348 415039202 713351409 656821225 -37...

output:

1

result:

ok single line: '1'

Test #20:

score: 0
Accepted
time: 4ms
memory: 132196kb

input:

20 10
283365694 154990137 -35366598 -650189405 -536760259 988010949 -588839879 419138587 473855117 783095177 -727335506 -711138940 688902025 848042392 -418956949 -551400268 -445912306 328186693 902566329 -781464261
-151440066 304048484 39686192 -66659263 690407227 450204900 21929380 -636199785 -2908...

output:

16

result:

ok single line: '16'

Test #21:

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

input:

20 30
237952402 -335139165 -955671638 -412642356 -480102753 -346638667 993109413 -711571417 653077878 434015585 670459996 -463458168 -861206961 -564606372 575461609 276985893 624287505 990687478 -356864944 -323862739
-65141151 -910501868 964552356 987340218 98190644 -533295887 -628531995 104796764 -...

output:

6

result:

ok single line: '6'

Test #22:

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

input:

20 30
422573927 -99296392 66641971 -467451544 -929697025 987635538 -823741408 -282328894 667795417 403667640 77855317 768938833 851375837 -482238764 535050604 693284244 665832562 -414334930 282053424 841142538
625401169 -873800421 -295606036 -563876252 -486871726 658432653 -540621613 83171505 -32868...

output:

1

result:

ok single line: '1'

Test #23:

score: 0
Accepted
time: 8ms
memory: 132508kb

input:

20 30
-296660442 -406371023 -7219650 -696407112 -541274666 -13649953 -547746165 103748569 -811509150 -852033818 161353366 477631703 -132349977 -867850711 -343436602 -864191995 664531962 642517117 995654422 -843941103
57878945 715837144 219107402 -746771795 -658539543 949649650 -896370803 86006348 -2...

output:

3

result:

ok single line: '3'

Test #24:

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

input:

20 30
-192624362 460020584 -130262590 -935952369 387086405 -811490574 575282127 -586968948 446945051 392426524 -602685180 954542768 -996079654 92931412 94702743 -358819889 89519102 891193603 534434457 -996719580
403561450 703364521 939494115 -839657656 684830582 235050720 -245163297 761982957 295950...

output:

0

result:

ok single line: '0'

Test #25:

score: 0
Accepted
time: 12ms
memory: 130164kb

input:

20 30
984062212 -888911800 -729112541 940614685 -541773420 605970812 -230912033 340003650 340985629 143521592 -386427316 -31856346 808873635 274103528 233430835 772424780 -655550174 669911837 735705463 526705066
790185048 -638066905 -983213910 570408047 -896905178 85016777 -878189921 670518427 -4579...

output:

5

result:

ok single line: '5'

Test #26:

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

input:

20 30
630876324 56244683 625055527 -950035722 -399372240 416090053 712766914 -388561528 317032192 319710085 -786416330 -294792666 -641205935 -727821639 -692829922 -406674366 549695310 -871824024 642768925 -629016403
-180569873 434318936 -65176780 -758495089 600395742 998998916 -601022991 -242259188 ...

output:

0

result:

ok single line: '0'

Test #27:

score: 0
Accepted
time: 4ms
memory: 132500kb

input:

20 30
-666340266 -234811428 -613029229 -528817072 279884753 -834470867 673189938 -610514210 -92017687 481461141 -587324161 873987707 -457843002 815867460 539889997 143607912 301867148 162973070 -318785258 -627647048
-558930 -833044485 301887649 -934748305 -628210523 411861834 -811488861 -34572500 -9...

output:

0

result:

ok single line: '0'

Test #28:

score: 0
Accepted
time: 8ms
memory: 132256kb

input:

20 30
239927141 -465560294 700693915 511306037 -390296901 480310945 -461978183 -863805363 -944705873 832112778 394354378 743043048 -478663952 -289554962 -803866530 615368711 -635243348 635674953 -456421804 -789099874
818582868 -911881246 202207315 -796098425 169489221 -619819018 293511697 -247294674...

output:

0

result:

ok single line: '0'

Test #29:

score: 0
Accepted
time: 4ms
memory: 132500kb

input:

20 30
-824666360 506734238 980229899 925472711 104863608 481111967 -986371176 -801971559 -503025942 -283635343 211219532 957945006 166080417 -911945996 560587726 477160625 -208523664 926066180 57061205 497640510
595505370 985692023 -704961427 -999195284 191225726 366491773 -723821168 984504350 -4198...

output:

0

result:

ok single line: '0'

Test #30:

score: 0
Accepted
time: 4ms
memory: 132212kb

input:

20 30
-581152550 64489641 -121332469 -453614400 -817554755 611886586 75569914 -349865487 -677752431 718801252 -983949690 834484538 -636214579 -177758424 -946800280 -997677236 -657490810 192964407 -420143812 -352789200
-842862564 -83267954 391555048 50259913 -767724854 438521794 -476428900 997953426 ...

output:

0

result:

ok single line: '0'

Test #31:

score: 0
Accepted
time: 4ms
memory: 130176kb

input:

50 30
849739208 -485245379 759609076 918185573 -381741070 -883872757 677155440 -573740561 -593068644 999523698 790907805 -321235567 889920133 932814137 943298784 -563463043 -540951867 -188050254 663593608 690608940 191835087 769667140 -691811010 -74258643 606737079 393545031 980427481 -184342014 997...

output:

131

result:

ok single line: '131'

Test #32:

score: 0
Accepted
time: 8ms
memory: 130408kb

input:

50 30
337358495 168890301 -636284848 133298621 11162323 -882189527 332613169 -197493589 392460745 449472203 993924015 -214079169 -11217012 858098896 430207239 386377385 9255069 -493130428 300190907 -176929310 -991566474 -325820677 89571050 836109059 -65503036 -595370268 -800993411 735924047 10423823...

output:

25

result:

ok single line: '25'

Test #33:

score: 0
Accepted
time: 8ms
memory: 132280kb

input:

50 30
-776586980 8595569 -611854960 -198898475 -590079800 -36179210 -428685956 -411125849 -475891714 -625378944 193632103 658691953 659675153 -292096694 -863917992 715095853 50338141 -734131367 -799923484 548328933 281591993 -208265042 284975347 -879618459 540314851 534464382 734476835 -64717416 -61...

output:

6

result:

ok single line: '6'

Test #34:

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

input:

50 30
734995880 29986329 4938877 351763070 -956156754 13768977 -798024023 338968506 784900087 -752431905 -405589874 -900959787 36908100 -846689461 409788356 -315360817 -601983453 860808328 -429514806 142179749 375369611 816879065 200539336 -327931038 -610205379 -801349765 921988128 -717355683 -73736...

output:

40

result:

ok single line: '40'

Test #35:

score: 0
Accepted
time: 8ms
memory: 130176kb

input:

50 30
322749335 -994036888 514201016 401141569 483048727 -321886615 -71992024 920489602 577547569 918919073 -282978124 521801869 -493176315 163137386 -840325375 -951019575 -220138831 -866719179 -17128512 -455223104 594319086 698552872 -803249689 -955351505 696210448 403413992 567367726 796410216 364...

output:

4

result:

ok single line: '4'

Test #36:

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

input:

50 30
762704387 -234169549 429517641 -702443418 -963520264 987045530 473327938 -179308697 865798105 -506187046 727968472 270637376 344665828 121975540 -748141520 765668433 -508415753 4374973 -48921323 -654649842 -391906861 -144985815 -103498132 -103141245 143542095 455047143 103209287 44683794 74133...

output:

8

result:

ok single line: '8'

Test #37:

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

input:

50 30
-362662304 -978615369 -169365823 381114237 400237212 -912642871 -5829373 413576907 792136373 -460715696 847468596 -203506653 -719106229 290735551 -86007719 -584424272 -608330602 -711470780 -790452372 125540130 418965010 610106447 -774697607 -462044071 -25340046 -676473903 -649271009 -583646715...

output:

0

result:

ok single line: '0'

Test #38:

score: 0
Accepted
time: 4ms
memory: 130260kb

input:

50 30
-500932177 -710582010 685375682 -903207311 270313065 77624034 581543527 -740019833 -854023774 -534698365 573996900 -256399456 505742772 436899144 860699959 -990585012 886284152 -962609434 844961571 -367402555 -226312431 337281139 378518521 -653772618 958737271 110179562 -426968779 898069507 -9...

output:

35

result:

ok single line: '35'

Test #39:

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

input:

50 30
294409269 252295420 -909674645 -302734470 747090905 821010584 -239377308 177276620 -928953989 282129924 202718662 74606426 605222942 357709360 -662585324 -171014522 20576347 987266613 -505116826 785915702 142909774 -188546578 823139684 -311037829 -29502442 130588208 214991920 -442827877 309061...

output:

26

result:

ok single line: '26'

Test #40:

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

input:

50 30
-321827151 805794976 400787991 735888316 340025653 386996029 860174494 622827541 -925335792 -970854095 -306750309 -956706324 -803700245 224412745 234708945 703888270 488644473 -425573126 491757044 -800685418 293034152 200105926 837948194 76831311 598553744 194728882 619994194 265271277 6793901...

output:

0

result:

ok single line: '0'

Test #41:

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

input:

50 60
519329142 448405568 296435578 -567407770 480661384 799199204 -4829028 -92771047 605393459 233046594 384760331 -860375269 -513825080 -609559233 968696113 -270295219 14231553 372462019 179594853 -843430389 -266167039 -942456048 29796851 -181829106 367543152 -49181388 -811691833 -155042127 317835...

output:

2

result:

ok single line: '2'

Test #42:

score: 0
Accepted
time: 8ms
memory: 132204kb

input:

50 60
-856100350 267091519 859641699 -3342492 -667509830 -362405209 254373723 -490430430 902978663 612111725 729451221 -474066722 -698543739 -511829840 121943585 -927007260 930575083 343748817 -880026476 705210405 963404401 -413363396 201478857 97693197 -628524782 763356427 409436341 -243570518 -679...

output:

79

result:

ok single line: '79'

Test #43:

score: 0
Accepted
time: 8ms
memory: 132164kb

input:

50 60
818822522 -695028386 -659725962 775327990 -996473529 -638264299 200912617 -749163398 -379501305 642836685 -64037206 -130998535 -990016724 632674763 -893708379 -34631742 -258745199 -482525579 963020428 -502775128 -494599533 292757013 -937942492 -103458058 -251150532 -95750660 -988401500 -467241...

output:

8

result:

ok single line: '8'

Test #44:

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

input:

50 60
781741768 -876451837 -432872680 -453302122 63260025 -490354532 534921667 822528547 147684558 -209500144 647733570 -960729329 -132883466 -602636203 -154196367 443376018 -991618548 775306579 -836966225 -527202845 -861513418 -434816922 151962610 677096029 -420961791 892066790 835332609 728515557 ...

output:

0

result:

ok single line: '0'

Test #45:

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

input:

50 60
176885182 -503164751 -488726197 -167960863 -961674671 445857680 998691295 845481094 -979133664 -672828533 -648061111 -212039577 -657158026 308937322 466927750 -644292425 -475829614 549805259 93776939 301768341 -799077098 688007359 -537057857 134470210 -694574933 763391115 -787411290 358276905 ...

output:

4

result:

ok single line: '4'

Test #46:

score: 0
Accepted
time: 4ms
memory: 132188kb

input:

50 60
-289149153 108228784 -688624400 440687668 -834723692 103541850 -974435489 672985989 110098029 580777352 -944281572 -4502816 -286063684 -386932130 896731064 840853844 -360021243 -90881057 -83521387 -537057708 -209223745 795869960 -537525392 -986582941 260604725 -383421509 -801492703 877398888 -...

output:

0

result:

ok single line: '0'

Test #47:

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

input:

50 60
77103830 -360607028 422336938 -336983868 -545915500 805489417 42571014 39046573 856878370 852169049 917202350 996673173 679505612 440915939 20891542 491397182 97204494 -889388190 -650100889 -826060150 807890651 -310946324 131137623 901862493 24370670 -590537533 -415772917 414732583 -579127372 ...

output:

93

result:

ok single line: '93'

Test #48:

score: 0
Accepted
time: 12ms
memory: 130380kb

input:

50 60
-814910378 -906511569 -273939470 -920265745 84008487 571029214 210307863 960464681 -716129938 -458127762 -311165513 -751324056 395366563 -843186754 653282 -313378438 -277732326 -12796559 -905253508 -209798242 624619125 -177238489 871960545 -492367909 -762838288 -745489500 141688635 161213069 -...

output:

0

result:

ok single line: '0'

Test #49:

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

input:

50 60
-53933558 -984000645 -730030204 342899694 -863806918 -992446773 -400970918 -530024722 -929354105 469743626 -473536407 877441462 692283784 -194155066 808405959 409612166 926094019 949650505 -713698610 316583949 -867287780 199633036 605415850 -185354652 574490432 -962556912 -376394376 22450181 -...

output:

0

result:

ok single line: '0'

Test #50:

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

input:

50 60
-884899039 644230327 -947255462 -370777551 -388122932 525035250 -803946622 303457938 -16037568 -796228893 -514530388 -48402963 514823927 -703277518 -224590491 839053547 -821181734 -390170042 286103467 907957367 -98012854 955115188 -958298435 239474878 -16655232 -319488676 742358975 569578960 -...

output:

26

result:

ok single line: '26'

Test #51:

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

input:

200 100
324569550 847190861 685238540 65813676 184378488 -380999499 -119253652 836392885 986365596 -410162140 258684892 801343085 -703236479 -173697841 489632028 8332882 -135260139 -624760981 992132010 393807754 306327316 -301041001 312404677 346468034 -253839740 -777387742 57822155 319800035 324242...

output:

221

result:

ok single line: '221'

Test #52:

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

input:

200 100
345284770 868161977 377885783 -802123304 418739379 -542501824 930241909 -561883653 -785237344 -904165190 331000912 -229547368 230414455 -512134394 532114130 185974237 829824991 -840785114 727983704 -355292126 483091403 932204964 280854057 -555182904 -464340865 -77713814 886150623 43587141 10...

output:

0

result:

ok single line: '0'

Test #53:

score: 0
Accepted
time: 4ms
memory: 132256kb

input:

200 100
-706028830 806418425 118577037 -349253193 119487302 -190320669 -722942939 -503195619 -349287992 -191268563 -32614406 507689032 868809265 256356873 471646670 990705950 91056368 105786493 691075168 -440994084 -734904653 -691986846 296763159 409398998 301879160 960639617 995001993 971378996 -52...

output:

71

result:

ok single line: '71'

Test #54:

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

input:

200 100
-187379301 682722387 -315882945 493548057 736391719 927087256 -326611619 160249432 -298206022 -644892887 -148901252 662851690 -68230501 370757788 -652022440 864103519 -523167629 942637116 -315891017 -615358443 103210494 -924615854 444433373 -45556550 -908437700 -32686067 28721062 599872120 5...

output:

0

result:

ok single line: '0'

Test #55:

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

input:

200 100
6951170 386323192 10348595 -722769933 -784880200 -297882859 613053117 -902529756 -372499956 269749068 557531286 -594059828 515092097 -465008871 556659582 -971662861 162879345 711881646 667414854 -381139280 -706483797 794126930 314922316 755309462 667105294 -783851670 176147815 405766656 5288...

output:

0

result:

ok single line: '0'

Test #56:

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

input:

200 100
-43938504 828589831 204560466 -705427480 748037713 -781398193 -385364002 -993286365 397475096 545193080 430032844 696646123 -457688932 -200967603 -119131297 -167095234 405332038 320495781 -229379811 203056321 -459314910 -119142709 464989551 232968707 -728387554 26555470 216829882 -134100028 ...

output:

5008

result:

ok single line: '5008'

Test #57:

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

input:

200 100
468513861 -948688712 -720523121 -84223961 -299553944 -223860575 764258567 -811469434 287939087 -314949597 -718357257 479399085 593746490 946371358 51390983 142115372 -600057024 -950287946 504355219 -300543483 884329879 -999719715 -65581033 -494006094 92732249 -698332810 380863178 309075644 1...

output:

0

result:

ok single line: '0'

Test #58:

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

input:

200 100
97135072 -173280743 790635387 -813949654 -936851282 850519094 618456663 -374434035 -60778070 592935012 -155128485 -586792619 722520265 -472777165 57477590 -648491708 508406643 -848276758 678675236 454427935 155090665 -908131309 234124279 -418774582 -844812619 -940851761 240469977 459876368 2...

output:

28

result:

ok single line: '28'

Test #59:

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

input:

200 100
-660466072 -700390123 703769609 -34817247 -690194362 -588451057 251873562 -81083124 -762578389 -363486793 967296732 664438556 -750517892 547165594 761189057 426791891 -37994438 -743818656 -226653079 -753662207 -411533208 -567962489 577381922 214443719 -5682432 716556750 -87168522 -366747000 ...

output:

0

result:

ok single line: '0'

Test #60:

score: 0
Accepted
time: 8ms
memory: 132508kb

input:

200 100
-350332720 198431633 444472095 122701697 -929403685 -556978668 -446954354 788004234 316766322 945312347 147198464 315436137 355722508 -942060485 54705047 -57163815 -368016576 -628701292 -677228584 115076310 -172142733 499135789 -876929528 782701060 102909639 523467042 186955146 -820178943 -5...

output:

2

result:

ok single line: '2'

Test #61:

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

input:

200 100
-655718795 -498092576 731781261 395294628 -977735840 111731546 -649504435 470494665 -330626832 97877953 771545923 -487240381 -379276034 994934495 866980176 269894139 -465311162 963383786 149747893 382367027 885833457 681090848 142341085 -984311214 713463545 -105237668 980719562 929798830 436...

output:

0

result:

ok single line: '0'

Test #62:

score: 0
Accepted
time: 8ms
memory: 132264kb

input:

200 100
792901280 -995665914 -983449278 -616341694 -175852138 -455274365 -671592786 928524942 -853200727 -811325544 987723220 442997401 -59303323 969155001 947512388 -947648702 -61667781 841552112 212192531 -295872477 -914338478 -147018119 533550591 -494691630 229185863 412709523 -481308131 -8093702...

output:

0

result:

ok single line: '0'

Test #63:

score: 0
Accepted
time: 12ms
memory: 132208kb

input:

200 100
-498259804 -504755829 869841034 640537249 -852951194 582859691 -672568831 -318096269 48284890 839354404 -967330945 -280086698 983871314 -512498891 -925635445 -477777994 309580686 45568428 -585826546 -928726597 -124457339 358042941 200379791 941919165 495819573 -167034059 -378059708 -60541673...

output:

0

result:

ok single line: '0'

Test #64:

score: 0
Accepted
time: 12ms
memory: 132280kb

input:

200 100
-114828790 -822648521 -980813620 953537281 394402719 364270921 -118130839 228170673 -755980998 61662669 -653577582 818128473 -443139342 -620752640 317241216 347039073 -424848265 -96641448 506542129 634466738 507939653 -921352444 580406357 -974812715 -742440303 493157496 609492857 190043572 -...

output:

1

result:

ok single line: '1'

Test #65:

score: 0
Accepted
time: 4ms
memory: 130400kb

input:

200 100
895794920 654074351 -809637950 625953084 911899866 619290495 111356948 873101488 -712681288 595550414 213041614 -801689188 245381119 -376933301 899561848 -464346060 391188290 -35441957 944532108 -55541383 263994098 -862646879 778036981 775935776 -99787511 -852976348 -981528777 -388201546 483...

output:

98

result:

ok single line: '98'

Test #66:

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

input:

200 1000
378063478 364941479 834982407 544292564 538138882 -992387701 68868295 497289336 210626138 194535793 276620069 744427352 640228816 -351593927 835181351 -450983203 335471543 -979229494 974801581 987972339 -983701539 989836639 595313626 -115616462 937968059 86035964 -421368010 6596467 -7828860...

output:

136

result:

ok single line: '136'

Test #67:

score: 0
Accepted
time: 8ms
memory: 132176kb

input:

200 1000
-962202944 406883514 -596013517 894571189 543997117 965827422 302979743 303759496 -589059001 -252228035 380300691 -474780334 -908529698 236646479 565679383 104140744 -159439182 287535683 53651533 971238660 733490298 -669112323 906679610 522314397 486549825 604410793 -516724509 -889740459 46...

output:

6

result:

ok single line: '6'

Test #68:

score: 0
Accepted
time: 4ms
memory: 132292kb

input:

200 1000
-534469145 616070475 -107183965 -118631171 531823046 -61053568 272325151 249235903 450543936 -771004763 904851389 -494152939 380136337 -690363676 -990254899 560478663 818257501 272951266 669672951 363058632 424165302 928936311 -68694980 -123376441 593201859 -697561835 -824831899 121744754 -...

output:

96

result:

ok single line: '96'

Test #69:

score: 0
Accepted
time: 4ms
memory: 132216kb

input:

200 1000
63252988 95376982 769386029 -246832581 810790742 -237379550 778971368 747370656 875307256 -941266471 956966642 136759860 847939152 -886393554 60450761 821552990 872175412 -806904013 -585635743 240441652 -911570408 939427952 -480333712 -956149289 990551055 -960440528 -836186758 -264919939 -7...

output:

0

result:

ok single line: '0'

Test #70:

score: 0
Accepted
time: 4ms
memory: 132312kb

input:

200 1000
359073526 346109016 -27471152 972193757 878906251 919809639 386255085 -427158418 -268939347 -363248993 -248891555 -515467200 257885770 -353328466 -821094909 -248696948 768577816 812065987 -584846077 -779625901 520932193 -230220404 171277615 133333763 924986463 -733823090 198646867 -54451509...

output:

0

result:

ok single line: '0'

Test #71:

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

input:

200 1000
992094411 161309298 -913731588 -816461837 79220821 335344585 -559398145 -9487613 980333109 -244633574 -707521698 976259148 91471649 -495226444 -258537249 478193863 455300673 712756059 645963770 -742750386 -822890247 914710966 -378707196 -141645210 471136552 -460806025 165716779 -813037667 7...

output:

0

result:

ok single line: '0'

Test #72:

score: 0
Accepted
time: 4ms
memory: 130164kb

input:

200 1000
79804346 -142827138 985865665 -606068724 575519956 630786585 -158057752 829331132 -168263065 -436373552 920647962 820636520 -947009677 86530927 231885163 -645422015 333963923 -497448547 -73068499 777057480 750587205 -587545534 712274567 -324909078 -393704004 -425517496 -582348936 -989457367...

output:

0

result:

ok single line: '0'

Test #73:

score: 0
Accepted
time: 12ms
memory: 132164kb

input:

200 1000
602693391 529342965 -972729038 -322263507 245852558 -285334675 -355937208 -809665557 564901753 -389733069 953515157 882507649 -663324922 540637493 -86736286 -329096800 326982810 -462620000 -623145395 -556482541 582282735 -838525603 726623746 207013348 -703080755 -272390670 -69796555 8163599...

output:

0

result:

ok single line: '0'

Test #74:

score: 0
Accepted
time: 8ms
memory: 132328kb

input:

200 1000
160735830 -788511798 -69279419 59269836 487967823 842217255 691285032 272759459 -284888097 -265614523 -652876974 -247982915 820001097 423734830 453503315 -986624823 31533076 -477921047 351876868 600912990 893409397 569409986 699965454 -463532690 917695144 965142434 5621964 -954619708 -98083...

output:

98

result:

ok single line: '98'

Test #75:

score: 0
Accepted
time: 8ms
memory: 132216kb

input:

200 1000
-464615207 -718888383 451938129 -278493750 -907178296 65570412 32926251 477775396 125011529 822534838 289817214 -55870774 -280303926 -329468208 -600492964 342791567 410643367 -286327403 -892005828 778848148 -6367765 -714558550 664407876 -837014866 343346418 -57869765 -973187200 -891940892 3...

output:

0

result:

ok single line: '0'

Test #76:

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

input:

200 1000
975328029 799208292 -254367307 -451164781 935797291 -582809033 92599235 705725497 342711611 400600818 499136827 -16694018 604079674 -926243130 961813049 -352272480 435595646 254523062 957502487 -519835745 -232617857 -367025327 -127390885 -969096012 -368019417 965589684 -732091270 464816715 ...

output:

0

result:

ok single line: '0'

Test #77:

score: 0
Accepted
time: 12ms
memory: 130172kb

input:

200 1000
471582686 -127811602 -224284600 337891723 -563281553 -382360541 -714333442 -392348124 -468159358 13526318 -331050674 537105080 -71826497 536846369 867947496 100075523 -204557623 -621537103 285168024 -400672585 -692881656 430488048 -544351239 -143618728 828188652 -302468991 355135437 -584881...

output:

0

result:

ok single line: '0'

Test #78:

score: 0
Accepted
time: 4ms
memory: 132208kb

input:

200 1000
-162338341 -915234309 407396407 -811054334 370751276 357298502 75269769 534761671 401870895 382858889 -376191879 -670897221 -485901702 249860999 337326346 100225788 -289009626 -396141070 -790496258 -406940296 -52693152 894940320 -839265396 -148181793 -643251435 132254878 -357001270 -3313496...

output:

0

result:

ok single line: '0'

Test #79:

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

input:

200 1000
992472275 -298328726 -432437848 403898246 -338225515 -896356650 758797953 -598511565 -114167130 -737159875 391784783 237016554 830575738 -551736261 -534898357 517372676 264211696 380760634 -937875358 -72917657 759646185 181340634 396363294 75497522 810044980 -129063464 -395240218 439992262 ...

output:

0

result:

ok single line: '0'

Test #80:

score: 0
Accepted
time: 4ms
memory: 130472kb

input:

200 1000
162652941 121151703 229052815 368918015 603250710 -426687601 -180627386 567742970 500671023 -488287749 593670824 -485672647 -576458381 529903124 208915955 -844658296 296780055 390260911 -721379613 -757725277 -111139042 873168022 -238480903 122931510 -985847753 -628961583 95597731 705042966 ...

output:

0

result:

ok single line: '0'

Test #81:

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

input:

5000 1000
-855536178 -95867083 680092492 809162653 215923927 -498659467 74080861 -728773271 -670437297 185840469 191409909 413698190 -709451321 623841014 -830688564 -37583299 895632630 686713212 -700737562 -608006009 -179461449 308237270 416337735 382218926 662900117 -26697968 -644252640 -5117094 -6...

output:

0

result:

ok single line: '0'

Test #82:

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

input:

5000 1000
-87012945 689815287 423428420 -616687248 -113746796 -340576794 403464737 994930117 848279070 446122978 -428637875 960562906 -318566382 233217102 -580390724 764852552 -292643572 73871184 -292277796 104159054 -706412861 -707710025 521625188 -885589462 -815551028 -550258179 -121669887 -730680...

output:

2168

result:

ok single line: '2168'

Test #83:

score: 0
Accepted
time: 8ms
memory: 132268kb

input:

5000 1000
747617539 -426987550 283093844 893141623 -273823437 -977340686 -729503654 866540098 -713848097 -886136309 -869555599 53534028 318661295 -335960975 611009114 -244074601 -656929993 673497723 -310358371 -18524505 238867432 288300897 6696785 -554649884 264249071 -847838831 -354671492 -68483276...

output:

2096

result:

ok single line: '2096'

Test #84:

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

input:

5000 1000
607072134 371234426 353132775 -453255390 -312657472 765436874 -694021840 -872462854 -626287419 649515792 966207894 -861129052 -152050731 -830596548 563297662 481662600 -695797970 -62137936 894573563 -950748339 -324906354 448893038 -136331008 -642417005 902118924 3883149 954351695 -15708996...

output:

6512

result:

ok single line: '6512'

Test #85:

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

input:

5000 1000
98224977 790583158 -775526051 569333929 15694000 -703031609 -104427186 -563528464 -812726097 40819798 -280913819 110151809 -103174166 806483283 -504473924 -119851786 272235968 597014507 166913638 233044992 -241719640 -273363859 31411569 -356626484 3111131 -191507466 -536247709 -264253749 -...

output:

3408

result:

ok single line: '3408'

Test #86:

score: 0
Accepted
time: 8ms
memory: 132536kb

input:

5000 1000
468980892 -767341161 603761139 -49810691 -589662715 -980515361 -741082340 124364130 -269387657 -526369107 37997643 -169712869 409438038 612939757 961692246 -98602062 356361711 -605829222 129644221 636164611 -328993786 -789571962 540354630 451199462 981275730 -819426778 -924620757 246651962...

output:

77435

result:

ok single line: '77435'

Test #87:

score: 0
Accepted
time: 12ms
memory: 132300kb

input:

5000 1000
946926152 687232028 -845248672 477380888 -206265880 192656059 -319297321 -556072568 789424015 386617251 -544042867 820329884 930691354 590033851 61318016 946328837 -51443565 230776508 201132774 -545859894 556878881 -731971753 -927303310 -956984494 -559894359 -681909920 -217957952 96603213 ...

output:

731

result:

ok single line: '731'

Test #88:

score: 0
Accepted
time: 4ms
memory: 132504kb

input:

5000 1000
-274840633 -599165338 -333616236 374344752 678543854 -857250063 -527748435 -84899661 -205097862 -445816161 -702414413 32881801 449466897 -110891482 -673179619 -832035542 -932661210 831087836 -418179351 63322252 750006418 -787003188 77460495 397961439 -822247368 -881687401 98175142 89804478...

output:

4519

result:

ok single line: '4519'

Test #89:

score: 0
Accepted
time: 4ms
memory: 130228kb

input:

5000 1000
234444495 -772191878 200387730 -847080421 504757277 -307782381 -676493883 714141819 -353626825 -143845938 637765860 -542656199 685151267 -160849195 800817801 922908011 134368909 -454195509 -469746883 -188119939 -436769169 -86134059 -192880423 -935124978 -636742439 -281275160 -249681088 159...

output:

3456

result:

ok single line: '3456'

Test #90:

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

input:

5000 1000
-134820093 -422567430 367168265 -1810224 -714220843 -909412669 972310498 -509851516 -786966793 -330387858 327240438 635648944 -515240396 390958745 132200388 -975807365 -251796444 424528569 -608169957 267112730 577830742 667969883 -561233928 -760429126 -465541394 124393912 -561389687 609015...

output:

222

result:

ok single line: '222'

Test #91:

score: 0
Accepted
time: 12ms
memory: 132532kb

input:

5000 10000
445600631 267886162 -205757241 198015517 -547840027 511842006 230718908 465080672 -444786978 -104979848 355303183 -963948054 -163953726 -814906943 173348334 -968942474 -269983499 736314993 -563747456 221082277 -542285112 -580169372 -317149104 88088044 508211256 -346010056 -294365192 67293...

output:

3530

result:

ok single line: '3530'

Test #92:

score: 0
Accepted
time: 12ms
memory: 132516kb

input:

5000 10000
230347784 204318487 471907771 719075317 241621868 202769083 755122556 -587770442 452757808 -722897554 -499302983 638551525 -174321520 275118809 -364423950 580852565 -363493101 367440593 961419829 377694373 367418195 250520671 -314778642 -810687205 269076717 587008408 -665037079 367038702 ...

output:

0

result:

ok single line: '0'

Test #93:

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

input:

5000 10000
908026700 953289641 631143860 66779953 -227546885 -185143512 -421629849 -879997638 354013854 -694574320 509100507 249626589 245607378 28516886 217429069 -816798487 619319913 -459460747 316793141 -764594751 505893788 918363286 658266988 946941301 657097580 -263806376 -556107524 -956640168 ...

output:

0

result:

ok single line: '0'

Test #94:

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

input:

5000 10000
-236867122 938357353 -677695695 -462947830 164364149 314568276 469922434 516298854 710492409 447621967 -892616749 -451283404 604044066 -301442897 -607668121 696394226 -270838182 40270909 305827512 -885629204 -702288182 537414970 108242160 576838100 -509212522 -942643534 -8817175 -85117737...

output:

0

result:

ok single line: '0'

Test #95:

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

input:

5000 10000
688404867 -275734727 32002445 551227240 880460717 854383927 -663152270 628782335 65468182 423152833 9887331 714887289 242200830 54967586 -539826594 799067875 -365894339 766492036 -631976109 -655087794 -746959403 -644336375 130909393 308610526 255913515 718529248 466770255 492621549 312689...

output:

0

result:

ok single line: '0'

Test #96:

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

input:

5000 10000
-857426087 -891470343 -57543269 175395472 993791559 506183429 -556255148 -724625196 941915695 218200144 -204274260 -509421117 -400473989 85759123 178526189 319744377 367556265 260965275 -119077353 -631965997 -792054076 -751667402 -898377551 941610415 -509843192 17904349 -635385671 1561563...

output:

0

result:

ok single line: '0'

Test #97:

score: 0
Accepted
time: 12ms
memory: 130360kb

input:

5000 10000
-60029269 736581160 83050556 -124199188 523172738 23182738 764583021 261312847 714827659 790200687 285670963 -281725657 -584848398 -558547889 -213747270 -217278306 167404514 921511230 147419185 238454290 -111178831 -854880164 249867239 914190115 597811484 -335101666 108024809 200891265 17...

output:

378

result:

ok single line: '378'

Test #98:

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

input:

5000 10000
-317610981 615321084 -481839023 -171283818 -112913452 705451242 30337900 384283681 -89565733 -974546120 -249236157 -49081191 85203774 255964647 749399998 -503659706 939805765 653565136 307135108 128577583 -533470000 662965284 -955387501 -157950927 722651010 775374075 997161418 421419736 -...

output:

73610

result:

ok single line: '73610'

Test #99:

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

input:

5000 10000
847724073 728929499 703379245 -826178892 -66014146 -560791152 646730630 345997495 -303905886 -679959483 -216005362 529963964 275103026 -964257143 -355304034 373064343 873007545 -813610934 26715384 -767683918 -173482871 -409125730 893950649 -288285133 232923385 104605383 -364742300 -287400...

output:

2024

result:

ok single line: '2024'

Test #100:

score: 0
Accepted
time: 12ms
memory: 132300kb

input:

5000 10000
-344782730 144060599 -621990460 -373015484 -300740559 919364664 -831632873 -290660697 426289515 -661985432 -747346717 -508852589 11692995 131437592 -458558779 -104288708 -465993077 284353883 396481129 437430995 199276770 -436946295 197314713 -344079101 289985143 45562977 -832888309 633183...

output:

4453

result:

ok single line: '4453'

Test #101:

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

input:

5000 10000
503357164 126076237 -2016787 869163304 96582051 249743417 385176809 657835569 864660257 578103995 -179729086 -726562219 -742559850 548516100 -782656901 -906645089 -770277939 346017980 -90513023 720322849 -723797230 -880213524 -245251518 -110743984 630130045 136564028 -872664437 448830492 ...

output:

5700

result:

ok single line: '5700'

Test #102:

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

input:

5000 10000
179940974 -290061618 466660508 -513907423 -401155636 -527664870 -663654900 -572565634 327465210 -985508203 284294493 474359702 -203032035 759065919 251016557 -622383072 -985469656 -767470612 27009466 787298021 -975033240 574800879 509113947 905497942 38883051 -956800194 -188470179 -937154...

output:

228

result:

ok single line: '228'

Test #103:

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

input:

5000 10000
-359318860 -357894752 -458940513 -790809867 -366545935 407060021 -803525810 -185403311 -421362391 -173702685 -187804157 334395680 906217335 -45366024 819862238 -569081981 -59744267 160195946 758323814 613030685 329864156 224446891 -694962344 -978656634 -880270671 -557090930 820880002 -479...

output:

1921

result:

ok single line: '1921'

Test #104:

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

input:

5000 10000
-654762636 455185356 768678212 130284272 541765551 -401658848 635671375 -176117879 -213920260 212541504 -623313338 173511293 199927857 -715115197 120098420 630114206 499234255 -869058073 410335822 -583671130 -9321984 -29412180 -896438040 265557408 -240825722 731392919 -287108426 -76431317...

output:

0

result:

ok single line: '0'

Test #105:

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

input:

5000 10000
794463142 1384419 245192661 653403662 -110685662 -639423967 864689079 -418962589 -530921025 518915359 -246556412 -506832591 -197209152 821917168 269786607 -83872014 221782479 472010676 -990842259 -623595577 -72557218 911196567 499899650 377885989 466169446 -228913932 872653957 957987345 -...

output:

16

result:

ok single line: '16'

Test #106:

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

input:

5000 10000
-549397218 214760852 -124310096 760497528 797910648 -566579569 -714532265 -52003039 -66606074 -754362599 -412959855 -798278089 -836226440 952840191 -578982409 951976383 -220541623 26029050 948192314 528302400 -399168569 -908877265 494678845 103016323 436457610 610570059 -449888500 7937352...

output:

3330

result:

ok single line: '3330'

Test #107:

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

input:

5000 10000
959268003 -999233315 -247400357 58506979 -103828516 -421262349 93342221 777119609 735710746 493649108 -428013940 521750375 203062975 -875292720 380241533 193695332 119877331 -494717281 631089643 416703944 376666694 -157652713 897562181 262844626 -578392499 263508508 429605427 224709586 -1...

output:

0

result:

ok single line: '0'

Test #108:

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

input:

5000 10000
-268633158 200466437 508770259 110564395 513637226 10353736 168355476 113187815 436665893 -300685877 770718327 -205502841 227159008 -619778704 405113489 -728573871 -450830295 890644956 -871575091 944852769 690304223 734282701 -857014024 -59490221 -976650181 53810179 173566285 -744362370 -...

output:

0

result:

ok single line: '0'

Test #109:

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

input:

5000 10000
-555905660 88297800 927230156 -928916175 -345203087 -930870216 -492873433 706113867 -514421291 -525269611 420916235 -626313501 -154946656 406818431 -614506599 -539905994 -763094520 421065482 -862501689 313213460 -758680188 233009564 97970694 -686980784 758473262 622425557 49482866 -538803...

output:

0

result:

ok single line: '0'

Test #110:

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

input:

5000 10000
-712876109 567965178 -184829117 -671367166 -640012444 -396995092 -798412522 -348167697 -54089480 436467908 654145243 447226587 -436761715 647733074 -578978031 -741266390 231470011 -762445512 235967190 -133893654 -582449768 996704380 483488840 -887107566 68943363 -123881011 -881161073 2868...

output:

0

result:

ok single line: '0'

Test #111:

score: -100
Time Limit Exceeded

input:

190369 108429
-858397364 960727080 758320490 780561934 163744667 867815055 -973859091 -54992807 872976386 -622750801 215015459 -765719291 -421605299 -45585011 428491229 -512417626 368211241 -453064763 267106015 -764730614 -638302332 -721293718 633459745 707596725 128562885 -710246424 -341761151 8516...

output:


result: