QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#516676#4401. PrizeJWRuixi100 ✓696ms243120kbC++202.9kb2024-08-12 20:21:192024-08-12 20:21:19

Judging History

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

  • [2024-08-12 20:21:19]
  • 评测
  • 测评结果:100
  • 用时:696ms
  • 内存:243120kb
  • [2024-08-12 20:21:19]
  • 提交

answer

#ifdef LOCAL
#include "stdafx.h"
#else
#include <bits/stdc++.h>
#define IL inline
#define LL long long
#define eb emplace_back
#define L(i, j, k) for (int i = (j); i <= (k); ++i)
#define R(i, j, k) for (int i = (j); i >= (k); --i)
#define FIO(FILE) freopen(FILE".in", "r", stdin), freopen(FILE".out", "w", stdout)
using namespace std;

using vi = vector<int>;
#endif

constexpr int N = 1e6 + 9;
constexpr int M = 1e5 + 9;
int n, K, Q, T;
int S[M], cnt;

struct tree {
  int rt, hd[N], tot, p[N];

  struct {
    int v, nx;
  } e[N];

  void add_edge (int u, int v) {
    e[++tot] = {v, hd[u]};
    hd[u] = tot;
  }

  int dfn[N], seq[N], dfc;

  void dfs (int u) {
    seq[dfn[u] = ++dfc] = u;
    for (int i = hd[u]; i; i = e[i].nx) {
      dfs(e[i].v);
    }
  }

  int st[20][N];

  int cp (int x, int y) {
    return dfn[x] < dfn[y] ? x : y;
  }
  
  void in () {
    L (i, 1, n) {
      scanf("%d", p + i);
      if (p[i] == -1) {
        rt = i;
      } else {
        add_edge(p[i], i);
      }
    }
    dfs(rt);
    L (i, 2, n) {
      st[0][i] = p[seq[i]];
    }
    L (i, 1, 19) {
      L (j, 1, n - (1 << i) + 1) {
        st[i][j] = cp(st[i - 1][j], st[i - 1][j + (1 << (i - 1))]);
      }
    }
  }

  int lca (int x, int y) {
    if (x == y) {
      return x;
    }
    if ((x = dfn[x]) > (y = dfn[y])) {
      swap(x, y);
    }
    int i = __lg(y - x++);
    return cp(st[i][x], st[i][y - (1 << i) + 1]);
  }

  int H[N], tt;

  struct {
    int v, nx, w;
  } E[M * 4];

  bool vis[N];
  int d[N];

  void add (int u, int v, int w) {
    E[++tt] = {v, H[u], w};
    H[u] = tt;
    E[++tt] = {u, H[v], -w};
    H[v] = tt;
  }

  void sol (int u) {
    vis[u] = true;
    for (int i = H[u], v; i; i = E[i].nx) {
      v = E[i].v;
      if (!vis[v]) {
        d[v] = d[u] + E[i].w;
        sol(v);
      }
    }
  }

  int dis (int x, int y) {
    int l = lca(x, y);
    return d[x] + d[y] - 2 * d[l];
  }
} t[2];

int qx[M], qy[M];

int main () {
  scanf("%d%d%d%d", &n, &K, &Q, &T);
  t[0].in();
  t[1].in();
  L (i, 1, K) {
    S[i] = t[0].seq[i];
  }
  sort(S + 1, S + K + 1, [] (int x, int y) {
    return t[1].dfn[x] < t[1].dfn[y];
  });
  L (i, 1, K) {
    printf("%d ", S[i]);
  }
  printf("\n");
  fflush(stdout);
  L (i, 2, K) {
    printf("? %d %d\n", S[i - 1], S[i]);
  }
  printf("!\n");
  fflush(stdout);
  L (i, 2, K) {
    int x = S[i - 1], y = S[i];
    int l1 = t[0].lca(x, y);
    int l2 = t[1].lca(x, y);
    int d1, d2, d3, d4;
    scanf("%d%d%d%d", &d1, &d2, &d3, &d4);
    t[0].add(l1, x, d1);
    t[0].add(l1, y, d2);
    t[1].add(l2, x, d3);
    t[1].add(l2, y, d4);
  }
  t[0].sol(S[1]);
  t[1].sol(S[1]);
  L (i, 1, T) {
    scanf("%d%d", qx + i, qy + i);
  }
  L (i, 1, T) {
    printf("%d %d\n", t[0].dis(qx[i], qy[i]), t[1].dis(qx[i], qy[i]));
  }
  fflush(stdout);
}
// I love WHQ!

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 370ms
memory: 181780kb

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: 10
Accepted
time: 336ms
memory: 178544kb

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: 10
Accepted
time: 293ms
memory: 167908kb

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 475865 321066 209201 462604 214253 196699 226268 117131 350699 80452 25767 119995 214529 357833 292947 225261 88518 406492 280325 288052 472421 212781 374357 131433 126129 146914 100104 462425 237524 61399 118483 69532 7167 205586 192148 457094 51756 22755 163842 266528 164794 33213 463264 24...

