QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#612175#9436. Some Sum of Subsetucup-team4688#AC ✓34ms74240kbC++141.0kb2024-10-05 08:49:192024-10-05 08:49:20

詳細信息

Test #1:

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

input:

4 7
3 1 5 2

output:

6
4
1
0
0

result:

ok 5 tokens

Test #2:

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

input:

1 5
7

output:

1
0

result:

ok 2 tokens

Test #3:

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

input:

9 18
1 9 5 6 2 7 1 4 8

output:

346
309
230
126
46
10
1
0
0
0

result:

ok 10 tokens

Test #4:

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

input:

1 1467
556

output:

0
0

result:

ok 2 tokens

Test #5:

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

input:

1 1753
2514

output:

1
0

result:

ok 2 tokens

Test #6:

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

input:

1 1182
1182

output:

1
0

result:

ok 2 tokens

Test #7:

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

input:

2 1741
955 835

output:

1
0
0

result:

ok 3 tokens

Test #8:

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

input:

2 1481
2004 1570

output:

3
1
0

result:

ok 3 tokens

Test #9:

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

input:

2 1336
1336 1336

output:

3
1
0

result:

ok 3 tokens

Test #10:

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

input:

12 400
2163 2729 1322 2787 2404 1068 1502 746 898 2057 1771 502

output:

4095
4083
4017
3797
3302
2510
1586
794
299
79
13
1
0

result:

ok 13 tokens

Test #11:

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

input:

42 1609
532 722 2650 2889 2260 659 1831 401 2779 1262 2185 1479 515 552 1627 637 1080 580 1589 2154 2650 219 2924 1712 311 2609 1062 968 1357 1310 1942 2419 2465 300 2546 2537 2967 1197 2271 1551 999 2531

output:

780135870
780135476
780133126
780115746
779984839
779086101
773744618
746617208
628409426
182368401
707355349
419830171
342550392
778349940
825220795
979080057
177969332
68371210
748001250
187917550
492152134
287983982
592218358
32133349
711757614
602140473
799225822
952989153
1466429
437088327
3596...

result:

ok 43 tokens

Test #12:

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

input:

93 24
1687 2324 1216 2696 2884 1678 1301 1957 1247 526 2519 2252 2141 960 1505 175 315 388 440 892 837 1942 256 1667 641 1629 2565 2837 1200 2427 418 1072 427 1589 969 886 2991 2249 539 1132 949 2425 2616 2107 1259 582 1979 386 177 1860 2825 316 2004 956 1218 2332 1498 2939 1126 1706 404 1604 505 11...

output:

958346177
958346084
958341806
958212040
955292305
903321022
141075538
649896624
629379357
102857051
471642575
350313411
852223261
984774652
743966819
740155079
222450670
637406264
282036249
875748580
177575581
602719974
451360351
244531346
556337405
139169356
737451056
595307440
402860967
935337558
...

result:

ok 94 tokens

Test #13:

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

input:

162 1057
695 2739 2637 797 503 1051 2243 2429 160 1900 1798 1584 1488 1377 2764 1324 978 2696 913 2651 817 1522 819 314 882 1536 2785 2193 540 2417 1357 959 2765 408 1693 1305 1643 2565 2677 966 860 2547 936 2123 496 2098 2130 38 378 1395 2725 2657 2107 2096 2039 2421 2548 431 2205 2907 1085 2919 25...

output:

389411124
389407419
389358436
388250937
356407046
445051896
284078655
310513451
444646929
152850475
993044643
431761154
990006065
274011210
363632851
570583138
738018586
406619069
554524447
68656757
468185513
297611934
115797909
686917345
226595373
291150212
272381264
220037421
897019520
543603827
1...

result:

ok 163 tokens

Test #14:

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

input:

258 115
711 2524 2720 190 2722 285 1451 2274 729 433 2198 1787 1513 1943 656 691 1564 110 857 1604 1900 749 936 811 736 2934 160 2765 1024 2777 1176 2451 1358 1527 207 2142 564 766 2187 1122 2394 2701 1518 1871 2047 192 448 198 1178 2337 2187 197 958 2712 1792 1801 2125 1553 642 991 2419 765 556 667...

output:

679628095
679627797
679594544
676765332
496412885
318714207
312586022
91966775
656865481
43835426
451822313
302874781
814080325
198066519
398512797
65425915
372232292
981614918
489120129
415216968
680055200
354073986
472346737
340468228
671304901
14537393
732660445
322180935
429580213
661767647
3710...

result:

ok 259 tokens

Test #15:

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

input:

361 2442
2259 2509 1332 1972 2038 20 69 2957 2994 1239 14 2165 1513 1687 110 296 1198 2179 2383 1107 1399 1283 2159 763 1797 2429 700 716 2155 1675 1084 1240 2511 88 2850 2095 1991 528 2350 2944 2478 1551 2603 1718 1997 2358 829 298 147 559 361 1147 1502 92 1500 2718 875 1138 681 1450 2527 2048 2358...

output:

307302301
580505153
851886546
949704794
513166194
554298173
376814448
260998744
286352570
1306229
942623010
990880004
483637443
639566802
87384186
647331744
456851473
79181365
814841605
928484866
732051628
807565561
967052391
396403870
827423238
628292032
729375608
76807794
441407519
105436762
37817...

result:

ok 362 tokens

Test #16:

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

input:

494 1465
2911 1256 1749 2495 1360 2696 1542 1925 2771 2971 2000 2177 522 1459 2923 1376 2910 871 2813 118 916 2732 505 2715 1867 1643 410 2611 1509 450 2216 2977 2146 25 2867 1921 1463 1404 1506 1642 1374 440 1367 746 773 1583 1189 88 138 206 333 95 2679 1798 1833 1574 269 261 2637 339 2942 880 1946...

output:

601338713
71190482
366743920
29439076
165764717
623413052
621710375
186270648
164229544
245356732
574049815
159928423
293955886
283917475
710614042
644889770
525216501
408416510
614685151
855141118
684389723
48613954
630787816
206430371
603047420
232394421
191648298
41682916
532845844
896480859
5580...

result:

ok 495 tokens

Test #17:

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

input:

641 1482
2059 104 2948 2452 980 1208 2490 1732 1157 933 1474 2562 2837 1879 781 1184 1315 1945 1354 1998 2342 1912 244 671 2332 1838 1982 255 559 523 2656 903 1703 97 368 278 709 2032 627 2965 2324 179 188 799 2729 960 2861 2792 1750 2827 158 1526 856 1772 1347 468 1497 2721 1521 2639 178 906 1406 9...

output:

954243398
984112835
721285238
517568578
548377046
81412459
964922628
162381954
804965567
248085717
497009368
165592753
403723827
130398680
814606186
255490452
680764934
37801227
440785027
805711271
661503649
155012433
312914255
502270457
953130944
352520788
354510603
848312651
602873666
106063941
11...

result:

ok 642 tokens

Test #18:

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

input:

813 853
791 1331 2436 2101 1358 2069 418 2806 362 1808 577 604 2470 1376 72 143 2920 1225 2844 2046 2642 1973 1833 367 2851 1999 1771 1892 475 657 1218 875 2530 2161 1359 2556 1426 168 198 1095 1887 496 1567 840 1635 1534 2968 414 1332 2129 2023 509 2460 2517 642 1601 891 207 557 1332 1762 2531 2185...

output:

266757501
960695671
105371913
284228297
767246574
537963296
132439517
656989604
183994944
35050045
737170898
815660864
387545312
294470919
26759305
981025679
347289315
388903831
740619964
67226751
848226762
170823914
800033200
107985190
574075391
904477100
183572348
259260214
687334926
705536921
403...

result:

ok 814 tokens

Test #19:

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

input:

1007 11
1548 2721 289 1606 1776 885 210 2105 1488 2220 2135 2 1303 2585 59 531 2959 1683 2201 2952 2721 2156 1426 2042 1897 1025 880 2091 2934 1677 472 659 2605 946 1221 2622 948 567 1606 2347 245 775 1505 2618 421 1391 588 2180 608 647 644 2828 1413 2458 1731 2480 4 2363 32 995 2458 470 2133 2117 2...

output:

976474719
976473708
975967181
806282650
141727206
396996576
102471855
909943074
22921318
389697349
458201923
133244365
114364582
665823743
887894407
16360457
884694972
181985551
464497163
616618136
744385990
760009010
189711548
244790462
506537230
895836166
625692223
792905824
655915741
643896846
25...

result:

ok 1008 tokens

Test #20:

score: 0
Accepted
time: 22ms
memory: 72832kb

input:

