QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#73140#4401. Prize12345678100 ✓1715ms449208kbC++142.8kb2023-01-22 13:42:082023-01-22 13:42:11

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-22 13:42:11]
  • 评测
  • 测评结果:100
  • 用时:1715ms
  • 内存:449208kb
  • [2023-01-22 13:42:08]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mp make_pair
#define inf 1e9
#define pii pair <int, int>
const int mod = 1e9 + 7;
inline int read () {
	int x;
	scanf("%lld", &x);
	return x;
}
inline void write (int x) {
	if (x < 0) x = -x, putchar ('-');
	if (x >= 10) write (x / 10);
	putchar (x % 10 + '0');
}
int n, k, Q, T;
struct Tree {
	int Fa[1000005], Rt;
	vector <int> G[1000005];
	int dep[1000005], siz[1000005], son[1000005], top[1000005];
	int dfn[1000005], seq[1000005], tot;
	void dfs(int x, int fa) {
		dfn[x] = ++tot, seq[tot] = x;
		dep[x] = dep[fa] + 1;
		siz[x] = 1;
		for(auto y : G[x]) {
			dfs(y, x);
			siz[x] += siz[y];
			if(!son[x] || siz[y] > siz[son[x]]) son[x] = y;
		}
	}
	void dfs2(int x) {
		int fa = Fa[x];
		if(son[fa] == x) top[x] = top[fa];
		else top[x] = x;
		if(son[x]) dfs2(son[x]);
		for(auto y : G[x]) if(y != son[x]) dfs2(y);
	}
	int LCA(int x, int y) {
		while(top[x] != top[y]) {
			if(dep[top[x]] < dep[top[y]]) swap(x, y);
			x = Fa[top[x]];
		}
		if(dep[x] > dep[y]) swap(x, y);
		return x;
	}
	void init() {
		for(int i = 1; i <= n; i++) {
			Fa[i] = read();
			if(Fa[i] == -1) Rt = i;
			else G[Fa[i]].push_back(i);
		}
		dfs(Rt, 0), dfs2(Rt);
	}
	vector <pii> V[1000005];
	void add(int x, int y) {
		int e = read();
		V[x].push_back(mp(y, e)); 
		V[y].push_back(mp(x, -e));
	}
	int vis[1000005], dis[1000005];
	void dfs3(int x, int e) {
		if(vis[x]) return ;
		vis[x] = 1, dis[x] = e;
		for(auto y : V[x]) dfs3(y.first, e + y.second);
	}
	int Dis(int x, int y) {
		int lca = LCA(x, y);
		return dis[x] + dis[y] - 2 * dis[lca];
	}
}T1, T2;
int a[1000005];
int qx[1000005], qy[1000005];
signed main () {
//	freopen (".in", "r", stdin);
//	freopen (".out", "w", stdout);
	n = read(), k = read(), Q = read(), T = read();
	T1.init(), T2.init();
	for(int i = 1; i <= k; i++) a[i] = T2.seq[i];
	sort(a + 1, a + 1 + k, [&] (int A, int B) {return T1.dfn[A] < T1.dfn[B];});
	
	for(int i = 1; i <= k; i++) write(a[i]), putchar(' ');
	putchar('\n'), fflush(stdout);
	
	for(int i = 1; i < k; i++) putchar('?'), putchar(' '), write(a[i]), putchar(' '), write(a[i+1]), putchar('\n');
	puts("!"), fflush(stdout);
	
	for(int i = 1; i < k; i++) {
		int lca1 = T1.LCA(a[i], a[i+1]), lca2 = T2.LCA(a[i], a[i+1]); 
		T1.add(lca1, a[i]), T1.add(lca1, a[i+1]), T2.add(lca2, a[i]), T2.add(lca2, a[i+1]);
	}
	
	for(int i = 1; i <= k; i++) T1.dfs3(a[i], 0);
	sort(a + 1, a + 1 + k, [&] (int A, int B) {return T2.dfn[A] < T2.dfn[B];});
	for(int i = 1; i <= k; i++) T2.dfs3(a[i], 0);
	
	for(int i = 1; i <= T; i++) qx[i] = read(), qy[i] = read();
	for(int i = 1; i <= T; i++) {
		int x = qx[i], y = qy[i];
		write(T1.Dis(x, y)), putchar(' '), write(T2.Dis(x, y)), putchar('\n');
	}
	fflush(stdout);
	return 0;
}
/*
*/

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 812ms
memory: 310676kb

input:

500000 64682 64681 100000
46115
470589
209303
2979
473162
343535
79503
299539
404621
102085
237721
279170
392890
165201
441593
456314
218991
358478
86614
410800
159785
169761
95368
285837
297549
370283
378974
26449
444381
39320
149913
404523
144109
174828
263837
49847
468694
478535
152644
216598
301...

output:

422989 414496 290928 388223 160563 301045 470257 259625 222733 231286 345214 169817 435263 277447 386014 210139 455433 225855 264772 199736 355788 288506 233893 146148 454958 267562 498596 183745 352665 151125 266374 43142 9414 204593 212097 311775 25324 300764 6643 94847 396968 428563 311355 255767...

result:

ok good job!

Test #2:

score: 0
Accepted
time: 905ms
memory: 310792kb

input:

500000 90967 90966 100000
122547
312039
290084
118442
352297
175176
294396
496975
127062
90539
132654
408480
493670
419897
53432
141795
264165
60368
473480
5634
253119
64236
85346
422987
28583
262389
111931
271291
13577
415079
132797
256502
76402
265607
11274
289667
398726
32021
302401
410650
369760...

output:

3090 193269 3028 186608 498475 64618 82114 231445 7541 329983 134623 235591 70401 18906 403427 280451 146897 355174 160090 144279 193430 332022 488244 228900 80781 84465 218682 27818 6035 368489 155673 440755 443926 241570 193717 143661 374105 56616 323329 95909 337798 20531 236329 28564 437244 4969...

result:

ok good job!

Test #3:

score: 0
Accepted
time: 688ms
memory: 240152kb

input:

500000 68287 68286 100000
273928
229768
65518
144983
311611
494773
489379
439644
467893
456131
430188
247387
485565
272285
474827
476962
338340
365804
344570
390867
390170
456217
43185
447057
385874
305750
107742
230530
259907
252254
280920
16831
45761
185191
117450
55891
175190
255615
35904
14855
2...

output:

242387 146602 106115 32426 8390 3821 314935 201979 171459 413397 469146 119187 74265 167902 479051 182695 260054 235048 135315 280891 13044 240704 209304 211564 188960 481631 289686 273785 175837 385737 204887 288861 330677 315423 120726 278204 129910 396267 322633 472675 325914 329277 67326 391455 ...

result:

ok good job!

Test #4:

score: 0
Accepted
time: 742ms
memory: 235380kb

input:

500000 63976 63975 100000
230132
63748
303785
13497
431672
370351
360004
412191
378555
409703
485802
218204
475692
27602
220794
398856
89157
166559
116145
350738
277404
196706
40307
118602
171802
378360
389092
485168
224465
383516
33147
322617
254917
274019
57283
272241
216098
421952
489927
75641
40...

output:

210552 1449 40773 30337 3831 195031 251118 21848 332855 402436 374839 357357 42119 382885 377328 13863 386544 201759 32946 323963 484564 215037 277370 472684 81309 484227 89315 381707 431727 439267 216824 485515 421976 411697 230680 43213 25204 68073 30255 143879 164080 135142 441489 282767 310382 1...

result:

ok good job!

Test #5:

score: 0
Accepted
time: 799ms
memory: 237748kb

input:

500000 87673 87672 100000
151599
456749
347511
703
348209
260440
488627
416030
419890
408089
83617
120781
133411
374231
460689
211838
137587
252914
392401
321583
55161
335205
334340
4527
14086
142229
197076
17695
262896
258702
273353
51181
10968
366799
324067
299421
281975
7236
420627
92324
299845
1...

output:

51300 4033 3297 46811 80464 284515 347374 116368 204675 12242 236061 42585 91081 312035 285728 234206 326918 231575 193431 385908 123360 219570 237308 488275 146973 278867 303046 17686 461933 83949 100486 65040 253090 278869 342370 141292 167787 205320 41653 29945 83893 40950 348576 412681 220300 26...

result:

ok good job!

Test #6:

score: 0
Accepted
time: 788ms
memory: 249368kb

input:

500000 77912 77911 100000
270576
129318
366297
25873
179787
473782
221947
331327
209469
412992
410608
286179
37554
355546
297085
420463
496948
223036
122019
151250
478469
468136
19073
318549
398897
364415
23730
407160
26064
436939
30150
336421
375149
131841
58480
259944
117641
414831
64311
336164
31...

output:

210887 26617 47747 209286 31977 243665 65697 394458 66936 330203 111706 400826 188117 490312 451749 377213 451432 482110 450513 372367 243217 17878 326862 79427 343913 203244 140881 256494 329204 164961 461047 338802 166743 393825 25540 420037 374407 50003 96053 427346 365280 191816 338726 463407 32...

result:

ok good job!

Test #7:

score: 0
Accepted
time: 857ms
memory: 251460kb

input:

500000 77688 77687 100000
433011
472346
395389
187114
436024
138403
189990
398859
136147
195283
331183
46789
19828
335128
387768
442181
65556
72327
318927
462834
421288
227912
37067
387794
145879
258896
185861
356020
202881
490952
443694
95413
137215
137239
112863
481338
167802
304239
309781
391976
...

output:

176419 131882 35390 373863 172713 204978 297105 474574 443479 326538 390969 34874 492305 157831 85371 217598 310810 104348 344506 18218 34919 284048 191391 375157 93215 437374 179027 95313 246201 105486 90705 261692 432138 60063 214041 101698 415529 126781 367122 27413 85730 36224 346513 104818 2238...

result:

ok good job!

Test #8:

score: 0
Accepted
time: 780ms
memory: 250256kb

input:

500000 70973 70972 100000
449081
8094
7358
89457
426121
454508
470543
485236
63347
441977
422774
88672
243638
499709
170209
157788
229166
106888
228931
289706
435222
496384
381579
323479
499140
1511
385050
44171
413854
248273
352221
305112
24289
277461
391744
395003
85800
396455
355110
186446
285096...

output:

449195 92100 139432 131622 170991 324408 396138 18454 365411 494280 359470 62857 516 49116 212775 228269 406044 238351 73730 344036 164637 142035 62522 287306 191612 27113 107127 151520 273425 3029 266766 489355 250496 60335 369915 212496 230914 324800 64090 294847 116290 472262 346162 136322 249997...

result:

ok good job!

Test #9:

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

input:

500000 66403 66402 100000
297237
432967
138046
88503
315699
372893
55309
335404
127581
165919
247543
254268
285147
289728
275281
44427
94393
302830
489861
429097
425153
11083
439096
414157
386411
152968
394984
46119
149177
369378
413029
198215
134317
366218
281170
465540
39702
367778
247925
64320
86...

output:

294428 15990 60747 1844 173342 476686 180822 429820 298329 356039 58547 290254 180015 476506 20120 265956 172302 27153 59287 30817 110197 441521 428010 2003 112355 265905 198312 129358 442298 120472 138884 373998 58266 256425 7274 137614 43114 65060 393472 137647 293565 81701 495260 317778 230822 47...

result:

ok good job!

Test #10:

score: 0
Accepted
time: 756ms
memory: 242668kb

input:

500000 82328 82327 100000
280281
366446
183709
14447
442815
440473
121531
103568
472324
479656
337467
424742
474404
340302
269686
457628
230012
484228
422877
10759
156759
66102
130428
307888
123685
460634
235321
98667
93133
489886
479420
34961
352500
322001
129001
121871
135775
235639
100221
221760
...

output:

185494 36690 87374 138798 36564 181594 428424 260437 178882 134288 146942 90320 210326 241671 445549 121178 164319 184591 354583 355428 247773 281684 307841 387907 97435 102464 184979 164216 317633 56960 295193 191071 295961 328549 299162 27136 188202 118130 161902 236258 147998 155971 322975 474055...

result:

ok good job!

Test #11:

score: 0
Accepted
time: 796ms
memory: 233704kb

input:

500000 53948 53947 100000
287984
258934
272973
481182
131565
217198
34714
463056
337977
495727
310042
26372
320480
231799
249741
340990
365501
267377
460708
248843
285777
172137
492784
201463
213559
259528
461602
235849
398717
25475
241699
451061
188952
251790
83551
169967
335575
209367
55705
6381
2...

output:

490646 30912 58228 256224 419416 179276 226624 297156 434671 224297 66900 102019 206352 345445 170824 216398 382142 38139 295276 461808 479814 117039 338283 434145 494560 141370 72417 19374 27632 289877 24100 185985 333545 136905 137035 102602 147548 27797 299360 304944 475001 306860 73631 185755 27...

