QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#763209#686. Bad DoctorCmsMartinAC ✓305ms47028kbC++141.0kb2024-11-19 18:56:232024-11-19 18:56:24

Judging History

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

  • [2024-11-19 18:56:24]
  • 评测
  • 测评结果:AC
  • 用时:305ms
  • 内存:47028kb
  • [2024-11-19 18:56:23]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
using ll = long long;

int n, m, L[N], R[N];
vector<tuple<int, int, int> > q;
vector<int> id[N];
ll c[N], ans[N], sum;

int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    for (int i = 1; i <= m; i++) cin >> c[i];
    for (int i = 1, k, x; i <= n; i++) {
        cin >> L[i] >> R[i] >> k;
        while (k--) { cin >> x; id[x].emplace_back(i); }
    }
    for (int i = 1; i <= m; i++) {
        for (int j : id[i]) { q.emplace_back(L[j], j, 1); q.emplace_back(R[j] + 1, j, -1); }
        sort(q.begin(), q.end());
        int cnt = 0, now = 0;
        for (int j = 0; j < (int)q.size() - 1; j++) {
            auto[a, b, c] = q[j];
            cnt += c; now ^= b;
            if (cnt) sum += 1ll * (::c[i]) * (get<0>(q[j + 1]) - a);
            if (cnt == 1) ans[now] += 1ll * (::c[i]) * (get<0>(q[j + 1]) - a);
        }
        q.clear();
    }
    for (int i = 1; i <= n; i++) cout << sum - ans[i] << " ";
    return 0;
}

详细

Test #1:

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

input:

5 4
1000 100 10 1
3 4 2 2 3
4 8 3 1 2 4
6 7 2 3 4
8 9 2 1 4
2 6 3 1 2 3

output:

8766 7564 8756 7765 6646 

result:

ok 5 number(s): "8766 7564 8756 7765 6646"

Test #2:

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

input:

1 1
1
1 1 1 1

output:

0 

result:

ok 1 number(s): "0"

Test #3:

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

input:

1 2
10 1
1 2 1 2

output:

0 

result:

ok 1 number(s): "0"

Test #4:

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

input:

2 1
1
1 2 1 1
3 4 1 1

output:

2 2 

result:

ok 2 number(s): "2 2"

Test #5:

score: 0
Accepted
time: 4ms
memory: 22104kb

input:

2 1
1
1 2 1 1
2 3 1 1

output:

2 2 

result:

ok 2 number(s): "2 2"

Test #6:

score: 0
Accepted
time: 4ms
memory: 20048kb

input:

1 3
1000000 909090 700700
1 1000000 3 1 2 3

output:

0 

result:

ok 1 number(s): "0"

Test #7:

score: 0
Accepted
time: 4ms
memory: 22092kb

input:

2 1
1000000
1 500000 1 1
500000 1000000 1 1

output:

500001000000 500000000000 

result:

ok 2 number(s): "500001000000 500000000000"

Test #8:

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

input:

2 2
10 1
3 8 1 1
5 9 1 2

output:

5 60 

result:

ok 2 number(s): "5 60"

Test #9:

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

input:

2 2
10 1
3 8 2 1 2
5 9 1 2

output:

5 66 

result:

ok 2 number(s): "5 66"

Test #10:

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

input:

2 2
10 1
3 8 2 1 2
5 6 1 1

output:

20 66 

result:

ok 2 number(s): "20 66"

Test #11:

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

input:

2 2
10 1
6 6 2 1 2
2 2 1 2

output:

1 11 

result:

ok 2 number(s): "1 11"

Test #12:

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

input:

2 2
10 1
6 6 1 2
1 2 1 2

output:

2 1 

result:

ok 2 number(s): "2 1"

Test #13:

score: 0
Accepted
time: 4ms
memory: 22072kb

input:

3 1
1
1 6 1 1
3 16 1 1
8 11 1 1

output:

14 10 16 

result:

ok 3 number(s): "14 10 16"

Test #14:

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

input:

3 1
1
1 8 1 1
3 15 1 1
5 12 1 1

output:

13 12 15 

result:

ok 3 number(s): "13 12 15"

Test #15:

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

input:

3 2
10 1
1 6 2 1 2
4 9 1 1
5 10 1 2

output:

66 70 96 

result:

ok 3 number(s): "66 70 96"

Test #16:

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

input:

3 2
10 1
1 6 2 1 2
7 9 1 1
3 6 1 2

output:

34 66 96 

result:

ok 3 number(s): "34 66 96"

Test #17:

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

input:

3 2
10 1
1 3 2 1 2
5 6 1 1
8 12 1 2

output:

25 38 53 

result:

ok 3 number(s): "25 38 53"

Test #18:

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

input:

3 2
10 1
1 8 1 1
1 1 1 2
3 4 2 1 2

output:

23 82 81 

result:

ok 3 number(s): "23 82 81"

Test #19:

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

input:

3 3
100 10 1
3 5 2 2 3
8 8 1 2
8 8 2 1 3

output:

111 134 43 

result:

ok 3 number(s): "111 134 43"

Test #20:

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

input:

5 5
10000 1000 100 10 1
1 4 1 4
7 9 2 4 5
8 10 5 1 2 3 4 5
5 6 4 1 2 3 4
2 3 3 1 2 4

output:

77584 77593 44293 55384 55604 

result:

ok 5 number(s): "77584 77593 44293 55384 55604"

Test #21:

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

input:

10 7
552910 150933 995175 215236 872242 381236 155576
2 9 2 1 3
5 8 4 1 3 4 7
13 20 2 2 4
17 19 4 1 2 3 6
16 19 4 3 4 5 7
6 10 4 1 2 6 7
16 16 4 1 4 5 7
6 12 3 3 4 7
14 16 4 2 3 6 7
12 18 4 1 2 3 5

output:

41574799 45848242 45207177 44522436 44880084 43005299 46219054 43056608 44764194 39372338 

result:

ok 10 numbers

Test #22:

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

input:

7 10
736484 818923 456465 12520 997843 981585 612726 181577 186139 168089
3 11 4 2 7 8 10
1 4 1 1
12 13 6 1 2 3 5 6 7
10 14 3 2 6 9
17 20 5 3 4 5 6 8
3 13 2 1 7
20 20 2 2 6

output:

40495012 47901499 46465851 44680094 39836092 44219079 48555544 

result:

ok 7 numbers

Test #23:

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

input:

30 10
857308 953250 600059 683156 139561 641008 542233 928243 893627 191827
2 22 2 5 8
29 50 2 1 3
47 48 3 7 8 10
21 22 2 8 9
42 45 3 3 6 9
4 27 4 5 6 8 10
45 50 1 8
26 39 3 1 4 10
40 44 5 6 7 8 9 10
44 46 5 1 4 6 7 9
44 44 3 1 8 10
2 24 5 3 6 7 8 10
4 39 2 3 4
40 46 2 3 4
30 45 5 1 2 7 8 9
10 45 3 ...

output:

293838811 290066769 292754345 292051557 293838811 293646984 293838811 292879676 293005976 292402951 293838811 287917175 285973327 291106187 284902541 291127646 267465483 281328033 293838811 293699250 293838811 293838811 293315596 290979061 293838811 292514647 293838811 293838811 293838811 293838811 

result:

ok 30 numbers

Test #24:

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

input:

10 30
391716 868283 902120 388402 981355 289714 570338 351001 196034 286794 661345 223544 480989 228068 668284 480867 671125 927397 983725 983858 967588 276597 257618 199614 61676 473411 45932 450727 45681 368382
11 26 7 1 13 14 15 16 19 27
15 16 4 13 14 29 30
19 46 4 6 21 22 30
37 38 6 9 10 18 20 2...

output:

123670461 171088996 119574830 165992964 169391754 153780399 165654628 148473523 166617345 168366240 

result:

ok 10 numbers

Test #25:

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

input:

60 40
214784 374560 331541 383120 553085 21716 253180 156648 54233 898460 696585 177744 806924 494782 17110 123004 611634 437506 349347 472426 960396 841591 117777 2457 743805 923885 808421 626506 444686 822906 738699 897414 751402 715382 174480 428567 525859 418878 139239 73165
43 94 2 4 34
73 86 1...

output:

1286380648 1288526794 1287651782 1283846804 1287658154 1280320699 1254862714 1287023990 1288514509 1287558232 1274668519 1288526794 1285120582 1261510038 1287007714 1286808665 1217981437 1288526794 1287552121 1288526794 1282578830 1286766918 1287478927 1279195034 1284937138 1268832042 1288526794 127...

result:

ok 60 numbers

Test #26:

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

input:

40 60
432564 15941 218898 381405 944405 622234 901280 644715 561289 369329 730603 514677 977787 810908 656473 232857 767720 878754 732768 319462 580706 196541 515660 633761 862798 740252 717437 351747 274470 884642 524838 3384 279161 303717 166799 106145 290214 443696 285588 707603 248932 403905 578...

output:

1521415473 1507270535 1517038227 1514380823 1513870185 1492434944 1508816703 1474941708 1485455736 1505592494 1518157381 1451068000 1519494183 1471167676 1517031855 1514809221 1490573182 1516619035 1520254617 1511020126 1455246571 1495439950 1515754649 1484130967 1520939771 1492389078 1496487626 152...

result:

ok 40 numbers

Test #27:

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

input:

100 50
157617 567295 279380 280193 657430 128267 559638 21581 945026 885826 677464 647180 311530 842012 76705 816983 673923 87222 839864 280237 66121 894351 175723 666480 871548 487243 177099 42342 380062 144691 501870 873145 195318 221491 488364 683896 52175 255195 124899 758996 532153 367647 82898...

output:

3692970391 3688368381 3692970391 3686375123 3674040877 3692970391 3691718191 3692970391 3677909003 3689477811 3638603893 3691966651 3692970391 3692970391 3692970391 3681343828 3576516275 3678811171 3690448258 3690135313 3687076307 3692970391 3692970391 3692970391 3659449541 3692970391 3677282527 369...

result:

ok 100 numbers

Test #28:

score: 0
Accepted
time: 5ms
memory: 22084kb

input:

50 100
794804 326387 72887 924307 232451 519528 601019 407798 56835 594796 65959 496043 671546 207428 101058 826245 496147 131382 293881 779360 885979 832974 511964 428055 431364 579226 578335 524555 366245 381871 723034 7587 343799 218210 979146 842118 372890 518159 660686 192290 32334 698453 54353...

output:

5130008628 4808728036 4975217735 5026093311 5124798868 5078109332 4900978059 5118767978 5118735484 5070095030 5111926749 4947276146 5078258499 5114790747 5121109765 4995857479 5073437520 4985034828 5008414458 5127352388 5113848491 5068341358 5116516098 5114753764 4902482956 5130008628 5124417520 492...

result:

ok 50 numbers

Test #29:

score: 0
Accepted
time: 178ms
memory: 37696kb

input:

500000 1
54323
737748 903520 1 1
692152 810006 1 1
12758 725821 1 1
127813 525491 1 1
872352 906159 1 1
10758 527461 1 1
778715 934980 1 1
320837 869940 1 1
224623 345649 1 1
7817 31142 1 1
991366 991656 1 1
312156 778301 1 1
516424 673463 1 1
824263 896790 1 1
160414 565103 1 1
994004 999732 1 1
30...

output:

54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 54323000000 ...

result:

ok 500000 numbers

Test #30:

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

input:

500000 3
695487 984478 270897
451761 850596 1 1
578083 877776 3 1 2 3
41753 70082 2 1 3
33050 414469 3 1 2 3
774680 804379 2 1 3
554914 686301 2 1 3
745174 897081 2 1 3
80593 401682 1 2
236530 874618 3 1 2 3
865188 934191 2 1 2
859083 901216 3 1 2 3
279481 824621 1 1
547685 831541 1 2
440186 804390 ...

output:

1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 1950858098276 195085...

result:

ok 500000 numbers

Test #31:

score: 0
Accepted
time: 256ms
memory: 30540kb

input:

500000 10
618236 832638 491856 55752 913414 585340 641276 908682 14966 68048
662071 726999 2 5 10
40420 760055 4 1 4 6 7
276419 794377 3 4 5 8
770146 823252 4 1 5 6 9
124185 421654 1 4
131154 776049 4 1 2 5 6
287480 462790 1 5
695915 818653 3 3 4 6
543730 827663 5 1 2 3 4 10
804167 888924 1 10
44771...

output:

5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 5130156345766 513015...

result:

ok 500000 numbers

Test #32:

score: 0
Accepted
time: 236ms
memory: 30868kb

input:

500000 100
531578 962055 401637 211882 646623 341951 426441 48942 94692 272556 493763 372568 765186 577287 522742 186973 618149 248670 160952 478660 401263 175634 830548 968104 766067 419353 868233 854970 194746 406781 822984 681597 216834 409690 79545 669896 302841 316516 446647 874184 730374 19279...

output:

44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 44504829146387 ...

result:

ok 500000 numbers

Test #33:

score: 0
Accepted
time: 207ms
memory: 30504kb

input:

500000 1000
445461 492338 145595 532351 291145 522123 788749 610458 177408 383647 443481 423401 246431 67804 455424 389924 441953 442599 555702 795385 261330 733716 46657 42504 818645 979504 377150 44518 877407 644472 954141 571611 695993 225183 915424 757412 141569 303052 156448 658865 196457 96200...

output:

513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516624 513002053516...

result:

ok 500000 numbers

Test #34:

score: 0
Accepted
time: 305ms
memory: 40976kb

input:

500000 500000
407665 286503 744557 39679 681543 414655 834654 780586 194989 441555 178692 786867 859194 150140 494113 424941 596859 585000 807661 869761 556210 203992 456978 513065 57170 389985 393006 758773 697349 485871 217044 471561 876646 480702 113291 808669 793927 242015 620365 825404 921837 7...

output:

94560575901071385 94560537311765719 94560576262568424 94560415374326076 94560531972066557 94560396079557989 94560472463365447 94560513257237315 94559661085335687 94560508681625479 94560426064631240 94560519696222871 94560576292527240 94560393968017257 94560575854406147 94560566487820345 945603779484...

result:

ok 500000 numbers

Test #35:

score: 0
Accepted
time: 296ms
memory: 40964kb

input:

500000 500000
105552 556694 158538 267579 446772 734096 508022 799411 33366 305260 238556 428909 627319 936410 51617 605770 606594 966799 820241 975219 846593 899844 671194 644243 928741 313400 884940 477528 514690 260842 568608 287350 925072 791967 126318 337188 216171 85986 422261 74972 853204 765...

output:

94582566539426674 94585580697589080 94585413004722165 94584351277158264 94583157810508822 94585618279715950 94585587146266065 94582758441458977 94585587728146183 94582439985997296 94585686003032165 94585565541303555 94585481442403844 94584683117249280 94584498874437759 94585475821951023 945846845910...

result:

ok 500000 numbers

Test #36:

score: 0
Accepted
time: 275ms
memory: 41000kb

input:

500000 500000
388058 176966 394520 651999 98806 748532 200766 388935 409994 236539 513214 384367 939448 854926 987526 714916 255256 355381 683894 143561 632115 660171 194786 100948 94217 464065 537364 693388 711372 6426 494472 131665 311011 256685 133807 756500 954344 359527 807596 407834 612650 622...

output:

95909044888716177 94135775758882649 96981949238389409 96394543675266356 93549365221254246 95048289107919256 96989451316824321 95807021499255263 96146115586059047 96836697796104491 94542426641356289 95666036578543809 96839024679863572 96647617972955027 96951656002311110 96590480281886299 968850494558...

result:

ok 500000 numbers

Test #37:

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

input:

500000 500000
358883 787902 560097 42348 968461 994237 169546 173233 153489 664316 880761 992681 442552 784059 695337 189589 942159 910171 948953 69272 286119 691873 355276 185403 725269 184697 949130 81449 237875 932592 63901 256308 354782 746809 218901 117262 414902 994474 70405 295889 676129 5293...

output:

6349701511903 6971615327767 7722164949625 7728260351085 7727503448708 7714990117760 7726693943015 7715870310076 7725605313666 7728607044735 7728398456363 7728728667680 7728796100447 7728791267006 7728799835371 7728786056539 7728718568685 7728781176193 7728799835371 7728779455723 7728794526221 772879...

result:

ok 500000 numbers

Test #38:

score: 0
Accepted
time: 272ms
memory: 41880kb

input:

500000 500000
849704 211329 325361 512416 625895 498979 211143 770725 323585 862955 612787 520184 475098 298142 628548 173080 847114 286295 710589 672666 836447 65218 922197 451173 205273 24289 996085 559540 479789 215243 482428 7448 936579 544936 137790 583028 771832 569398 57537 176447 120861 8903...

output:

137835116569728 70734611566127 141398507165954 144415021992377 144893936727497 144888482751994 144898779209719 144898902252870 144899233544680 144899432367090 144899413294215 144899432367090 144899418520980 144899432367090 144899432367090 144899432367090 144899150305905 144899432367090 1448994323670...

result:

ok 500000 numbers

Test #39:

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

input:

100 500000
201875 404619 275954 939779 122744 975915 957928 918129 11719 782955 365238 761735 64707 811654 509627 849002 925187 313645 468007 101365 67123 987078 170753 299512 959827 31273 749346 706356 526966 909602 318200 267296 661445 451314 651460 312679 743226 431054 1884 149544 926181 281950 9...

output:

81863443247375652 81388729289605697 82073916949804551 82794082002137584 82088688051781203 82871430073524890 80541631054281715 82508833654473935 81732433116514827 82965830591220107 82934310172590156 82944520436228864 82116277414164732 80197004934311151 82830608683070397 82805372180784252 819585374426...

result:

ok 100 numbers

Test #40:

score: 0
Accepted
time: 247ms
memory: 35140kb

input:

500000 100000
464454 152738 823003 774993 504422 807648 930704 949149 567005 701977 506370 273172 741370 883255 206873 116614 155553 520405 539795 933435 492105 83589 186306 444525 129022 117836 526924 595212 454496 770913 905258 351673 170531 305713 133353 669195 980110 370782 40684 47437 256508 63...

output:

42287421766886972 42287421766886972 42287421766886972 42287306472908412 42287392633737306 42287421766886972 42287396480539456 42287421766886972 42287412358246572 42287421766886972 42287406884622027 42287421766886972 42287329856284062 42287421766886972 42287383623589602 42287397136631602 422874217668...

result:

ok 500000 numbers

Test #41:

score: 0
Accepted
time: 141ms
memory: 37336kb

input:

100000 500000
89756 566051 766333 59813 985719 777547 948311 840812 85498 224652 288852 296061 989676 325187 498986 445494 21012 338668 472982 993366 723713 609322 74197 492546 286659 763075 933868 865602 551343 626146 237346 221249 765022 778516 122560 774352 590766 912651 125592 949091 804416 4047...

output:

58600262381694961 58599855122930710 58599308027957518 58600256786138450 58600300606543750 58600099368091247 58600135124837515 58600299101418310 58600300606543750 58599135608541797 58600229249441465 58599957005802490 58599912387808459 58600277779405702 58598916191492004 58599687313057271 586002486082...

result:

ok 100000 numbers

Test #42:

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

input:

500000 500000
959139 199252 470888 74578 802746 396295 386884 721198 628655 722503 207868 647942 87506 792718 761498 917727 843338 908043 952768 268783 375312 414369 319712 96230 277106 168102 263554 936674 246545 667941 198849 268921 191459 436316 134606 802932 515506 837311 465964 394766 17626 650...

output:

250306199951000000 250306959838000000 250306688202000000 250307084512000000 250306356344000000 250306762795000000 250306772206000000 250306437892000000 250306530435000000 250306436587000000 250306951222000000 250306511148000000 250307071584000000 250306366372000000 250306397592000000 250306241363000...

result:

ok 500000 numbers

Test #43:

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

input:

500000 500000
9859 748096 475634 928248 927808 875072 158867 937890 595515 26685 468307 240390 887597 586447 764525 365644 156469 188306 350786 308832 695957 562147 427221 937909 590963 478310 357775 361535 993561 967811 718075 555000 533750 412453 936715 173340 350235 67386 20497 895277 233727 2358...

output:

187333355674461648 187332617438209744 187332889900412916 187332437288246392 187332437729172880 187332490465837008 187333206667414850 187332427650026878 187332770023225768 187333338848701813 187332897231144718 187333125146105938 187332477947112812 187332779094085459 187332601019164998 187332999894946...

result:

ok 500000 numbers

Test #44:

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

input:

500000 500000
125987 264237 288891 590429 244358 321145 930851 89174 529670 363571 728747 543238 720391 188689 702144 813561 628383 660056 781508 605777 759705 485733 534730 812292 937524 788519 451996 10588 483682 267682 461493 65270 619145 355885 963015 800644 217669 264757 640439 685387 674020 85...

output:

250158138971 250158000721 250157976067 250157674529 250158020600 250157943813 250157334107 250158175784 250157735288 250157901387 250157536211 250157721720 250157544567 250158076269 250157562814 250157451397 250157636575 250157604902 250157483450 250157659181 250157505253 250157779225 250157730228 2...

result:

ok 500000 numbers

Test #45:

score: 0
Accepted
time: 198ms
memory: 42728kb

input:

500000 500000
209411 813081 102149 219907 593611 24114 959730 305867 496529 635050 21890 102981 487777 982418 896659 518374 876106 907614 179526 645826 856158 633510 642240 653971 475573 98727 513513 435449 165290 567552 980720 351348 994140 332021 797828 138348 52399 751728 227676 475498 922825 215...

output:

78094062119439937 78094062118626856 78094062119445050 78094062118176546 78094062117274904 78094062119426629 78094062113890968 78094062117288372 78094062115677116 78094062113340287 78094062119430448 78094062118492443 78094062113796024 78094062105918184 78094062107096122 78094062111567871 780940621056...

result:

ok 500000 numbers

Test #46:

score: 0
Accepted
time: 177ms
memory: 42664kb

input:

500000 500000
325539 329221 106895 882089 718673 502890 699009 489855 430685 939232 282330 630021 287868 584659 866982 966291 348020 379364 642952 942770 919906 781288 492853 752547 789430 217447 607734 893014 655411 867422 467242 828915 303728 275454 599937 732948 887129 981803 814914 8713 363118 8...

output:

62428111453067039 62428192838035683 62428192837482815 62428192836871037 62428192837250236 62428192837269900 62428192837282935 62428192837551259 62428192837101882 62428192837250237 62428192837559448 62428192837553910 62428192837599272 62428192837020158 62428192836638526 62428192837157488 624281928377...

result:

ok 500000 numbers

Test #47:

score: 0
Accepted
time: 109ms
memory: 39868kb

input:

500000 1
376259
1 2 1 1
2 4 1 1
4 6 1 1
6 8 1 1
8 10 1 1
10 12 1 1
12 14 1 1
14 16 1 1
16 18 1 1
18 20 1 1
20 22 1 1
22 24 1 1
24 26 1 1
26 28 1 1
28 30 1 1
30 32 1 1
32 34 1 1
34 36 1 1
36 38 1 1
38 40 1 1
40 42 1 1
42 44 1 1
44 46 1 1
46 48 1 1
48 50 1 1
50 52 1 1
52 54 1 1
54 56 1 1
56 58 1 1
58 ...

output:

376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 376258623741 3...

result:

ok 500000 numbers

Test #48:

score: 0
Accepted
time: 34ms
memory: 24736kb

input:

50000 20
492387 235422 924898 332532 192988 684636 499872 857831 331700 547597 579017 525316 696560 204822 31820 862125 908873 131377 438988 312468
1 21 1 1
2 22 1 2
3 23 2 1 2
4 24 1 3
5 25 2 1 3
6 26 2 2 3
7 27 3 1 2 3
8 28 1 4
9 29 2 1 4
10 30 2 2 4
11 31 3 1 2 4
12 32 2 3 4
13 33 3 1 3 4
14 34 3...

output:

266208358809 266209108161 266209343583 266208418685 266209343583 266209343583 266209343583 266209011051 266209343583 266209343583 266209343583 266209343583 266209343583 266209343583 266209343583 266209150595 266209343583 266209343583 266209343583 266209343583 266209343583 266209343583 266209343583 2...

result:

ok 50000 numbers

Test #49:

score: 0
Accepted
time: 200ms
memory: 42680kb

input:

500000 500000
9859 748096 475634 928248 927808 875072 158867 937890 595515 26685 468307 240390 887597 586447 764525 365644 156469 188306 350786 308832 695957 562147 427221 937909 590963 478310 357775 361535 993561 967811 718075 555000 533750 412453 936715 173340 350235 67386 20497 895277 233727 2358...

output:

100048077044710922 100048028181801817 100047982038856228 100047385331987114 100048075350636884 100047901549948790 100048024083725716 100047942031845394 100047708591079669 100047839463145232 100048043409148695 100048071528221362 100048058485977805 100047936902109922 100048016741352877 100047846267507...

result:

ok 500000 numbers

Test #50:

score: 0
Accepted
time: 206ms
memory: 45400kb

input:

500000 500000
405440 588704 61481 472140 115810 658854 743034 305150 780684 361360 50516 554301 478790 543678 546138 279893 889899 960260 802881 66499 699500 254572 454419 833657 743179 661234 729965 591136 937826 626886 906880 664913 990362 385934 153747 840219 514676 746017 62847 187713 207556 370...

output:

71170390771035638 71170392837563318 71170392837563318 71170392837563318 71170390826463858 71170376151274678 71170392837563318 71170392837563318 71170392837563318 71170392837563318 71170392837563318 71170358692067417 71170392837563318 71170392837563318 71170392837563318 71170392837563318 711703928375...

result:

ok 500000 numbers

Test #51:

score: 0
Accepted
time: 221ms
memory: 45596kb

input:

500000 500000
132990 670832 532397 706099 376165 974383 351265 811338 15338 566770 468323 407573 503843 953942 369988 758973 378490 415278 789095 114141 949676 785985 570307 294279 512907 822345 580644 277631 224188 986101 745130 262078 315322 505768 101256 268976 244049 488568 558470 870326 589667 ...

output:

62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 62706393053090640 627063930530...

result:

ok 500000 numbers

Test #52:

score: 0
Accepted
time: 229ms
memory: 45080kb

input:

500000 500000
336960 203931 808795 6267 692983 914962 866176 907872 959265 172501 680630 629289 146182 585324 737776 227868 447523 126454 601875 785295 671784 570083 138426 245806 883003 868090 483252 372473 958324 316116 873668 74243 213983 978335 458784 660724 561533 150235 591603 174472 88963 864...

output:

62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 62612398663246801 626123986632...

result:

ok 500000 numbers

Test #53:

score: 0
Accepted
time: 214ms
memory: 47028kb

input:

500000 500000
141764 497259 454586 218013 75415 174257 849107 638133 675008 621009 804815 816804 763480 58668 755609 625834 827967 371333 187172 328878 370841 452932 696676 821498 237196 805815 99091 807677 987715 178764 876077 227528 665966 161689 382836 418066 33984 601173 399404 663348 832432 331...

output:

62513698071450350 62513698071450350 62513698071450350 62513698071450350 62513698071450350 62513543536160582 62513524615023283 62513685993507059 62513603556830190 62513486582488337 62513613873314680 62513017210590482 62513642238157950 62513673260987822 62513662064414673 62513536153800368 625134860481...

result:

ok 500000 numbers

Test #54:

score: 0
Accepted
time: 152ms
memory: 37460kb

input:

333333 333333
125987 264237 288891 590429 244358 321145 930851 89174 529670 363571 728747 543238 720391 188689 702144 813561 628383 660056 781508 605777 759705 485733 534730 812292 937524 788519 451996 10588 483682 267682 461493 65270 619145 355885 963015 800644 217669 264757 640439 685387 674020 85...

output:

92105933497539475 92105757533109679 92106143389825505 92105861288280741 92105951173748260 92106131457573055 92106110737512077 92106000042188689 92105779700312148 92106015615284117 92105353077555913 92106141082725102 92106116185919489 92105502565435380 92106124741424249 92105336281493224 921061433898...

result:

ok 333333 numbers

Test #55:

score: 0
Accepted
time: 128ms
memory: 27540kb

input:

1428 1428
132990 670832 532397 706099 376165 974383 351265 811338 15338 566770 468323 407573 503843 953942 369988 758973 378490 415278 789095 114141 949676 785985 570307 294279 512907 822345 580644 277631 224188 986101 745130 262078 315322 505768 101256 268976 244049 488568 558470 870326 589667 6517...

output:

710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710936486469186 710930619960825 710936486469186 710936486469186 710936486469...

result:

ok 1428 numbers

Test #56:

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

input:

500000 2
9859 748096
1 2 1 2
2 4 1 2
4 6 1 2
6 8 1 2
8 10 1 1
10 12 1 2
12 14 1 1
14 16 1 1
16 18 1 1
18 20 1 2
20 22 1 1
22 24 1 1
24 26 1 1
26 28 1 2
28 30 1 1
30 32 1 2
32 34 1 2
34 36 1 2
36 38 1 1
38 40 1 1
40 42 1 1
42 44 1 1
44 46 1 1
46 48 1 2
48 50 1 1
50 52 1 1
52 54 1 1
54 56 1 1
56 58 1 ...

output:

473744009875 473744009875 473744009875 473743261779 473744728394 473742513683 473744738253 473744748112 473744738253 473742513683 473744738253 473744748112 473744738253 473742513683 473744728394 473743261779 473744009875 473743261779 473744738253 473744748112 473744748112 473744748112 473744738253 4...

result:

ok 500000 numbers

Test #57:

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

input:

500000 10
30518 196518 274071 359971 550121 204862 843967 173607 619138 690754
1 2 1 3
2 4 1 7
4 6 1 9
6 8 1 3
8 10 1 7
10 12 1 7
12 14 1 7
14 16 1 7
16 18 1 6
18 20 1 7
20 22 1 10
22 24 1 2
24 26 1 3
26 28 1 6
28 30 1 6
30 32 1 8
32 34 1 4
34 36 1 7
36 38 1 1
38 40 1 4
40 42 1 7
42 44 1 6
44 46 1 1...

output:

571744192213 571742208454 571742882941 571743918142 571743052421 571743896388 571743896388 571743052421 571744125769 571742208454 571742668093 571744150801 571743918142 571744330631 571744330631 571744219534 571743660442 571742208454 571744648801 571743660442 571742208454 571744125769 571744648801 5...

result:

ok 500000 numbers

Test #58:

score: 0
Accepted
time: 123ms
memory: 27780kb

input:

500000 700
132990 670832 532397 706099 376165 974383 351265 811338 15338 566770 468323 407573 503843 953942 369988 758973 378490 415278 789095 114141 949676 785985 570307 294279 512907 822345 580644 277631 224188 986101 745130 262078 315322 505768 101256 268976 244049 488568 558470 870326 589667 651...

output:

743281681047 743282002262 743280956930 743279976245 743281461563 743282404616 743281451759 743279765159 743281266416 743281478138 743281250846 743279643791 743281177046 743281942415 743282319740 743281798025 743281280390 743279863211 743281811126 743280559928 743281720121 743281444844 743282123969 7...

result:

ok 500000 numbers

Test #59:

score: 0
Accepted
time: 122ms
memory: 38684kb

input:

500000 2
9859 748096
1 3 1 1
2 4 1 2
3 5 2 1 2
4 6 1 2
5 7 1 1
6 8 1 2
7 9 2 1 2
8 10 1 2
9 11 1 1
10 12 1 2
11 13 2 1 2
12 14 1 2
13 15 1 1
14 16 1 2
15 17 2 1 2
16 18 1 2
17 19 1 1
18 20 1 2
19 21 2 1 2
20 22 1 1
21 23 1 1
22 24 1 2
23 25 2 1 2
24 26 1 2
25 27 1 1
26 28 1 2
27 29 2 1 2
28 30 1 1
2...

output:

378978238237 378977509859 378978248096 378978257955 378978248096 378978257955 378978248096 378978257955 378978248096 378978257955 378978248096 378978257955 378978248096 378978257955 378978248096 378978257955 378978248096 378978257955 378977509859 378978257955 378978257955 378977509859 378978248096 3...

result:

ok 500000 numbers

Test #60:

score: 0
Accepted
time: 53ms
memory: 27628kb

input:

125000 8
608515 751563 705451 994713 509537 130709 463343 41819
1 9 1 1
2 10 1 2
3 11 2 1 2
4 12 1 3
5 13 2 1 3
6 14 2 2 3
7 15 3 1 2 3
8 16 1 4
9 17 2 1 4
10 18 2 2 4
11 19 3 1 2 4
12 20 2 3 4
13 21 3 1 3 4
14 22 3 2 3 4
15 23 4 1 2 3 4
16 24 1 5
17 25 2 1 5
18 26 2 2 5
19 27 3 1 2 5
20 28 2 3 5
21...

output:

475928077431 475928542898 475929294461 475928589010 475929294461 475929294461 475929294461 475928299748 475929294461 475929294461 475929294461 475929294461 475929294461 475929294461 475928299748 475928784924 475929294461 475929294461 475929294461 475929294461 475929294461 475929294461 475929294461 4...

result:

ok 125000 numbers

Test #61:

score: 0
Accepted
time: 45ms
memory: 23244kb

input:

62500 17
679894 524637 508634 280107 481104 939275 953130 494227 256339 787326 107999 575751 592642 596921 974470 20999 869688
1 18 1 1
2 19 1 2
3 20 2 1 2
4 21 1 3
5 22 2 1 3
6 23 2 2 3
7 24 3 1 2 3
8 25 1 4
9 26 2 1 4
10 27 2 2 4
11 28 3 1 2 4
12 29 2 3 4
13 30 3 1 3 4
14 31 3 2 3 4
15 32 4 1 2 3 ...

output:

375053204448 375054039599 375054564236 375054055602 375054564236 375054564236 375054564236 375054284129 375054564236 375054564236 375054564236 375054564236 375054564236 375054564236 375054564236 375054083132 375054564236 375054564236 375054564236 375054564236 375054564236 375054564236 375054564236 3...

result:

ok 62500 numbers

Test #62:

score: 0
Accepted
time: 257ms
memory: 34388kb

input:

500000 5
590574 62422 897447 874192 928675
151776 151792 2 1 3
744660 744663 2 1 5
913928 913937 2 1 5
547547 547566 3 2 3 4
542537 542541 2 3 5
395721 395732 2 2 5
727766 727773 3 2 4 5
110205 110222 2 4 5
382871 382876 3 2 4 5
597039 597051 2 4 5
412818 412837 3 3 4 5
889383 889390 1 1
74688 74701...

output:

2942026134424 2942027031871 2942024669575 2942023535103 2942027031871 2942027031871 2942027031871 2942027031871 2942021459821 2942027031871 2942006850181 2942027031871 2942027031871 2942027031871 2942027031871 2942027031871 2942019852295 2942026907027 2942027031871 2942027031871 2942019070791 294202...

result:

ok 500000 numbers

Test #63:

score: 0
Accepted
time: 242ms
memory: 30384kb

input:

500000 40
314708 152977 972213 957050 607264 486588 84273 263022 573791 469423 636445 381027 692867 701372 676333 122170 808163 6836 72633 836824 496697 40815 830974 462885 210914 16328 663195 350800 188898 624095 268437 934664 802909 701973 948627 283972 215967 297875 389666 202045
264157 264167 2 ...

output:

4331973121860 4331964953290 4331981634390 4331944922135 4331965707236 4331987045200 4331967740907 4331982567613 4331973502493 4331973174607 4331970070531 4331954437178 4331984490607 4331974634590 4331985593677 4331982744823 4331950273598 4331970589588 4331971007147 4331972363395 4331972175041 433198...

result:

ok 500000 numbers

Test #64:

score: 0
Accepted
time: 213ms
memory: 29948kb

input:

500000 300
624927 800294 983484 911355 799154 319824 209563 827443 916416 316989 491118 921295 794883 330430 831816 559755 109444 358423 617039 67349 250405 99009 850044 309520 535383 510056 521564 224785 993380 323565 527122 580069 141798 742437 636754 559497 792526 122200 613928 124016 861214 8225...

output:

5088095157230 5088174602356 5088169818556 5088082687861 5088111948398 5088163234848 5088183833341 5088178877915 5088157784534 5087994620411 5088162615597 5088133028847 5088143774234 5088175215168 5088102197561 5088133065467 5088118639970 5088093175466 5088157976672 5088120818534 5088170630828 508803...

result:

ok 500000 numbers

Test #65:

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

input:

500000 5
853219 457465 499189 44077 219569
523265 523348 3 2 3 4
537408 537581 3 3 4 5
590927 591098 1 4
201854 201891 2 4 5
444232 444301 3 1 2 4
37460 37650 1 4
664110 664171 3 2 3 4
499386 499441 1 2
168533 168609 3 1 4 5
373451 373607 1 5
632102 632250 1 3
922789 922828 1 5
170229 170337 3 1 3 4...

output:

2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 2073393224490 207339...

result:

ok 500000 numbers

Test #66:

score: 0
Accepted
time: 245ms
memory: 30324kb

input:

500000 40
449474 983371 476969 512310 616507 253080 506570 359288 209828 150911 694826 228905 818335 667577 167105 727150 920605 343091 973983 503963 823592 63053 131876 596028 667098 709339 254917 980176 606116 758951 224590 661833 172232 246188 420058 231693 988256 741917 64349 17400
947632 947643...

output:

18303480493228 18303419542598 18303469870954 18303481220378 18303481220378 18303475603538 18303469524840 18303480299773 18303481220378 18303481220378 18303397225448 18303481220378 18303479181042 18303414606514 18303400288254 18303481220378 18303477299674 18303478506718 18303464249130 18303450342188 ...

result:

ok 500000 numbers

Test #67:

score: 0
Accepted
time: 214ms
memory: 32776kb

input:

500000 10000
561485 470219 636650 24639 739370 366882 636727 460823 135512 771225 192499 241882 966099 145903 702635 395050 860251 779848 125105 590285 978481 972013 567257 358382 716511 592970 959100 912729 625005 442415 170488 165442 858284 184976 402413 3327 680751 151621 757313 488778 779789 177...

output:

4908982005828357 4908982005828357 4908982005828357 4908982005828357 4908982005828357 4908982005828357 4908847257964091 4908982005828357 4908982005828357 4908982005828357 4908982005828357 4908338067458851 4908982005828357 4908982005828357 4908982005828357 4908952399275169 4908982005828357 49089820058...

result:

ok 500000 numbers

Test #68:

score: 0
Accepted
time: 168ms
memory: 29904kb

input:

500000 100000
130758 214256 186996 967482 364304 701052 394387 213197 764975 485248 399203 291093 508305 58610 101389 68050 650871 240572 882315 35256 788727 716670 980461 755504 808186 68491 150039 671576 854143 861031 379969 791679 123671 466576 668022 771882 641191 258994 659029 176594 943721 674...

output:

33270441564678625 33270476156171011 33270527630985493 33270418179879073 33270548887240003 33270532331079964 33270547946547311 33270548887240003 33270529816003771 33270548887240003 33270498881089795 33270548887240003 33270382511679619 33270497392124656 33270548887240003 33270509706726407 332705488872...

result:

ok 500000 numbers

Test #69:

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

input:

100000 500000
938684 216051 786196 271608 391017 661002 825633 753600 399522 994997 474024 787258 31704 735502 95957 766348 245394 594276 442857 862477 811242 299450 593397 679563 466380 980486 716451 427334 50682 35379 774445 884210 74954 367519 888036 972089 392934 174813 443434 223991 902987 1643...

output:

94485463972638084 94485849996057809 94485847097446856 94485850153351694 94485810331442132 94484861856828940 94485773486738974 94485630550687174 94485873306645938 94485702785131082 94485070659825700 94485665757520052 94482672514662127 94485056377862262 94485113550965558 94485659379110294 944842160803...

result:

ok 100000 numbers

Test #70:

score: 0
Accepted
time: 196ms
memory: 36940kb

input:

500000 500000
240817 188814 959258 523827 207228 489805 66495 155714 326678 865894 625108 667380 450501 754169 329275 496403 844518 865691 978921 532767 204521 908436 241959 572810 396752 961057 237267 909051 492916 918834 211296 642508 448960 593837 252177 843660 91764 557674 413186 534782 265443 5...

output:

54145536377414485 54145567268502023 54145577559252955 54145573551713661 54145552225068765 54145410239384029 54145513124598627 54145407991822595 54145572134929825 54145577559252955 54145506045141426 54145532063008667 54145571027108910 54145555180704877 54145576682046245 54145325027357703 541455132772...

result:

ok 500000 numbers

Test #71:

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

input:

500000 500000
927174 523195 206840 194654 138888 341869 274021 707331 942000 942252 505682 794399 673354 416235 932804 288175 864817 783950 154899 398755 301016 535091 614762 125793 65029 419174 437897 890944 499793 730155 782915 407310 601001 158008 211968 730507 44112 119544 860348 772652 557019 8...

output:

94444481247006349 94444919078248751 94444626363439848 94400912240894906 94443317490852958 94441927659060573 94443826159183298 94441744970280154 94444995009653204 94442669968434471 94440276066492423 94414532108808794 94433777187024828 94443083244320306 94400336040054511 94409762596757211 944414355519...

result:

ok 500000 numbers

Test #72:

score: 0
Accepted
time: 303ms
memory: 41064kb

input:

500000 500000
454261 128664 467445 735691 425625 982534 292846 513004 773001 2116 147724 338332 459623 6443 113633 456693 438104 20723 260358 656434 29573 716603 713236 997363 988443 911109 123948 740989 307467 824823 598704 423032 912267 171035 516295 928559 144978 921439 77213 704019 574944 30230 ...

output:

91942158054228934 92295491189547170 92274143842141872 91950736627929464 92209731999151347 92291489321564216 92324831842356932 92289391322531740 92065926489700834 92313700103469598 92323059569025235 91889189767735355 92176626611491769 92300183177812542 92221892210866181 92304520004412950 922572454007...

result:

ok 500000 numbers

Test #73:

score: 0
Accepted
time: 262ms
memory: 41404kb

input:

500000 500000
26232 437571 159749 938736 515278 800062 6438 252640 469858 102773 281339 203340 529656 35755 964556 96716 267836 460839 941573 839414 813627 758646 66357 800170 586152 150116 420113 468359 838744 822215 542898 442930 324038 752500 397267 857366 756240 609095 706260 425759 839992 79152...

output:

83856535458504197 115454143473424300 127612420414861366 121961243744383922 127692737891285236 126316309835286754 127666165902162990 127693083228053404 127695011293201977 127691482531952386 127692230036293174 127693405561652905 127695006453263242 127695438102123319 127695496659555767 1276955622741977...

result:

ok 500000 numbers

Test #74:

score: 0
Accepted
time: 39ms
memory: 29368kb

input:

1 500000
329462 567912 504541 334923 683564 779829 209054 933019 220925 308485 896826 996865 402496 727962 877318 343818 827876 123244 741417 353205 753451 583716 334494 410168 661929 186210 854198 187132 788553 876665 836500 265308 434696 704878 768623 749418 649720 580092 452435 840042 734271 3995...

output:

0 

result:

ok 1 number(s): "0"

Test #75:

score: 0
Accepted
time: 109ms
memory: 39656kb

input:

5 500000
694319 443540 227886 39735 850273 341532 781188 158924 597211 59193 816578 481647 606658 697418 535141 440423 325387 314846 124670 614703 762244 172282 259765 721588 932108 600792 944705 985754 639382 234658 155249 73656 506474 445051 67302 279383 975204 901814 545622 677878 925811 296541 1...

output:

41021963437202349 114365232312222072 118349184887167981 120154618382756236 115037915382589804 

result:

ok 5 number(s): "41021963437202349 114365232312...618382756236 115037915382589804"

Test #76:

score: 0
Accepted
time: 117ms
memory: 38488kb

input:

10 500000
696289 930267 369249 913890 606319 44260 663092 61686 352544 43542 627962 691547 853112 552366 440464 459064 454670 398684 651944 502503 864911 349126 341447 761720 523961 998851 818376 801516 675041 702113 315479 942522 710190 889184 412726 263053 130587 10293 788731 319811 189369 830024 ...

output:

97269586816874021 89867631852059056 68931535873254655 70560867625367128 87144574384634835 96324456889551347 95124018791908452 97383978218179708 95887079259924156 96807125183211392 

result:

ok 10 numbers

Test #77:

score: 0
Accepted
time: 158ms
memory: 38096kb

input:

1000 500000
664211 957612 302206 140913 324385 770370 186675 672964 570358 710149 485951 77932 963990 175410 71231 465937 730584 494394 958565 577931 414377 925121 756919 604906 660295 729055 397645 552753 703047 559458 728086 829655 834192 720778 976468 112965 988382 929996 825627 98266 495679 1326...

output:

98168396694568856 98078649934214465 98163294591997952 98166195193709346 98163969718959748 97987211684906454 98096944003251946 98027714100611613 98047218320677983 97981903802527381 98150584399434049 98172148993407063 97941704164528991 98172068925308123 98173626179312864 98150101060902443 979330154381...

result:

ok 1000 numbers

Test #78:

score: 0
Accepted
time: 251ms
memory: 41396kb

input:

500000 500000
491971 78013 476201 60750 219030 163487 398449 618522 356729 231945 591653 44700 749645 535593 592200 579827 298197 199406 587134 999938 508346 744783 65939 62705 151624 392452 202931 362090 680366 890955 518899 61149 639426 848293 296071 196988 175547 841558 347786 97152 299573 964328...

output:

215948686759 195915330324 218885865641 222708786688 223475365571 223712169377 223891534675 223903277239 223884749768 223857755443 223830962405 223927933132 223928365357 223929401543 223929401543 223929401543 223929401543 223929401543 223929401543 223929401543 223928961102 223929401543 223929401543 2...

result:

ok 500000 numbers

Test #79:

score: 0
Accepted
time: 260ms
memory: 41604kb

input:

500000 500000
524903 637061 11763 449214 303953 998418 64853 140089 625715 718154 356245 750838 172398 820408 288590 962698 285943 33626 588977 140477 830746 548131 711040 463244 100211 136635 146580 623976 370675 896122 42905 810357 794529 555825 604941 713548 432342 480033 373892 341369 569472 730...

output:

11114001631655383 8387345981223664 8875498440663484 11089913291117170 11178881254592145 11220744350062211 11221253067908193 11221524350218962 11221517162534257 11221523948962427 11221524799388793 11221523112827327 11221526692633646 11221524354931702 11221527478907422 11221522707417492 11221515251738...

result:

ok 500000 numbers