result:

ok good job!

Test #4:

score: 10
Accepted
time: 283ms
memory: 167076kb

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 497883 480811 452802 492417 418837 489998 482202 374848 289765 110680 44797 89513 378682 31352 85884 239398 471868 462423 126653 81678 479584 465851 494207 338718 467250 307848 66039 38694 318222 497955 274328 218770 211188 137818 464748 74827 307971 311906 435586 96725 263480 427209 316995 4...

result:

ok good job!

Test #5:

score: 10
Accepted
time: 303ms
memory: 173188kb

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 486608 447632 311856 176217 140269 41860 495622 336304 407115 326281 422501 237284 228965 459131 164231 210096 36000 18635 113069 424572 369989 278926 5557 285982 428570 246301 37534 439333 362562 335977 270335 150717 217178 479485 216679 181482 158511 101150 450818 65767 281479 254609 76742 3...

result:

ok good job!

Test #6:

score: 10
Accepted
time: 307ms
memory: 170040kb

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 450513 372367 243217 400064 17878 393825 463407 419374 324697 246607 415699 193455 464346 123412 360569 179912 398688 70886 255935 399564 225125 66793 171898 292203 303280 310037 168995 59490 80738 100068 33512 34314 337722 389758 398573 961 150261 487444 449590 366771 480658 469084 386039 24...

result:

ok good job!

Test #7:

score: 10
Accepted
time: 330ms
memory: 174620kb

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 412347 156219 429048 311400 237666 376930 358105 172116 223728 347566 163517 24933 222554 62652 450905 111814 292285 381302 9722 20522 237978 362286 151412 329939 131882 35390 373863 273121 290480 204978 443479 492305 157831 85371 426614 320962 313401 260605 124678 401442 429465 35096 116573 ...

result:

ok good job!

Test #8:

score: 10
Accepted
time: 311ms
memory: 169300kb

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 453335 431734 359470 262646 246698 118545 434345 308679 54000 429984 58520 150175 496485 320496 226752 157757 411306 471147 177546 84102 21718 405045 229436 365081 354126 287769 18847 159843 439439 472598 266529 209455 153471 162068 232574 113351 30464 210981 92825 30916 22707 141818 30364 25...

result:

ok good job!

Test #9:

score: 10
Accepted
time: 280ms
memory: 169700kb

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 473786 485825 431592 164281 145981 86316 174346 80301 113618 487665 195552 414429 388882 204209 80452 122276 419753 180024 193433 229168 88715 50776 213156 141400 324806 395048 381700 288273 304234 33047 458744 184179 366547 154339 335938 453780 354088 190817 228996 422056 344516 120896 33776...

result:

ok good job!

Test #10:

score: 10
Accepted
time: 305ms
memory: 169776kb

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 481099 499156 453960 393401 420707 490583 300635 457841 400593 362860 43697 439965 396991 259790 76224 209515 171230 384576 55737 330347 157797 329818 259497 162271 198217 140016 472820 346759 384195 48170 465258 391317 424786 181091 362106 81702 55087 46106 446240 429146 381049 446694 111378...

result:

ok good job!

Test #11:

score: 10
Accepted
time: 234ms
memory: 167948kb

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 472144 368896 436727 185550 365962 268698 368492 3377 345731 3530 464046 140761 273689 201619 469799 394344 235126 314427 90759 257401 495673 56059 218201 415591 470103 255673 178092 331005 207934 77614 238596 214701 232320 472004 432899 63486 380625 274954 193159 466963 373914 221349 40706 2...

result:

ok good job!

Test #12:

score: 10
Accepted
time: 306ms
memory: 172916kb

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 497074 411928 166528 27377 492052 442541 286098 257719 348936 496628 65473 327811 270751 427588 253567 209339 182074 3507 347804 482508 464097 368679 379219 262140 457347 414902 413100 249692 107916 365412 166083 109652 355124 313876 225009 139337 337423 39090 139799 20308 101393 120141 45641...

result:

ok good job!

Subtask #2:

score: 25
Accepted

Test #13:

score: 25
Accepted
time: 369ms
memory: 183608kb

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:

299348 225578 286701 388703 273711 466172 478011 490391 462013 126494 92677 182472 13812 107732 303666 361862 256289 91025 389690 156797 268792 434419 208299 409874 319842 64913 385537 136511 498213 255392 208598 45196 97386 482069 290480 370649 225780 380585 84550 485237 301855 494683 414740 107270...

result:

ok good job!

Test #14:

score: 25
Accepted
time: 349ms
memory: 179000kb

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:

180276 246334 495583 402629 160081 135829 437502 411046 380530 139431 365266 373213 304147 83868 82333 429663 60973 379653 172399 163454 32708 375362 151036 335442 305087 243402 252686 172089 94334 222818 22129 288097 54119 315516 305714 257805 486465 169334 213035 447566 446068 161042 183900 97933 ...

result:

ok good job!

Test #15:

score: 25
Accepted
time: 286ms
memory: 179220kb

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:

402449 496248 83629 402922 62765 256693 449371 443872 87142 243066 114113 338532 311262 294609 311770 470620 159787 155394 415618 364001 451000 125487 75719 262053 276098 234851 86399 388022 393080 415107 276905 269299 28168 394634 171326 37738 183820 402422 441263 103423 209978 456455 242873 205394...

result:

ok good job!

Test #16:

score: 25
Accepted
time: 322ms
memory: 179412kb

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:

339446 405774 383542 472187 434295 147892 424049 112692 446851 68608 95638 265780 495182 106753 339150 466901 269032 284049 233024 493323 481989 14291 240945 258713 208942 261254 164281 320820 185785 56816 247544 56499 477668 252561 489907 370514 10217 280884 434407 360570 182341 175580 370814 37751...

result:

ok good job!

Test #17:

score: 25
Accepted
time: 303ms
memory: 174544kb

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:

448283 265285 278633 355101 232955 251364 346689 325069 446956 282799 154838 148009 138960 142001 488139 111826 185553 95486 451622 399220 330251 55754 70608 361482 392610 50349 121864 80871 393706 290344 499987 352758 61940 397766 58510 45188 462994 207170 489763 428497 495353 47439 174836 391399 4...

result:

ok good job!

Test #18:

score: 25
Accepted
time: 306ms
memory: 175208kb

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:

156112 225581 162530 434145 269060 154731 79273 156560 443138 244105 257438 220676 212934 103595 431599 142026 391798 263300 402625 302485 266908 436988 351019 410927 372677 494844 204565 206513 77593 239374 336174 6401 89133 335173 492816 273903 91286 180021 56218 175977 170651 360463 245374 325637...

result:

ok good job!

Test #19:

score: 25
Accepted
time: 340ms
memory: 178960kb

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:

369705 419706 29273 468460 445882 327299 499141 30061 39564 438287 465408 389188 471873 244263 385001 355478 128663 16835 463620 254174 435223 172697 395912 263957 358191 444537 278392 470350 459844 418832 258918 92574 286733 341378 146084 451300 24366 312832 386992 279352 139139 420693 446961 29790...

result:

ok good job!

Test #20:

score: 25
Accepted
time: 354ms
memory: 177760kb

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:

214675 359179 469437 389367 449784 68400 325922 423189 497571 498570 386412 480758 102416 141277 384672 307256 229862 456173 32052 479100 352235 403489 294524 484742 99276 311226 428716 31585 368408 195023 408070 86917 446233 320073 14582 493783 361836 482630 335244 424270 241037 448857 495559 43020...

result:

ok good job!

Test #21:

score: 25
Accepted
time: 340ms
memory: 176692kb

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:

450896 475068 330248 241600 419416 77651 200118 140447 392462 267130 481290 285915 72419 213408 454017 42098 374107 201116 190618 199398 269669 68343 129500 339565 54671 488399 141642 127951 140949 286900 416639 306796 483622 376452 289215 146351 89870 403325 79987 475364 71184 302195 456658 423485 ...

result:

ok good job!

Test #22:

score: 25
Accepted
time: 337ms
memory: 180620kb

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:

245819 300662 364449 227653 456964 282455 267546 186667 123777 460941 468924 473526 17026 206497 82245 417285 1303 290915 308200 394760 38563 35426 276893 390338 332515 90610 340346 252926 210977 221903 84779 250637 381640 74307 277629 388114 459187 426418 17044 129906 309076 338204 225141 244769 21...

result:

ok good job!

Test #23:

score: 25
Accepted
time: 310ms
memory: 176392kb

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:

282885 270612 481137 189195 462933 212152 38244 366092 420002 278094 222105 313229 86165 296624 441738 91740 464188 76806 132436 200210 383093 269194 216250 162428 126043 194961 291303 227074 371679 173171 263205 40170 419783 393476 271205 407818 410937 425694 432896 478339 190349 493335 247558 1865...

result:

ok good job!

Test #24:

score: 25
Accepted
time: 335ms
memory: 188208kb

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:

425234 392977 36440 62727 80378 429397 344584 38400 120137 447735 137188 466691 385341 402177 479512 64525 348611 288752 107988 253918 406487 56971 365151 398698 882 196653 435066 50169 181604 341840 464863 94165 498093 410587 441600 448979 289822 180942 123227 447048 356691 244797 91808 56797 19053...

result:

ok good job!

Subtask #3:

score: 19
Accepted

Test #25:

score: 19
Accepted
time: 269ms
memory: 185940kb

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:

12225 329473 124294 112780 478338 445039 249189 32330 65783 179054 497476 452979 319006 30813 48206 427935 466790 486377 109196 200837 164218 45188 487722 282259 229713 367076 188057 187010 232559 151913 348461 116954 20242 322713 185020 157495 443679 326708 325415 391214 266949 457474 3735 299220 2...

result:

ok good job!

Test #26:

score: 19
Accepted
time: 275ms
memory: 194852kb

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:

455890 309275 63656 335800 292806 9763 489623 63346 86191 446791 183068 362736 197911 107095 211424 101597 145440 202553 8696 425553 151090 60540 369501 412878 462364 222 148686 133609 158102 107714 270626 112101 244973 133381 421561 462192 28928 193698 101629 183699 205161 304190 364442 409432 4207...

result:

ok good job!

Test #27:

score: 19
Accepted
time: 199ms
memory: 187772kb

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:

202545 440862 361010 401185 475867 496061 39372 222066 236817 48111 60999 471755 360514 236313 204451 106250 381948 236421 376463 311524 441571 461140 98374 326916 103118 4158 483991 237952 222429 81602 347639 227796 78705 480293 427895 94835 128503 382030 222511 447219 456777 442490 405317 331113 3...

result:

ok good job!

Test #28:

score: 19
Accepted
time: 196ms
memory: 185852kb

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:

74629 216409 452886 65274 396083 306614 271286 250271 377987 76133 184065 443000 108728 51517 28628 412868 179055 464576 343588 397215 111447 8749 370727 92101 86364 448557 216093 1279 387295 348867 302046 390957 375386 266148 88874 379220 396301 409011 144844 495576 243516 59739 293503 135896 13486...

result:

ok good job!

Test #29:

score: 19
Accepted
time: 219ms
memory: 184040kb

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:

226412 269284 83547 393586 330369 494997 26991 474239 153656 355957 268755 98973 109076 282461 352777 408065 333791 251643 363031 478601 282820 375604 255417 243410 136724 450004 313552 453256 234253 185784 396339 64884 382408 469458 73824 104809 244911 91481 397385 427909 319057 194883 322229 38040...

result:

ok good job!

Test #30:

score: 19
Accepted
time: 229ms
memory: 189080kb

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:

430109 499635 484741 359744 385839 333901 288089 98276 352167 219328 324681 148925 406326 478546 81987 131830 291795 343344 288034 394508 189581 224237 120076 302345 400332 471908 493759 436271 338102 224353 417516 95746 311161 245608 323019 219800 94186 448190 485597 428847 462352 94095 465464 6507...

result:

ok good job!

Test #31:

score: 19
Accepted
time: 222ms
memory: 184624kb

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:

254190 224095 403575 254787 441835 173323 494866 116770 495162 482174 458062 195211 267003 327697 339874 461704 128423 66381 496452 380845 401804 296051 338444 277202 111718 192182 283559 63067 213198 226857 73752 219540 410874 462468 247045 117455 125635 71655 245860 404133 98717 125853 120091 3016...