result:

ok good job!

Test #12:

score: 0
Accepted
time: 816ms
memory: 238324kb

input:

500000 77935 77934 100000
38748
422564
39441
105430
38474
225464
237519
121832
72613
477531
321661
29181
307418
314049
120252
261006
88761
17726
492112
460837
55199
354114
417097
133271
231933
436973
110894
478550
291976
50101
38774
316091
306160
121826
315769
361823
82990
188508
124574
13093
235123...

output:

423149 92225 16389 129241 166449 184539 134974 114717 355886 329721 379424 292962 421117 497443 381527 149162 408 10702 212632 50138 317213 372008 378849 113411 195237 172507 239020 420304 489080 360466 438166 227686 419986 209153 382570 15084 218300 418265 483901 215816 378626 452355 214360 491276 ...

result:

ok good job!

Subtask #2:

score: 25
Accepted

Test #13:

score: 25
Accepted
time: 880ms
memory: 314228kb

input:

500000 88721 177440 100000
30974
23891
211201
125199
180489
387190
218020
498838
230147
307989
484136
257785
353027
304420
311738
169842
334090
486070
126212
328609
174959
368840
238722
418092
488389
226349
427271
457322
332454
12958
197530
264474
355717
482774
221286
282148
216441
266659
213750
628...

output:

63742 263216 146169 50728 199716 469441 459156 322328 152164 66876 274063 180006 237497 208598 249207 359435 96669 110070 41714 147909 214779 59127 151892 216797 194356 199621 20899 418742 198323 158340 163745 123748 85656 172672 123919 47108 313725 12227 183377 183933 348552 102798 184923 290145 17...

result:

ok good job!

Test #14:

score: 0
Accepted
time: 848ms
memory: 307608kb

input:

500000 50267 100532 100000
68723
142685
445548
215087
478634
201362
177405
373123
227456
161487
276716
452818
230715
466238
250886
368974
77152
493722
129115
154402
319190
170867
27898
338290
170229
428001
62611
19188
164329
435154
128
358453
137653
430592
160391
407392
125236
320137
27945
393135
17...

output:

154816 362396 450037 134811 7518 38422 119314 43275 412297 380046 465285 405991 75531 379813 36281 281211 137834 336400 10173 219815 389857 29366 476153 333693 222590 318117 4684 259586 214152 484414 225911 152245 481486 109527 42793 47295 294599 177444 430241 227553 353815 421724 89015 337781 46301...

result:

ok good job!

Test #15:

score: 0
Accepted
time: 834ms
memory: 234492kb

input:

500000 67604 135206 100000
269046
235003
144646
314602
323547
204450
484229
26672
78499
602
110738
117079
125630
408912
188317
256853
71590
365703
370008
194267
342683
400737
369194
127912
96314
269751
219125
431887
398790
200053
279314
365797
187505
75025
48264
492515
387506
13267
80948
378737
1106...

output:

35015 347431 88597 414354 482857 397065 53183 354769 71664 51245 149001 236219 214693 499786 495321 413412 317633 211084 73492 227415 433440 9224 282936 375177 297475 150630 216010 319455 181652 118510 299772 383585 365737 274800 219207 372367 381196 467630 65752 287268 251434 60618 268518 195142 26...

result:

ok good job!

Test #16:

score: 0
Accepted
time: 878ms
memory: 239036kb

input:

500000 90109 180216 100000
153893
273609
184853
157428
466683
457867
343783
259618
87262
260826
466902
41972
482221
496695
293976
300490
455874
320279
314574
128316
280220
2566
383716
351629
219577
29212
26631
73182
458601
318651
105942
60715
392339
265615
387177
110713
319395
336826
483543
70790
36...

output:

359300 62726 70869 28396 315994 467252 156609 490530 27320 269822 25508 460451 182507 235894 366388 420578 334804 74769 98633 273595 252245 359686 325827 473574 278396 471980 144750 51127 279395 26107 259124 415923 270924 355160 454823 451090 471198 355103 375636 23793 326420 419926 420247 357951 33...

result:

ok good job!

Test #17:

score: 0
Accepted
time: 856ms
memory: 236388kb

input:

500000 74321 148640 100000
477030
412534
57969
357009
116485
327483
437765
67781
471780
418080
308252
138279
338053
95055
275789
97204
386829
122048
57181
436136
222481
395950
352928
73438
250800
184259
16097
398913
456107
105407
39764
116186
80552
65160
316601
284871
313136
414498
414938
343247
310...

output:

44369 196502 190964 245909 494770 362680 470919 152178 188666 183386 55250 136082 377070 245294 473475 4180 189786 429899 242107 274369 346604 490309 101912 353086 488484 256501 419053 94294 474775 97311 72094 264902 454778 120449 326613 367668 475712 405038 188585 152394 283019 196977 347730 231066...

result:

ok good job!

Test #18:

score: 0
Accepted
time: 816ms
memory: 248496kb

input:

500000 54262 108522 100000
150680
169780
208423
114492
398775
47217
58682
258733
452080
54148
451364
196867
75350
134397
51280
339529
475503
166592
224426
358444
423175
366761
49422
400504
398619
18773
429051
59685
291626
145365
261042
445752
234123
21931
318295
94503
388014
414710
346782
466751
205...

output:

348556 31436 433035 216732 343766 8410 310972 497472 59360 242470 50946 390152 59809 489769 88757 251032 413046 49693 121635 87588 56865 107239 339574 29954 154851 497382 150799 382117 118912 179994 289052 207323 458304 17629 254155 390401 107919 305671 33319 348860 354822 221851 82736 328174 109891...

result:

ok good job!

Test #19:

score: 0
Accepted
time: 905ms
memory: 250412kb

input:

500000 81364 162726 100000
321857
75911
117294
148668
322025
103777
419430
187082
374875
230927
338513
433399
305556
363405
457801
70917
297078
386374
322110
76493
189187
21851
453679
296595
389232
386129
310835
432013
450769
74142
284176
90713
430145
142503
212302
384600
157386
490862
201498
415387...

output:

170008 7720 95069 142119 47615 71057 360660 491157 260044 147678 213389 291392 304251 23733 67981 42523 39330 463767 29212 126873 163253 281812 408132 168786 68645 430810 220224 495957 306779 329272 121841 83727 71456 440352 101560 103176 67985 229014 468700 2473 42501 186245 221832 92245 242907 891...

result:

ok good job!

Test #20:

score: 0
Accepted
time: 886ms
memory: 253676kb

