QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#319497#5036. 卑鄙的下毒人Harry2718250 361ms49092kbC++141.7kb2024-02-02 17:26:052024-02-02 17:26:06

Judging History

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

  • [2024-02-02 17:26:06]
  • 评测
  • 测评结果:50
  • 用时:361ms
  • 内存:49092kb
  • [2024-02-02 17:26:05]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,m,k;
namespace Sub1
{
	ll sum[500005],l,r,w;vector<pair<int,int> >v[500005];
	void main()
	{
		for(int i=1;i<=m;i++)cin>>l>>r>>w,v[r].emplace_back(make_pair(l,w));
		for(int i=1;i<=n;i++)
		{
			sum[i]=sum[i-1];
			for(int j=0;j<v[i].size();j++)
			{
				ll now=sum[i]-sum[v[i][j].first-1];
				if(now<v[i][j].second)sum[i]+=v[i][j].second-now;
			}
		}
		cout<<sum[n];
	}
}
namespace Sub2
{
	int dp[500005],l,r,w,tr[2000005],tag[2000005],num[500005];vector<int>v[500005];
	void update(int k,int v){tr[k]+=v;tag[k]+=v;}
	void pushdown(int k)
	{
		if(!tag[k])return;
		update(k<<1,tag[k]);update(k<<1|1,tag[k]);
		tag[k]=0;
	}
	void change(int k,int l,int r,int x,int y,int v)
	{
		if(x<=l&&r<=y){update(k,v);return;}
		int mid=(l+r)>>1;pushdown(k);
		if(x<=mid)change(k<<1,l,mid,x,y,v);
		if(y>mid)change(k<<1|1,mid+1,r,x,y,v);
		tr[k]=min(tr[k<<1],tr[k<<1|1]); 
	}
	int query(int k,int l,int r,int x,int y)
	{
		if(x<=l&&r<=y)return tr[k];
		int mid=(l+r)>>1,res=1e9;pushdown(k);
		if(x<=mid)res=min(res,query(k<<1,l,mid,x,y));
		if(y>mid)res=min(res,query(k<<1|1,mid+1,r,x,y));
		return res;
	}
	void main()
	{
		for(int i=1;i<=m;i++)cin>>l>>r>>w,v[r].emplace_back(l);
		for(int i=1;i<=n;i++)dp[i]=1e9;
		int ans=m;
		for(int i=1;i<=n;i++)
		{
			dp[i]=query(1,0,n,0,i-1)+k;
			change(1,0,n,i,i,dp[i]);
			for(int j=0;j<v[i].size();j++)change(1,0,n,0,v[i][j]-1,1),num[v[i][j]]++;
		}
		for(int i=n;i>=1;i--)num[i]+=num[i+1];
		for(int i=1;i<=n;i++)ans=min(ans,dp[i]+num[i+1]);
		cout<<ans;
	}
}
int main()
{
	cin.tie(0)->sync_with_stdio(0);
	cin>>n>>m>>k;
	if(k==1)Sub1::main();
	else Sub2::main();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

7 20 5
3 4 1
1 1 1
2 7 1
3 7 1
2 2 1
3 7 1
4 6 1
7 7 1
5 5 1
1 6 1
3 4 1
1 4 1
3 6 1
3 3 1
2 5 1
1 1 1
5 5 1
1 1 1
6 7 1
2 2 1

output:

15

result:

ok "15"

Test #2:

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

input:

12 20 5
5 5 1
8 12 1
4 10 1
10 12 1
2 11 1
3 6 1
6 12 1
1 10 1
4 9 1
7 10 1
4 12 1
2 10 1
1 12 1
4 5 1
4 9 1
7 9 1
3 9 1
10 11 1
6 12 1
4 10 1

output:

10

result:

ok "10"

Test #3:

score: 0
Accepted
time: 6ms
memory: 27028kb

input:

7 20 5
2 7 1
6 6 1
3 6 1
3 3 1
2 5 1
6 6 1
2 6 1
2 7 1
4 6 1
3 3 1
2 2 1
5 5 1
1 4 1
1 5 1
2 5 1
4 4 1
2 7 1
3 4 1
2 4 1
1 2 1

output:

12

result:

ok "12"

Test #4:

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

input:

11 20 5
1 8 1
1 10 1
10 11 1
7 11 1
3 10 1
3 8 1
1 8 1
4 5 1
4 5 1
1 7 1
3 4 1
3 7 1
5 6 1
2 6 1
4 9 1
4 10 1
4 4 1
1 11 1
7 10 1
4 8 1

output:

9

result:

ok "9"

Test #5:

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

input:

8 20 5
6 7 1
4 5 1
1 7 1
3 7 1
1 6 1
3 8 1
1 1 1
2 2 1
1 7 1
3 4 1
6 6 1
1 7 1
1 1 1
1 3 1
4 4 1
8 8 1
3 4 1
1 6 1
6 6 1
2 8 1

output:

13

result:

ok "13"

Test #6:

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

input:

20 20 1
3 14 1
1 17 1
3 18 1
14 20 1
15 17 1
9 17 1
10 12 1
6 20 1
11 16 1
3 17 1
1 2 1
6 19 1
17 18 1
4 18 1
4 9 1
3 7 1
4 13 1
17 19 1
7 12 1
10 14 1

output:

4

result:

ok "4"

Test #7:

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

input:

20 20 2
10 20 1
8 9 1
1 8 1
12 17 1
3 20 1
7 18 1
6 10 1
3 5 1
5 9 1
3 6 1
1 3 1
2 6 1
9 11 1
2 11 1
3 15 1
1 7 1
5 7 1
6 11 1
15 18 1
8 10 1

output:

7

result:

ok "7"

Test #8:

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

input:

20 20 3
3 16 1
6 17 1
8 17 1
11 19 1
5 7 1
3 13 1
16 19 1
6 8 1
3 14 1
7 10 1
6 13 1
1 5 1
4 20 1
16 16 1
8 17 1
7 19 1
12 16 1
5 14 1
10 18 1
10 16 1

output:

7

result:

ok "7"

Test #9:

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

input:

20 20 4
8 19 1
15 19 1
10 20 1
5 11 1
1 2 1
12 15 1
5 7 1
10 14 1
3 6 1
13 19 1
5 10 1
6 7 1
7 7 1
1 19 1
9 16 1
3 16 1
1 2 1
4 20 1
15 16 1
7 11 1

output:

12

result:

ok "12"

Test #10:

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

input:

20 20 5
10 18 1
5 9 1
1 17 1
12 19 1
12 13 1
11 17 1
7 10 1
2 10 1
8 13 1
4 6 1
12 13 1
13 13 1
14 20 1
1 9 1
19 19 1
5 8 1
16 16 1
1 6 1
5 16 1
2 4 1

output:

15

result:

ok "15"

Subtask #2:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 4ms
memory: 27136kb

input:

1794 5000 5
419 430 46802829
1071 1140 167141363
1154 1554 366136993
735 1265 152210166
387 1104 646459531
1073 1637 525871859
1340 1729 44303243
1221 1574 588158235
91 478 922877048
1117 1268 460323230
315 1103 378106915
272 1071 784282054
1147 1469 220209516
281 375 514585737
677 1031 231082599
55...

output:

233

result:

wrong answer 1st words differ - expected: '136716114929', found: '233'

Subtask #3:

score: 20
Accepted

Test #31:

score: 20
Accepted
time: 152ms
memory: 38296kb

input:

322675 500000 1
162058 177924 125740423
72321 188693 51206015
73706 159883 238256306
223634 241332 292316893
8164 94217 879196279
232892 319246 624760769
67688 195525 319652781
70831 92026 394982900
68675 156743 598333126
107804 308096 843245966
57077 248406 291662171
12794 193657 560389007
105560 2...

output:

480886198651

result:

ok "480886198651"

Test #32:

score: 0
Accepted
time: 144ms
memory: 37540kb

input:

252531 500000 1
73336 89104 198033994
117801 178724 312536059
83164 115804 819989513
1359 145774 511306394
47527 143191 383786500
1003 48236 76011634
125645 183182 48474946
106010 149967 927727206
103952 112384 125439208
104139 173611 971831922
92285 136188 923537157
1086 180210 427446035
23210 2210...

output:

475010855091

result:

ok "475010855091"

Test #33:

score: 0
Accepted
time: 154ms
memory: 36760kb

input:

249992 490700 1
214479 214496 515365625
14206 14382 334019307
217230 217309 735689827
63924 63925 258401277
12070 12079 934649204
207338 207371 758583044
37166 37413 417324175
126526 126539 124700076
55914 56166 936572436
216053 216093 893982405
45801 46192 131912638
241657 241696 730127825
116589 1...

output:

24050495775217

result:

ok "24050495775217"

Test #34:

score: 0
Accepted
time: 154ms
memory: 36788kb

input:

249997 494845 1
85695 85706 947011452
173987 175115 969606646
50884 50893 735552086
44292 44297 627665457
215893 215931 539749179
110666 111348 593653974
37171 38363 554044675
152491 152726 857012755
128775 129900 279287672
171922 172278 447261487
123925 123930 105674353
54822 54901 583760389
133139...

output:

18391590923314

result:

ok "18391590923314"

Test #35:

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

input:

249935 497717 1
48307 48437 56342637
151763 152298 861912241
19415 19415 927311192
59828 60101 204305982
147582 147862 395948999
186343 186386 10643541
44713 44853 524618914
192169 192211 648592572
188253 188338 998141500
34052 34721 466660212
156785 156916 59576841
202401 202629 971241453
139207 13...

output:

12964165809186

result:

ok "12964165809186"

Test #36:

score: 0
Accepted
time: 163ms
memory: 36820kb

input:

249950 496942 1
62391 62983 157267127
207325 208422 715495951
29165 29192 834359395
91599 91615 332629666
84504 85813 5574214
55544 55732 893133907
68164 68179 848654383
229512 230081 808984107
165586 165713 454872244
200207 201999 968200081
65750 65806 299499692
202042 202614 558169368
140195 14188...

output:

14606631340114

result:

ok "14606631340114"

Test #37:

score: 0
Accepted
time: 161ms
memory: 36836kb

input:

249982 495670 1
86390 86526 783248482
9407 9411 540434263
238452 238534 830682740
91200 91302 364033820
145244 147442 35874704
21309 21354 781112886
220232 221381 997542261
99464 99511 240733162
20848 21196 714567934
164306 164325 993562838
151641 151665 555186611
95172 95199 763915769
189851 189962...

output:

16988476067185

result:

ok "16988476067185"

Test #38:

score: 0
Accepted
time: 133ms
memory: 39136kb

input:

237809 500000 1
1 1 725340623
2 2 556538685
2 3 750113351
2 4 89997667
1 5 176278822
6 6 628044473
4 7 376781143
4 8 691054257
8 9 681694326
8 10 107877180
10 11 895699579
8 12 309610008
9 13 583966770
11 14 91473484
15 15 795666681
14 16 199439006
17 17 235804033
18 18 459166246
15 19 261822162
19 ...

output:

54827431453285

result:

ok "54827431453285"

Test #39:

score: 0
Accepted
time: 145ms
memory: 38004kb

input:

193004 500000 1
1 1 418968490
1 2 696290526
1 3 35413858
2 4 468838187
1 5 249430274
3 6 574413613
4 7 399467033
6 8 75065642
6 9 340727930
6 10 862056055
7 11 902270161
11 12 246578995
12 13 245100768
14 14 911540131
13 15 88554299
13 16 454499535
13 17 232059626
16 18 908692431
15 19 139531524
20 ...

output:

44183387167347

result:

ok "44183387167347"

Test #40:

score: 0
Accepted
time: 124ms
memory: 37592kb

input:

168037 500000 1
1 1 571104806
2 2 127213141
2 3 975939427
3 4 132217350
5 5 894810748
3 6 490775217
4 7 25203836
6 8 458117768
6 9 426044363
8 10 745181289
9 11 432989435
10 12 578165354
9 13 68938921
12 14 793934534
11 15 74005157
16 16 311972043
14 17 625329955
18 18 168234200
15 19 465554170
18 2...

output:

38680733724403

result:

ok "38680733724403"

Test #41:

score: 0
Accepted
time: 136ms
memory: 37628kb

input:

177842 500000 1
1 1 421267539
2 2 773838708
3 3 174145748
2 4 345791748
4 5 178857721
6 6 63445539
5 7 785501019
6 8 293135367
7 9 107408904
6 10 781833072
7 11 380579169
11 12 149601052
13 13 941321725
13 14 68117336
14 15 878597414
14 16 501204638
15 17 856015182
14 18 474203866
18 19 851148153
16...

output:

40928382637201

result:

ok "40928382637201"

Test #42:

score: 0
Accepted
time: 135ms
memory: 37544kb

input:

177915 500000 1
1 1 271292280
2 2 625813925
1 3 939340374
2 4 84776571
5 5 456945542
3 6 191363078
7 7 78237995
4 8 723718315
6 9 199913337
7 10 276964318
11 11 475214330
11 12 956526724
9 13 234753935
11 14 850526973
13 15 377635279
12 16 866464127
16 17 72950802
17 18 54563404
15 19 532673622
20 2...

output:

40869789096961

result:

ok "40869789096961"

Test #43:

score: 0
Accepted
time: 167ms
memory: 37744kb

input:

278352 500000 1
170913 214543 168974049
78160 236308 127212570
22624 192783 758327554
33353 119675 112500515
123238 138960 773944493
102641 104678 525298818
39746 265269 231933608
101566 199878 496386445
160697 214573 875085547
138890 189675 304621779
72230 233413 82446355
93697 111582 716259833
248...

output:

470663510567

result:

ok "470663510567"

Test #44:

score: 0
Accepted
time: 163ms
memory: 38312kb

input:

313114 500000 1
192852 245567 319309601
97135 304118 787617405
76891 190936 17692495
9880 226269 747702459
117760 188046 398275162
61120 289318 158491038
41844 216947 23254041
48629 302643 629285602
262794 301320 933483522
23187 211531 218319925
31448 106981 97268677
32372 191357 161506602
87160 272...

output:

469269376470

result:

ok "469269376470"

Test #45:

score: 0
Accepted
time: 161ms
memory: 36800kb

input:

205945 500000 1
146039 176990 894969853
61417 89219 764910645
37405 123868 427213499
64826 75839 220017382
85594 128873 116882220
186391 190027 882212569
5498 54259 155371726
21164 123514 490637163
96788 187848 376113236
35647 185488 993192042
36184 39246 792947747
108807 165538 393657269
83958 1120...

output:

483741106377

result:

ok "483741106377"

Test #46:

score: 0
Accepted
time: 180ms
memory: 41592kb

input:

500000 500000 1
496837 496870 923496382
278362 278392 357421464
274060 274061 345429203
65297 65317 503103187
236352 236398 120593170
181125 181172 197502113
123694 123736 224553449
130956 130974 786534231
134569 134606 55741322
12360 12365 286706634
300281 300328 410270588
236167 236193 832854993
4...

output:

33887394129829

result:

ok "33887394129829"

Test #47:

score: 0
Accepted
time: 182ms
memory: 41524kb

input:

500000 500000 1
51275 51298 906550332
91442 91490 890797911
483126 483169 880126619
438390 438400 604056812
23577 23608 201153018
112465 112503 146011563
84539 84565 351378223
60262 60277 458827584
305983 306004 140042073
312033 312044 18883706
238027 238047 356335074
163624 163668 134261442
272969 ...

output:

33962870370969

result:

ok "33962870370969"

Test #48:

score: 0
Accepted
time: 171ms
memory: 41536kb

input:

500000 500000 1
57535 57553 874794489
443359 443368 328379248
73189 73203 567826431
200304 200308 552526649
271876 271909 231476665
378433 378453 495669857
108553 108584 431003982
42176 42197 773752461
93371 93401 797605414
404017 404032 25578235
361930 361979 209265
247150 247182 620036262
18378 18...

output:

33917735271253

result:

ok "33917735271253"

Test #49:

score: 0
Accepted
time: 169ms
memory: 41532kb

input:

500000 500000 1
330583 330583 819334510
342192 342225 251008140
23558 23562 693668995
7713 7745 20457747
358117 358150 397036939
484167 484203 505239528
314640 314645 449883400
40462 40503 485953240
77808 77832 572898847
147529 147564 337988142
189570 189614 949484749
453228 453254 752514208
364749 ...

output:

33900595789167

result:

ok "33900595789167"

Test #50:

score: 0
Accepted
time: 164ms
memory: 41540kb

input:

500000 500000 1
167444 167450 930275075
359867 359876 53239020
441544 441576 585496181
439743 439786 17684411
36167 36203 217051650
29078 29096 949040506
124064 124110 880111173
59505 59551 825248135
177726 177746 769432518
17759 17804 604866783
265114 265151 657157449
356894 356929 496106508
82971 ...

output:

33861714821089

result:

ok "33861714821089"

Subtask #4:

score: 20
Accepted

Test #51:

score: 20
Accepted
time: 266ms
memory: 38400kb

input:

194181 500000 5
22921 38709 1
103611 130117 1
33044 135246 1
25161 106036 1
13484 183424 1
129622 133239 1
103905 105727 1
8418 141108 1
5951 145648 1
61392 105830 1
139975 149309 1
47361 59947 1
91598 172246 1
32303 43094 1
72490 170121 1
68502 168603 1
56051 91019 1
106112 129606 1
70776 177996 1
...

output:

2485

result:

ok "2485"

Test #52:

score: 0
Accepted
time: 347ms
memory: 44652kb

input:

304003 500000 5
101915 187818 1
96905 285932 1
39472 217335 1
223783 231789 1
201166 211239 1
22769 134905 1
19436 89499 1
78054 117024 1
6577 94503 1
16701 62281 1
59789 95662 1
68941 96708 1
17347 224646 1
1970 50789 1
197428 215792 1
79626 243334 1
70524 218601 1
17518 113996 1
199398 247243 1
63...

output:

2493

result:

ok "2493"

Test #53:

score: 0
Accepted
time: 291ms
memory: 40956kb

input:

249974 496542 5
87672 88771 1
52366 53940 1
25887 25963 1
184719 186260 1
104443 104706 1
95989 96053 1
134358 135382 1
55635 55647 1
134371 134382 1
148206 149011 1
95965 96135 1
140844 140891 1
78797 78798 1
15619 15943 1
31258 31343 1
47248 47358 1
157920 157998 1
135597 135708 1
98966 99089 1
20...

output:

78661

result:

ok "78661"

Test #54:

score: 0
Accepted
time: 280ms
memory: 40956kb

input:

249974 494350 5
161514 163184 1
87911 87959 1
105204 106421 1
178980 181538 1
19665 19715 1
58148 58167 1
67664 67964 1
5582 6048 1
242900 242913 1
218881 218915 1
84444 84678 1
99763 100602 1
208276 208335 1
35121 35190 1
115890 115966 1
122960 123877 1
22163 22657 1
100321 100645 1
99196 99575 1
1...

output:

97350

result:

ok "97350"

Test #55:

score: 0
Accepted
time: 271ms
memory: 40924kb

input:

249983 486062 5
178515 178556 1
46509 46657 1
623 630 1
223892 223897 1
227434 227448 1
127239 127242 1
175036 175061 1
144855 144868 1
107886 107891 1
118310 118312 1
165907 165919 1
174395 174413 1
196413 196457 1
137455 139090 1
59658 59673 1
196868 196878 1
53952 54025 1
49268 49480 1
38355 3885...

output:

144650

result:

ok "144650"

Test #56:

score: 0
Accepted
time: 300ms
memory: 40960kb

input:

249983 495448 5
123223 124925 1
161437 161839 1
204523 204907 1
123417 124631 1
169136 169205 1
109580 109591 1
202411 202609 1
237547 237552 1
43171 43533 1
19726 20052 1
191894 192321 1
140366 140369 1
24388 24490 1
1393 1417 1
155640 155653 1
204676 205389 1
232668 235247 1
45859 47006 1
77633 77...

output:

87916

result:

ok "87916"

Test #57:

score: 0
Accepted
time: 282ms
memory: 40952kb

input:

249992 494620 5
84373 84412 1
125864 125902 1
203420 203427 1
64431 64437 1
56552 56567 1
71532 71611 1
71190 71248 1
107213 108211 1
115775 116553 1
181151 181244 1
37673 37714 1
44770 44800 1
227519 227561 1
245293 245343 1
11949 12034 1
51161 51192 1
242357 242401 1
142142 142144 1
203117 203611 ...

output:

94967

result:

ok "94967"

Test #58:

score: 0
Accepted
time: 297ms
memory: 38736kb

input:

208426 500000 5
28645 101916 1
7440 127239 1
137321 138796 1
155729 158144 1
167838 203986 1
127568 151506 1
49515 81900 1
37962 167268 1
141888 144316 1
48742 192792 1
8191 124087 1
113172 141152 1
92571 105888 1
23469 75518 1
25800 127940 1
94900 157340 1
11438 114334 1
1826 37080 1
5738 122480 1
...

output:

2398

result:

ok "2398"

Test #59:

score: 0
Accepted
time: 347ms
memory: 44028kb

input:

270310 500000 5
151314 259090 1
80695 183506 1
20699 196732 1
142374 248474 1
77831 129977 1
31693 170486 1
42481 50638 1
237296 244555 1
117532 206885 1
154573 230747 1
17424 38046 1
95181 228843 1
123250 217068 1
194563 252222 1
93291 206436 1
4217 7976 1
89143 239119 1
222217 248624 1
9680 246195...

output:

2422

result:

ok "2422"

Test #60:

score: 0
Accepted
time: 323ms
memory: 39652kb

input:

255424 500000 5
59606 133843 1
186905 209051 1
67305 243269 1
27933 65974 1
78338 171108 1
3704 177437 1
62314 217400 1
65683 216660 1
10999 51811 1
203698 245062 1
200238 227732 1
95702 203308 1
108957 224327 1
7616 111101 1
188051 237741 1
54576 209144 1
98897 230281 1
154770 233686 1
106761 20723...

output:

2448

result:

ok "2448"

Test #61:

score: 0
Accepted
time: 149ms
memory: 41508kb

input:

500000 500000 1
435056 435101 1
96682 96726 1
366447 366479 1
409321 409329 1
319459 319478 1
386826 386851 1
477209 477243 1
405392 405424 1
366564 366584 1
313831 313852 1
126671 126705 1
402868 402877 1
126969 127001 1
433546 433559 1
103408 103446 1
203 220 1
499640 499669 1
86463 86509 1
222795...

output:

56551

result:

ok "56551"

Test #62:

score: 0
Accepted
time: 361ms
memory: 49084kb

input:

500000 500000 2
398851 398882 1
269476 269518 1
239296 239337 1
16069 16079 1
442104 442126 1
209852 209891 1
327424 327439 1
297952 297955 1
21272 21303 1
220730 220772 1
79140 79174 1
405354 405360 1
313185 313228 1
171020 171069 1
316725 316764 1
325712 325733 1
477774 477781 1
204985 205014 1
16...

output:

94306

result:

ok "94306"

Test #63:

score: 0
Accepted
time: 349ms
memory: 49076kb

input:

500000 500000 3
81122 81131 1
307742 307754 1
421008 421037 1
126583 126613 1
349371 349376 1
108214 108231 1
234333 234335 1
51679 51691 1
176180 176215 1
457610 457643 1
429415 429416 1
143493 143498 1
455898 455937 1
225199 225227 1
38247 38264 1
115825 115851 1
433824 433827 1
2395 2399 1
156156...

output:

124594

result:

ok "124594"

Test #64:

score: 0
Accepted
time: 357ms
memory: 49040kb

input:

500000 500000 4
50207 50249 1
466545 466586 1
409439 409451 1
3041 3073 1
261821 261845 1
303963 303989 1
74383 74417 1
256880 256917 1
393046 393056 1
56497 56534 1
255489 255533 1
283323 283329 1
151024 151051 1
110312 110338 1
229377 229384 1
252166 252196 1
387865 387886 1
398932 398966 1
287693...

output:

150753

result:

ok "150753"

Test #65:

score: 0
Accepted
time: 358ms
memory: 49092kb

input:

500000 500000 5
498982 499017 1
489602 489619 1
184352 184383 1
272166 272181 1
165728 165760 1
195337 195354 1
119007 119010 1
195484 195507 1
151529 151550 1
263467 263503 1
102050 102056 1
295825 295850 1
337212 337242 1
217581 217620 1
74890 74894 1
286633 286645 1
149257 149275 1
369127 369159 ...

output:

174194

result:

ok "174194"

Subtask #5:

score: 0
Wrong Answer

Test #66:

score: 0
Wrong Answer
time: 332ms
memory: 43876kb

input:

265199 500000 5
51732 151507 196279569
1147 251097 325871693
79410 120618 539045634
209514 221950 912376813
44813 147573 616444800
53619 134328 533306546
94940 108466 186490362
42483 236958 489649490
127349 167018 943263893
103970 193784 202963780
197001 221033 210521750
5815 113674 152090319
129972...

output:

2506

result:

wrong answer 1st words differ - expected: '1456927835184', found: '2506'