QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#431269#1132. Financial ReportIDontKnowGoodNames#100 ✓430ms28120kbC++172.0kb2024-06-05 08:44:522024-06-05 08:44:52

Judging History

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

  • [2024-06-05 08:44:52]
  • 评测
  • 测评结果:100
  • 用时:430ms
  • 内存:28120kb
  • [2024-06-05 08:44:52]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int NR=3e5+10;
int n,k,a[NR],idx[NR],f[NR],ans;
struct task{
	int x,id;
	bool operator <(const task &T)const{
		if(x!=T.x)return x<T.x;
		return id>T.id; 
	}
}t[NR];

#define lson (id<<1)
#define rson (id<<1|1)
#define mid ((l+r)>>1)
int minv[NR<<2],maxf[NR<<2],sum[NR<<2],tag[NR<<2];
void addtag(int id,int x){
	minv[id]=tag[id]=x;
} 
void pushdown(int id,int l,int r){
	if(l==r||!tag[id])return;
	addtag(lson,tag[id]);addtag(rson,tag[id]);
	tag[id]=0;
}
void update(int id){
	maxf[id]=max(maxf[lson],maxf[rson]);
	minv[id]=min(minv[lson],minv[rson]);
	sum[id]=sum[lson]+sum[rson];
}
void buildtree(int id,int l,int r){
	minv[id]=1e9;
	if(l==r)return;
	buildtree(lson,l,mid);
	buildtree(rson,mid+1,r);
}
void modify(int id,int l,int r,int L,int R,int x){
	pushdown(id,l,r);
	if(r<L||R<l)return;
	if(L<=l&&r<=R){
		addtag(id,x);
		return;
	}
	modify(lson,l,mid,L,R,x);
	modify(rson,mid+1,r,L,R,x);
	update(id);
}
void change(int id,int l,int r,int pos,int x,int v){
	pushdown(id,l,r);
	if(l==r){
		maxf[id]=x;minv[id]=v;sum[id]=1;
		return;
	}
	if(pos<=mid)change(lson,l,mid,pos,x,v);
	else change(rson,mid+1,r,pos,x,v);
	update(id);
}
void erase(int id,int l,int r,int x){
	pushdown(id,l,r);
	if(minv[id]>x||!sum[id])return;
	if(l==r){
		maxf[id]=0;minv[id]=1e9;sum[id]=0;
		return;
	}
	erase(lson,l,mid,x);
	erase(rson,mid+1,r,x);
	update(id); 
}
int query(int id,int l,int r,int L,int R){
	pushdown(id,l,r);
	if(r<L||R<l)return 0;
	if(L<=l&&r<=R)return maxf[id];
	int res=max(query(lson,l,mid,L,R),query(rson,mid+1,r,L,R));
	update(id);
	return res;
}

int main(){
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i],t[i]=task{a[i],i};
	sort(t+1,t+1+n);
	for(int i=1;i<=n;i++)idx[t[i].id]=i;
	for(int i=1;i<=n;i++){
		erase(1,1,n,i-k-1);
		f[i]=query(1,1,n,1,idx[i]-1)+1;
		change(1,1,n,idx[i],f[i],i);
		modify(1,1,n,idx[i]+1,n,i);
		ans=max(ans,f[i]);
	}
	cout<<ans<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 14
Accepted

Test #1:

score: 14
Accepted
time: 2ms
memory: 13896kb

input:

1 1
314159265

output:

1

result:

ok single line: '1'

Test #2:

score: 14
Accepted
time: 2ms
memory: 13904kb

input:

1 1
0

output:

1

result:

ok single line: '1'

Test #3:

score: 14
Accepted
time: 0ms
memory: 13908kb

input:

1 1
1000000000

output:

1

result:

ok single line: '1'

Test #4:

score: 14
Accepted
time: 0ms
memory: 7700kb

input:

2 1
299792458 299792458

output:

1

result:

ok single line: '1'

Test #5:

score: 14
Accepted
time: 0ms
memory: 13984kb

input:

2 1
141421356 173205080

output:

2

result:

ok single line: '2'

Test #6:

score: 14
Accepted
time: 1ms
memory: 9688kb

input:

2 1
244948974 223606797

output:

1

result:

ok single line: '1'

Test #7:

score: 14
Accepted
time: 0ms
memory: 7712kb

input:

2 2
299792458 299792458

output:

1

result:

ok single line: '1'

Test #8:

score: 14
Accepted
time: 2ms
memory: 11736kb

input:

2 2
141421356 173205080

output:

2

result:

ok single line: '2'

Test #9:

score: 14
Accepted
time: 0ms
memory: 7696kb

input:

2 2
244948974 223606797

output:

1

result:

ok single line: '1'

Test #10:

score: 14
Accepted
time: 1ms
memory: 9748kb

input:

3 1
500000000 1000000000 0

output:

2

result:

ok single line: '2'

Test #11:

score: 14
Accepted
time: 0ms
memory: 7776kb

input:

3 2
500000000 1000000000 0

output:

2

result:

ok single line: '2'

Test #12:

score: 14
Accepted
time: 0ms
memory: 11788kb

input:

4 1
0 1000000000 200000000 500000000

output:

2

result:

ok single line: '2'

Test #13:

score: 14
Accepted
time: 0ms
memory: 13912kb

input:

4 2
0 1000000000 200000000 500000000

output:

3

result:

ok single line: '3'

Test #14:

score: 14
Accepted
time: 2ms
memory: 13956kb

input:

5 2
111111111 888888888 555555555 222222222 444444444

output:

2

result:

ok single line: '2'

Test #15:

score: 14
Accepted
time: 1ms
memory: 7656kb

input:

19 1
876813783 876813783 294665595 1000000000 515198511 876813783 876813783 294665595 403855901 439947219 439947219 403855901 581007064 294665595 1000000000 581007064 294665595 865289906 865289906

output:

5

result:

ok single line: '5'

Test #16:

score: 14
Accepted
time: 1ms
memory: 7756kb

input:

17 2
49121102 449215299 18829293 449463830 765492419 440501697 233785699 50699732 569054461 105188844 983737936 877900994 0 44809615 361020433 74987201 725464354

output:

5

result:

ok single line: '5'

Test #17:

score: 14
Accepted
time: 1ms
memory: 7724kb

input:

15 3
807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796 807337796

output:

1

result:

ok single line: '1'

Test #18:

score: 14
Accepted
time: 1ms
memory: 9768kb

input:

20 7
733581184 733581184 0 205928229 0 733581184 1000000000 733581184 0 815970650 975939523 0 815970650 975939523 0 205928229 0 733581184 205928229 815970650

output:

5

result:

ok single line: '5'

Test #19:

score: 14
Accepted
time: 1ms
memory: 7712kb

input:

18 12
1000000000 358612551 1000000000 358612551 358612551 358612551 358612551 1000000000 1000000000 1000000000 358612551 358612551 1000000000 1000000000 358612551 1000000000 1000000000 358612551

output:

2

result:

ok single line: '2'

Test #20:

score: 14
Accepted
time: 1ms
memory: 9896kb

input:

20 20
802421546 601860856 909073419 815745406 913824895 924761528 954389636 774128549 427176220 23722581 439396497 59191904 121848351 774320268 817458024 565828491 890339952 82761751 717137276 524535907

output:

6

result:

ok single line: '6'

Test #21:

score: 14
Accepted
time: 0ms
memory: 7708kb

input:

20 2
220907318 325117564 759996279 361226977 713619929 530965981 367577457 488411054 555070688 620059582 541892208 949650763 645304844 727718360 709566813 803811825 110264462 960815323 875849635 450666865

output:

10

result:

ok single line: '10'

Test #22:

score: 14
Accepted
time: 1ms
memory: 9884kb

input:

20 4
920699809 20405458 430167187 323905322 321816206 337791282 869436958 505338540 45509543 532042224 672842133 816481120 854290279 948611594 979068279 996148973 674793874 347773693 320013346 759492294

output:

11

result:

ok single line: '11'

Test #23:

score: 14
Accepted
time: 0ms
memory: 13964kb

input:

20 1
10000000 60000000 110000000 160000000 210000000 260000000 310000000 360000000 410000000 460000000 510000000 560000000 610000000 660000000 710000000 760000000 810000000 860000000 910000000 960000000

output:

20

result:

ok single line: '20'

Test #24:

score: 14
Accepted
time: 0ms
memory: 9828kb

input:

20 1
970000000 920000000 870000000 820000000 770000000 720000000 670000000 620000000 570000000 520000000 470000000 420000000 370000000 320000000 270000000 220000000 170000000 120000000 70000000 20000000

output:

1

result:

ok single line: '1'

Test #25:

score: 14
Accepted
time: 0ms
memory: 13832kb

input:

16 5
68514423 410103741 591567982 865691960 982387008 223996512 306149309 324123848 352045607 927590130 238419389 252822214 452213108 539870292 860882612 965882206

output:

9

result:

ok single line: '9'

Test #26:

score: 14
Accepted
time: 2ms
memory: 13980kb

input:

17 4
22790108 220864673 248053769 404589265 637574960 166412775 260226295 262479043 286448651 300001992 734205739 58675918 181211505 263369364 299892200 509157732 867133240

output:

9

result:

ok single line: '9'

Subtask #2:

score: 14
Accepted

Dependency #1:

100%
Accepted

Test #27:

score: 14
Accepted
time: 0ms
memory: 9816kb

input:

400 1
697625071 338955244 701273756 765293932 12805194 46984119 775140965 390552579 875281333 950702147 361444232 680144638 917418512 747923326 543035419 899203308 659270340 218742714 484689980 866434940 270117732 538163289 665365203 226080481 734351408 300250974 824534838 56953777 250622631 4998775...

output:

15

result:

ok single line: '15'

Test #28:

score: 14
Accepted
time: 1ms
memory: 7792kb

input:

397 4
467705846 767740944 895438469 533795958 693293401 869030737 691890948 522874750 670064696 815950426 83220749 368503752 5886628 670367518 609376726 194811413 318102838 766625872 758649856 845072193 606306969 52285365 72714393 155785860 666438261 387383555 79107247 370372410 228320080 342363590 ...

output:

26

result:

ok single line: '26'

Test #29:

score: 14
Accepted
time: 0ms
memory: 9836kb

input:

375 7
419990450 226023065 518565144 389170913 6829200 997083989 55187689 570620839 206928279 344779139 772964274 597404515 211682354 376663678 431873380 459063765 949200561 855646588 968869829 258337829 459063765 389170913 877761657 893177314 949200561 914249958 155847450 195707470 313542363 6024787...

output:

30

result:

ok single line: '30'

Test #30:

score: 14
Accepted
time: 2ms
memory: 9768kb

input:

382 14
297641955 579261299 693365773 503834660 625185678 930401348 231126864 588719210 115995879 871663635 258093515 21599253 717037833 133866136 302501944 794309456 331324463 33313393 169169419 178114058 513684028 420634528 381201674 795038522 120614458 785418360 709760430 156406189 724382191 13433...

output:

33

result:

ok single line: '33'

Test #31:

score: 14
Accepted
time: 1ms
memory: 7748kb

input:

398 68
87296112 87296112 0 0 87296112 87296112 87296112 0 0 0 87296112 0 87296112 87296112 0 87296112 87296112 0 0 87296112 0 0 0 87296112 0 0 0 0 87296112 87296112 87296112 87296112 0 87296112 0 0 87296112 0 87296112 87296112 0 0 87296112 87296112 87296112 87296112 0 87296112 0 0 0 87296112 0 0 872...

output:

2

result:

ok single line: '2'

Test #32:

score: 14
Accepted
time: 0ms
memory: 9836kb

input:

400 400
313643918 524837714 454497606 202185266 437460102 990219224 516405597 233454847 415501995 729752658 126493633 349361696 745579115 265649159 131329130 891526222 924054909 942306716 304196292 299533653 551317273 576482438 187264127 512575413 296382331 880052159 639485797 822109205 525502039 92...

output:

37

result:

ok single line: '37'

Test #33:

score: 14
Accepted
time: 2ms
memory: 9832kb

input:

400 2
572992061 931760159 538911610 891579979 861642215 54327796 130767579 217152621 806772462 958998532 482498465 110236290 534509333 90384831 344203521 398544881 920189563 166667845 630221338 89304326 788119936 598881289 996249896 499062241 215002930 456126547 938742792 76742232 377279685 91368408...

output:

178

result:

ok single line: '178'

Test #34:

score: 14
Accepted
time: 2ms
memory: 9908kb

input:

400 6
32850957 474568476 227393309 630723698 167871732 354713013 389685651 299988790 967355970 965004350 715503841 467286086 498715418 471251794 460548737 517020574 748737219 244292652 90334581 755243526 495303468 333725872 857155431 190563758 754274079 750605544 808305303 937057193 418690406 968735...

output:

121

result:

ok single line: '121'

Test #35:

score: 14
Accepted
time: 1ms
memory: 7724kb

input:

400 8
79961857 576026118 16651375 879359072 193504323 569824876 634814541 871160695 511489526 173357034 97742195 84534766 954895737 964675532 544456288 68397614 125750383 789974450 428100633 274455301 851478710 380463960 686092199 325634643 617240385 320281317 103433469 850604969 887147210 652637705...

output:

81

result:

ok single line: '81'

Test #36:

score: 14
Accepted
time: 2ms
memory: 9912kb

input:

400 36
672509835 968244063 457843819 533220194 8063350 409206579 168978949 466574816 899087033 285953558 728053213 894434695 257073896 414052552 552097198 102236348 2414491 911600232 776967305 747095786 360363242 22141552 578403058 819697857 5849647 373314810 825058085 343112586 8395386 956557769 36...

output:

60

result:

ok single line: '60'

Test #37:

score: 14
Accepted
time: 1ms
memory: 7728kb

input:

391 5
15756643 28559248 17487648 28685063 41063081 16751972 11095509 23603424 24823382 7038374 41161660 18075846 20970076 12807907 26381790 18306742 40221542 46262836 44038516 35183563 35171512 39407822 32878890 52404899 22696539 57205882 38655319 49528464 49655633 29146099 43241199 55320605 4496007...

output:

130

result:

ok single line: '130'

Test #38:

score: 14
Accepted
time: 2ms
memory: 9804kb

input:

389 8
132932626 51483275 53053136 39473371 114679338 82014215 117871074 4578588 38886546 184183396 96824433 110271307 8869552 87165913 202416955 13377084 92703547 98501358 81507515 9116699 115752025 262825071 65150741 59092990 107677249 140705122 30582132 80644036 190412737 104863688 97316270 785163...

output:

72

result:

ok single line: '72'

Test #39:

score: 14
Accepted
time: 1ms
memory: 9828kb

input:

400 17
151095706 190975190 436755026 544554326 627550531 662975688 731354911 839795955 127584834 135440339 215656518 357864438 746751018 786782791 810927606 811210605 1237342 66583570 331360859 368102996 500057934 742456547 813503798 981487152 17041396 274598434 683481223 698445202 704291741 8901336...

output:

39

result:

ok single line: '39'

Test #40:

score: 14
Accepted
time: 1ms
memory: 7788kb

input:

400 26
919068014 915312027 877597208 861346503 861071054 802433166 769027385 749253388 747182416 736938102 716626759 709839569 693282274 676841819 642280286 621501313 616134084 612553098 477369992 409815828 362120372 324994216 312898769 278866725 267550910 230290918 198714023 159535083 145963617 144...

output:

12

result:

ok single line: '12'

Subtask #3:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #41:

score: 20
Accepted
time: 8ms
memory: 10088kb

input:

7000 1
894882663 687753860 274846006 785270210 3034342 194264610 291176506 356300576 120019831 305340082 101303261 801498371 440274687 761247865 857100563 398852968 963685664 414803100 659457692 531909044 617088521 745956160 841866618 606356828 951489050 862821239 183071512 867632063 206346442 96390...

output:

16

result:

ok single line: '16'

Test #42:

score: 20
Accepted
time: 8ms
memory: 8004kb

input:

6891 2
632527524 380090567 457881486 582901705 708262391 626697081 867421844 784051327 543701519 188202428 101402683 828650744 340629967 952806253 467068793 47484909 242849333 236919334 881161983 645230044 547203841 720367375 757188731 219094902 333520200 837043846 977837 372876193 773042618 6064653...

output:

61

result:

ok single line: '61'

Test #43:

score: 20
Accepted
time: 6ms
memory: 7996kb

input:

6947 5
0 606521094 606521094 71862996 833581144 71862996 606521094 0 71862996 0 0 71862996 606521094 606521094 71862996 606521094 0 71862996 833581144 0 606521094 71862996 606521094 833581144 71862996 606521094 0 71862996 606521094 606521094 606521094 833581144 606521094 71862996 0 71862996 71862996...

output:

4

result:

ok single line: '4'

Test #44:

score: 20
Accepted
time: 6ms
memory: 10124kb

input:

6082 17
653825844 95003719 232511819 282711510 413302615 295686021 729879996 390205014 704773361 41234297 927053886 125874319 684535027 787769423 447975483 725930843 29298948 192207929 861267968 748889787 265752982 748201966 993282254 185270081 794213726 137379742 968170538 583426317 278561844 67425...

output:

130

result:

ok single line: '130'

Test #45:

score: 20
Accepted
time: 6ms
memory: 10084kb

input:

6598 239
119845597 214713881 621450789 155237032 362833540 427146986 911580330 429805492 287020533 803270157 330531943 869240942 378374360 701999344 374194594 137325913 211388065 240199215 212418273 772905399 215550283 197154671 998482968 740996765 248290110 737918383 520172181 420153620 987228969 6...

output:

155

result:

ok single line: '155'

Test #46:

score: 20
Accepted
time: 6ms
memory: 10084kb

input:

7000 7000
878120849 707107263 545848166 957389012 415182409 616010725 489144426 366437303 96187160 829743578 588284055 89692724 148894245 722236778 454753205 869731774 227942653 969689769 882913893 344439431 959034671 911507934 610544102 228398651 580991988 147548958 877099070 940338556 942651766 10...

output:

155

result:

ok single line: '155'

Test #47:

score: 20
Accepted
time: 7ms
memory: 10072kb

input:

6700 3
278590013 12588909 958880531 247155375 380042332 373025120 894279121 25453788 191885364 700319075 357247233 726517884 592025671 927795034 790414908 512393766 121146395 101594668 850993017 20094136 153277941 426471417 914571733 257378911 756667582 63233739 335465243 790162055 158804185 2781735...

output:

3834

result:

ok single line: '3834'

Test #48:

score: 20
Accepted
time: 7ms
memory: 8052kb

input:

6800 7
704128693 234065385 172120190 718808373 620392552 972063868 84418881 649704234 488070112 12224911 827692119 840223369 767923697 84882056 346017250 597306318 875973576 896790035 367946936 795401539 924624576 164190602 612848948 246557796 695878609 668410588 894320416 56926549 529468578 9389639...

output:

1236

result:

ok single line: '1236'

Test #49:

score: 20
Accepted
time: 7ms
memory: 10072kb

input:

6900 35
450072458 945833108 213437623 912112388 985894141 186455424 359328402 476293022 625433483 723805554 378833024 917292930 464791730 128577839 175175834 180497438 579466933 911153055 201534372 169949982 299401590 316688282 432415476 119133990 520604741 575354077 794734809 709724209 678982039 52...

output:

276

result:

ok single line: '276'

Test #50:

score: 20
Accepted
time: 7ms
memory: 10152kb

input:

7000 68
532612757 527223309 335822658 593825853 417795604 2264523 268671227 666318862 460682554 922630283 15650021 724245039 952429216 462944193 190215750 428930202 430841267 480841752 493844310 168757618 280423325 549533863 876080714 501508186 792030638 552016853 645867171 479201045 792233395 98555...

output:

228

result:

ok single line: '228'

Test #51:

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

input:

7000 1
12371016 8610235 12925395 3165091 6966911 11327287 5049186 17141933 4501546 13209104 13110873 8144503 1588461 23954099 6678958 3618181 12158459 11941082 9211122 1971044 7133482 15319252 9892103 12928703 6904543 8704990 6713320 3185737 16950682 20043309 14338545 7075289 12980599 26058526 56502...

output:

217

result:

ok single line: '217'

Test #52:

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

input:

7000 2
72214509 129054035 57936632 37588781 21847484 19982056 52674224 94225753 247073840 36658623 5392933 129435716 289586017 135719622 42779872 10181692 104309873 334712429 18690144 65622212 87488882 68599904 109598208 92149674 55199635 106726324 77849583 65482911 23438019 4858238 168091315 310376...

output:

111

result:

ok single line: '111'

Test #53:

score: 20
Accepted
time: 7ms
memory: 14036kb

input:

7000 7
110338 479413 254382 729010 755017 561788 1378622 968942 1222542 1531947 1386814 2133421 1207310 2168019 2031279 2031846 1997685 2133510 2488581 2088526 2906032 3184421 3125430 3223973 3159361 4138311 3537975 3385416 3659566 3945523 4598674 4607925 4129777 4090764 4813146 4990584 4964286 5362...

output:

4043

result:

ok single line: '4043'

Test #54:

score: 20
Accepted
time: 6ms
memory: 9996kb

input:

7000 58
2900991 1055588 2399597 6142594 6181086 1808857 826500 8537340 2409664 7200602 1689042 2272979 2940795 102354 10332963 11754508 1461010 7247260 10277442 13361648 3877144 10992372 9570062 7670553 9121416 4305570 6820379 5620512 14691324 9550730 5468515 3818933 11979975 8111300 3109632 9400414...

output:

1121

result:

ok single line: '1121'

Test #55:

score: 20
Accepted
time: 6ms
memory: 8136kb

input:

7000 316
294291327 278108753 144036115 69606222 199317479 1409237 24677629 172814612 286057385 131747009 212302034 415887769 1523474 203796971 121516354 34438481 34892874 279537657 38843996 346920348 249062012 73577270 163223033 93533196 10276911 119511490 465241848 207696181 522797448 60403937 2476...

output:

220

result:

ok single line: '220'

Test #56:

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

input:

6953 307
2358163 54923986 78689040 184011021 253580116 289436715 349695004 377127530 413972065 419316830 430120611 519220523 548185667 624001566 656828754 746687724 773106933 778472491 814222959 832172554 838088251 868264391 889869687 900918350 927954019 997477453 23576089 59505438 59789546 15618395...

output:

176

result:

ok single line: '176'

Test #57:

score: 20
Accepted
time: 7ms
memory: 10132kb

input:

6986 59
30267579 114526919 245210016 295643487 361933372 447212121 472771088 524922966 611744621 636556557 658856037 666671065 699978432 730424683 750060133 892523422 930965374 987105849 993292938 48947611 153884610 162604789 176777279 191444673 237985496 403726785 407914282 415296823 415641800 4239...

output:

176

result:

ok single line: '176'

Test #58:

score: 20
Accepted
time: 6ms
memory: 14092kb

input:

7000 6997
415885 999929409 999896770 999400299 999163707 998994317 998963012 998668376 998646012 998458918 998351634 998085441 997755439 997504500 997434792 997192000 997090131 997086503 997047292 996874409 996775206 996747081 996729268 996716844 996599233 996338116 996020139 995913390 995525081 995...

output:

2

result:

ok single line: '2'

Test #59:

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

input:

7000 6998
81326 999994313 999939097 999888570 999842220 999636662 999566806 999480316 999048212 998947874 998251994 998099804 997551809 997469989 997426516 997315246 996850633 996665454 996489994 996396157 996170003 995829721 995619805 995573643 995417797 995394295 995301375 995248858 995166331 9949...

output:

3

result:

ok single line: '3'

Test #60:

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

input:

6810 295
163903 968076529 965947171 961243931 956895936 953825367 951583637 949848288 946878692 943337079 940835736 937314270 934299805 932552285 928858986 925759101 921861430 918345907 916386415 913461413 910477403 907364272 904849286 902042203 898062809 894579670 892279266 887649802 884946400 8813...

output:

24

result:

ok single line: '24'

Test #61:

score: 20
Accepted
time: 6ms
memory: 11888kb

input:

6810 296
364363 970268896 967154068 963380385 959868528 956963449 953758508 949841769 945709162 941659488 938241908 935471564 931953505 928521770 924058667 921097263 917855847 914813939 911311542 907656476 905352658 901171765 898895367 896078927 893785158 889172282 885948979 882092490 877449012 8731...

output:

25

result:

ok single line: '25'

Subtask #4:

score: 12
Accepted

Test #62:

score: 12
Accepted
time: 256ms
memory: 27404kb

input:

300000 1
285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 2...

output:

1

result:

ok single line: '1'

Test #63:

score: 12
Accepted
time: 318ms
memory: 26436kb

input:

299971 1
213313757 312061773 790195557 213313757 0 790195557 30936680 832403554 312061773 30936680 0 213313757 329317874 329317874 0 0 329317874 329317874 0 213313757 329317874 790195557 832403554 832403554 329317874 312061773 832403554 832403554 329317874 329317874 312061773 790195557 790195557 790...

output:

7

result:

ok single line: '7'

Test #64:

score: 12
Accepted
time: 380ms
memory: 27676kb

input:

299964 1
999391533 795527538 725929353 340564009 761636306 1000000000 266904585 105958508 549383838 340564009 431998269 141078858 236783723 651207509 554129129 514310143 802266954 185376130 366537845 883789079 688298181 621545068 692525271 555960625 415080461 468820678 149895819 709946893 415080461 ...

output:

15

result:

ok single line: '15'

Test #65:

score: 12
Accepted
time: 430ms
memory: 27348kb

input:

300000 1
548117244 559216957 507201469 40534874 269192764 516346951 183733704 869745777 781914589 551408564 699975473 735567843 438862496 240429620 67594019 153803925 72746062 343276550 121453383 412576614 208627475 771041507 950354624 832001069 221477371 192349583 674402432 552830114 73583781 83795...

output:

27

result:

ok single line: '27'

Test #66:

score: 12
Accepted
time: 360ms
memory: 27092kb

input:

300000 1
691596759 196814375 574002903 594314532 982102853 676133704 51798090 506287024 603831698 332571699 178065016 71628067 59716653 762524657 554265870 950792677 301567670 821363269 109779474 783340951 247333489 525773395 351088520 438229302 527706457 82894430 867332858 179925618 508622616 66518...

output:

884

result:

ok single line: '884'

Test #67:

score: 12
Accepted
time: 430ms
memory: 27192kb

input:

300000 1
508573390 653912933 525806709 842004427 840728278 229089762 812466273 74713576 264668073 60014628 114629166 490347940 65502437 978210434 145920485 2253440 570123282 966368812 123749349 598895954 650307775 739167010 695523885 568813226 673823768 163707323 266177084 902827760 68463107 2067017...

output:

103

result:

ok single line: '103'

Test #68:

score: 12
Accepted
time: 267ms
memory: 27600kb

input:

298001 1
0 3000 6000 9000 12000 15000 18000 21000 24000 27000 30000 33000 36000 39000 42000 45000 48000 51000 54000 57000 60000 63000 66000 69000 72000 75000 78000 81000 84000 87000 90000 93000 96000 99000 102000 105000 108000 111000 114000 117000 120000 123000 126000 129000 132000 135000 138000 141...

output:

298001

result:

ok single line: '298001'

Test #69:

score: 12
Accepted
time: 260ms
memory: 27276kb

input:

299000 1
1000000000 999997000 999994000 999991000 999988000 999985000 999982000 999979000 999976000 999973000 999970000 999967000 999964000 999961000 999958000 999955000 999952000 999949000 999946000 999943000 999940000 999937000 999934000 999931000 999928000 999925000 999922000 999919000 999916000 ...

output:

1

result:

ok single line: '1'

Test #70:

score: 12
Accepted
time: 262ms
memory: 27604kb

input:

300000 1
51267 48487 51734 58209 66692 65845 71175 71732 83572 79254 83251 84629 87645 94230 94738 100344 109931 112084 109549 113351 119313 127359 123183 126791 128597 137279 141116 149449 140623 148493 149407 162451 157006 167247 165547 165108 173471 171258 179567 178965 180527 191627 193481 19801...

output:

199817

result:

ok single line: '199817'

Test #71:

score: 12
Accepted
time: 254ms
memory: 26912kb

input:

300000 1
999954124 999961493 999949571 999940534 999946372 999925293 999921072 999931534 999929095 999921784 999918158 999912773 999912775 999907080 999901635 999906959 999895997 999914791 999898797 999887896 999886196 999879293 999878173 999860009 999870934 999862029 999856087 999870137 999855763 9...

output:

6

result:

ok single line: '6'

Test #72:

score: 12
Accepted
time: 367ms
memory: 27092kb

input:

300000 1
55790207 24851814 5936441 5673060 10133935 26545446 6192893 19286522 1039500 10348355 18571272 21565109 2707724 2645056 7768362 16168158 30490652 14472735 41080293 17329687 29499736 27215909 1570578 20363064 29573893 15689924 2964459 38913136 3086679 27953900 5577610 9113792 8417327 2795942...

output:

173

result:

ok single line: '173'

Test #73:

score: 12
Accepted
time: 379ms
memory: 27736kb

input:

300000 1
986224645 973290423 921165567 942477463 990040077 973659018 993652908 957835882 900146494 991231459 916204391 995878673 940086940 984600081 948674214 939427627 982916850 936106236 905592641 995543085 991453079 927386355 873454036 929562047 975674525 959756113 960251352 996473311 940368512 9...

output:

24

result:

ok single line: '24'

Test #74:

score: 12
Accepted
time: 378ms
memory: 27008kb

input:

300000 1
1074087 1395268 3277962 4530953 7048294 8442637 9391344 10199114 10556943 10873532 10954804 12009054 12203474 12877543 13677744 14068323 14499068 14748767 15532706 16080395 16439403 16639545 17139008 17485645 18247183 20479594 22874753 24727837 24902867 25239038 25411476 26015570 26210533 2...

output:

1347

result:

ok single line: '1347'

Test #75:

score: 12
Accepted
time: 408ms
memory: 26560kb

input:

300000 1
988050337 978814479 951726265 944396353 940609759 923184414 913787618 910930128 903521243 878390362 873253523 858528019 843354656 841931158 836360030 815304982 794519954 790267809 772866477 770579401 742214422 734000478 713784823 586112422 580474117 560105339 556897652 551354844 537217385 5...

output:

19

result:

ok single line: '19'

Subtask #5:

score: 5
Accepted

Test #76:

score: 5
Accepted
time: 230ms
memory: 27416kb

input:

300000 300000
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 ...

output:

1

result:

ok single line: '1'

Test #77:

score: 5
Accepted
time: 274ms
memory: 27688kb

input:

299994 299994
799095588 515641284 851040998 371590609 581412250 114983578 870953189 65883574 114983578 546636247 675572999 416143410 763181943 799095588 564152084 521371792 455808474 799095588 870953189 839155298 684313832 605076527 675572999 219704773 684313832 372618560 875093839 41381734 11498357...

output:

85

result:

ok single line: '85'

Test #78:

score: 5
Accepted
time: 303ms
memory: 26704kb

input:

299967 299967
55436237 815265051 726638198 232614559 766667170 589412354 222916094 881505795 351969379 185039621 500722663 929961726 12106126 527589224 131615979 740414875 483735803 961030961 685115515 630631167 847411283 606876236 853479813 969869770 978153478 951567612 284079913 655441675 23301827...