input:

500000 84343 168684 100000
92159
3025
19095
171545
269452
230103
428411
105653
130154
107687
352956
242321
444883
277419
59579
326919
4318
292812
326242
108917
253600
261383
320680
353469
283662
437811
470379
170617
46289
454830
253014
4165
381169
328908
493243
143442
265851
59330
347945
264421
2460...

output:

56308 196921 374547 152720 427528 459956 394189 62953 492883 439659 238674 175283 143277 104885 26470 201490 166585 103182 28221 12797 450482 432089 334598 485522 125532 397397 15844 192056 270769 324346 316171 37816 201213 150907 106122 48691 127899 491688 265756 203005 316187 29521 168666 196951 1...

result:

ok good job!

Test #21:

score: 0
Accepted
time: 904ms
memory: 255048kb

input:

500000 88757 177512 100000
445069
77200
391318
333565
435416
362966
141662
45522
355791
256039
214614
450379
170016
467327
282215
243533
183175
463770
163579
461662
317411
261187
253905
468654
231023
3749
90566
45210
343865
165800
136852
383910
367984
413623
325053
41177
298566
351228
15540
262375
2...

output:

202359 366414 80906 383779 352732 326953 297110 108739 100910 37799 226560 8592 304190 115761 64140 414792 207706 61695 193530 290031 449456 468315 309281 484634 453585 461355 57247 83285 198414 220569 96029 406753 338915 14228 263889 63514 206974 409299 2185 369316 342949 223025 387511 165120 21633...

result:

ok good job!

Test #22:

score: 0
Accepted
time: 904ms
memory: 253588kb

input:

500000 96344 192686 100000
195205
422258
407338
9779
476600
35329
336839
237680
366318
378932
386654
353800
118734
312717
156858
133692
72221
189109
391324
145763
38629
330117
404936
68820
255606
431020
392503
176884
178395
275064
488090
130311
314587
217628
462496
28966
425413
116762
437176
468713
...

output:

106976 307508 421252 197480 202163 135357 93112 489693 326426 143891 279775 417070 479399 293085 316146 216858 57340 240706 271572 54335 122257 206284 486591 37101 204694 479369 158600 262 447530 233178 265747 15541 39181 256498 302714 496191 129190 348571 215187 215181 453150 400201 262480 215256 4...

result:

ok good job!

Test #23:

score: 0
Accepted
time: 819ms
memory: 246712kb

input:

500000 62967 125932 100000
228958
294130
161634
80333
361275
345422
393334
286611
311452
453264
275215
289266
452502
447517
458518
295775
420774
426985
410788
79249
309720
61573
250760
5587
481312
161015
303445
8961
463259
24340
331413
237498
488929
475822
425952
251105
487129
230062
368282
264038
1...

output:

331279 372910 166724 74197 349255 47773 435333 20521 174135 161474 243157 404000 14642 26023 37386 172619 142874 185591 290374 273144 326102 271609 280173 384839 182662 470692 311157 16491 77600 78941 359677 376165 251994 415761 134288 295421 226893 106395 169045 275064 284053 113795 381484 51234 63...

result:

ok good job!

Test #24:

score: 0
Accepted
time: 869ms
memory: 254488kb

input:

500000 94830 189658 100000
104237
453576
334546
43320
88991
174623
80118
405142
341990
225030
164655
136865
106241
208562
67332
289772
379828
245569
190369
136859
196296
376390
298773
202031
129266
220643
477229
76909
267607
412545
178338
100575
280161
390719
280691
294766
490870
175723
312546
47683...

output:

25404 135863 102488 10729 49401 271739 103213 318167 483948 482330 260919 98382 440619 303065 362474 44435 38358 225369 27495 100324 90721 440600 459095 332212 74856 43049 293159 403546 446759 378102 424194 132241 171937 423093 70309 414462 279052 474510 123881 394427 134293 51316 149132 384723 9958...

result:

ok good job!

Subtask #3:

score: 19
Accepted

Test #25:

score: 19
Accepted
time: 622ms
memory: 290792kb

input:

500000 200 199 40000
76296
130139
291501
292412
139543
433345
372726
451574
18315
465578
324564
477223
237354
81532
65170
465332
342130
9670
193303
193680
129668
149532
268907
89969
398275
356210
324593
433492
482232
466692
135343
433758
102545
287283
432859
351864
305769
489532
101532
450535
295762...

output:

464387 27779 146694 443858 405500 46371 375328 183696 253669 95388 173896 183797 18073 431275 140576 468877 345574 227090 361228 17134 261985 60381 64649 124883 275006 345205 205047 166559 173438 437370 498046 158980 365732 106698 145138 342120 407307 83109 296453 316074 219468 97176 251586 177490 2...

result:

ok good job!

Test #26:

score: 0
Accepted
time: 677ms
memory: 296684kb

input:

500000 200 199 40000
83785
150667
304961
267635
97760
385201
77226
6522
352645
72592
427133
30755
100574
359648
403948
394809
425453
115868
11287
351385
494434
245106
58157
395180
326236
277135
359592
13569
76251
45366
172378
122783
216597
466130
284420
342613
471698
380682
92490
79264
241049
54038
...

output:

332473 244705 329425 11670 1976 487833 9007 276165 332796 312780 40729 316303 262301 333879 107770 492625 290121 131493 452498 165311 58291 430151 17928 144890 413013 491676 82978 491900 220829 88480 488804 85566 226877 148451 471377 89209 413295 493138 228587 42773 455217 374293 451378 249388 39514...

result:

ok good job!

Test #27:

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

input:

500000 200 199 40000
94863
498513
460682
411416
360517
309831
253717
325019
496632
255803
130770
289206
181204
74729
481723
293737
94126
307214
342974
448321
17084
433126
387809
279606
251781
65795
125269
129465
433572
219622
11806
179248
367117
84640
114067
122590
4140
116015
77759
392439
408930
10...

output:

169886 353970 165772 35671 120488 360404 48001 458381 167337 252993 223945 396664 121542 188473 370616 320801 171804 89934 69710 140435 365836 256733 210565 12566 194461 287204 297993 348301 241605 165284 95484 389971 390030 131636 396905 327597 255698 325220 289186 490101 313430 204679 28580 7557 2...

result:

ok good job!

Test #28:

score: 0
Accepted
time: 540ms
memory: 219804kb

input:

500000 200 199 40000
460896
356428
214577
150748
16877
1635
258267
370689
262538
369939
466845
415822
304104
329494
6035
489031
48344
181107
61121
4048
156120
273134
234110
418870
101454
330401
45460
74853
175589
44170
192108
214802
482345
120910
76381
307448
204387
170471
187255
20694
494550
351800...

output:

467443 287451 479552 76351 455380 1152 323503 86138 411260 254321 44538 33954 31588 483998 387122 496078 170968 227330 319124 319701 37028 51418 29830 4266 276448 113181 160151 123323 499813 25708 411883 445449 463422 47127 315998 257182 277024 119567 123152 117442 446447 134285 94514 258077 207442 ...

result:

ok good job!

Test #29:

score: 0
Accepted
time: 535ms
memory: 215780kb

input:

500000 200 199 40000
472275
149661
377034
488618
186507
171592
345983
124571
76807
5855
300138
80553
340257
185587
378146
311401
334561
194922
182638
104826
420776
448537
393232
195734
347470
219413
82586
185915
58528
404731
329285
300479
342445
115864
230618
360114
281628
86760
203158
212935
376440...

output:

387467 158572 459893 215382 144480 151193 113942 465077 376336 100454 110210 438996 97624 115303 227306 116102 444517 142914 80051 34893 49705 349818 205234 107396 80343 54159 213075 483936 377878 72716 395491 64426 379377 348031 411167 201026 238638 388949 83665 467844 87421 286373 352334 441665 38...

result:

ok good job!

Test #30:

score: 0
Accepted
time: 598ms
memory: 230604kb

input:

500000 200 199 40000
457235
436089
312892
490957
247950
207946
50653
437012
325088
141386
319878
207087
398253
383132
11996
402164
409233
443227
294400
242006
327126
10129
244769
232885
165818
291514
332036
352883
406737
63191
380159
208131
327008
61194
18237
223687
413010
160943
426911
162568
18875...

output:

328032 444739 62058 460205 13291 218108 101581 342586 343619 368776 133968 70694 264483 395970 100109 104627 116980 310956 67490 252390 39708 366310 205806 15072 179438 314908 2204 122492 48571 124387 178213 298775 393873 27457 346658 271389 390125 325100 286400 53138 69781 303964 394617 254414 3359...

result:

ok good job!

Test #31:

score: 0
Accepted
time: 540ms
memory: 230512kb

input:

500000 200 199 40000
498222
451076
484997
74171
344510
119552
181399
378715
468521
103237
143923
10760
103036
353626
331913
232159
181090
14984
85005
467731
200014
74750
304897
488094
80862
428792
303440
325833
70112
301252
111208
109820
23216
97480
361786
424164
357979
22040
249278
329701
472798
13...

output:

272279 218186 369442 488411 472708 174556 50257 395175 58264 277033 91621 133326 369692 115992 281862 154519 405200 45289 211341 149917 239992 130317 24098 107762 383190 138217 397799 9303 499092 239983 102815 138914 164128 185587 46244 342876 57815 388702 256237 420426 398459 97290 35541 272665 168...

result:

ok good job!

Test #32:

score: 0
Accepted
time: 600ms
memory: 232092kb

input:

500000 200 199 40000
235229
335906
185851
155252
476682
68595
44502
499901
403010
120212
365527
365904
165512
445297
44401
416812
282314
301556
484290
469265
250037
184042
387456
226812
371932
410610
263086
279108
442354
371814
37100
77190
202799
118817
250469
478086
307786
11617
132836
304380
25170...

output:

201669 318456 71421 334205 22193 136407 372041 75916 126822 235293 383819 275534 486187 424786 276555 207040 261079 321530 447332 492394 475505 145092 190222 118499 66475 17609 301750 250418 204275 259647 183418 126429 25892 374279 51825 327372 4596 263082 1148 9052 435920 405309 116177 65888 370496...

result:

ok good job!

Test #33:

score: 0
Accepted
time: 605ms
memory: 232956kb

input:

500000 200 199 40000
27113
326978
70968
474916
390195
217639
467929
292659
58323
454399
169213
185253
114409
287912
251420
281315
94695
326310
237316
424237
79688
285918
43312
65978
450176
255930
425562
242907
198847
77977
135410
122795
349710
416624
428899
314932
135513
464911
286182
28508
268649
1...

output:

238824 458133 238411 406145 155380 212697 109250 397286 433734 311844 109159 167074 432766 337586 97435 460374 343210 491449 109196 336481 85539 277336 33299 441291 498868 295285 27018 120208 223241 7147 48083 244305 416742 206714 107761 240579 57769 20544 327053 186716 49646 201230 326422 170001 41...

result:

ok good job!

Test #34:

score: 0
Accepted
time: 606ms
memory: 230756kb

input:

500000 200 199 40000
158367
3349
98725
462635
71709
384166
328253
132679
334131
433401
352051
9045
188775
366068
218093
90403
193264
359869
432442
263881
154277
470908
470355
200679
36628
399310
359036
163322
404722
42891
12614
147023
421373
479199
71619
182994
443724
120532
217367
134309
221302
310...

output:

271057 18319 443423 1246 113306 338943 51991 489972 295162 337845 28428 47018 204261 49443 182506 216386 320378 396343 129815 343649 359882 392653 48596 452874 353271 479360 100918 460297 100759 154454 320917 63042 493418 342618 494707 202377 122758 236209 100746 411185 405901 79443 228691 112082 42...

result:

ok good job!

Test #35:

score: 0
Accepted
time: 555ms
memory: 228708kb

input:

500000 200 199 40000
487441
36354
395955
6882
385179
368092
7896
377902
329818
287628
224290
27427
439352
326593
43030
180557
361665
163
8128
233496
22632
367138
126510
64436
351877
190302
145137
17783
209795
411209
255585
72497
161599
407307
216969
128706
67358
261184
268088
304573
63115
386332
827...

output:

350813 210800 64441 447700 466231 34146 167363 420052 152821 21617 167675 63834 215465 74509 480537 186398 319857 149471 444 404223 231120 100179 430190 260402 111585 272433 286929 128713 169136 34556 42970 23637 55007 224949 198487 289811 100929 446363 336352 335717 229111 475636 335792 292221 4949...

result:

ok good job!

Test #36:

score: 0
Accepted
time: 596ms
memory: 231000kb

input:

500000 200 199 40000
234051
59729
19849
414190
183195
238559
189881
256369
97803
379735
363604
391055
490274
186114
46653
230044
14075
437112
279313
141334
478372
146753
310018
305921
464449
475813
132149
290804
21707
51493
249658
15019
151386
494305
468781
444714
318658
179510
283604
351846
110675
...

output:

329736 150417 322846 132241 309886 213741 403197 37769 378389 34215 488013 141651 415606 429739 408290 174738 338542 8838 239170 289894 333891 246761 375206 178426 10448 459591 315504 415086 285108 205876 441299 343345 344427 427972 237693 476513 211280 305188 429350 32955 11548 135369 234862 211924...

result:

ok good job!

Subtask #4:

score: 22
Accepted

Test #37:

score: 22
Accepted
time: 1511ms
memory: 422900kb

input:

1000000 1000 999 100000
678746
439069
32542
85937
936926
284219
461661
203235
533462
940676
230275
621140
780674
254931
562355
229273
201341
493976
358955
963527
880412
91220
474599
160086
698841
591551
718276
844558
39859
765917
34722
401724
219774
443004
682244
545401
968419
968020
354030
411187
1...

output:

927453 237540 859419 982835 971518 506285 771618 939329 16802 700671 845162 359776 499849 958003 722555 893539 667107 399090 361260 56054 518738 929831 330952 261064 845434 378738 416383 813166 332967 155083 279300 603715 217430 73563 278581 71462 840056 191244 422478 38987 402361 21178 733103 92045...

result:

ok good job!

Test #38:

score: 0
Accepted
time: 1464ms
memory: 425092kb

input:

1000000 1000 999 100000
530144
36744
762893
712555
181981
816257
634992
419372
362279
817260
80801
697008
163211
900947
207310
862766
871091
388529
304808
574011
609949
509094
682125
781230
431445
517909
578411
288003
874415
410542
327673
607230
278208
956997
60166
842448
708661
562761
996349
382922...

output:

959155 71732 216953 52396 218400 471935 261546 739634 378310 36063 83375 817354 897911 522282 872241 172504 51526 459366 489117 1470 604900 617893 858099 222969 589307 401759 600954 487433 102962 333151 531844 369556 979169 59651 886371 796473 529233 799539 596446 792490 872895 106195 268233 639986 ...

result:

ok good job!

Test #39:

score: 0
Accepted
time: 1284ms
memory: 274336kb

input:

1000000 1000 999 100000
184414
849676
938006
927343
390133
327580
229110
507237
712311
8816
414520
114671
637641
82050
586607
523821
775429
139792
129360
175687
202474
801377
53523
281419
268534
488983
371227
294280
754555
448802
474939
391153
68307
762784
972243
245396
471656
982894
891252
945526
5...

output:

935903 742767 776505 209077 540850 378368 106462 295900 583220 798487 631062 159116 497616 268580 524374 199064 111133 263481 245724 125096 777592 847522 417436 551566 323602 124426 218947 646449 741767 370130 135890 622218 292794 290093 210257 770367 873413 645460 577467 27710 778548 610984 846641 ...

result:

ok good job!

Test #40:

score: 0
Accepted
time: 1288ms
memory: 276092kb

input:

1000000 1000 999 100000
279950
249721
597292
449885
16559
173928
771422
461514
392390
935006
401814
270115
877076
38286
665465
238399
632929
179581
685305
910549
211998
608701
352060
872741
888320
701449
144650
551823
899287
53420
994085
608934
941044
730655
818001
379877
176374
592364
165476
704855...

output:

526846 515700 391704 785622 493517 120516 41936 438593 862861 769982 829935 57916 228365 373428 964473 462849 394915 968316 488693 374309 18076 32165 107657 608985 573423 616244 928293 400730 390605 647543 734332 197777 102286 663555 356648 915541 454733 130355 82201 113092 646388 933970 55652 5465 ...

result:

ok good job!

Test #41:

score: 0
Accepted
time: 1248ms
memory: 277296kb

input:

1000000 1000 999 100000
20291
14699
561360
480484
286821
851537
642046
340254
362763
85475
567413
791788
145352
893579
253840
568256
281056
600506
834619
722257
570033
739505
158527
142792
475867
834583
85573
692242
107763
238427
749609
945275
238413
468714
75532
903433
452471
189579
134021
196949
2...

output:

702616 73353 862893 222243 406467 27827 84356 944451 676062 317550 265963 844932 333291 194996 291808 586158 233720 617954 62781 109761 219577 14990 910432 143081 807544 861750 33460 470406 422509 148859 627847 238628 572295 256670 945967 321000 993841 123243 901189 721578 275554 511183 330681 31330...

result:

ok good job!

Test #42:

score: 0
Accepted
time: 1376ms
memory: 304240kb

input:

1000000 1000 999 100000
79586
680985
105418
485822
250996
367398
927624
781485
911744
133593
352104
588258
914821
421528
538901
315958
275633
856427
5509
935195
913751
92920
619111
848814
663965
45219
344279
165968
865619
154854
900710
774023
872807
340764
497215
631438
911663
879056
918477
890010
3...

output:

45622 365448 295550 675757 496340 698127 92734 83107 461427 208662 538994 176988 954010 566973 996489 345542 896680 351723 70399 702895 130032 427616 543770 623778 247136 18907 605357 541463 786659 545695 569310 286950 364187 533967 157324 132313 673546 239130 487081 500397 421874 962733 209587 7141...

result:

ok good job!

Test #43:

score: 0
Accepted
time: 1359ms
memory: 304792kb

input:

1000000 1000 999 100000
864268
381722
137834
585983
418961
493735
111546
74594
3531
508504
383125
609419
708077
928352
762197
141167
174341
418962
107812
631708
84967
770802
568509
276991
376328
909246
85244
453348
203444
298108
478742
824330
149959
297025
840543
296938
691263
894733
491791
319919
8...

output:

163828 718689 166771 388656 338613 24880 133407 463054 733284 827731 193739 819247 548777 395515 474275 982457 933458 411425 674670 602812 182632 218498 36393 215270 173016 238272 352679 524228 749387 461798 472239 793287 285705 369472 145394 255584 405181 994663 297122 85983 809992 361818 588559 82...

result:

ok good job!

Test #44:

score: 0
Accepted
time: 1436ms
memory: 304672kb

input:

1000000 1000 999 100000
845169
885017
493118
865999
3330
999692
653381
608408
419452
799529
98306
295418
755923
442503
85146
52116
980435
452773
633069
998249
788034
527181
418057
380217
158464
23015
364569
275325
675030
381121
889352
891866
203541
14657
69958
428476
4927
853670
908949
664221
936648...

output:

740055 434447 209647 223358 311668 530703 390129 797795 42146 194516 19463 75736 18701 210446 917560 382858 122800 683640 80662 84526 650704 115648 213765 752991 297044 738000 641742 154339 645215 3656 168842 153586 990772 130758 405461 693222 885281 808665 197128 544018 409033 955110 247289 57837 9...

result:

ok good job!

Test #45:

score: 0
Accepted
time: 1343ms
memory: 300984kb

input:

1000000 1000 999 100000
582602
618937
427880
217239
896256
608317
42018
91716
145269
277504
94008
601157
503365
892936
294525
477654
286441
721652
14541
805171
315688
615193
950960
232416
430226
299443
690527
317106
303199
277200
283069
268869
650167
725195
788623
817992
647261
671722
426903
453937
...

output:

607360 577128 562911 307935 158884 315151 384821 415408 680507 147697 649267 377012 636570 903747 199272 279357 92800 85749 76117 404595 810289 91712 932523 722309 166926 764626 201541 51584 507695 70869 546321 792949 186195 918199 386497 586111 760746 733699 392499 32657 864242 981219 895843 86791 ...

result:

ok good job!

Test #46:

score: 0
Accepted
time: 1393ms
memory: 302676kb

input:

1000000 1000 999 100000
761086
125560
807519
496861
197173
671162
286468
361527
420830
337089
99902
928320
527383
162932
540385
255275
952224
668471
897966
186547
575192
315130
399856
441499
876295
462690
556218
167574
711101
146911
914260
296451
432034
722939
27102
687771
200204
636114
525983
59197...

output:

579025 700964 678297 774290 434113 290531 372905 994882 291765 717007 505207 254922 114356 85703 802165 666560 987982 181495 285277 617263 299618 571587 813965 699712 131333 905570 835019 12834 395436 285309 340845 977018 42823 336078 420708 85187 351352 969389 673249 430159 369538 686606 83762 2767...

result:

ok good job!

Test #47:

score: 0
Accepted
time: 1305ms
memory: 300332kb

input:

1000000 1000 999 100000
700422
705984
742655
297368
991331
273447
971924
235042
288410
226105
751213
71757
552545
234328
777224
460184
747354
483278
77275
960232
145343
677496
979573
598317
294693
762557
214101
155814
368037
345816
214266
272277
6667
461234
109578
330628
355557
16281
696921
633114
6...

output:

988130 515392 227532 163357 266083 535615 783375 944615 732027 143773 953716 152754 606472 704871 519606 747268 441200 902765 454502 586843 317897 556635 610751 649489 385708 593304 260628 84240 261234 983873 43565 802204 590829 505181 407638 573401 82372 23896 932632 618641 226097 84490 631098 7024...

result:

ok good job!

Test #48:

score: 0
Accepted
time: 1346ms
memory: 300488kb

input:

1000000 1000 999 100000
294979
912636
954626
984835
432393
676651
323592
496950
442003
287176
988897
310588
517194
868410
42913
165122
231552
13998
103334
502710
396538
590023
630061
530055
980426
628250
446184
451072
276133
424200
328584
26687
392134
766381
197139
174221
564083
149136
481705
457343...

output:

868278 205578 511390 180302 480640 974028 125658 305379 827831 676296 617329 824252 992483 15760 193594 481837 329896 176920 275201 971566 318651 509809 287846 268716 688225 776775 813298 68359 828092 157130 540028 61374 703082 588798 575311 855222 47154 726200 618571 636875 419945 955230 445505 282...

result:

ok good job!

Subtask #5:

score: 24
Accepted

Dependency #4:

100%
Accepted

Test #49:

score: 24
Accepted
time: 1713ms
memory: 449208kb

input:

1000000 91074 91073 100000
844855
360256
604500
520288
3402
603913
199722
732526
574997
429775
182518
190073
386932
693624
254661
333433
557929
350362
247817
201441
960948
519977
461212
493412
852908
455639
732827
432452
320916
223796
413293
969300
617038
438432
2369
51283
908991
374139
410798
19612...

output:

100266 524911 805244 861271 648132 338218 588017 846372 361674 257564 857806 809152 146144 655284 305021 895380 787314 337733 840423 783219 849918 564122 924389 456471 56411 922287 626528 573150 955857 663398 713622 677964 973127 106150 529384 890628 839820 734754 971452 312629 105748 707190 993032 ...

result:

ok good job!

Test #50:

score: 0
Accepted
time: 1634ms
memory: 446480kb

input:

1000000 85406 85405 100000
243967
952129
483179
427670
241063
673465
936850
819488
932267
432087
168570
75516
427761
708350
579841
56944
327580
291932
619630
977053
424711
862203
360360
723933
64552
550800
399697
549936
425473
413499
431310
248361
149311
199196
247552
227202
676100
694069
347994
988...

output:

657031 420833 863985 744549 327860 7465 366454 503105 174600 66331 884132 440435 83331 20169 431840 637465 706870 854218 769446 308290 973468 409784 465480 510074 624313 325255 531901 746512 948232 774257 670120 537460 477635 627130 405465 446642 481969 419640 744427 161791 304380 337938 935695 9745...

result:

ok good job!

Test #51:

score: 0
Accepted
time: 1539ms
memory: 292204kb

input:

1000000 62028 62027 100000
354774
944572
228278
449941
359325
57969
43031
616490
898916
61312
768136
892022
42765
227563
373737
241400
671641
155600
137082
803792
95473
30579
438130
496747
204238
57940
100124
47370
141803
745731
687568
952816
518284
677981
803613
28392
918299
517226
69867
69501
8590...

output:

99787 106099 816677 200110 28897 708054 751082 577975 501553 91023 106865 54682 706638 855016 498514 416601 401219 50805 234962 665531 21147 248311 19968 619727 610706 788270 357935 683115 311273 499071 665705 836110 270043 574585 144488 592526 202542 614399 984 977646 485563 691791 55853 709565 544...

result:

ok good job!

Test #52:

score: 0
Accepted
time: 1635ms
memory: 298268kb

input:

1000000 97415 97414 100000
453981
477203
689925
857434
241949
91494
993077
34954
605245
874902
893112
881129
576016
404784
870963
602740
1572
569897
624684
792962
189914
558522
191463
49120
326617
360379
162970
903046
277880
985508
419832
756246
978897
958038
74713
370260
67182
710992
829080
535448
...

output:

155723 465011 26352 577474 362019 602894 940965 675866 415965 812672 553264 910060 602269 640927 719961 975893 703535 720928 560505 415667 882565 50040 152231 236691 254363 755623 618422 798483 599175 381114 458847 685535 755231 78224 255574 265028 46727 143006 727354 179524 324228 621907 397386 620...