3000 1
1355 1270 1449 1697 714 2076 2157 2727 2019 1150 1209 1945 2851 36 1944 2693 2551 2030 1528 2375 1412 901 2384 1137 2050 1760 2172 1466 2336 2282 591 1692 2162 19 2748 354 2203 1523 2758 334 2866 2014 2612 1212 1305 1533 1771 1054 1613 1324 2344 361 2394 421 871 1544 2235 1457 1407 2015 811 1...

output:

21292721
21289721
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #21:

score: 0
Accepted
time: 19ms
memory: 72668kb

input:

3000 1
1921 2368 2560 1531 627 323 582 1630 1207 1803 2909 2609 424 2079 2814 1223 1098 1692 2814 655 2743 534 1681 2935 2280 396 311 2337 2351 995 2296 1772 2292 1799 2183 2258 1880 2097 660 1430 1177 1786 2990 2274 2140 1640 1874 2755 2968 2926 2657 667 330 1998 1282 1199 663 525 2192 2375 595 120...

output:

21292721
21289721
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #22:

score: 0
Accepted
time: 22ms
memory: 74064kb

input:

3000 1
3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 300...

output:

21292721
21289721
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #23:

score: 0
Accepted
time: 15ms
memory: 73096kb

input:

3000 2
2929 1694 2047 2024 2843 705 2906 897 1799 823 387 1241 1146 818 120 898 898 1602 2514 2430 1203 1900 708 391 1083 74 2739 1695 197 349 947 886 2232 1458 1520 2626 1612 2828 191 2345 1620 1186 2377 1126 1152 285 1746 233 754 800 2355 2677 242 811 240 2887 2329 1366 1822 1307 1711 1697 437 248...

output:

21292720
21289721
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #24:

score: 0
Accepted
time: 15ms
memory: 72696kb

input:

3000 3
1990 1915 1351 1338 2134 66 2574 2191 2993 1249 596 195 2950 2009 1794 1188 1960 1864 30 1122 1642 2650 2578 819 1948 831 1659 62 205 1346 1466 792 2453 316 1284 552 858 4 686 257 2207 2550 1714 1601 525 2804 997 2229 2662 2478 1692 2318 1087 444 1911 1623 2880 2688 2184 2360 1168 1544 2380 1...

output:

21292719
21289720
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #25:

score: 0
Accepted
time: 24ms
memory: 74072kb

input:

3000 3000
3000 2998 3000 3000 3000 2999 3000 2999 2999 3000 2998 3000 2998 3000 2999 2999 2998 2998 3000 3000 2999 2999 3000 2999 2998 2999 2998 3000 2998 3000 2998 3000 3000 2999 2998 3000 3000 2998 3000 2999 2998 2999 3000 3000 3000 3000 2998 3000 2999 2999 3000 2998 2998 2999 3000 2999 3000 3000 ...

output:

21290734
19316630
707751382
830938763
444808297
608067155
924094933
1687509
563478752
607612632
590805700
341252112
889244077
874047101
768557604
511649185
332247409
288135972
282335483
769619655
538126159
476242053
130441813
746797303
734952758
497061337
857679746
216231552
246511085
759366222
3825...

result:

ok 3001 tokens

Test #26:

score: 0
Accepted
time: 24ms
memory: 74060kb

input:

3000 3000
2999 2996 2999 3000 2996 2996 3000 2998 3000 2997 2999 3000 3000 2998 2999 2997 3000 2998 3000 2998 3000 2999 2996 2999 2997 2999 3000 3000 2997 2996 2997 2998 2999 3000 2996 2997 3000 2999 2999 2996 2998 2996 2997 2999 2997 2997 3000 3000 2996 2999 2997 2998 2999 3000 2996 2998 3000 2996 ...

output:

21290331
18434866
739059700
35105245
515348178
762925416
648427163
574103402
785280827
554393944
104625284
276008864
634589346
174178635
811170282
575152487
185638621
202892992
660739128
94093369
640462044
37424106
905890057
815740004
612803528
929501183
146372729
197959531
663401476
725068210
36001...

result:

ok 3001 tokens

Test #27:

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

input:

3000 2999
571 2015 316 840 560 1948 2355 2589 597 1002 2932 627 472 1205 428 2799 1633 2092 2473 719 428 1821 773 1208 103 227 2661 1734 665 1200 1907 920 2002 2912 2112 2779 91 175 1118 1710 2929 844 598 2586 413 2147 1992 199 2633 2460 1677 326 1819 2809 2567 565 572 2166 1358 2672 2754 1347 699 1...

output:

126306401
572236197
513686031
446167677
450257761
336249038
142017986
809877555
260799698
469283854
844249562
494460271
753429668
487063447
528020080
543383765
203564827
260891390
351171301
18410383
133415642
215231940
613972451
563306737
575786323
368449756
712876411
851617784
664992261
530507733
5...

result:

ok 3001 tokens

Test #28:

score: 0
Accepted
time: 25ms
memory: 74152kb

input:

3000 3000
2370 1015 62 55 1181 1378 1228 2110 2603 156 911 2866 1673 2610 2414 965 484 2453 314 1374 1444 1247 2746 926 1551 1271 2279 2485 2281 2804 618 2456 654 875 89 1759 2383 772 89 679 709 1214 27 2758 2585 588 607 827 1583 838 2963 1245 1896 425 2888 992 2043 673 2569 364 986 374 612 2847 283...

output:

359100636
756857299
694105506
563076628
826763558
54979922
755245480
9732915
990069489
593586669
429902383
176062108
48367049
3976665
126064767
333656604
723078906
640109565
428558527
18755645
50363213
228011908
702698618
167675248
9983265
794653880
745346728
353684583
690240297
670367521
391779200
...

result:

ok 3001 tokens

Test #29:

score: 0
Accepted
time: 25ms
memory: 73744kb

input:

3000 506
3000 2998 2997 2994 2992 2991 2989 2989 2988 2988 2986 2980 2979 2978 2977 2977 2976 2975 2974 2973 2972 2969 2968 2967 2967 2964 2963 2962 2962 2961 2959 2959 2957 2955 2955 2953 2952 2952 2952 2948 2947 2946 2946 2945 2945 2943 2943 2940 2939 2938 2937 2937 2936 2933 2932 2931 2930 2929 2...

output:

275862321
493624455
804686406
9167810
204107830
352220553
151687699
743779517
578536872
784582591
83880990
477715896
845437101
606973785
672937520
424817386
383414942
845613526
822608286
311927548
67084345
793451850
418285700
335369235
82669920
711482454
913291415
567482098
528634953
732856692
24107...

result:

ok 3001 tokens

Test #30:

score: 0
Accepted
time: 20ms
memory: 74100kb

input:

3000 603
3000 2999 2999 2998 2996 2995 2993 2993 2993 2991 2991 2989 2987 2987 2986 2985 2985 2985 2985 2984 2983 2983 2982 2982 2977 2977 2977 2976 2976 2975 2974 2972 2970 2970 2969 2967 2965 2965 2964 2963 2962 2961 2961 2961 2961 2961 2961 2960 2960 2955 2955 2952 2945 2944 2944 2943 2943 2942 2...

output:

484493087
239938875
919525484
901457797
82090818
346661081
4016252
979594088
429496054
311213726
669114049
87760479
894401296
175102955
847487554
169798677
255313434
445111833
707103
562410997
358525698
276751484
93017939
895744151
874615287
817709577
213689070
793697309
117554408
333167127
86551494...

result:

ok 3001 tokens

Test #31:

score: 0
Accepted
time: 15ms
memory: 72776kb

input:

3000 197
2 2 2 4 5 5 6 6 7 7 8 8 8 9 10 11 12 12 13 14 15 16 18 19 19 20 24 26 28 28 30 30 30 32 33 33 34 35 36 36 38 38 39 40 41 42 46 51 52 56 56 56 58 60 60 60 60 61 62 65 66 66 67 68 68 68 69 70 70 71 73 73 74 75 75 76 77 77 78 79 81 82 82 83 83 86 86 86 86 86 86 87 88 90 90 90 91 91 92 92 95 96...

output:

38606904
134021846
800776337
583516172
558018032
478800242
346039534
463116807
320709419
178809394
793998390
347003716
189851068
688113799
931309063
297679602
863827994
558037957
230057545
863257787
567223302
785358810
270896513
88125708
286400012
162760241
814873597
701161514
56712665
272294169
702...

result:

ok 3001 tokens

Test #32:

score: 0
Accepted
time: 16ms
memory: 74160kb

input:

3000 2544
1 2 5 5 7 7 8 9 10 14 14 16 16 17 18 18 18 19 19 20 20 21 22 27 28 28 30 30 31 34 37 39 40 40 41 44 44 47 48 49 49 51 52 52 53 54 55 56 56 56 57 58 60 62 65 66 66 69 69 70 70 72 75 76 80 82 82 82 86 87 89 89 90 94 95 97 97 98 100 102 102 104 104 105 107 110 110 110 110 112 113 114 114 115 ...

output:

991955167
472005082
234232019
704818502
720976404
22915948
512187670
733051782
966419362
553210997
321194103
205385068
23472007
148133096
758067371
554156346
576928709
97427819
160142577
389270442
538465101
518716719
634703671
976634182
363354920
408804078
131316549
61515009
301636225
238439756
3594...

result:

ok 3001 tokens

Test #33:

score: 0
Accepted
time: 15ms
memory: 74236kb

input:

3000 3000
145 766 383 849 1448 2855 2915 1960 802 1072 1148 2519 2141 400 2619 258 740 1990 2080 2609 899 2184 365 342 512 1003 448 2897 955 54 887 1653 743 360 338 2293 2289 408 119 850 1672 1240 1820 2812 2096 29 1630 2814 829 1853 253 154 458 397 1534 1889 1092 1737 2548 2179 325 1460 2313 2522 2...

output:

180020590
87906880
698633840
23402147
828348275
331702955
779189723
186299513
440907054
320168601
185848597
202077135
522987517
200603186
535667292
28507417
221795189
633756800
149954333
572604356
113648088
34556535
3549924
442673786
272474351
700101016
266911033
990663342
148406823
779066182
442548...

result:

ok 3001 tokens

Test #34:

score: 0
Accepted
time: 26ms
memory: 74064kb

input:

3000 2780
664 1215 687 271 1004 1636 1399 983 1251 1728 1521 446 2641 215 1458 278 722 162 1576 1123 873 2036 1277 335 1516 2085 1106 1807 2584 1147 2549 2325 714 578 2685 2155 1582 1865 1778 437 265 232 2516 2065 1299 1218 2478 15 138 2481 987 296 251 1655 1492 113 601 2503 2338 1666 18 12 1360 126...

output:

237613948
501450301
586607154
312376257
319425767
368652674
607793471
766955511
374222795
959606270
724045881
664435899
11885677
87505590
809078630
595871927
189918004
725113414
342203744
651100430
852592930
333882020
861818242
525666348
49478572
681172252
237012395
959289378
130028253
446984666
568...

result:

ok 3001 tokens

Test #35:

score: 0
Accepted
time: 24ms
memory: 73808kb

input:

3000 2214
822 2202 945 1865 1195 692 1516 656 1192 2163 1161 1186 1643 1626 2211 991 424 1521 1428 1195 1753 812 551 1555 1225 396 873 350 434 1889 391 1878 1054 734 1636 1787 1690 2008 2163 1602 322 959 585 1472 1498 733 1624 948 1689 1757 1731 103 1652 1642 1353 578 1538 1361 2061 305 1419 1818 15...

output:

327423782
677942762
520489583
325725916
286042036
665006489
670615877
515696489
260076759
58614293
910367494
698288415
469435645
241583361
377752572
82947849
477659442
442181163
9414247
295315236
430938025
256591679
782966145
684500951
150987805
603645775
202618758
655105743
700237529
603052465
9406...

result:

ok 3001 tokens

Test #36:

score: 0
Accepted
time: 32ms
memory: 74132kb

input:

3000 3000
3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 ...

output:

21292721
21289721
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #37:

score: 0
Accepted
time: 30ms
memory: 74076kb

input:

3000 2127
2190 2939 2640 2766 2488 2990 2798 2997 2174 2267 2689 2692 2633 2280 2571 2296 2200 2231 2590 2877 2963 2234 2517 2863 2652 2920 2410 2373 2187 2474 2643 2819 2348 2810 2995 2853 2402 2920 2229 2939 2736 2227 2845 2563 2800 2463 2903 2303 2645 2410 2717 2951 2758 2533 2449 2352 2868 2294 ...

output:

21292721
21289721
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #38:

score: 0
Accepted
time: 20ms
memory: 73904kb

input:

3000 1763
2474 2850 2844 2775 2177 2036 2434 2747 2802 2876 2297 2007 2338 2050 1782 2343 1962 1813 2302 2634 2476 2371 2606 2050 2383 2084 2597 2714 2045 1769 1835 2265 1781 2163 1950 1772 2624 1861 2431 2639 2895 2113 1973 2836 2139 2309 2387 1905 1823 2221 2337 2450 2762 2516 2852 2139 1855 2521 ...

output:

21292721
21289721
16791221
512511986
334834758
882434382
706960640
665267230
289946597
408147435
224519114
586218366
171985713
563297430
556437524
322202503
857434290
90581997
615019010
962912804
9356526
503947387
457550366
396208967
398932791
403738607
32178535
329319256
898069998
426487055
9319434...

result:

ok 3001 tokens

Test #39:

score: 0
Accepted
time: 27ms
memory: 74132kb

input:

3000 3000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 3001 tokens

Test #40:

score: 0
Accepted
time: 27ms
memory: 74196kb

input:

3000 3000
1 1 2 2 1 1 1 1 2 1 2 1 2 2 2 1 1 1 2 2 2 2 2 2 1 2 1 1 2 1 1 2 1 2 1 2 2 1 1 1 2 2 1 1 2 1 1 1 2 2 1 2 2 2 1 2 1 1 2 1 2 2 2 2 1 2 1 2 1 1 2 2 2 1 1 2 2 1 2 2 2 1 1 1 2 2 1 1 1 2 2 2 1 1 1 1 2 2 1 1 1 2 2 2 2 1 1 1 2 2 2 2 2 2 2 2 1 1 1 2 1 2 1 1 2 2 1 2 1 1 1 2 1 1 1 2 2 1 2 2 2 2 2 2 2 ...

output:

961125508
216351256
607434345
95960611
149367534
101972592
124091630
948959940
908881003
664867222
933472221
949596899
643988410
798585393
657048957
860216001
884636867
880772269
264362191
904229293
692288846
427043983
871766155
140962628
689659679
988279946
750506083
816462674
980828203
656739646
6...

result:

ok 3001 tokens

Test #41:

score: 0
Accepted
time: 23ms
memory: 74156kb

input:

3000 3000
3 3 3 3 2 2 1 2 2 2 3 2 1 1 1 1 1 2 2 1 2 2 2 2 2 3 3 3 1 2 3 1 2 3 3 2 3 2 3 1 2 2 1 1 1 1 3 2 1 3 1 1 2 2 3 3 3 3 1 1 3 1 2 1 3 3 2 3 1 1 2 3 3 3 2 3 3 2 3 2 3 1 3 1 3 3 1 2 1 2 1 1 3 1 1 3 2 1 2 3 3 1 1 3 3 1 2 2 1 2 3 2 2 1 3 1 2 3 3 1 1 2 2 1 3 3 2 1 2 1 2 3 1 1 1 2 2 1 2 3 2 2 1 2 1 ...

output:

233918966
739223666
674807459
358769868
722586826
937079613
836512914
535774974
189282009
788309219
578594370
471650001
194518601
199179546
909427340
968960205
975712654
463491469
987873469
260693336
536515128
839000980
167052459
519222841
370188123
962425574
892894924
545919213
271568792
448774406
...

result:

ok 3001 tokens

Test #42:

score: 0
Accepted
time: 19ms
memory: 74072kb

input:

3000 3000
1 1 1 3 2 3 4 4 2 3 2 1 4 1 4 3 3 4 3 3 3 3 3 4 4 4 4 1 3 3 4 2 2 2 3 1 3 1 4 1 2 3 4 3 3 4 2 1 2 2 4 2 2 3 1 1 2 4 2 2 2 3 4 3 2 3 1 1 4 3 1 2 2 2 1 1 1 1 3 1 3 4 2 2 3 4 3 2 4 4 1 2 1 2 4 3 1 1 4 3 2 2 2 2 4 4 4 4 4 3 3 4 4 1 3 1 2 4 1 2 1 2 1 1 2 4 2 1 2 4 4 2 2 3 4 1 4 3 4 3 3 1 2 2 1 ...

output:

979517354
47500384
514909617
235775241
695892671
527374958
255291731
50386337
381154162
292475192
304208737
22618266
159350385
694061895
912165881
647884222
932958894
762436201
158892934
158842204
283784149
369629202
828889618
441444560
194067417
917690310
124312811
330200539
414220022
398628008
571...

result:

ok 3001 tokens

Test #43:

score: 0
Accepted
time: 21ms
memory: 73476kb

input:

3000 705
2574 870 1638 2183 1458 1566 2188 2659 770 1722 2073 2130 1223 2136 3000 2333 1675 327 486 1652 2586 2087 1926 2261 2871 2288 2637 986 536 2853 1742 2129 241 223 1671 1062 2792 2333 2249 2335 2003 1976 437 282 850 1020 2305 2292 805 492 2466 2778 1216 2356 1455 2462 2104 2649 1391 1169 1058...

output:

662264497
737978033
563789071
362398423
30116409
137124147
779979813
732283274
28170064
156986314
879223222
645126091
690521532
801823119
189564194
970112380
597808721
950296179
582538550
177074978
768554502
289352661
549582425
393213308
654597035
852191823
304376329
808295464
96340207
536288902
963...

result:

ok 3001 tokens

Test #44:

score: 0
Accepted
time: 21ms
memory: 74100kb

input:

3000 2225
212 76 1117 2508 929 690 2846 2996 2696 864 1177 775 196 628 995 1518 899 1367 63 7 1074 796 1923 2996 662 1346 768 223 2996 2634 25 2429 2929 1468 1346 951 1672 1367 2044 2247 1517 1939 439 980 438 789 741 410 2607 1713 2175 662 181 430 2467 360 2196 2160 2329 2359 2668 2794 875 2643 146 ...

output:

294901318
485808928
820587070
768296506
311722904
1192507
281391794
354626014
493786598
315600188
166049402
367427872
281121065
279129112
830413920
148129856
323681498
185389170
491220360
950442436
959765420
311415510
548958889
452368487
686040392
693400245
555652717
724253241
911881825
352025746
20...

result:

ok 3001 tokens

Test #45:

score: 0
Accepted
time: 20ms
memory: 73808kb

input:

3000 712
2193 1895 358 1306 84 595 2160 552 1317 2396 2778 869 1922 842 2016 1579 1235 2471 599 982 1168 845 491 1663 446 1346 1214 1493 2764 894 1176 2476 2597 1121 1931 1309 770 1823 2836 2700 283 937 1104 2804 2694 1502 1036 1012 696 1054 344 2884 10 743 2144 579 2029 2477 1359 474 2543 286 2014 ...

output:

569030965
202615598
260623647
443368298
299166776
682103292
461770878
267229561
323285482
572620531
837651513
102982019
296651492
365422854
473332715
591928216
12139072
17330491
801677814
176873924
261015363
450600289
957966125
706614341
395816840
149048838
228374418
977783051
966954747
315171062
19...

result:

ok 3001 tokens

Test #46:

score: 0
Accepted
time: 24ms
memory: 74240kb

input:

3000 2504
929 2457 1464 2011 45 1076 663 29 592 1006 99 711 1671 2621 1849 741 1980 2355 227 2029 237 1414 382 928 49 1796 735 846 324 1930 2334 954 2920 49 1221 1212 2372 779 1866 2885 2074 1577 1068 2164 2879 1527 1556 2911 1073 258 1998 1237 2200 2491 923 2061 1527 2289 2121 2835 1254 2331 184 28...

output:

667591880
609947512
723470287
589230705
422197141
447906653
891104818
526710328
642173563
925300433
405107377
400771219
227004740
296973274
697767828
868892955
289794138
394979392
824355212
613921006
447226623
439041781
535705195
125028155
329627503
783211592
786674082
37132556
539636961
228034122
9...

result:

ok 3001 tokens

Test #47:

score: 0
Accepted
time: 18ms
memory: 73388kb

input:

3000 747
1162 1133 1191 2382 744 1460 1 800 557 743 307 717 2350 98 878 2020 2424 2956 2285 784 1875 944 1269 1921 2326 2566 23 261 1339 776 681 686 954 1036 1938 1795 1486 1132 839 915 2632 380 2127 382 27 258 147 498 1268 1779 2949 1895 356 728 1969 435 2610 1879 2716 572 2608 504 2639 2147 2758 2...

output:

702802177
97345347
605166727
611310495
486785209
946814483
945098417
653157673
65908299
471994979
73036341
818429110
580782719
466437631
75420324
993519009
5829093
628068116
248532239
438025220
384598972
340237677
948340822
690144465
203310183
799139671
498530850
428353934
734293935
537814529
684856...

result:

ok 3001 tokens

Test #48:

score: 0
Accepted
time: 20ms
memory: 73944kb

input:

3000 2152
2352 919 1296 2902 390 2996 2135 164 762 2501 1383 1583 1977 540 2882 1472 2833 710 2069 347 1189 1341 552 591 1523 1478 1486 1484 2033 1207 1608 2143 203 171 2100 1769 2414 2122 1044 2300 1400 1274 2601 1232 1838 2806 440 1345 2299 748 2845 1596 1229 806 2968 2451 2811 1295 1019 471 1627 ...

output:

782223101
677414549
495988932
945045273
39542319
955750659
359587943
879496314
309613935
72398735
459440641
105009165
132494679
832423524
819984500
773189367
13197029
17410735
124486331
217972651
379666949
859582291
540276342
356260248
976211206
316342215
859726015
722062297
334775846
546541547
1337...

result:

ok 3001 tokens

Test #49:

score: 0
Accepted
time: 19ms
memory: 73156kb

input:

3000 282
234 2944 2953 734 2829 945 73 2768 971 771 1074 49 2113 2311 872 201 1102 2050 1512 1351 539 2947 261 2206 708 2446 795 224 2591 1794 2237 192 1290 1254 574 2551 1760 167 2839 2428 2777 1160 1481 2312 1416 176 1103 978 933 2795 2625 776 2241 71 189 1722 235 2130 937 2252 1828 1960 2910 2506...

output:

448965005
116746487
609449241
40600227
279084342
41830531
204122890
382444044
519396738
577394771
852774590
536389636
569035766
660145722
213448765
263202065
681389619
976060473
382727746
312709203
555806247
743150717
729469412
589303038
612898068
939778611
307441616
343186001
374172470
835674639
99...

result:

ok 3001 tokens

Test #50:

score: 0
Accepted
time: 19ms
memory: 72908kb

input:

3000 415
2098 5 1534 1658 669 1512 1020 1478 2140 1316 2255 2766 1765 1531 879 1492 1612 133 2710 528 2636 53 1628 391 554 529 2252 482 2251 79 2489 2165 1727 2188 1981 1518 466 594 1220 2234 2823 333 2506 1841 305 598 166 2082 2308 532 771 1431 2572 621 1059 2800 2049 922 548 2508 2019 2094 2574 10...

output:

260976513
7956087
991796378
582128905
596131572
872576898
466726821
290476452
963398379
597424434
726740741
426772245
22857115
157646843
649918379
628228604
89435852
214448606
36979703
206266898
687326498
327235021
673401174
94791375
494352177
266682500
819158978
628869015
940762920
962333662
376113...

result:

ok 3001 tokens

Test #51:

score: 0
Accepted
time: 23ms
memory: 73776kb

input:

3000 1567
1349 978 1682 1159 2486 589 2612 1937 315 2702 872 688 2569 1186 795 158 559 1854 2888 614 2325 1548 2532 2633 2283 2828 2960 1281 42 1703 2114 610 745 49 585 1826 1737 1420 2656 1409 2950 1633 2139 2367 506 58 1726 858 2851 452 2308 2808 2193 2619 1745 204 1875 1369 2607 2296 1236 1113 10...

output:

542437761
36781080
485348595
782230499
364576798
960328180
444262874
380052419
812566397
822649766
331517422
946320964
914646443
935306039
373308242
623386920
404237274
542654202
770964653
123759209
308183732
564864839
880021166
187992737
414489200
818761527
387367433
769341267
848234028
628886895
6...

result:

ok 3001 tokens

Test #52:

score: 0
Accepted
time: 16ms
memory: 73968kb

input:

3000 493
1430 1606 1536 2205 1219 1260 1482 1037 70 2827 2104 3000 2759 2816 2491 554 612 2065 154 1422 2142 1148 363 1305 1618 968 350 202 1095 2924 2102 918 2661 184 2664 1657 81 2333 699 2628 201 2649 1728 2119 1869 1700 243 709 1915 997 2325 364 2280 2146 2900 1768 1217 344 2597 2405 1742 1205 1...

output:

837089
246978565
406867713
361583485
66469926
30126391
294496468
763312388
391129734
731597604
691066317
717124296
39394277
491545674
714470655
793257911
808208759
816562272
302799121
111159885
515147101
902245161
9760261
502492881
281695575
967368247
432718176
384827881
398802951
473784419
21183763...

result:

ok 3001 tokens

Extra Test:

score: 0
Extra Test Passed