result:

ok good job!

Test #32:

score: 19
Accepted
time: 232ms
memory: 192708kb

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:

84512 334590 67846 84398 361772 344927 199707 300189 39341 361970 209197 189233 82832 142238 438504 158285 285254 178422 443208 459069 240655 75359 419951 381356 435460 497662 312544 429920 356661 281074 456218 275992 134186 293889 484260 454301 166568 342651 341600 427091 160635 109132 233166 47294...

result:

ok good job!

Test #33:

score: 19
Accepted
time: 226ms
memory: 199828kb

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:

383154 495088 484903 365729 36915 196840 11209 263169 255393 340669 323322 366781 455322 369803 385298 103302 102532 371354 466571 463473 422048 488775 16113 298363 271979 283397 108389 423954 138523 153650 286698 439342 306150 314146 42526 26101 6563 410910 353654 146575 308765 435646 325636 420904...

result:

ok good job!

Test #34:

score: 19
Accepted
time: 215ms
memory: 200032kb

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:

434928 268613 437195 495851 354255 69204 419069 305587 334133 45453 189634 45000 391163 5965 38937 88360 342769 338499 691 225347 134611 473618 487150 454527 123711 382830 473568 137370 399272 323282 478989 59405 373840 72166 387590 376373 383128 91477 493120 26198 451825 278270 264509 6684 280070 4...

result:

ok good job!

Test #35:

score: 19
Accepted
time: 226ms
memory: 196144kb

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:

392141 41926 348088 396582 336921 398453 163626 464364 56651 405963 384129 383230 87006 287565 482787 268951 353934 379818 330384 319023 354953 143111 110992 401553 403670 397591 321779 129356 449992 488379 61303 61482 329289 214815 454175 383390 445943 34854 231573 400467 266272 139316 143764 22891...

result:

ok good job!

Test #36:

score: 19
Accepted
time: 215ms
memory: 191496kb

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:

425295 271226 303957 278988 79842 395483 254615 263682 141435 386955 429785 433365 259515 422515 235300 481389 7000 364402 29646 493480 188259 20343 338442 408018 241464 201108 289191 431874 306891 387759 302886 280860 176860 60456 377968 194068 389832 9512 92188 358464 366782 154777 311194 341613 3...

result:

ok good job!

Subtask #4:

score: 22
Accepted

Test #37:

score: 22
Accepted
time: 589ms
memory: 225840kb

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 737189 653885 840772 346403 780854 103601 49131 439139 486132 820231 177271 826206 982104 499097 409243 194435 293457 172618 662161 236859 473531 81188 533335 712368 462084 777243 239386 911529 829354 62098 492333 390487 523069 358162 163042 451543 653539 717744 885154 584533 11086 661366 952...

result:

ok good job!

Test #38:

score: 22
Accepted
time: 587ms
memory: 231992kb

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:

70930 162711 104847 600658 547594 219142 447597 811056 140247 502224 659605 421892 389493 152949 636421 692108 137214 372169 804489 399568 586198 152111 43257 899797 878142 278025 996438 364577 750352 580921 589621 139136 802259 100210 987920 563289 985356 224651 422771 630597 972354 915562 97459 56...

result:

ok good job!

Test #39:

score: 22
Accepted
time: 422ms
memory: 223648kb

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:

881979 65371 912477 527036 771384 637332 77375 96895 202131 869565 189017 344963 196422 79444 100330 903304 343434 851499 371245 836709 649674 985443 866113 369794 901391 590940 852434 64909 863307 156420 172661 78866 325578 556760 158104 549272 713416 571200 129022 328902 131081 557467 370894 8037 ...

result:

ok good job!

Test #40:

score: 22
Accepted
time: 469ms
memory: 224996kb

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:

223909 718896 217558 500095 199877 328634 96085 905331 970007 158199 27921 603783 357140 504155 706692 280199 789540 617406 204097 463501 679648 197898 724177 927084 944959 886477 251562 798038 801095 937749 182285 770424 269868 664501 852487 16270 511998 258753 846305 652364 599760 557613 730263 56...

result:

ok good job!

Test #41:

score: 22
Accepted
time: 436ms
memory: 223856kb

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:

802849 576946 497170 716012 758812 496113 646943 780166 104468 129141 558079 844433 59593 273939 836142 686555 135726 540964 236364 980636 575270 548431 929241 236650 61762 842283 579015 337174 58957 839920 707901 698417 568342 48901 222229 826970 757594 644164 98622 70592 157070 136264 20534 795284...

result:

ok good job!

Test #42:

score: 22
Accepted
time: 530ms
memory: 224716kb

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:

463307 934289 351017 190930 590421 329349 207397 353160 698589 604066 736674 925930 499187 512546 224629 728976 686682 717259 943915 38674 163871 738389 521236 337757 318576 640457 759355 886092 225601 229664 90976 781806 51946 152893 685328 870872 864783 566242 988557 4905 726860 361741 488808 6791...

result:

ok good job!

Test #43:

score: 22
Accepted
time: 497ms
memory: 225680kb

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:

828195 835791 665377 388368 436365 943990 443275 726421 73272 550893 679669 245286 985622 828674 471421 244760 594152 498272 279598 918410 315068 181589 731587 883600 328601 100623 121515 896280 554028 486686 894194 229925 953262 775412 278622 629074 972329 893022 409360 592343 810275 792776 591239 ...

result:

ok good job!

Test #44:

score: 22
Accepted
time: 507ms
memory: 222384kb

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:

264261 554773 213033 167095 460079 476465 678290 771904 247487 452229 2604 861632 905956 525799 270116 636788 168283 966476 28928 241051 414557 808579 968047 624451 332609 432698 836981 823613 725764 578806 985650 314654 882329 396154 716564 973526 68087 947437 768181 494539 464301 218405 531171 301...

result:

ok good job!

Test #45:

score: 22
Accepted
time: 480ms
memory: 224360kb

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:

871595 153845 146436 998885 710416 695381 752688 383536 28440 887790 486262 236298 138990 598641 743599 161111 206937 958106 575202 513534 876309 507993 929031 76772 54967 198579 805405 809834 765812 493357 629546 3350 486288 475826 83185 497259 590227 124847 734532 881334 419055 759792 590422 54176...

result:

ok good job!

Test #46:

score: 22
Accepted
time: 474ms
memory: 224604kb

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:

464950 902827 958282 846598 508480 448022 831436 696630 278538 400461 98227 959239 892399 488867 645860 522789 410147 868157 979065 595866 467110 182287 688051 974358 652264 279300 534265 577714 331923 693086 703371 474168 913274 314267 482826 996478 659670 545055 479754 967361 721159 107379 108340 ...

result:

ok good job!

Test #47:

score: 22
Accepted
time: 510ms
memory: 222256kb

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:

280854 748941 965663 52093 765738 688770 804241 50893 713297 572171 332298 479000 868683 390347 829676 121783 664736 240859 481008 798858 732908 93893 908421 830478 949532 512679 577977 720518 556787 345400 908919 440071 637688 657447 747811 777615 958310 164787 575870 569617 527750 380880 503067 28...

result:

ok good job!

Test #48:

score: 22
Accepted
time: 461ms
memory: 221476kb

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:

474295 903419 600502 158418 618883 77946 541327 691617 279685 545829 371649 492990 689702 393806 529836 959331 901255 75652 614474 325479 936332 983931 197515 894203 473057 683679 921426 902388 573665 541873 58301 240808 477910 449220 214967 874238 132798 743132 51696 313697 902443 271444 538487 620...

result:

ok good job!

Subtask #5:

score: 24
Accepted

Dependency #4:

100%
Accepted

Test #49:

score: 24
Accepted
time: 696ms
memory: 242984kb

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:

104349 170744 322298 943785 796710 500874 79937 976772 191057 27689 906009 603418 442795 561154 796064 292228 504787 249824 525843 435036 271618 183442 461251 6332 765553 582250 226179 860734 445334 729051 457570 772087 147634 119269 85940 899087 838934 714547 249430 419834 488759 535606 70064 74100...

result:

ok good job!

Test #50:

score: 24
Accepted
time: 677ms
memory: 243120kb

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:

600691 665700 394186 920033 67110 282228 422563 424839 65617 886450 197532 463926 711771 581926 743376 860065 363944 619369 548813 448810 333494 514122 109376 269392 289634 194364 244306 322851 208595 223144 694693 3079 572346 25709 765912 66723 337394 544324 945673 108504 78758 851948 167958 84801 ...

result:

ok good job!

Test #51:

score: 24
Accepted
time: 522ms
memory: 231580kb

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:

679921 326653 628916 810371 845656 351958 633342 211595 114570 675404 682383 231199 664435 186112 561363 636301 431325 813776 869782 663576 188424 645524 163175 559575 278763 208626 177439 72245 679376 895965 393350 873005 39521 172800 681376 472768 207789 705354 279832 415640 96138 334383 97998 369...

result:

ok good job!

Test #52:

score: 24
Accepted
time: 547ms
memory: 234756kb

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:

938843 930695 394745 527802 276455 792036 552764 390119 64587 279765 924345 866296 471557 506328 67550 554639 970566 966967 714412 780781 752235 312042 238784 989828 251701 426032 256668 561514 398776 580246 789579 361280 418172 255842 760473 268125 486275 618841 843175 569910 42298 830733 877276 30...

result:

ok good job!

Test #53:

score: 24
Accepted
time: 528ms
memory: 229856kb

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:

403859 935275 441961 562987 738781 940852 812632 155172 946425 608185 187204 902739 26222 430535 224997 407241 877097 927552 180918 309411 998271 127749 764336 215425 198754 206648 280352 916941 21791 975143 39216 143202 49560 147708 806546 980586 838990 970622 220018 54972 784361 607432 149866 3499...

result:

ok good job!

Test #54:

score: 24
Accepted
time: 631ms
memory: 234464kb

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:

784772 966266 588771 139159 616827 206872 508571 342402 765529 661931 397327 713145 880660 873828 546468 203264 287745 829920 151802 741319 386482 29024 548575 902206 130940 867372 660374 942739 604617 720603 860109 90101 933413 857248 760969 382593 250392 405696 72129 645839 797061 225282 974201 46...

result:

ok good job!

Test #55:

score: 24
Accepted
time: 578ms
memory: 235184kb

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:

456672 8278 982899 812708 605742 4183 145358 586075 318385 192582 712099 512864 48687 715495 236168 244853 134155 564217 792359 89621 544960 871954 809059 774619 851191 534411 584005 234549 457893 170494 820596 962500 167741 772078 654228 40777 21933 410777 122711 355090 450317 114462 896469 831848 ...

result:

ok good job!

Test #56:

score: 24
Accepted
time: 569ms
memory: 234848kb

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:

623411 860694 751437 14427 631501 583671 35630 697611 655925 457672 120597 678476 992684 980319 244732 716140 316089 968045 356816 698444 624464 232579 179861 662142 629177 994650 429868 390755 442601 972273 848392 526490 693172 813168 790502 769634 851356 645740 964204 83538 665334 621962 665321 67...

result:

ok good job!

Test #57:

score: 24
Accepted
time: 532ms
memory: 235356kb

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:

807220 587296 265045 701799 31385 348222 855475 149853 442790 164213 280720 703395 805423 999747 17502 625887 839284 95801 348122 977629 194804 193847 32033 633682 559988 503805 465242 131530 987956 973183 622974 764093 52250 953497 247663 170448 218212 748379 302805 439624 775778 522671 956970 7080...

result:

ok good job!

Test #58:

score: 24
Accepted
time: 556ms
memory: 233732kb

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:

300264 361936 561989 958841 345866 255787 433920 845961 675590 759992 768339 284791 551446 603530 595863 940190 917410 847660 893468 362680 238523 52789 727547 156816 645927 328092 528407 810179 692210 358731 491605 541428 141029 616198 787896 233804 992726 455019 711459 46819 707334 179841 122272 2...

result:

ok good job!

Test #59:

score: 24
Accepted
time: 534ms
memory: 235804kb

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:

967985 967623 948179 565723 614574 50647 375206 649412 614906 197544 423421 26925 204720 23752 926833 6260 762300 919400 738114 156448 657667 812064 196282 297865 252193 770099 911622 264142 929372 362144 917948 969630 648155 155121 176196 760702 12383 85314 502830 982901 101115 905537 874962 318659...

result:

ok good job!

Test #60:

score: 24
Accepted
time: 574ms
memory: 235924kb

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:

143492 810759 412547 670769 126323 399233 610935 288182 44302 860041 484386 783967 563698 607525 811520 397987 500415 10090 585514 981608 323594 698956 296928 842951 103164 182130 953851 865228 854580 903935 220162 769891 838035 572826 620376 259131 75931 971018 752105 112614 905081 378161 859583 41...

result:

ok good job!

Extra Test:

score: 0
Extra Test Passed