result:

ok good job!

Test #53:

score: 0
Accepted
time: 1491ms
memory: 292336kb

input:

1000000 54975 54974 100000
96952
319199
205229
785476
392425
909864
205985
81504
109636
164519
589106
373513
308062
898520
41603
88922
939415
189814
67267
237546
983306
247777
949797
339161
315551
248540
137128
344060
336465
199815
730843
44931
403415
657739
689755
660391
67077
940902
804294
104482
...

output:

386504 85473 539893 481227 511503 416399 665559 413190 918446 27586 674 751127 406413 949651 968668 187647 9368 494616 838957 808429 842579 523183 50762 484647 829243 134716 206307 477512 898924 504714 428576 726056 288035 645847 12496 192507 138759 296621 399445 272666 9883 149368 680559 953687 852...

result:

ok good job!

Test #54:

score: 0
Accepted
time: 1647ms
memory: 330356kb

input:

1000000 93603 93602 100000
590581
384770
986471
380567
941542
676443
800265
713198
618948
485196
793122
992449
102071
504074
882555
246256
810300
783699
191498
938198
981235
862324
82689
856318
830003
553359
194501
448504
13262
81426
659762
358904
334920
884736
624654
360241
520224
491932
756589
684...

output:

148349 449026 879307 718594 467090 155546 201243 987712 50210 560783 160040 262543 73956 606346 877799 760865 279282 935156 100108 945484 826838 895889 626245 254823 109979 578461 447673 566416 235348 818719 876604 631949 551282 272719 636245 316235 717340 853306 214189 639745 884632 288292 936412 3...

result:

ok good job!

Test #55:

score: 0
Accepted
time: 1591ms
memory: 321748kb

input:

1000000 56476 56475 100000
321806
617064
56801
469913
349501
226853
982685
953768
950260
773865
850920
494648
347845
472357
967459
307312
410773
669459
406948
398239
680315
58721
209614
422608
265050
904778
804303
548987
718504
941419
213137
647451
595973
781907
716699
248913
465529
100816
289739
43...

output:

824813 620399 294453 203773 317965 39769 477132 567303 619696 828758 639575 110632 488708 642618 777892 487456 94180 540628 895416 453451 525996 208680 35087 498517 728627 517754 731941 974100 140872 558945 460970 544576 495545 167150 89915 905813 588059 455322 973246 880571 831574 45912 48238 41894...

result:

ok good job!

Test #56:

score: 0
Accepted
time: 1715ms
memory: 324432kb

input:

1000000 77761 77760 100000
102141
89521
32208
995357
946428
638388
994079
200096
759506
415117
989818
157285
145299
619468
947456
343707
49714
479293
934090
399241
209616
459583
232400
34280
269169
429394
513182
447184
603
473746
92149
723284
310077
518197
800474
506674
796719
151664
380675
374791
4...

output:

204770 213786 266969 823594 794684 307146 184445 589045 726765 71376 140552 659490 500225 106414 793951 265231 706390 650801 528208 198538 815608 363900 194876 66265 437273 133724 44680 463312 219080 200698 820111 756038 234651 112879 11942 145163 434281 135628 947395 250883 259807 534211 687094 854...

result:

ok good job!

Test #57:

score: 0
Accepted
time: 1623ms
memory: 323580kb

input:

1000000 74966 74965 100000
683534
239091
842267
16017
468005
568280
573610
693011
161069
706082
795227
151601
934006
479774
513858
109101
851525
331377
875016
70381
299813
706417
753015
505672
720335
650876
915187
738727
132896
784656
425639
867644
376143
733308
245383
783527
550113
526907
856694
48...

output:

452743 804167 366760 790615 563559 964644 944672 7937 581970 869048 530075 48242 924949 233234 213618 122434 928979 854318 442925 718458 670859 358907 500753 918780 847573 94004 411831 765798 323566 937207 968150 214260 384619 710718 815210 612824 631176 842532 211461 110968 313990 932674 751272 735...

result:

ok good job!

Test #58:

score: 0
Accepted
time: 1672ms
memory: 322812kb

input:

1000000 65730 65729 100000
389535
782666
938044
721678
849220
701060
181030
52406
234247
790969
174777
437888
55263
195566
435426
928800
69026
168462
766751
672961
454375
175149
710125
383627
736135
711434
433482
836973
541367
953192
986804
693441
444489
287176
517890
131648
879596
119420
264712
351...

output:

739172 346774 364554 234333 652810 235708 731020 498957 676038 21577 386781 333840 18243 968428 371857 152510 290201 280160 461265 314045 244395 358473 889699 601921 538505 117052 790363 812263 418360 56850 232465 556766 860689 594442 816502 60740 688403 426839 113952 56616 923782 463219 648274 2356...

result:

ok good job!

Test #59:

score: 0
Accepted
time: 1545ms
memory: 322652kb

input:

1000000 65817 65816 100000
51488
844164
68841
411983
904138
407472
718044
583532
651150
806564
830599
283691
887913
521795
183797
959816
140200
768090
936924
842275
478523
522794
333465
184430
825549
711686
617264
901453
971141
487698
621032
169621
843824
122780
528194
237041
140546
980298
46138
984...

output:

252719 128296 673951 1881 221901 265719 353714 537719 15977 950009 371552 791316 257002 296709 568010 808733 210948 21425 57857 105715 967571 46983 858749 124192 104974 606595 594713 312840 733786 723811 169852 990162 207662 900690 134882 979701 416581 240768 121210 611711 859200 462927 526508 55570...

result:

ok good job!

Test #60:

score: 0
Accepted
time: 1605ms
memory: 323164kb

input:

1000000 84524 84523 100000
518841
510059
160070
674927
130615
180721
695363
700479
501744
933738
820766
543469
600830
488190
995734
515877
169413
488120
455582
27902
410480
323699
99289
522373
351735
903291
250384
153
678098
186046
396071
639296
608479
651025
672719
494101
85372
331436
954731
79292
...

output:

189338 779591 502374 96194 52600 656948 954435 210980 379814 136761 684432 610131 649629 226493 517470 20845 865072 77322 825767 308455 43948 249391 483362 584379 112296 843654 402774 47984 867384 682260 95017 533994 470686 555318 755099 413872 94635 900806 305879 645196 435352 578486 169984 934530 ...

result:

ok good job!

Extra Test:

score: 0
Extra Test Passed