output:

1000

result:

ok single line: '1000'

Test #79:

score: 5
Accepted
time: 322ms
memory: 27612kb

input:

300000 300000
501796523 297945585 927399536 440670566 495542465 80848196 28003478 540869900 992383926 48799286 967913195 572970230 215873915 538679144 853459893 70385046 947090071 440258092 348827388 912684078 519842448 805256446 548573509 148406683 373586707 74817790 975254107 599779344 939526125 4...

output:

1079

result:

ok single line: '1079'

Test #80:

score: 5
Accepted
time: 292ms
memory: 27620kb

input:

300000 300000
863887522 425397042 713124005 773467613 489882500 437277345 139704179 557800941 215336895 161026143 927354002 294297768 165771354 512842947 537130652 175822358 136551779 148723787 79361863 416871734 644501573 743434372 557135739 94545556 438248865 141290994 550236652 94773186 137640908...

output:

119010

result:

ok single line: '119010'

Test #81:

score: 5
Accepted
time: 324ms
memory: 27548kb

input:

300000 300000
261069220 62324615 942003105 79398536 881237922 660291668 342301327 287380444 258811488 67001231 625514902 572229121 938217290 244331276 295213680 418810760 250148739 681986353 93691086 258512344 334478574 842247076 289652772 232932429 900601662 770838744 512730335 879450985 799339736 ...

output:

4195

result:

ok single line: '4195'

Test #82:

score: 5
Accepted
time: 212ms
memory: 27560kb

input:

300000 300000
0 3000 6000 9000 12000 15000 18000 21000 24000 27000 30000 33000 36000 39000 42000 45000 48000 51000 54000 57000 60000 63000 66000 69000 72000 75000 78000 81000 84000 87000 90000 93000 96000 99000 102000 105000 108000 111000 114000 117000 120000 123000 126000 129000 132000 135000 13800...

output:

300000

result:

ok single line: '300000'

Test #83:

score: 5
Accepted
time: 217ms
memory: 27464kb

input:

300000 300000
1000000000 999997000 999994000 999991000 999988000 999985000 999982000 999979000 999976000 999973000 999970000 999967000 999964000 999961000 999958000 999955000 999952000 999949000 999946000 999943000 999940000 999937000 999934000 999931000 999928000 999925000 999922000 999919000 99991...

output:

1

result:

ok single line: '1'

Test #84:

score: 5
Accepted
time: 234ms
memory: 26628kb

input:

298001 298001
34832 79106 92233 41187 22866 85580 32085 65715 113345 78332 61133 129921 63730 69451 73358 152855 121615 76292 134438 105458 81917 6956 78765 162590 107750 159413 169971 115829 134528 131661 75589 115759 143187 97623 223499 186250 151499 168707 105513 236574 176390 103994 237829 22505...

output:

87419

result:

ok single line: '87419'

Test #85:

score: 5
Accepted
time: 268ms
memory: 27736kb

input:

299000 299000
21957810 19402999 14174232 1584658 23477964 9979277 9164532 22323998 21003307 7443362 11819189 14661748 5803988 13596735 14666310 13535681 6460845 4003025 22441699 11909961 17684693 22096644 3463574 10789456 23133078 971943 20299903 1829387 6699896 17730801 1731607 17750814 7072208 903...

output:

4790

result:

ok single line: '4790'

Test #86:

score: 5
Accepted
time: 299ms
memory: 27300kb

input:

300000 300000
18367526 39162436 46248746 53023958 58166604 60555798 128617672 154424917 171357763 178047421 179307707 186820325 216560886 238860292 244781586 284718360 288356348 337385547 341190169 345812663 352395427 353945030 361546670 367410573 386805472 420176531 495081945 500301991 502134964 51...

output:

1124

result:

ok single line: '1124'

Test #87:

score: 5
Accepted
time: 288ms
memory: 27156kb

input:

300000 300000
998504892 998265952 997934075 997214275 997098713 996128339 995808017 995445379 994380027 994042007 994039412 993364233 993318976 992223668 991102126 990845586 987858596 987274453 986989530 986543852 986441325 986249054 986094401 985671270 985225560 984404578 984003136 983470456 983176...

output:

225

result:

ok single line: '225'

Subtask #6:

score: 35
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #88:

score: 35
Accepted
time: 397ms
memory: 27692kb

input:

300000 2
981846411 315718804 516432956 987273199 649762813 979401009 908072972 701356179 676204019 793285441 684688109 241976459 51722587 986317681 719748461 461049533 558117534 86510473 52055820 277117807 557423995 451238309 332910777 700726781 338455667 891529233 578534293 445406659 135824800 8707...

output:

71

result:

ok single line: '71'

Test #89:

score: 35
Accepted
time: 415ms
memory: 27576kb

input:

300000 3
459449672 303904365 612179914 319158601 90344039 259360470 64833420 128446703 899314976 387623781 524873384 558742029 298684834 84351557 74950502 571410668 694397124 966557906 472551199 204555703 728504139 206753025 273444523 345716387 747077685 786313622 673247627 283604700 894245532 56940...

output:

245

result:

ok single line: '245'

Test #90:

score: 35
Accepted
time: 400ms
memory: 26964kb

input:

300000 9
586749 115334694 980907471 96107850 409738829 676282753 897602727 666013357 538754392 75198645 438470673 762708776 513634679 446096792 729398014 531354295 977011975 690263253 446994522 212907986 910123745 282918796 925486590 374582223 347771294 244281329 489510389 332204825 367148229 452685...

output:

707

result:

ok single line: '707'

Test #91:

score: 35
Accepted
time: 346ms
memory: 26500kb

input:

300000 87
880233441 201206480 19792743 369501219 500679516 858188016 763969162 310287946 510511081 299527134 294598908 785511281 370555881 305739694 42510191 919286821 804900327 150741169 938613936 875968366 393939771 267879825 295958102 557747140 224605271 235745812 425088767 662680656 20538357 241...

output:

1064

result:

ok single line: '1064'

Test #92:

score: 35
Accepted
time: 320ms
memory: 27188kb

input:

300000 945
585361934 744838211 501489485 135969833 135969833 606236048 580866548 428531361 566185600 760887916 566185600 104083695 585361934 569042183 210647640 704484875 88214230 501489485 135969833 833821026 684128243 973894366 144473255 920759802 88214230 866392409 55248208 283109291 666038621 88...

output:

34

result:

ok single line: '34'

Test #93:

score: 35
Accepted
time: 348ms
memory: 27132kb

input:

300000 13654
532056255 108288049 785964028 168101912 792710055 494332921 291690507 896191375 981776147 247396660 364323559 449409858 549379456 13774404 318441005 481170297 323580895 567373921 792515305 94785585 434499010 97300090 206755498 432080963 923218770 482289307 477578374 505090299 502356725 ...

output:

1032

result:

ok single line: '1032'

Test #94:

score: 35
Accepted
time: 345ms
memory: 27244kb

input:

300000 210606
355949955 758987707 861583896 393005653 306541166 841036558 78633593 751965182 97703379 767855651 674061317 692989657 804547762 46970647 366161482 233733443 402549207 56298871 649600762 854202213 246805136 332198174 917640814 502812826 566799044 256183958 929245764 287668391 576006074 ...

output:

1087

result:

ok single line: '1087'

Test #95:

score: 35
Accepted
time: 388ms
memory: 27456kb

input:

299994 2
895554881 915483808 6999738 589775783 364671169 140159441 219453769 476773940 701626618 381268581 613963842 7205314 957391937 198361681 714867379 771770154 641356627 257308703 740132852 35940834 419597644 166727703 892160803 368264240 523007048 476726986 794040598 688310823 509553606 856824...

output:

5262

result:

ok single line: '5262'

Test #96:

score: 35
Accepted
time: 407ms
memory: 27612kb

input:

299995 7
209956261 489647146 35799374 811411974 571094183 143096047 411011338 157560385 770770079 589432069 843876087 52748307 612850585 398358561 82755773 552943414 121307310 790182306 862514087 989870203 599894704 241834404 322879099 172521599 654563643 359012832 857122567 1695589 768472966 156867...

output:

75417

result:

ok single line: '75417'

Test #97:

score: 35
Accepted
time: 368ms
memory: 26968kb

input:

299996 40
603469419 347443411 325120990 706277952 419616822 15613877 886127371 430471777 675061885 142851343 320143886 81137256 584418426 854881293 834960420 968473210 844467002 202562890 336599444 390481004 871722308 96531328 227316464 709681952 775570853 620991314 524726018 327057630 377502041 221...

output:

7379

result:

ok single line: '7379'

Test #98:

score: 35
Accepted
time: 360ms
memory: 27616kb

input:

299997 71
653644247 811930841 727251227 138934936 880605118 642503706 254585414 522491701 701580073 574459199 936163367 530990391 480640915 203863289 585002713 371404861 496010326 620293878 115703032 778601128 644953614 578682724 210344609 176635189 243646008 978445180 647529637 621562491 530484873 ...

output:

6792

result:

ok single line: '6792'

Test #99:

score: 35
Accepted
time: 356ms
memory: 27640kb

input:

299998 586
908284052 563170295 500147085 117112269 279820728 746612943 645683775 387620985 181390274 211550483 614577121 633190042 692196935 292506967 474865301 738339097 837886718 270881000 963202036 497115732 459430490 50542796 778111733 582389112 150206246 326207181 37209841 907906102 682669898 4...

output:

1188

result:

ok single line: '1188'

Test #100:

score: 35
Accepted
time: 349ms
memory: 27960kb

input:

299999 679
75037315 144274932 878632365 943584260 63916144 623492330 31727735 601754520 107459234 750162267 510393730 599935326 419844196 943599583 416154499 708259053 453691813 531824585 231035122 706303631 729361287 947983769 258538139 578077560 660827912 235077540 357937800 288529395 148022003 38...

output:

1278

result:

ok single line: '1278'

Test #101:

score: 35
Accepted
time: 263ms
memory: 27148kb

input:

300000 2
59832 81195 42469 53975 55445 56824 68860 65132 87045 87630 83523 98324 103712 113021 98382 108778 110151 118643 110383 109729 122575 125535 124120 123681 133743 128045 124893 134269 148473 144730 155494 139077 155512 152880 162390 162652 192822 181251 167474 177302 188098 192206 172389 194...

output:

155227

result:

ok single line: '155227'

Test #102:

score: 35
Accepted
time: 251ms
memory: 27664kb

input:

300000 20
24377 157557 16288 32800 102848 108790 142839 63455 58035 181833 163873 57219 73986 104292 19766 98875 44604 198022 94939 128336 14456 166850 206664 117051 25374 56710 100959 211780 79592 190527 53798 28739 24108 239036 333860 195224 80268 155260 32959 305264 34693 194270 106416 168983 118...

output:

65295

result:

ok single line: '65295'

Test #103:

score: 35
Accepted
time: 262ms
memory: 27028kb

input:

300000 200
542453 69378 929005 1069969 313323 715172 685547 456635 993791 339052 189045 358388 1321940 831629 141437 75317 672201 425697 1074272 1146889 615089 1347186 14278 205480 452235 62248 1885287 663667 1075446 774783 506593 558891 247533 644224 928745 401480 420725 1598517 716498 1345905 7722...

output:

24187

result:

ok single line: '24187'

Test #104:

score: 35
Accepted
time: 276ms
memory: 26956kb

input:

300000 2000
3727622 6819934 3476715 6178149 646568 4330957 8463544 5654003 1068370 5061398 5130796 2868489 205525 2548188 330179 2221361 3738695 6593543 9803777 455011 1513572 3333400 7011154 1667772 783564 5513133 1474302 3815285 4084075 4629448 2445283 1544717 11305487 804162 8307904 7650197 32407...

output:

8627

result:

ok single line: '8627'

Test #105:

score: 35
Accepted
time: 276ms
memory: 27252kb

input:

300000 20000
38571887 27809957 82279333 53029177 9612485 12668335 48654772 15436423 56055879 48202407 31833125 23735688 9765537 112839350 92585172 29263689 10772080 8571979 68339458 26752426 100251004 8734699 44810774 76455565 40011518 71375244 62724275 124145368 32051351 24552834 41050412 46278237 ...

output:

3118

result:

ok single line: '3118'

Test #106:

score: 35
Accepted
time: 295ms
memory: 28088kb

input:

300000 60
995874848 991730915 998786596 996632461 998399913 996227508 994330518 995621282 998009070 995861362 994364651 999273779 998517261 998970532 993230215 998708574 996367666 999032670 999653416 997995760 995100914 997815782 997959228 995123793 996072347 997468336 989188130 997536508 998117462 ...

output:

80

result:

ok single line: '80'

Test #107:

score: 35
Accepted
time: 304ms
memory: 26536kb

input:

300000 600
952967948 969256950 952196385 979075265 988608932 928612591 992107305 957206761 984317516 977153540 996363055 974589818 948549769 973270384 930546948 987680920 989790958 958803077 988177817 988515603 961106729 989917294 973922857 980141523 996916157 986639148 975239381 961108485 995008098...

output:

222

result:

ok single line: '222'

Test #108:

score: 35
Accepted
time: 361ms
memory: 28120kb

input:

300000 6000
962718512 804134735 986988434 997956577 844442540 986863768 855399792 926749034 759887761 761864448 819033638 898310056 656318962 849905341 740528516 505041834 767643438 857793001 953355309 849601763 765159740 885573688 788391435 935747117 992818087 997583279 636927252 960126342 97318576...

output:

572

result:

ok single line: '572'

Test #109:

score: 35
Accepted
time: 338ms
memory: 27088kb

input:

299999 50
232696 517972 851440 997383 1036483 1056403 1152413 1256369 1401672 1417516 1447234 1497950 1627425 1681738 1801887 1801992 1932355 2183213 2299167 2458504 2692357 2976686 2990243 3090907 3361789 3381690 3724304 4015280 4239512 4281727 4357325 4467946 4515380 5476824 5511061 5695836 587673...

output:

6096

result:

ok single line: '6096'

Test #110:

score: 35
Accepted
time: 372ms
memory: 26568kb

input:

299998 50
16149325 26847509 32785649 41306711 87845630 92392845 94729324 105925743 150142601 160867972 216702752 217419420 221935128 228914780 262178136 268875019 277170539 314151983 343623936 415183847 451292004 453847185 457486332 490195604 497960624 512324918 523364851 524170868 551095870 5560303...

output:

989

result:

ok single line: '989'

Test #111:

score: 35
Accepted
time: 351ms
memory: 27080kb

input:

299997 50
949894835 928670191 921219530 920255791 916244181 875431082 861474927 855292550 841059162 831832343 824818942 808351364 797809774 788562826 784659873 762061021 732489515 720850218 711262333 684565558 678497148 645368843 638340044 544687265 532471708 441353104 384697361 376850585 333128308 ...

output:

995

result:

ok single line: '995'

Test #112:

score: 35
Accepted
time: 287ms
memory: 27656kb

input:

299996 5000
300379 327079 439092 695552 745801 1513407 1585353 1603372 1617873 1680257 1806331 2070011 2111649 2435728 2562695 2805969 2829768 2981021 3001843 3195679 3463364 3851874 4127903 4174563 4422440 4552216 5044085 5201585 5353614 5393763 5396783 5497450 5506317 5966739 6014332 6056940 63151...

output:

7006

result:

ok single line: '7006'

Test #113:

score: 35
Accepted
time: 334ms
memory: 27152kb

input:

299995 5000
7100562 15231828 16452076 39538059 51876250 60246052 72328626 86462407 92911309 107358317 149260813 174423332 196719023 204104086 214900529 221618917 261034289 299728097 306107030 357499988 357616143 374267644 390531228 402176485 412188355 415686042 418626146 451351066 461390278 46821409...

output:

1123

result:

ok single line: '1123'

Test #114:

score: 35
Accepted
time: 343ms
memory: 27608kb

input:

299994 5000
991949425 966944694 937710385 931408708 915869485 907516354 891097949 859431230 839964750 807341109 777862804 765265250 756074070 729891002 702436573 633382317 628600028 548558088 519227518 509079361 491845398 468480212 465911140 462234113 454021743 436629565 434497861 380104148 36959501...

output:

1023

result:

ok single line: '1023'

Test #115:

score: 35
Accepted
time: 214ms
memory: 27672kb

input:

300000 299997
4008 999995622 999995461 999993940 999993352 999992991 999983385 999981899 999977260 999977110 999976200 999972111 999958485 999957764 999957361 999953459 999953388 999952758 999938091 999937847 999932575 999932318 999928345 999927457 999927256 999917003 999915846 999915751 999914482 9...

output:

2

result:

ok single line: '2'

Test #116:

score: 35
Accepted
time: 221ms
memory: 27476kb

input:

300000 299998
368 999999017 999997749 999988252 999978244 999974486 999960786 999960577 999959853 999959429 999956942 999955559 999941405 999937117 999932108 999923316 999921551 999911101 999903318 999903006 999899857 999892540 999885618 999885232 999883218 999878500 999876683 999873809 999871104 99...

output:

3

result:

ok single line: '3'

Test #117:

score: 35
Accepted
time: 234ms
memory: 27704kb

input:

300000 149998
329 999993428 999985559 999982542 999979039 999977398 999969541 999953733 999950064 999946533 999939460 999932190 999931007 999929533 999924418 999921839 999912898 999910544 999904673 999898252 999894726 999893337 999891828 999879923 999874448 999867048 999863408 999848791 999845147 99...

output:

3

result:

ok single line: '3'

Test #118:

score: 35
Accepted
time: 228ms
memory: 27688kb

input:

300000 149999
1136 999997607 999996068 999995383 999981885 999980419 999978018 999975151 999970289 999965230 999963258 999951474 999948239 999941412 999934461 999930402 999925700 999905629 999903631 999894503 999894096 999887598 999872556 999866609 999856151 999846622 999841431 999834183 999829646 9...

output:

4

result:

ok single line: '4'

Test #119:

score: 35
Accepted
time: 289ms
memory: 27696kb

input:

299600 500
1445 996561720 994514953 992357157 990219938 988107572 986171220 984202253 982096807 980125803 978117502 976102926 974115600 972053275 970044324 968066610 965993017 963980120 962061687 960126099 958142582 956192318 954147668 952024125 950070480 947904442 945781375 943886214 941999984 9400...

output:

599

result:

ok single line: '599'

Test #120:

score: 35
Accepted
time: 267ms
memory: 27600kb

input:

299600 501
477 996619294 994468148 992452012 990419956 988410512 986355419 984419441 982390676 980337646 978369105 976301927 974265217 972444735 970541450 968515231 966479231 964439986 962453874 960525760 958566381 956551499 954661397 952760831 950860366 948791482 946849371 944949053 942920457 94091...

output:

600

result:

ok single line: '600'

Extra Test:

score: 0
Extra Test Passed