QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#434958#8793. Toiletsucup-team3510#TL 2057ms92268kbC++205.2kb2024-06-08 17:59:492024-06-08 18:05:47

Judging History

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

  • [2024-06-08 18:05:47]
  • 评测
  • 测评结果:TL
  • 用时:2057ms
  • 内存:92268kb
  • [2024-06-08 17:59:49]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define N 200011
using namespace std;
int n,m;ll L;
set<ll> Tpos;
struct Ppers{ll x,t;int id;Ppers(int _x=0){x=t=id=-1;}Ppers(ll _x,ll _t,int _id){x=_x;t=_t;id=_id;}};
bool operator<(Ppers a,Ppers b)
{
	if(a.x==b.x)return a.t>b.t;
	else return a.x<b.x;
}
struct Npers{ll x,t;int id;Npers(int _x=0){x=t=id=-1;}Npers(ll _x,ll _t,int _id){x=_x;t=_t;id=_id;}};
bool operator<(Npers a,Npers b)
{
	if(a.x==b.x)return a.t<b.t;
	else return a.x<b.x;
}
set<Npers> Npos;set<Ppers> Ppos;
struct event
{
	ll t,t_;int typ;
	Npers n;Ppers p;
	ll x;
	event(){t=t_=typ=x=-1;}
};
// typ=0: Npers n gets a toilet at x
// typ=1: Ppers p gets a toilet at x
// typ=2: A toilet appears at x
// typ=3: A Npers n appears at x
// typ=4: A Ppers p appears at x 
bool operator<(event a,event b)
{
	if(a.t!=b.t)return a.t<b.t;
	if(a.typ>=2||b.typ>=2)
	{
		if(a.typ!=b.typ)return a.typ>b.typ;
		else return a.x<b.x;
	}
	else
	{
		if(a.t_!=b.t_)return a.t_<b.t_;
		else return a.x<b.x;
	}
}
set<event> Est;
template<typename T>
T prv(set<T> &Tpos,T x)
{
	if(Tpos.empty())return -1;
	auto it=Tpos.upper_bound(x);
	if(it==Tpos.begin())return *--Tpos.end();
	else return *--it;
}
template<typename T>
T nxt(set<T> &Tpos,T x)
{
	if(Tpos.empty())return -1;
	auto it=Tpos.lower_bound(x);
	if(it==Tpos.end())return *Tpos.begin();
	else return *it;
}
ll Tx[N];
ll t[N],p[N],d[N];
char s[11];
ll dis(ll u,ll v){u=(u%L+L)%L;v=(v%L+L)%L;return (v-u+L)%L;}
ll resT[N],resX[N];
int main()
{
	scanf("%d%d%lld",&n,&m,&L);
	for(int i=1;i<=m;++i)
	{
		event e;
		e.t=0;
		e.typ=2;
		scanf("%lld",&e.x);
		Est.insert(e);
	}
	for(int i=1;i<=n;++i)
	{
		scanf("%lld%lld%s%lld",t+i,p+i,s+1,d+i);
		event e;
		if(s[1]=='+')
		{
			e.t=t[i];
			e.typ=4;
			e.x=p[i];
			e.p=Ppers(p[i],t[i],i);
		}
		else
		{
			e.t=t[i];
			e.typ=3;
			e.x=p[i];
			e.n=Npers(p[i],t[i],i);
		}
		Est.insert(e);
	}
	while(!Est.empty())
	{
		event e=*Est.begin();
		Est.erase(Est.begin());
		// printf("========================found event e typ:%d\n",e.typ);
		// printf("t:%lld t_:%lld typ:%d x:%lld\n",e.t,e.t_,e.typ,e.x);
		// printf("e.n:(%lld,%lld,%d) e.p(%lld,%lld,%d)\n",e.n.x,e.n.t,e.n.id,e.p.x,e.p.t,e.p.id);
		if(e.typ==0)
		{
			if(Npos.find(e.n)==Npos.end())continue;
			if(Tpos.find(e.x)==Tpos.end())
			{
				ll x=prv(Tpos,e.x);
				// printf("aiming for toilet x:%lld\n",x);
				if(~x)
				{
					event ne;
					ne.t=e.t+dis(x,e.x);
					ne.n=e.n;ne.x=x;
					ne.t_=e.n.t;
					ne.typ=0;
					Est.insert(ne);
				}
			}
			else
			{//printf("success\n");
				Npos.erase(e.n);
				Tpos.erase(e.x);
				resT[e.n.id]=e.t;resX[e.n.id]=e.x;
				event ne;
				ne.t=e.t+d[e.n.id];
				ne.typ=2;
				ne.x=e.x;
				Est.insert(ne);
				ll x=prv(Tpos,e.x);
				Npers n=nxt(Npos,Npers((x+e.t)%L,-1e18,0));
				if(~x&&~n.id)
				{
					event ne;
					ne.t=e.t+dis(x,n.x-e.t);
					ne.n=n;ne.x=x;
					ne.t_=n.t;
					ne.typ=0;
					Est.insert(ne);
				}
			}
		}
		else if(e.typ==1)
		{
			if(Ppos.find(e.p)==Ppos.end())continue;
			if(Tpos.find(e.x)==Tpos.end())
			{
				ll x=nxt(Tpos,e.x);
				// printf("aiming for toilet x:%lld\n",x);
				if(~x)
				{
					event ne;
					ne.t=e.t+dis(e.x,x);
					ne.p=e.p;ne.x=x;
					ne.t_=e.p.t;
					ne.typ=1;
					Est.insert(ne);
				}
			}
			else
			{//printf("success\n");
				Ppos.erase(e.p);
				Tpos.erase(e.x);
				resT[e.p.id]=e.t;resX[e.p.id]=e.x;
				event ne;
				ne.t=e.t+d[e.p.id];
				ne.typ=2;
				ne.x=e.x;
				Est.insert(ne);
				ll x=nxt(Tpos,e.x);
				Ppers p=prv(Ppos,Ppers(((x-e.t)%L+L)%L,-1e18,0));
				if(~x&&~p.id)
				{
					event ne;
					ne.t=e.t+dis(p.x+e.t,x);
					ne.p=p;ne.x=x;
					ne.t_=p.t;
					ne.typ=1;
					Est.insert(ne);
				}
			}
		}
		else if(e.typ==2)
		{
			Npers n=nxt(Npos,Npers((e.x+e.t)%L,-1e18,0));
			// printf("Npers %d aims for toilet %lld\n",n.id,e.x);
			if(~n.id)
			{
				event ne;
				ne.t=e.t+dis(e.x,n.x-e.t);
				ne.n=n;ne.x=e.x;
				ne.t_=n.t;
				ne.typ=0;
				Est.insert(ne);
			}
			Ppers p=prv(Ppos,Ppers(((e.x-e.t)%L+L)%L,-1e18,0));
			// printf("Ppers %d aims for toilet %lld\n",p.id,e.x);
			if(~p.id)
			{
				event ne;
				ne.t=e.t+dis(p.x+e.t,e.x);
				ne.p=p;ne.x=e.x;
				ne.t_=p.t;
				ne.typ=1;
				Est.insert(ne);
			}
			Tpos.insert(e.x);
		}
		else if(e.typ==3)
		{
			ll x=prv(Tpos,e.x);
			// printf("aiming for toilet x:%lld\n",x);
			Npers tn((e.n.x+e.n.t)%L,e.n.t,e.n.id);
			if(~x)
			{
				event ne;
				ne.t=e.t+dis(x,e.n.x);
				ne.n=tn;ne.x=x;
				ne.t_=e.n.t;
				ne.typ=0;
				Est.insert(ne);
			}
			Npos.insert(tn);
		}
		else if(e.typ==4)
		{
			ll x=nxt(Tpos,e.x);
			// printf("aiming for toilet x:%lld\n",x);
			Ppers tp(((e.p.x-e.p.t)%L+L)%L,e.p.t,e.p.id);
			if(~x)
			{
				event ne;
				ne.t=e.t+dis(e.p.x,x);
				ne.p=tp;ne.x=x;
				ne.t_=e.p.t;
				ne.typ=1;
				Est.insert(ne);
			}
			Ppos.insert(tp);
		}
		// printf("Tpos:");for(ll x:Tpos)printf("%lld ",x);putchar(10);
		// printf("Npos:");for(Npers x:Npos)printf("(x:%lld t:%lld id:%d) ",x.x,x.t,x.id);putchar(10);
	}
	for(int i=1;i<=n;++i)printf("%lld %lld\n",resX[i],resT[i]);
	fclose(stdin);fclose(stdout);return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 11976kb

input:

5 3 45
10 20 30
0 0 + 200
2 5 + 10
20 40 - 100
21 16 + 10
50 0 + 22

output:

20 20
10 7
30 30
10 60
10 105

result:

ok 10 numbers

Test #2:

score: 0
Accepted
time: 2ms
memory: 10124kb

input:

1 1 1
0
0 0 - 1

output:

0 0

result:

ok 2 number(s): "0 0"

Test #3:

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

input:

5 3 33
3 24 23
12 24 - 9
16 28 - 1
17 27 - 9
19 26 - 5
32 22 - 2

output:

24 12
23 21
3 41
24 21
3 51

result:

ok 10 numbers

Test #4:

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

input:

4 5 6
1 3 4 2 0
2 1 + 2
7 3 + 6
9 0 + 9
10 1 - 6

output:

1 2
3 7
0 9
1 10

result:

ok 8 numbers

Test #5:

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

input:

736 30 100500
99382 85511 67593 53450 55531 9959 37170 57546 52666 62342 50707 71285 65933 19874 2092 100255 23965 83091 45652 64171 100128 19518 21445 96069 79781 52642 37943 95321 97569 69154
0 44619 + 7052
2 72499 + 29247
3 53785 - 35614
5 81887 + 64475
7 8561 + 31641
8 95471 - 22654
9 61040 - 44...

output:

53450 310331
95321 22824
53450 338
67593 186711
23965 718911
95321 158
83091 580958
62342 71243
50707 602820
83091 183
2092 375130
96069 552638
100128 541370
64171 5285
50707 288492
45652 795873
2092 284
85511 720931
55531 713428
53450 483192
69154 5302
83091 155808
57546 351069
2092 231938
85511 60...

result:

ok 1472 numbers

Test #6:

score: 0
Accepted
time: 931ms
memory: 71424kb

input:

200000 200000 200000
45589 41206 151226 67898 73967 140984 73325 186330 35522 72131 147731 139390 123121 817 198939 98824 55631 84079 28987 108012 22006 143408 11442 195253 179662 189693 142207 99819 103750 166626 140235 140358 148893 170212 14967 98607 193895 19535 87565 166568 179135 11569 109260 ...

output:

99245 0
159669 1
129567 2
170331 3
193860 4
48848 5
30808 6
189543 7
197499 8
74809 9
87700 10
65894 11
73388 12
26093 13
153804 14
70658 15
145638 16
160334 17
186485 18
152675 19
12885 20
147489 21
163294 22
113719 23
83742 24
113022 25
93798 26
76277 27
140176 28
59905 29
136561 30
51995 31
19607...

result:

ok 400000 numbers

Test #7:

score: 0
Accepted
time: 1036ms
memory: 71304kb

input:

200000 200000 200000
67377 142291 151268 72979 185819 156121 192200 17397 65947 188441 42732 105128 109047 194478 172594 65720 145270 45896 158786 91346 151717 128510 38516 132320 173853 29926 115425 97498 194492 38593 105133 145425 178811 102871 27054 85946 177981 86039 135592 133041 63258 30002 14...

output:

156379 0
148151 1
114121 2
60170 3
154886 4
25861 5
142624 6
134229 7
80846 8
8523 9
79418 10
55843 11
43557 12
67407 13
90714 14
150661 15
102995 16
27052 17
156741 18
136583 19
182169 20
67154 21
6858 22
163531 23
139341 24
106763 25
76312 26
66688 27
24109 28
93047 29
12862 30
125422 31
56277 32
...

result:

ok 400000 numbers

Test #8:

score: 0
Accepted
time: 763ms
memory: 61768kb

input:

200000 200000 200000
75431 44316 77115 59881 63128 182471 72672 52412 155046 30174 97415 197975 188366 186775 35287 115874 33691 160508 105488 191145 99179 125899 143586 67203 179779 125317 190574 29343 171338 105679 103732 188425 146712 73889 191673 119394 8051 40718 67673 136263 179160 73373 17261...

output:

82463 6142487
67122 9466423
46017 14176344
18103 15505191
170333 21378579
193254 34705540
63347 40854565
71397 41121172
155259 44467575
43884 48298334
50155 53825544
143955 56062180
166730 61533465
6334 62892719
50564 65427831
42035 65475099
59339 79123818
116066 79162272
136400 80833074
129564 8606...

result:

ok 400000 numbers

Test #9:

score: 0
Accepted
time: 779ms
memory: 62668kb

input:

200000 200000 200000
79792 167942 169599 94936 166501 51906 17316 189440 198683 151975 147832 43627 48492 189248 162143 188792 154071 142667 18102 140167 64278 172223 30195 109806 20994 66239 166811 179018 183631 34144 30993 168468 188171 155455 87023 59501 120638 131354 2343 46606 51939 31244 56953...

output:

194946 11531103
10748 15977606
189971 17689879
35517 34381790
15316 36880898
164576 40181273
188585 47338971
4476 52413723
90056 55312456
140740 56342662
126777 69101294
91524 70559200
95216 71687608
103841 76187098
146441 80440772
28662 87345421
34411 94295266
65000 100982855
42545 109580282
171422...

result:

ok 400000 numbers

Test #10:

score: 0
Accepted
time: 937ms
memory: 72224kb

input:

200000 200000 200001
185921 149183 147529 165773 80912 116913 111526 7380 177737 87557 179276 5891 154212 176656 165650 92202 135083 160059 197199 113208 119837 6038 113170 89010 128897 160117 26757 117315 26060 163737 45168 7986 174017 186809 58527 101588 52743 194442 138346 3743 98092 33214 8851 7...

output:

28754 0
167773 1
166845 2
23428 3
183879 4
88623 5
158682 6
135632 7
63503 8
74686 9
78866 10
36637 11
132703 12
114802 13
45989 14
171632 15
100670 16
154259 17
191905 18
190434 19
75031 20
68593 21
5895 22
15477 23
99669 24
156744 25
126169 26
80925 27
186460 28
181854 29
125303 30
25268 31
9252 3...

result:

ok 400000 numbers

Test #11:

score: 0
Accepted
time: 1024ms
memory: 70964kb

input:

200000 200000 200001
131169 81628 127074 153856 130144 183484 29252 199207 99979 168357 70850 90603 121013 74742 73223 28914 75855 45872 165791 133388 19745 136370 48781 156525 111068 160922 67283 168483 190693 123061 166030 10849 58271 10970 134019 81443 161181 106566 4816 70108 120621 122463 15660...

output:

172279 0
182889 1
126041 2
163938 3
124368 4
120559 5
130227 6
5045 7
97507 8
32079 9
197593 10
64871 11
97283 12
63365 13
7041 14
23554 15
137330 16
50290 17
158315 18
70607 19
17348 20
64057 21
51550 22
65917 23
190896 24
141325 25
111664 26
40824 27
173878 28
42119 29
43417 30
94819 31
19309 32
9...

result:

ok 400000 numbers

Test #12:

score: 0
Accepted
time: 744ms
memory: 63132kb

input:

200000 200000 200001
41402 34096 39692 139625 94103 106816 58037 21778 79470 64035 127101 18625 77104 24067 116337 75056 188946 81914 134350 167228 17948 187975 127174 77638 11473 197753 106580 133559 176122 145629 7621 163463 52244 6449 88689 71236 198251 123968 156269 112261 9289 35216 11434 16682...

output:

179613 2998211
176522 7541115
79937 13791443
161623 15145586
23297 18316659
119503 23508884
2823 28015561
23989 29153313
18185 43534121
57695 45000452
146116 49642783
145709 51901683
126768 61783250
166348 67231577
112159 75862001
144374 81437551
87516 87057042
164937 89991910
87745 94255307
63948 1...

result:

ok 400000 numbers

Test #13:

score: 0
Accepted
time: 774ms
memory: 62240kb

input:

200000 200000 200001
55520 163786 125903 154328 160422 53352 36498 101959 52613 96897 160620 55790 39400 181028 44314 30733 61918 174767 120474 119178 157437 67616 13927 84297 66602 113394 84990 137621 92398 67036 117393 97977 163322 91750 147342 187616 122191 129810 141142 102120 94859 106858 16941...

output:

51083 4562872
3290 14731039
46661 19751612
176606 36542618
50485 40187943
29971 40953677
9447 42439758
137501 49500327
128084 60356660
147307 64196903
9352 66387108
58066 67497282
66319 69330777
51208 73574141
41781 86086091
180081 86847971
33370 95018264
153719 99370502
47155 103933012
25054 108198...

result:

ok 400000 numbers

Test #14:

score: 0
Accepted
time: 1825ms
memory: 86772kb

input:

200000 200000 1000000000000
712005944892 113969833957 951774640005 163890217155 218509957041 376888324133 332455729292 498751766550 389038478702 314331040801 664603229484 83801528759 856269762595 684554436963 378454799038 337860622639 531443402354 431229888013 837990324717 319612737184 943039351994 ...

output:

606351775881 58271980
779831906733 36571731
292323866415 1967863
821642623933 2679581
830046246936 22079776
238429333090 6968808
443342220572 2361276
879545851169 3198412
451853859336 10543717
374696459634 12777466
530381822686 17830445
448098097940 6806094
531808571467 8861119
261470848686 13002511...

result:

ok 400000 numbers

Test #15:

score: 0
Accepted
time: 2057ms
memory: 92268kb

input:

200000 200000 1000000000000
898968443177 525103084063 533531976207 33397411613 980113180542 710230905711 232724135377 896608780352 491257803291 154404328819 762705667306 102019932409 956890054541 296087645010 604636694610 694336418811 802504752465 85151294664 957281307989 952139047434 731354174498 1...

output:

472913011628 2487291
53720438011 6989012
994079853933 6379587
281472156544 2812719
875229950063 323972
889048333601 15537388
998048233115 1381578
583906616984 1329675
959076162827 3008180
988897258986 3480517
127197543936 1629156
502778085251 15072771
940935292501 7816798
949990043702 743923
3156930...

result:

ok 400000 numbers

Test #16:

score: 0
Accepted
time: 1110ms
memory: 61732kb

input:

200000 200000 1000000000000
345629755005 836753366691 648018025890 110291178211 548821396200 374027573481 78914529377 739629271304 585488283326 461292714026 455512968963 185841041429 837364608255 715536691469 517559191350 860342509309 899067171252 670436734714 30123777134 378011203997 762821064730 1...

output:

833399601864 5478042
438847614422 14175850
442881331857 36587876
355093076227 40264912
96390011449 44979770
174731331390 59397414
324154804356 51308771
861056154762 49217478
283936116784 70708903
549047209673 71528657
123971428554 74404731
765005132728 73806595
531486816196 90103140
681818434194 935...

result:

ok 400000 numbers

Test #17:

score: 0
Accepted
time: 1098ms
memory: 61880kb

input:

200000 200000 1000000000000
797861601896 46507519315 487325345413 387682869933 341311537127 641609555524 29306953045 250700863807 353003658401 881704467780 399043805033 581953352146 998538717952 941645090550 457470962228 626178810294 758811126147 75562594758 286677682805 289947308750 104218496944 76...

output:

616770452118 16282635
279640914924 14417805
809614826875 47492610
678265919939 26578362
257080936964 41432406
577319585103 39356063
112007798968 46568622
48754386409 48125119
800796002538 54895106
744302691752 49227242
199021677781 56838254
319069586782 61627677
376712490586 68384750
142467793036 78...

result:

ok 400000 numbers

Test #18:

score: 0
Accepted
time: 463ms
memory: 37268kb

input:

200000 1 200000
39051
0 28764 + 637694208351
1 179368 + 587449626679
2 119462 + 581009207196
3 114420 - 343378163308
4 12844 + 658663967816
5 161178 + 788297971605
6 34716 + 931035276079
7 131846 + 159956763825
8 119467 + 724839758229
9 76952 - 60658416720
10 169364 + 624653753081
11 83923 - 7871538...

output:

39051 13270995858810287
39051 76857208118459684
39051 12918263508719591
39051 97941900604475372
39051 91008067124626211
39051 87691085824077878
39051 70982990029604341
39051 72852749622307212
39051 58746542353719592
39051 7913866355437910
39051 80494932476069697
39051 14185481895444883
39051 8864797...

result:

ok 400000 numbers

Test #19:

score: 0
Accepted
time: 469ms
memory: 37432kb

input:

200000 1 200000
19086
0 76858 - 183503
1 179483 - 126923
2 120121 - 943
3 85494 + 136523
4 133318 + 172371
5 152189 - 168956
6 65889 - 79288
7 58192 + 38994
8 93851 + 1299
9 51140 - 102034
10 34418 + 139616
11 151038 + 100892
12 89115 + 154283
13 68677 - 62133
14 121050 - 8112
15 103246 - 148671
16 ...

output:

19086 14895257772
19086 10998160398
19086 9495701037
19086 987733595
19086 1410485772
19086 2952733108
19086 7431846809
19086 14073760901
19086 15055325243
19086 10307832063
19086 9739784678
19086 193068059
19086 3335529983
19086 7007249604
19086 17060301978
19086 10609484175
19086 16887544356
19086...

result:

ok 400000 numbers

Test #20:

score: 0
Accepted
time: 480ms
memory: 37116kb

input:

200000 1 200000
117683
6293673 130114 - 224444601930
6331488 154535 + 594817926199
7354646 29848 + 699763457030
23965989 196152 + 975774360326
27217003 16382 + 706898116673
29968642 81442 + 987726299221
39694082 176714 - 969627855285
45978607 56804 - 157626993978
54081802 137511 + 993853476068
54739...

output:

117683 6306104
117683 38570140481294636
117683 94102387984042481
117683 94835242687687520
117683 77010486192918304
117683 14233478145604883
117683 27703136438953113
117683 7131730140917728
117683 99541206048261974
117683 10613386171341694
117683 22845313423552496
117683 45933198749169675
117683 4265...

result:

ok 400000 numbers

Test #21:

score: 0
Accepted
time: 467ms
memory: 37972kb

input:

200000 1 200000
84121
851979 185128 + 844216614315
2428119 82790 + 125897779899
6577875 168445 - 996886687811
20175610 176833 + 300602008510
26134806 141041 - 51159008594
26490635 134602 - 885209574696
30072934 95023 + 614694857317
30826346 59036 + 761402470998
39743944 52972 - 943017576761
42264407...

output:

84121 950972
84121 76535960447429450
84121 64049331269662199
84121 6663499640682898
84121 13400832253391726
84121 89262160623741116
84121 15761771752462032
84121 51117571638251431
84121 5443084143912795
84121 21108298795081410
84121 44354681650515134
84121 67143378548152340
84121 7536070237426442
84...

result:

ok 400000 numbers

Test #22:

score: 0
Accepted
time: 230ms
memory: 37144kb

input:

200000 1 2
0
0 1 + 330183680565
1 1 - 404203785195
2 0 - 241903073421
3 0 + 244811067209
4 1 - 639420687301
5 0 - 327040548151
6 1 + 740607939542
7 0 - 175873620913
8 1 + 295699949859
9 0 + 412686164354
10 1 + 50261365069
11 0 - 350259552498
12 0 - 913741705409
13 1 + 640898230453
14 0 + 48971592203...

output:

0 1
0 330183680566
0 979198532970
0 734387465761
0 1221101606391
0 2774263999101
0 3742202777705
0 4482810717247
0 5928890571491
0 8322612951623
0 8735299115977
0 9069762861013
0 1860522293692
0 3101304547252
0 4658684338160
0 9420022413511
0 10275470519219
0 11143339924581
0 5148400260196
0 6224590...

result:

ok 400000 numbers

Test #23:

score: 0
Accepted
time: 218ms
memory: 36712kb

input:

200000 1 2
0
0 0 - 188236
1 0 - 32026
2 0 - 184700
3 0 + 136784
4 0 + 55845
5 0 - 118963
6 0 - 129854
7 1 + 30038
8 0 - 72330
9 0 + 199054
10 0 - 159380
11 1 - 140098
12 1 + 138282
13 1 - 138652
14 1 - 89621
15 1 + 97110
16 0 + 70492
17 1 - 100549
18 0 - 125146
19 1 - 53035
20 1 - 188710
21 1 + 1299...

output:

0 0
0 428781
0 188236
0 460807
0 372936
0 597591
0 716554
0 846408
0 876446
0 1655057
0 948776
0 1108156
0 1854111
0 1248254
0 1992393
0 1386906
0 1484016
0 1554508
0 2082014
0 2207160
0 2260195
0 2455290
0 2786068
0 2448905
0 2585195
0 2716873
0 2821811
0 2977800
0 3148395
0 3223399
0 3413358
0 356...

result:

ok 400000 numbers

Test #24:

score: 0
Accepted
time: 216ms
memory: 36592kb

input:

200000 1 2
0
806026 0 + 340582390570
8885829 0 - 700975679877
11678853 0 + 81870061567
20583706 1 - 871008133305
32688866 0 - 842444876895
35245885 0 + 715953697538
45102941 1 - 951415844985
48225574 1 + 267380257759
50949196 1 + 448288031051
52893770 0 + 48436662090
53764369 1 + 270996567683
551308...

output:

0 806026
0 1183028073491
0 2835419598353
0 3236722889693
0 340583196596
0 6148246569109
0 1884003753368
0 6864200266647
0 10472458888899
0 2917289659920
0 2965726322010
0 4107731022998
0 4899986283268
0 5352548560356
0 12477648470075
0 5696102333990
0 12965453974239
0 6009538176488
0 7131580524406
0...

result:

ok 400000 numbers

Test #25:

score: 0
Accepted
time: 232ms
memory: 38044kb

input:

200000 1 2
0
8535855 1 + 375322507077
11318398 0 + 409442351094
12611724 0 - 273737749575
14088595 1 - 861205879837
15969129 0 + 913590439352
17570188 1 - 655289244558
18137561 1 + 919796650527
19130106 1 - 29142114537
19918132 1 - 707095606182
46031768 1 - 347804771149
46745544 0 - 338339336483
565...

output:

0 8535856
0 1973352841380
0 2382795192474
0 3711433319380
0 375331042933
0 1288921482285
0 5389188119572
0 1944210726843
0 2656532942049
0 3363628548231
0 6372014946264
0 6745955838214
0 7253272352026
0 9345386125994
0 10551946174804
0 11524030730332
0 4572639199217
0 12343473577416
0 6308984770099
...

result:

ok 400000 numbers

Test #26:

score: 0
Accepted
time: 712ms
memory: 50312kb

input:

200000 1 1000000000000
657524445622
0 5896125517 + 782166915018
1 164450538467 - 693852110390
2 33227574299 + 539952620368
3 967143332558 - 829076233244
4 471015997665 - 601734164726
5 796454310372 - 221343730471
6 450019579655 - 31376499632
7 807359704987 + 383196471849
8 602670900702 - 95378574552...

output:

657524445622 31486651628320105
657524445622 14482506926092846
657524445622 55352624296871325
657524445622 63284309618886939
657524445622 81036813491552047
657524445622 85458138929864755
657524445622 17628792495134039
657524445622 11285850164740642
657524445622 14347945146455088
657524445622 32606342...

result:

ok 400000 numbers

Test #27:

score: 0
Accepted
time: 493ms
memory: 49320kb

input:

200000 1 1000000000000
206984653562
0 181793727349 + 2315
1 541299722655 - 74843
2 609129625612 - 83948
3 975013297012 - 122279
4 822995237465 - 177541
5 48130234671 + 54669
6 595405354269 + 32973
7 536220170539 + 88965
8 941158593591 - 120952
9 382225230924 + 57120
10 876423202664 + 94869
11 636301...

output:

206984653562 25190926213
206984653562 334315069094
206984653562 402144972052
206984653562 768028643453
206984653562 616010583907
206984653562 158854418896
206984653562 611579299299
206984653562 670764483030
206984653562 734173940037
206984653562 824759422647
206984653562 330561450908
206984653562 42...

result:

ok 400000 numbers

Test #28:

score: 0
Accepted
time: 505ms
memory: 36844kb

input:

200000 1 1000000000000
140795080215
1625765 897598117681 - 453253848646
5413766 188271037002 + 772888562534
6118817 67779399787 - 570844934316
8784568 876605571205 - 35640525892
9513821 160256914958 + 40916671289
10098490 407007947784 - 369682005829
11172918 307953905036 - 387311479595
12095807 2010...

output:

140795080215 43553756804663231
140795080215 56440952529456979
140795080215 33533926990438389
140795080215 87941735819275558
140795080215 80114980547679078
140795080215 57010266222966059
140795080215 51457167169997739
140795080215 69883060257054384
140795080215 49128101280326651
140795080215 64994249...

result:

ok 400000 numbers

Test #29:

score: 0
Accepted
time: 485ms
memory: 36724kb

input:

200000 1 1000000000000
850046821322
3487886 840694349222 + 807166775037
6567249 100680852750 + 629564881537
23643550 865788859164 + 733691433237
27603398 302863711714 + 874210284941
29714872 310704860943 + 101259823504
44538135 371557969787 - 98668201931
50532380 526587941361 - 409015136965
56059321...

output:

850046821322 11977009355959986
850046821322 87651749372535821
850046821322 4794984281605708
850046821322 32178547210713006
850046821322 45454539371675251
850046821322 29813521555686600
850046821322 12909676591652419
850046821322 31949224126988816
850046821322 91355616191910615
850046821322 999213819...

result:

ok 400000 numbers

Test #30:

score: 0
Accepted
time: 541ms
memory: 37136kb

input:

200000 30 200000
3583 2283 112670 71614 42028 20774 44607 35458 194743 46557 104340 73749 150485 140166 88496 114923 145304 155508 91011 137414 161936 61721 183717 77768 76433 50687 22344 83301 148645 117660
0 140912 - 783331227501
1 188712 + 41358655117
2 39543 + 252191609398
3 119980 + 35294026838...

output:

114923 3209290588425989
150485 1023858497361774
35458 115794451995917
194743 569110629274766
112670 77
145304 247
46557 467552484825953
3583 112273692549159
71614 2591682342119643
46557 969627795762982
76433 1792076341716839
3583 358263043985258
76433 119785313192192
104340 179600767824428
117660 23...

result:

ok 400000 numbers

Test #31:

score: 0
Accepted
time: 545ms
memory: 36792kb

input:

200000 30 200000
27920 127398 103353 131810 5791 39316 112695 170520 129518 22774 66442 143026 85117 106594 188309 22267 133072 60195 5450 107330 98564 58819 165012 82487 122648 6317 25741 1952 141467 34452
0 21391 - 63858
1 195364 - 50914
2 91004 + 151406
3 160295 + 167711
4 119002 - 150299
5 62534...

output:

107330 44114061
112695 459682670
5791 335514789
131810 353971518
60195 610458811
22267 177359738
141467 234228587
22267 133160587
131810 551148047
60195 270629968
34452 298572224
25741 212864570
122648 171913524
82487 277111586
129518 632514637
165012 205
1952 55577576
22774 610751262
60195 52654082...

result:

ok 400000 numbers

Test #32:

score: 0
Accepted
time: 525ms
memory: 37652kb

input:

200000 30 200000
96134 176318 56951 78014 165494 82036 122250 7025 100961 32950 63355 186352 40431 8894 135866 37487 75697 160205 118495 13552 94052 178174 34682 154072 163516 88127 134639 45022 190225 37376
1203546 105092 + 367682859585
1278817 3646 - 418774138692
8270489 189572 + 84923337597
21883...

output:

118495 1216949
190225 1292238
7025 8287942
163516 21886182
37376 23632096
56951 26125139
178174 26131766
134639 43476453
165494 43699069
94052 49383885
100961 54028152
13552 56401443
154072 60501740
32950 65413177
34682 66148841
40431 70284884
37487 83277479
88127 86131516
45022 103309199
63355 1037...

result:

ok 400000 numbers

Test #33:

score: 0
Accepted
time: 515ms
memory: 38200kb

input:

200000 30 200000
39281 170056 67334 4700 146754 186718 83834 12572 140141 6967 98031 55732 152092 60773 4619 181665 8390 141688 134388 23434 44012 129890 110272 34626 48633 118146 23588 23835 4162 97648
2417906 39887 - 306945938853
8021089 178273 + 186401903436
12819692 195261 - 650553009128
1440387...

output:

39281 2418512
181665 8024481
186718 12828235
170056 14412508
152092 16862363
83834 23246039
23434 25256636
34626 38450789
4162 41435954
110272 43325011
146754 53097273
12572 55828387
129890 57475523
141688 58718353
44012 62227830
140141 70976949
48633 74261527
4619 74644389
4700 78282210
60773 78921...

result:

ok 400000 numbers

Test #34:

score: 0
Accepted
time: 302ms
memory: 37028kb

input:

200000 30 31
9 0 24 16 19 11 8 4 26 15 13 27 22 25 5 18 6 20 17 14 23 1 3 29 21 2 10 7 28 12
0 25 - 287682855238
1 19 + 110240357176
2 15 + 26224789005
3 27 - 519024613253
4 25 + 770816838136
5 11 - 118661210863
6 12 + 714443046552
7 16 + 674872468905
8 18 + 619229953888
9 0 + 607860348454
10 9 + 29...

output:

25 0
19 1
15 2
27 3
26 5
11 5
12 6
16 7
18 8
0 9
9 10
5 11
14 12
13 15
10 14
4 15
2 16
24 19
6 18
22 19
17 23
23 21
21 26
20 27
29 24
29 1478093496947
16 709158904044
3 28
7 42
8 32
22 58240750284
14 21134044844
25 1056052874378
28 35
1 39
14 288134131314
5 259571750152
5 1110265426950
16 1152245072...

result:

ok 400000 numbers

Test #35:

score: 0
Accepted
time: 304ms
memory: 36772kb

input:

200000 30 31
15 25 1 10 20 30 22 29 24 19 11 27 3 14 28 26 17 6 16 0 21 9 13 18 5 12 23 8 4 7
0 23 - 61748
1 8 + 80365
2 29 - 35944
3 3 + 129198
4 13 + 187866
5 21 + 6653
6 11 + 39277
7 26 + 178265
8 13 - 84334
9 28 - 96665
10 12 + 100068
11 24 + 132603
12 10 - 73014
13 24 + 85010
14 19 - 99207
15 9...

output:

23 0
8 1
29 2
3 3
13 4
21 5
11 6
26 7
12 9
28 9
14 12
24 11
10 12
25 14
19 14
9 15
30 18
17 17
27 18
18 19
15 22
1 21
22 23
20 26
6 24
16 28
7 27
18 326988
30 23883
9 60897
16 122955
4 32
0 32
23 61748
5 36
25 177923
4 94248
19 99221
17 250452
14 100080
7 363641
16 67517
25 85024
0 172469
22 106701
...

result:

ok 400000 numbers

Test #36:

score: 0
Accepted
time: 313ms
memory: 37016kb

input:

200000 30 31
27 7 12 8 4 29 23 22 21 13 25 10 28 11 5 20 17 15 24 1 30 3 19 2 6 18 16 26 14 0
5402887 24 - 942232749750
7998783 13 - 232057733736
13066930 7 - 248293169464
19108095 2 - 616460067631
29788681 6 - 528385795938
29843027 1 + 958785462314
31242798 25 - 491397644943
41893860 2 - 9463830352...

output:

24 5402887
13 7998783
7 13066930
2 19108095
6 29788681
1 29843027
25 31242798
0 41893862
5 44266030
17 54251492
18 61252081
10 62082514
14 71734513
11 74391203
26 74535995
8 80179549
12 86889854
15 88020313
20 91042159
21 92788646
16 93459901
4 101770804
19 109772525
30 118804526
27 121112689
29 125...

result:

ok 400000 numbers

Test #37:

score: 0
Accepted
time: 328ms
memory: 37740kb

input:

200000 30 31
28 19 11 12 13 4 17 26 14 5 1 29 2 15 30 18 3 16 20 6 7 9 25 0 24 10 22 27 23 21
746619 9 + 848889764060
34497201 0 + 964301518046
40983038 8 + 187249185277
41915064 22 - 682247069988
43540892 8 + 584440493033
63176615 5 - 565059716674
65765429 18 + 487650628652
70221605 14 - 3544089576...

output:

9 746619
0 34497201
10 40983040
22 41915064
11 43540895
5 63176615
18 65765429
14 70221605
20 73403612
13 80143392
7 80287188
23 88577503
19 93808978
12 94536987
1 98349068
30 102187582
26 104669360
27 106899648
17 107453466
15 108566930
21 110075633
2 117401436
6 120950690
3 135154130
29 139227032
...

result:

ok 400000 numbers

Test #38:

score: 0
Accepted
time: 712ms
memory: 50184kb

input:

200000 30 1000000000000
792650482380 588528522501 872554188577 461461341111 987826744120 406790003631 962730144610 495574133467 814730526827 54919198128 155211086540 248351658197 942023332147 194587377802 632648239606 512672200007 117351127716 889449116524 57987791605 621776141748 846810738409 82892...

output:

117351127716 2773592659614925
846810738409 2663306192898329
194587377802 774427080216964
753091870679 1895861250626404
753091870679 102638384726672
947802710506 1222582538509596
54919198128 1489012148103068
995529796557 259304422733572
828923931821 375638303606848
54919198128 2928448594244943
999513...

result:

ok 400000 numbers

Test #39:

score: 0
Accepted
time: 581ms
memory: 49760kb

input:

200000 30 1000000000000
706695880516 6028125089 323190368626 904166696367 320776621761 408167157885 655336454240 605325522351 316161061406 860995152180 212064222770 854564496499 590794232455 944538230914 191744449998 306065106723 219690747629 902845687499 591812294751 115273222894 531026191363 65854...

output:

550306970868 10624014835
447518473869 77844084615
447518473869 78023657260
590794232455 8723306243
655336454240 33403358024
944538230914 22281273400
658543239646 39730234866
854564496499 20353418946
408167157885 47244275364
320776621761 8825476399
56459700081 48469949674
327002440850 8175976781
5503...

result:

ok 400000 numbers

Test #40:

score: 0
Accepted
time: 495ms
memory: 36720kb

input:

200000 30 1000000000000
420137842996 651582833993 115669189316 713967798422 961042670074 955554192498 91889978874 983939148960 371810113529 579382451419 41610176884 259497085987 460483615916 27002842601 265633484515 303587430580 124290342493 286604686865 696389772549 554510535944 428329116913 870896...

output:

554510535944 2687533339522665
259497085987 3165799659174385
983939148960 2153131470577798
870896466412 2141883339152627
637463090865 183432607229492
41610176884 3022735164221384
870896466412 1402618325808334
425753669602 1352100254529582
460483615916 2122818109048143
425753669602 1476940736930513
31...

result:

ok 400000 numbers

Test #41:

score: 0
Accepted
time: 516ms
memory: 37092kb

input:

200000 30 1000000000000
71021834452 256956911680 654571171072 686121949279 592029694550 653947722881 147843995221 923512436125 51889280375 273515174793 484701632166 444394004210 894402725122 632289183647 65867542163 738851110854 865681004988 455184702713 391860441659 663271596635 761127620127 707862...

output:

273515174793 1622701135229527
71021834452 1329588548387466
484701632166 1001428637300896
663271596635 2812615725746891
653947722881 999976572875026
187076861737 3197039032711425
894402725122 522796722491447
65867542163 1662711297663790
484701632166 1503648690033660
686121949279 2013936826
6861219492...

result:

ok 400000 numbers

Test #42:

score: 0
Accepted
time: 261ms
memory: 48692kb

input:

200000 1 1000000000000
999999999999
999999800001 199999 + 1000000000000
999999800002 199998 + 1000000000000
999999800003 199997 + 1000000000000
999999800004 199996 + 1000000000000
999999800005 199995 + 1000000000000
999999800006 199994 + 1000000000000
999999800007 199993 + 1000000000000
999999800008...

output:

999999999999 1999999600001
999999999999 2999999600003
999999999999 3999999600005
999999999999 4999999600007
999999999999 5999999600009
999999999999 6999999600011
999999999999 7999999600013
999999999999 8999999600015
999999999999 9999999600017
999999999999 10999999600019
999999999999 11999999600021
9...

result:

ok 400000 numbers

Test #43:

score: 0
Accepted
time: 255ms
memory: 48508kb

input:

200000 1 999999999999
999999999998
999999800001 199999 + 1000000000000
999999800002 199998 + 1000000000000
999999800003 199997 + 1000000000000
999999800004 199996 + 1000000000000
999999800005 199995 + 1000000000000
999999800006 199994 + 1000000000000
999999800007 199993 + 1000000000000
999999800008 ...

output:

999999999998 1999999600000
999999999998 2999999600001
999999999998 3999999600002
999999999998 4999999600003
999999999998 5999999600004
999999999998 6999999600005
999999999998 7999999600006
999999999998 8999999600007
999999999998 9999999600008
999999999998 10999999600009
999999999998 11999999600010
9...

result:

ok 400000 numbers

Test #44:

score: 0
Accepted
time: 1109ms
memory: 62836kb

input:

200000 200000 1000000000000
999999999999 999999999998 999999999997 999999999996 999999999995 999999999994 999999999993 999999999992 999999999991 999999999990 999999999989 999999999988 999999999987 999999999986 999999999985 999999999984 999999999983 999999999982 999999999981 999999999980 999999999979...

output:

999999800000 1999999400002
999999800001 1999999400005
999999800002 1999999400008
999999800003 1999999400011
999999800004 1999999400014
999999800005 1999999400017
999999800006 1999999400020
999999800007 1999999400023
999999800008 1999999400026
999999800009 1999999400029
999999800010 1999999400032
999...

result:

ok 400000 numbers

Test #45:

score: 0
Accepted
time: 284ms
memory: 48776kb

input:

200000 1 1000000000000
0
999999800001 999999800000 - 1000000000000
999999800002 999999800001 - 1000000000000
999999800003 999999800002 - 1000000000000
999999800004 999999800003 - 1000000000000
999999800005 999999800004 - 1000000000000
999999800006 999999800005 - 1000000000000
999999800007 9999998000...

output:

0 1999999600001
0 2999999600003
0 3999999600005
0 4999999600007
0 5999999600009
0 6999999600011
0 7999999600013
0 8999999600015
0 9999999600017
0 10999999600019
0 11999999600021
0 12999999600023
0 13999999600025
0 14999999600027
0 15999999600029
0 16999999600031
0 17999999600033
0 18999999600035
0 1...

result:

ok 400000 numbers

Test #46:

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

input:

200000 1 999999999999
0
999999800001 999999799999 - 1000000000000
999999800002 999999800000 - 1000000000000
999999800003 999999800001 - 1000000000000
999999800004 999999800002 - 1000000000000
999999800005 999999800003 - 1000000000000
999999800006 999999800004 - 1000000000000
999999800007 99999980000...

output:

0 1999999600000
0 2999999600001
0 3999999600002
0 4999999600003
0 5999999600004
0 6999999600005
0 7999999600006
0 8999999600007
0 9999999600008
0 10999999600009
0 11999999600010
0 12999999600011
0 13999999600012
0 14999999600013
0 15999999600014
0 16999999600015
0 17999999600016
0 18999999600017
0 1...

result:

ok 400000 numbers

Test #47:

score: 0
Accepted
time: 1181ms
memory: 62520kb

input:

200000 200000 1000000000000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 ...

output:

199999 1999999400002
199998 1999999400005
199997 1999999400008
199996 1999999400011
199995 1999999400014
199994 1999999400017
199993 1999999400020
199992 1999999400023
199991 1999999400026
199990 1999999400029
199989 1999999400032
199988 1999999400035
199987 1999999400038
199986 1999999400041
199985...

result:

ok 400000 numbers

Test #48:

score: 0
Accepted
time: 250ms
memory: 49296kb

input:

200000 1 1000000000000
999999999999
999999800001 0 + 1000000000000
999999800002 0 + 1000000000000
999999800003 0 + 1000000000000
999999800004 0 + 1000000000000
999999800005 0 + 1000000000000
999999800006 0 + 1000000000000
999999800007 0 + 1000000000000
999999800008 0 + 1000000000000
999999800009 0 +...

output:

999999999999 1999999800000
999999999999 2999999800001
999999999999 3999999800002
999999999999 4999999800003
999999999999 5999999800004
999999999999 6999999800005
999999999999 7999999800006
999999999999 8999999800007
999999999999 9999999800008
999999999999 10999999800009
999999999999 11999999800010
9...

result:

ok 400000 numbers

Test #49:

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

input:

200000 1 999999999999
999999999998
999999800001 0 + 1000000000000
999999800002 0 + 1000000000000
999999800003 0 + 1000000000000
999999800004 0 + 1000000000000
999999800005 0 + 1000000000000
999999800006 0 + 1000000000000
999999800007 0 + 1000000000000
999999800008 0 + 1000000000000
999999800009 0 + ...

output:

999999999998 1999999799999
999999999998 2999999799999
999999999998 3999999799999
999999999998 4999999799999
999999999998 5999999799999
999999999998 6999999799999
999999999998 7999999799999
999999999998 8999999799999
999999999998 9999999799999
999999999998 10999999799999
999999999998 11999999799999
9...

result:

ok 400000 numbers

Test #50:

score: 0
Accepted
time: 1535ms
memory: 62188kb

input:

200000 200000 1000000000000
999999999999 999999999998 999999999997 999999999996 999999999995 999999999994 999999999993 999999999992 999999999991 999999999990 999999999989 999999999988 999999999987 999999999986 999999999985 999999999984 999999999983 999999999982 999999999981 999999999980 999999999979...

output:

999999800000 1999999600001
999999800001 1999999600003
999999800002 1999999600005
999999800003 1999999600007
999999800004 1999999600009
999999800005 1999999600011
999999800006 1999999600013
999999800007 1999999600015
999999800008 1999999600017
999999800009 1999999600019
999999800010 1999999600021
999...

result:

ok 400000 numbers

Test #51:

score: 0
Accepted
time: 283ms
memory: 49056kb

input:

200000 1 1000000000000
0
999999800001 999999999999 - 1000000000000
999999800002 999999999999 - 1000000000000
999999800003 999999999999 - 1000000000000
999999800004 999999999999 - 1000000000000
999999800005 999999999999 - 1000000000000
999999800006 999999999999 - 1000000000000
999999800007 9999999999...

output:

0 1999999800000
0 2999999800001
0 3999999800002
0 4999999800003
0 5999999800004
0 6999999800005
0 7999999800006
0 8999999800007
0 9999999800008
0 10999999800009
0 11999999800010
0 12999999800011
0 13999999800012
0 14999999800013
0 15999999800014
0 16999999800015
0 17999999800016
0 18999999800017
0 1...

result:

ok 400000 numbers

Test #52:

score: 0
Accepted
time: 288ms
memory: 48856kb

input:

200000 1 999999999999
0
999999800001 999999999998 - 1000000000000
999999800002 999999999998 - 1000000000000
999999800003 999999999998 - 1000000000000
999999800004 999999999998 - 1000000000000
999999800005 999999999998 - 1000000000000
999999800006 999999999998 - 1000000000000
999999800007 99999999999...

output:

0 1999999799999
0 2999999799999
0 3999999799999
0 4999999799999
0 5999999799999
0 6999999799999
0 7999999799999
0 8999999799999
0 9999999799999
0 10999999799999
0 11999999799999
0 12999999799999
0 13999999799999
0 14999999799999
0 15999999799999
0 16999999799999
0 17999999799999
0 18999999799999
0 1...

result:

ok 400000 numbers

Test #53:

score: 0
Accepted
time: 1599ms
memory: 62236kb

input:

200000 200000 1000000000000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 ...

output:

199999 1999999600001
199998 1999999600003
199997 1999999600005
199996 1999999600007
199995 1999999600009
199994 1999999600011
199993 1999999600013
199992 1999999600015
199991 1999999600017
199990 1999999600019
199989 1999999600021
199988 1999999600023
199987 1999999600025
199986 1999999600027
199985...

result:

ok 400000 numbers

Test #54:

score: 0
Accepted
time: 259ms
memory: 48544kb

input:

200000 1 1000000000000
999999999999
999999800001 0 + 1000000000000
999999800002 1 + 1000000000000
999999800003 2 + 1000000000000
999999800004 3 + 1000000000000
999999800005 4 + 1000000000000
999999800006 5 + 1000000000000
999999800007 6 + 1000000000000
999999800008 7 + 1000000000000
999999800009 8 +...

output:

999999999999 1999999800000
999999999999 2999999800000
999999999999 3999999800000
999999999999 4999999800000
999999999999 5999999800000
999999999999 6999999800000
999999999999 7999999800000
999999999999 8999999800000
999999999999 9999999800000
999999999999 10999999800000
999999999999 11999999800000
9...

result:

ok 400000 numbers

Test #55:

score: 0
Accepted
time: 299ms
memory: 48644kb

input:

200000 1 999999999999
999999999998
999999800001 0 + 1000000000000
999999800002 1 + 1000000000000
999999800003 2 + 1000000000000
999999800004 3 + 1000000000000
999999800005 4 + 1000000000000
999999800006 5 + 1000000000000
999999800007 6 + 1000000000000
999999800008 7 + 1000000000000
999999800009 8 + ...

output:

999999999998 1999999799999
999999999998 3999999799997
999999999998 5999999799995
999999999998 7999999799993
999999999998 9999999799991
999999999998 11999999799989
999999999998 13999999799987
999999999998 15999999799985
999999999998 17999999799983
999999999998 19999999799981
999999999998 219999997999...

result:

ok 400000 numbers

Test #56:

score: -100
Time Limit Exceeded

input:

200000 200000 1000000000000
999999999999 999999999998 999999999997 999999999996 999999999995 999999999994 999999999993 999999999992 999999999991 999999999990 999999999989 999999999988 999999999987 999999999986 999999999985 999999999984 999999999983 999999999982 999999999981 999999999980 999999999979...

output:


result: