QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#500315#9159. 登山tzl_Dedicatus54525 595ms50644kbC++144.8kb2024-08-01 09:28:112024-08-01 09:28:11

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 0ms
memory: 18196kb

input:

1
4
6
1 1 1 0
1 1 1 0
3 1 2 1
3 2 2 0
4 2 3 1
6
1 1 1 0
2 1 2 0
2 1 2 0
1 1 1 0
4 1 2 2
6
1 1 1 0
1 1 1 0
3 1 2 1
4 2 2 0
3 1 1 0
6
1 1 1 0
1 1 1 0
3 1 1 0
4 2 3 1
2 1 2 0

output:

1 4 10 1 5 
3 4 7 1 10 
1 2 5 2 2 
2 2 5 3 3 

result:

wrong answer 3rd numbers differ - expected: '2', found: '10'

Pretest #2:

score: 0
Wrong Answer
time: 0ms
memory: 20240kb

input:

2
4
300
1 1 1 0
2 1 2 1
3 1 3 1
1 1 1 0
3 1 3 0
4 2 2 3
7 1 2 0
8 2 2 2
7 1 3 4
7 3 4 4
11 1 6 1
12 1 3 5
10 2 5 5
13 1 5 4
13 4 7 2
15 8 8 8
16 8 9 4
15 1 9 6
18 4 5 6
19 3 8 8
18 5 10 2
19 3 7 5
23 5 7 6
22 6 8 10
23 4 7 3
24 1 4 6
24 8 12 9
28 7 11 8
26 1 9 7
28 1 3 1
29 2 5 0
32 1 6 4
30 5 12 7
...

output:

19 626 28756 1 646 1695958 3420672 1695958 3450699 113541021 529621106 674786802 1725359 174759146 875419622 19 873694263 981333551 643162127 321429916 230532116 908803911 819073794 115265735 599020291 887481696 464266265 542857603 477415986 195655264 857457947 864109017 964218842 726586698 38983781...

result:

wrong answer 2nd numbers differ - expected: '18', found: '626'

Pretest #3:

score: 0
Wrong Answer
time: 3ms
memory: 20240kb

input:

3
4
300
1 1 1 0
2 1 2 1
3 3 3 0
2 1 2 1
3 1 3 1
3 1 3 0
4 1 4 1
6 4 4 2
9 3 5 1
7 3 4 2
10 2 5 4
12 1 5 2
11 1 3 2
12 3 6 6
13 6 6 3
13 3 8 0
14 3 5 0
16 3 5 5
16 6 9 5
20 2 7 3
20 3 7 9
21 7 9 2
23 3 4 8
21 4 9 6
24 11 12 2
25 3 4 1
27 7 13 5
26 1 8 3
29 2 4 6
29 6 15 14
29 5 5 10
32 6 10 11
30 1 9...

output:

20 578 600 21 23015 1796 1199 1012061 47566866 4789 429420861 656455888 9557 1035674 243865014 48602541 2394 477999788 620640966 492574260 136234338 158749328 448228079 480519945 808780649 344285029 478023402 865738563 641896119 2496564 939042543 446468283 524009235 771874576 935343624 477852085 380...

result:

wrong answer 2nd numbers differ - expected: '18', found: '578'

Pretest #4:

score: 0
Wrong Answer
time: 25ms
memory: 25392kb

input:

4
4
5000
1 1 1 0
1 1 1 0
1 1 1 0
4 1 2 0
5 2 3 2
5 1 3 1
6 2 3 2
6 2 3 1
8 3 5 4
8 4 5 3
11 2 4 4
11 1 3 3
11 5 6 3
12 1 1 6
15 1 5 3
15 1 6 6
17 5 6 5
17 6 8 4
18 7 9 3
19 1 10 3
19 2 4 7
20 1 9 3
23 8 11 7
22 2 5 4
23 7 8 1
24 1 9 8
26 9 11 7
28 8 10 13
29 1 11 3
30 9 9 14
31 11 15 4
32 8 16 8
31 ...

output:

1 1 28 1455 98882 1484 8502340 1483 1484 935254433 355573224 943855655 29 926150705 229090878 580220934 321079045 540325975 955713193 351394918 271238289 32527539 130646706 405782132 360833255 252690707 768822224 131258362 386604655 308061511 840368940 842761146 10232530 536790753 753144347 8715773 ...

result:

wrong answer 4th numbers differ - expected: '83', found: '1455'

Pretest #5:

score: 0
Wrong Answer
time: 26ms
memory: 23400kb

input:

5
4
5000
1 1 1 0
1 1 1 0
1 1 1 0
2 1 2 0
3 1 1 1
4 1 1 0
6 1 3 2
7 1 3 1
8 2 2 0
8 1 3 2
11 3 5 1
10 1 5 4
13 1 2 4
12 3 4 3
15 3 5 2
15 2 6 2
15 1 3 3
16 7 7 3
19 1 7 4
18 2 3 4
20 1 10 5
21 2 3 8
21 4 9 6
22 7 9 3
24 2 6 8
25 1 3 4
25 3 4 1
26 3 4 3
29 5 11 9
28 8 11 12
29 7 9 11
32 5 12 5
32 11 1...

output:

2 35 2 3 1959 5 154726 8 158680 14538295 702579442 474081 632761 902003873 990487984 717274457 212880442 960280266 846387970 6011073 813749688 116639962 316936705 205797884 334780198 867691189 527453952 238239771 833914419 717274422 778291992 839925492 562168849 300058327 777498428 976073713 7316358...

result:

wrong answer 5th numbers differ - expected: '34', found: '1959'

Pretest #6:

score: 5
Accepted
time: 517ms
memory: 50516kb

input:

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

output:

7 90 1343 13340 200010 2186770 17480820 279693113 800242414 420706509 214087588 358274752 946289212 530647994 955227776 663050301 438245147 621009062 780623708 80919478 728275212 743623748 978006196 735181462 256088384 612217572 335562169 696082683 110948988 53450390 637356472 107616671 988788196 54...

result:

ok 399996 numbers

Pretest #7:

score: 5
Accepted
time: 549ms
memory: 47040kb

input:

7
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
3 1 1 0
1 1 1 0
3 1 1 0
7 1 1 0
6 1 1 0
9 2 2 0
6 1 1 0
6 1 1 0
7 2 2 0
9 2 2 0
11 1 1 0
11 2 2 0
14 4 4 0
12 1 1 0
16 3 3 0
15 1 1 0
17 3 3 0
20 5 5 0
18 4 4 0
20 2 2 0
19 2 2 0
22 5 5 0
22 2 2 0
22 3 3 0
23 5 5 0
27 7 7 0
26 6 6 0
27 5 5 0
31 1 1 0
33 9 9 0
34 2 ...

output:

1 1 1 1 31 2 2 94 31 1298 33 1 126 41443 62 95 35 93 1490650 94 49108564 2 41443 62 31502098 1491949 41443 1 1 882058713 1298 808538694 650336433 808538694 808538695 53283330 1298 31502098 1 31502098 319947267 692436002 360370658 1534689 1298 41443 692394559 41443 518136386 1298 972986764 32 6923530...

result:

ok 399996 numbers

Pretest #8:

score: 0
Wrong Answer
time: 532ms
memory: 50520kb

input:

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

output:

12 131 1047 11516 115159 1035384 11389223 68220179 818642136 839391296 111001182 154548470 547228831 30051022 389959371 675145817 790940666 24261262 218351346 385284321 709825906 520566825 899427700 321912846 258086906 842467248 594494630 518082962 227529414 594460498 24801098 988168427 585648173 46...

result:

wrong answer 2nd numbers differ - expected: '23', found: '131'

Pretest #9:

score: 0
Wrong Answer
time: 549ms
memory: 45864kb

input:

9
4
100000
1 1 1 0
2 2 2 0
2 1 1 1
2 2 2 1
1 1 1 0
6 1 1 1
3 1 1 0
6 1 1 0
7 1 1 2
6 2 2 0
8 3 3 2
9 1 1 1
9 1 1 0
12 5 5 2
14 1 1 3
13 4 4 3
13 1 1 3
14 3 3 3
17 5 5 2
19 1 1 0
18 3 3 3
22 3 3 5
23 1 1 0
21 5 5 3
22 4 4 4
23 7 7 2
24 6 6 3
25 2 2 1
29 6 6 7
29 8 8 3
31 8 8 7
32 6 6 5
31 5 5 7
31 2 ...

output:

4 6 4 1 23 23 11 688 23 1 5 2755 18550 1 18550 2 7575 648562 1 19456837 4820 3444 4132 544142874 688 1 688 806478028 688 792317818 648585 648562 807126590 619918850 792317818 806478028 957665627 276926000 957665627 947109639 586391283 58362664 19456837 792317818 149552067 953385192 619918873 3448091...

result:

wrong answer 3rd numbers differ - expected: '0', found: '4'

Pretest #10:

score: 5
Accepted
time: 561ms
memory: 50628kb

input:

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

output:

27 1160 73079 5773240 508043960 401903691 408194108 913457210 404309453 850776989 162033550 491800762 693950334 88591672 90581013 261837127 124549390 607776285 954584563 426982262 910735533 125508942 301425049 369545791 349157696 256736908 276834134 449249498 408190411 362993320 980271019 745442146 ...

result:

ok 399996 numbers

Pretest #11:

score: 5
Accepted
time: 578ms
memory: 45796kb

input:

11
4
100000
1 1 1 0
1 1 1 0
2 1 2 0
1 1 1 0
2 1 2 0
6 1 3 0
5 1 2 0
7 2 3 0
6 2 2 0
8 1 3 0
9 2 3 0
9 3 5 0
10 2 4 0
13 2 4 0
12 4 6 0
13 1 6 0
16 1 4 0
18 6 7 0
18 2 4 0
20 1 6 0
21 2 9 0
20 1 3 0
23 1 4 0
22 1 8 0
24 10 10 0
23 3 5 0
24 3 11 0
26 8 11 0
27 1 9 0
30 2 11 0
28 12 12 0
32 4 8 0
32 9 ...

output:

41 1 42 3 3401 407995 8 65275757 3484 12 30977333 131377791 3443 65687153 608294415 197064986 558803128 3442 391883539 973952531 292262895 548293486 864139803 925368887 65687235 614731260 251165603 65687194 646118904 822181649 995485114 956758427 65275757 656989819 750355997 665993179 321752162 1997...

result:

ok 399996 numbers

Pretest #12:

score: 5
Accepted
time: 573ms
memory: 46964kb

input:

12
4
100000
1 1 1 0
1 1 1 0
3 1 2 0
3 1 2 0
4 1 1 0
4 1 3 0
6 2 4 0
7 2 4 0
9 1 4 0
8 1 3 0
11 3 3 0
11 5 6 0
12 1 2 0
14 3 3 0
13 2 7 0
16 2 3 0
17 2 4 0
17 7 9 0
17 3 8 0
20 2 6 0
21 10 11 0
21 6 11 0
21 7 9 0
23 3 4 0
24 5 11 0
26 6 9 0
26 5 7 0
27 12 13 0
29 10 10 0
28 1 3 0
31 13 15 0
32 7 13 0...

output:

1 44 3430 45 363401 10424 49055705 17373 31271 763087444 528293936 364247389 57980118 763087444 558370737 701077016 687461217 3475 530193136 875194506 45 47291471 587072521 233025799 902397684 501363487 984008256 763090918 763087444 553932106 460519388 415423761 485110453 526953701 435687917 4594610...

result:

ok 399996 numbers

Pretest #13:

score: 0
Wrong Answer
time: 544ms
memory: 50576kb

input:

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

output:

28 1259 81806 7035288 661315784 864025730 863917953 567015965 632851874 132702554 521696651 772637351 113900451 137279442 603264778 217691525 349804460 404652220 953978823 374459796 251330892 736212576 256285225 720466157 784383517 354643799 498450765 273310818 122921962 167030763 201005620 65790467...

result:

wrong answer 2nd numbers differ - expected: '55', found: '1259'

Pretest #14:

score: 0
Wrong Answer
time: 587ms
memory: 46684kb

input:

14
4
100000
1 1 1 0
2 1 1 1
1 1 1 0
2 1 2 1
4 2 2 1
5 2 2 1
7 1 4 1
8 2 5 3
8 5 5 3
10 2 3 5
11 1 6 5
10 1 4 5
12 5 8 1
12 3 6 5
13 3 6 2
15 2 5 8
17 6 7 6
18 6 8 5
17 10 10 1
18 4 5 5
20 4 11 7
22 8 9 4
23 9 13 12
24 9 13 10
24 6 8 7
26 3 13 13
26 11 14 11
28 11 11 2
27 9 16 8
30 6 12 0
31 13 17 16...

output:

38 38 2 3039 1 322095 46059547 325173 119875102 403886935 293142938 212644502 325173 596246258 46384719 189123055 909668259 166256744 501562056 697029873 376794563 59012220 598886239 166259821 161356997 114406638 166259821 119875102 420452076 551004683 300698357 21333644 863289695 712067359 23889589...

result:

wrong answer 2nd numbers differ - expected: '0', found: '38'

Pretest #15:

score: 0
Wrong Answer
time: 553ms
memory: 45152kb

input:

15
4
100000
1 1 1 0
1 1 1 0
3 1 1 1
3 2 2 0
4 1 2 0
5 1 1 2
2 1 2 0
3 1 2 0
7 3 3 1
9 3 3 1
8 1 2 1
10 1 5 1
8 2 3 0
9 1 2 1
11 3 3 3
14 1 2 2
15 1 3 1
15 2 4 0
15 1 4 3
17 3 4 2
19 5 5 2
21 4 6 4
21 6 6 2
24 2 4 6
24 3 7 4
22 3 4 0
23 1 5 5
23 5 6 6
26 2 8 3
30 5 9 8
27 4 6 1
27 3 7 2
31 6 8 7
32 5...

output:

8 69 138 140 207 419 79 8691 698 70 87 1327 773 1494712 69 6175 1503472 321336799 1503473 42373 371940881 49575 119830 49321 190338 757935105 98975 87 183302 14063 115143116 311562716 7027 36540219 907449027 907440267 653277075 452968432 418153825 604849194 694772392 452968432 348994068 51936222 401...

result:

wrong answer 3rd numbers differ - expected: '0', found: '138'

Pretest #16:

score: 0
Wrong Answer
time: 580ms
memory: 46644kb

input:

16
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
4 1 1 1
1 1 1 0
2 1 2 0
7 2 3 2
3 2 2 0
6 2 2 0
8 2 3 0
11 1 5 1
11 2 5 3
11 3 3 4
14 2 6 2
14 2 3 0
12 2 3 0
12 4 5 0
16 3 7 1
19 3 7 2
18 3 4 2
21 2 4 0
22 1 3 0
21 1 6 6
21 4 5 3
21 1 7 4
23 1 10 2
26 1 6 4
23 9 10 0
25 7 8 1
25 3 9 2
27 9 11 3
29 4 11 7
33 2 6...

output:

55 2 1 1 2 6049 949637 1 1 193725892 763914977 955742 778726479 194681634 364520922 194675529 829240379 169845393 973408112 98807262 459377087 730910737 888399843 593798926 778549339 82205122 668698780 848255755 519451070 789592637 6105 796579866 703325732 550037440 407743516 913308108 193020506 349...

result:

wrong answer 4th numbers differ - expected: '0', found: '1'

Pretest #17:

score: 0
Wrong Answer
time: 589ms
memory: 47032kb

input:

17
4
100000
1 1 1 0
2 2 2 0
1 1 1 0
1 1 1 0
5 1 2 1
5 1 2 1
6 2 2 2
7 1 1 0
8 1 1 3
8 3 4 2
6 1 3 2
9 2 4 1
8 4 4 0
11 1 4 2
10 3 3 1
11 2 5 0
14 2 3 0
17 4 4 2
14 3 4 4
17 1 4 2
19 2 6 6
17 1 1 5
18 1 5 3
23 3 7 2
22 2 3 7
24 4 6 3
23 1 7 4
23 7 7 5
27 5 6 2
26 6 9 5
28 1 7 4
30 1 9 5
29 2 6 6
29 4...

output:

2 1 1 54 7017 110 1276984 275 1284001 285995025 7072 165 6427240 287279080 7017 498293206 19274648 286912212 7071 785572232 573817407 657449646 56539943 287279081 786489474 86093943 889555159 711837330 343091717 1284056 336088385 372838514 446061580 223020576 1284055 232965481 895213591 36745302 900...

result:

wrong answer 5th numbers differ - expected: '51', found: '7017'

Pretest #18:

score: 0
Wrong Answer
time: 579ms
memory: 47060kb

input:

18
4
100000
1 1 1 0
2 1 2 1
2 1 2 0
2 1 2 0
3 3 3 1
5 1 3 1
4 2 3 2
7 1 3 1
8 2 4 0
9 1 4 1
8 2 3 3
12 2 5 3
9 2 3 2
11 1 1 1
11 2 4 1
14 1 6 2
15 7 7 0
17 2 4 4
18 6 7 1
17 2 6 6
17 5 5 1
20 2 5 7
22 1 7 3
23 6 10 7
25 4 4 6
25 8 11 7
26 2 10 3
26 6 7 6
27 12 12 2
28 1 1 0
29 8 11 11
32 3 9 12
30 2...

output:

60 62 304 6413 1 1058084 1155 222191166 365 634733074 1884 1520 894087330 497209369 223255663 476394741 745831617 119092227 958488924 119098700 595499854 69731575 192748942 561354315 52627648 958882632 695871478 389660912 918456353 695871478 384773585 315670612 591724169 326732183 222191166 68658469...

result:

wrong answer 2nd numbers differ - expected: '2', found: '62'

Pretest #19:

score: 0
Wrong Answer
time: 584ms
memory: 47040kb

input:

19
4
100000
1 1 1 0
1 1 1 0
2 1 1 1
4 1 3 1
1 1 1 0
6 2 2 1
5 2 2 1
6 1 1 0
5 2 3 1
9 1 3 0
10 1 5 3
11 2 4 1
10 2 5 2
13 1 2 2
15 1 3 0
16 1 3 1
16 3 4 6
14 6 6 0
18 6 6 1
19 1 7 2
21 6 6 4
20 9 9 3
21 1 4 5
22 4 8 7
24 2 9 8
26 7 8 0
25 1 2 8
28 1 9 8
26 2 5 3
30 2 2 1
27 9 9 3
30 4 9 2
29 3 7 8
3...

output:

38 1 3533 512247 5 1 3533 18 92709602 67 93225421 244 359557657 1196 3277 4717 330 969464644 19 974394612 883624963 1 136607920 677907812 283401791 519313 841571171 767110434 18091661 283401791 3533 307489757 946829599 836426722 482409528 214825925 45725305 836426683 29657854 608248683 155055383 575...

result:

wrong answer 3rd numbers differ - expected: '37', found: '3533'

Pretest #20:

score: 0
Wrong Answer
time: 578ms
memory: 47156kb

input:

20
4
100000
1 1 1 0
2 1 1 0
3 1 3 2
4 4 4 1
5 1 5 0
6 1 6 3
4 2 2 1
3 3 3 2
8 1 1 3
7 2 5 0
10 1 3 4
11 1 7 5
9 1 1 3
14 1 3 1
12 4 6 4
16 1 4 7
15 2 4 4
17 2 7 1
19 6 9 6
18 4 6 2
18 2 7 4
18 2 4 3
22 1 7 0
19 3 9 6
20 4 7 7
26 5 10 9
27 2 7 10
27 3 10 6
29 8 9 10
26 7 8 5
31 3 9 1
31 5 13 5
32 10 ...

output:

52 5615 909420 3660299 18301494 68630589 192768753 28233 173251927 114384297 129889336 205891766 225863 1326945 303230951 541475051 5048069 545371451 201019428 33900 8221486 1581041 14856263 800056054 560122730 282806798 284620241 196374908 303141263 141710357 477885871 528162192 193683840 800050387...

result:

wrong answer 2nd numbers differ - expected: '103', found: '5615'


Final Tests

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 20212kb

input:

1
4
6
1 1 1 0
2 1 2 0
3 2 3 0
3 2 2 2
5 4 4 3
6
1 1 1 0
1 1 1 0
3 1 1 1
3 1 1 0
4 2 3 1
6
1 1 1 0
2 1 2 1
2 1 2 0
2 2 2 0
2 1 2 0
6
1 1 1 0
2 1 1 1
1 1 1 0
4 1 2 1
5 1 2 2

output:

4 15 5 5 1 
1 2 5 2 3 
5 6 6 1 6 
1 1 2 5 7 

result:

wrong answer 2nd numbers differ - expected: '11', found: '15'

Test #2:

score: 0
Wrong Answer
time: 2ms
memory: 20364kb

input:

2
4
300
1 1 1 0
2 1 1 0
1 1 1 0
4 1 2 1
2 2 2 0
6 1 2 1
3 1 3 0
4 1 2 1
6 1 1 1
10 2 3 0
6 2 3 2
11 2 4 0
11 4 5 2
14 4 4 5
10 1 3 2
12 3 4 0
12 2 4 1
15 7 7 5
17 3 4 1
16 4 4 0
21 2 2 5
20 2 4 2
20 2 2 1
23 3 5 1
20 3 4 0
22 4 5 0
26 5 7 1
28 1 8 1
27 2 6 6
26 1 5 2
30 1 3 6
28 1 1 4
28 2 7 6
34 2 ...

output:

34 69 3 4 1664 1698 104 4 13519 18615 99598 15217 1700 1665 60835 7069724 1699 1 558508161 288958 1444756 14341972 7069724 7170986 415523731 8607701 894558673 877517233 43023322 981202878 170283556 894558673 564086391 877517232 238940076 287491333 948589318 145926960 511139626 10402250 582503667 649...

result:

wrong answer 4th numbers differ - expected: '1', found: '4'

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 20368kb

input:

3
4
300
1 1 1 0
2 1 2 0
3 1 3 0
4 1 3 2
4 1 4 2
3 1 2 0
5 1 5 0
4 1 2 3
4 1 4 3
5 1 2 2
8 5 6 3
10 1 3 2
9 4 5 3
13 4 6 1
10 1 4 3
12 4 5 5
13 1 2 1
13 2 3 4
18 6 7 6
17 6 8 3
19 1 3 3
21 9 9 4
22 2 4 5
21 5 7 4
22 1 5 1
23 3 9 3
24 1 1 6
25 1 2 7
28 1 8 6
30 1 11 2
30 4 9 0
32 2 10 3
30 6 8 8
32 6 ...

output:

25 1124 60645 370743 61795 1149 1360533 61795 3385797 431388 2288528 219953216 26 1150 3447591 4577030 223339039 754609991 26 9092291 470691658 8658629 119546863 9524803 450456954 8658628 37918862 18617094 563849692 603753717 584970707 173529142 553670880 973155359 977949004 430224549 476184575 8839...

result:

wrong answer 2nd numbers differ - expected: '249', found: '1124'

Test #4:

score: 0
Wrong Answer
time: 24ms
memory: 21380kb

input:

4
4
5000
1 1 1 0
2 1 2 1
1 1 1 0
4 1 1 0
1 1 1 0
3 2 3 2
6 1 2 1
5 1 2 0
8 3 3 1
10 1 3 2
8 2 2 0
11 1 5 4
11 3 5 3
13 4 5 3
12 3 3 1
16 1 5 1
13 4 5 5
18 1 5 5
17 1 6 5
17 1 5 4
20 5 7 4
19 1 1 7
23 1 8 3
23 4 6 4
23 8 9 7
24 3 4 2
27 3 6 3
28 5 8 9
26 1 4 4
27 3 10 8
28 8 11 9
31 4 6 3
31 10 10 2
...

output:

3 8 1 2 41 4 2992 3 289933 35951691 12217 257429121 3034 3033 48827 195267 350281720 582118784 262379 259344 3034 811137407 827657937 293670745 745293600 527804742 138396472 227536963 492342805 385685373 904625536 745293558 149784420 969954697 868380879 702917499 513926970 755336985 414235320 879959...

result:

wrong answer 2nd numbers differ - expected: '2', found: '8'

Test #5:

score: 0
Wrong Answer
time: 17ms
memory: 23440kb

input:

5
4
5000
1 1 1 0
2 2 2 1
3 1 2 2
1 1 1 0
3 1 1 0
4 2 2 3
5 1 1 1
8 3 3 1
8 2 3 2
6 4 4 3
10 2 4 2
10 2 4 2
12 4 5 3
11 2 3 4
11 5 5 1
14 1 3 5
16 1 1 2
15 1 3 0
17 1 4 2
18 3 7 3
21 5 8 6
18 6 7 2
22 1 5 5
24 4 7 4
21 5 7 7
24 2 9 0
26 9 9 2
24 5 9 9
29 8 11 2
30 3 7 4
30 8 9 6
31 5 10 6
30 3 5 4
34...

output:

34 2107 4248 6 202237 2107 35 1 98 25884229 245 42 693 26290810 809842022 2072 913667378 52377276 3108 581469197 363654177 35 73103748 751351513 204379 698232675 1 400934230 628713032 13015615 254431115 292043382 306788806 204378 884100583 737206879 965053056 430630477 68345670 776385461 123467601 2...

result:

wrong answer 2nd numbers differ - expected: '33', found: '2107'

Test #6:

score: 5
Accepted
time: 520ms
memory: 50524kb

input:

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

output:

13 116 1159 11577 150385 1654119 16540031 198480359 787928493 734581969 103223677 120676063 963754385 618704320 378636756 206516872 241703175 693677871 68103114 817225791 671888130 60162705 601476665 456558188 30918290 836035627 422508580 961059777 721412290 780076554 866081801 542037914 961741065 6...

result:

ok 399996 numbers

Test #7:

score: 5
Accepted
time: 565ms
memory: 46020kb

input:

7
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
1 1 1 0
5 2 2 0
5 2 2 0
7 1 1 0
8 1 1 0
6 1 1 0
7 3 3 0
9 3 3 0
12 2 2 0
10 2 2 0
13 1 1 0
13 4 4 0
13 7 7 0
15 1 1 0
15 7 7 0
16 7 7 0
19 1 1 0
18 8 8 0
19 2 2 0
23 1 1 0
23 5 5 0
24 8 8 0
23 6 6 0
27 3 3 0
28 4 4 0
26 12 12 0
29 6 6 0
30 1 1 0
31 12 12 0
30 9 9 0...

output:

1 1 1 21 1 376 9022 162020 2 1 3879458 77588784 1 475771479 9043 1 475771500 836010287 21 836010287 21 723456114 723627157 3879458 171043 462547233 193433576 974019581 162021 821331611 162021 376 162020 686601685 418942555 31199510 217891022 462547233 836010287 944144826 217891022 575663750 44315401...

result:

ok 399996 numbers

Test #8:

score: 0
Wrong Answer
time: 535ms
memory: 50568kb

input:

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

output:

7 97 1260 8813 132098 528295 6339539 100904329 212607594 601712070 938821897 516525166 173501600 796194103 610685606 685866190 92941726 557649096 791228479 924574222 40532649 717704653 429243089 805573887 799933261 211688781 866422027 92383119 506885358 178401415 316390150 387409525 950381566 245489...

result:

wrong answer 2nd numbers differ - expected: '13', found: '97'

Test #9:

score: 0
Wrong Answer
time: 573ms
memory: 46684kb

input:

9
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
3 1 1 0
4 2 2 1
6 2 2 2
6 1 1 2
8 3 3 2
9 1 1 4
8 4 4 0
9 4 4 0
12 6 6 3
13 3 3 4
13 6 6 3
15 5 5 0
15 2 2 7
15 4 4 2
17 5 5 2
18 5 5 0
18 4 4 6
19 2 2 8
22 8 8 9
23 3 3 10
24 6 6 12
25 7 7 13
24 1 1 11
27 3 3 7
27 12 12 2
28 4 4 0
30 3 3 9
31 15 15 15
32 1 1 7
31 ...

output:

1 1 15 1 419 15 5012 89796 89796 1 1975497 31607937 89796 758500691 5012 433932071 2155089 357526799 89796 1975497 520262512 424575809 654649079 518757029 758500691 516277852 101807811 419 695310112 22632341 965946478 642967309 13931525 269744495 15 654649079 85487888 798645017 477809663 147418274 1...

result:

wrong answer 5th numbers differ - expected: '14', found: '419'

Test #10:

score: 5
Accepted
time: 547ms
memory: 50600kb

input:

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

output:

16 527 25807 1883910 167667973 634982620 705207129 488881034 887725160 151025554 347960978 855383206 80305903 380559379 538908054 777587576 260990688 523673420 353610155 624705377 700258326 228676702 200177699 984634103 68249951 263072670 517709689 650106087 34684922 592160972 944601706 376074738 79...

result:

ok 399996 numbers

Test #11:

score: 5
Accepted
time: 586ms
memory: 46896kb

input:

11
4
100000
1 1 1 0
2 1 2 0
3 1 2 0
3 1 2 0
5 3 4 0
5 1 3 0
5 2 3 0
8 1 3 0
9 2 5 0
10 3 5 0
11 4 6 0
10 1 3 0
11 6 8 0
13 4 8 0
13 2 7 0
14 1 3 0
17 3 8 0
17 5 7 0
19 10 11 0
19 1 2 0
20 5 12 0
22 12 12 0
22 8 10 0
23 6 14 0
23 2 8 0
25 2 9 0
27 6 9 0
26 9 15 0
29 3 10 0
30 9 9 0
30 12 13 0
32 14 1...

output:

37 2478 2515 242769 38 245284 32040440 39124800 942462595 336524633 32285687 63297973 516597219 32285725 15628766 418384838 352153362 613054463 541763722 33194948 718423411 374189456 71408009 227001638 334965261 356495372 886316800 521955760 368374612 227507583 587492770 498900953 709154717 10323060...

result:

ok 399996 numbers

Test #12:

score: 5
Accepted
time: 569ms
memory: 47348kb

input:

12
4
100000
1 1 1 0
2 1 2 0
3 2 3 0
4 1 3 0
2 1 1 0
4 2 2 0
3 1 2 0
8 1 4 0
8 1 3 0
5 2 5 0
9 1 4 0
10 3 5 0
11 1 6 0
11 3 6 0
11 3 3 0
14 2 6 0
17 3 7 0
14 2 4 0
14 4 6 0
18 2 8 0
18 6 9 0
21 8 10 0
22 5 5 0
20 6 8 0
22 1 4 0
24 3 9 0
26 3 8 0
25 3 3 0
24 6 7 0
25 5 9 0
27 2 9 0
32 4 6 0
32 9 11 0
...

output:

69 7796 1278127 262008169 69 7796 39327 94385 55058 777304836 141577 7866 482180153 1285993 1278127 465685418 825856966 42346779 575383498 990228081 154169563 7866 833831197 726620149 749228357 498747852 817824963 482180153 41068652 699428075 474778269 447467594 402643074 564999930 7866 869370470 84...

result:

ok 399996 numbers

Test #13:

score: 0
Wrong Answer
time: 547ms
memory: 50644kb

input:

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

output:

25 1149 72361 5860067 533192562 678934972 155910328 396583498 38410493 211203032 753655102 699830562 340595620 664478034 327623694 403232516 943136615 417264110 557597633 28142332 774027237 238932426 376271323 863196487 747965125 978429499 592171458 469541804 580760915 525807776 9957981 672955403 45...

result:

wrong answer 2nd numbers differ - expected: '24', found: '1149'

Test #14:

score: 0
Wrong Answer
time: 572ms
memory: 46116kb

input:

14
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
4 1 2 1
1 1 1 0
5 1 1 2
6 1 1 0
6 2 2 1
5 2 3 2
5 1 2 1
7 2 2 1
8 1 2 1
11 2 4 1
11 4 4 2
15 2 4 0
13 1 3 3
15 1 3 3
18 2 4 4
16 2 5 5
16 4 4 0
18 6 6 4
22 4 4 5
18 2 5 5
20 5 6 5
24 1 6 4
25 5 6 2
22 3 4 1
28 3 7 0
25 2 4 4
29 1 6 4
27 3 8 0
28 5 5 7
30 2 3 1
33 ...

output:

1 1 68 8635 2 17270 6 1 69 1597337 8635 16 8704 384940810 549566289 24 747879658 386546782 200161775 8635 924954805 1597337 522729005 614262025 658911160 891929051 776493148 975559207 950848321 816691906 784007777 782751796 814423800 987798856 561000591 651660987 645977216 795864885 62883904 6238931...

result:

wrong answer 4th numbers differ - expected: '67', found: '8635'

Test #15:

score: 0
Wrong Answer
time: 570ms
memory: 46964kb

input:

15
4
100000
1 1 1 0
1 1 1 0
2 1 2 0
1 1 1 0
4 1 3 1
3 2 2 1
5 1 2 0
5 2 2 1
7 2 3 1
9 1 2 0
9 2 3 0
8 1 2 1
9 1 2 0
10 3 3 2
11 2 3 1
13 2 3 3
15 3 5 4
14 4 4 2
16 2 4 0
20 4 5 5
18 1 6 4
21 2 5 6
19 4 5 4
23 3 7 4
23 3 5 0
25 3 3 8
26 4 8 8
26 3 7 6
28 6 9 5
26 6 9 2
29 8 9 7
29 6 10 1
31 4 4 5
34 ...

output:

3 5 8 46 12 24 139 4552 71 700866 47 370 4646 136 132459076 185 267 48 59446809 125118727 504 848104432 47 317730076 253387010 125118727 325775889 582417127 133164540 38448740 4598 15445174 443206377 559408544 192611303 4552 911415334 853449975 277131492 798845907 5149893 38800263 410740625 68914413...

result:

wrong answer 5th numbers differ - expected: '4', found: '12'

Test #16:

score: 0
Wrong Answer
time: 578ms
memory: 46960kb

input:

16
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
1 1 1 0
5 2 2 1
5 1 1 0
5 1 2 1
4 1 2 0
7 1 2 2
6 1 2 0
7 2 3 0
12 1 4 0
11 1 1 2
13 1 4 0
14 3 3 4
12 1 4 0
16 2 2 1
18 1 7 5
19 6 6 5
20 4 5 1
17 2 5 4
22 1 3 4
23 1 3 3
21 5 5 9
22 3 4 3
24 1 7 3
23 2 5 1
27 2 5 4
25 2 8 7
29 6 7 3
27 5 9 6
30 10 11 6
30 1 2 3
...

output:

1 1 2 60 243 6655 61 3 6715 1700 1038060 2089551 9897 3134326 67579 207598508 472810 1881343 5091739 20366713 157726189 711670464 834973272 81389376 1044715 329383287 366369412 981990237 325489925 34198516 454551073 216208768 406879301 245907789 446419949 151356027 216208465 109360637 109281461 5895...

result:

wrong answer 5th numbers differ - expected: '3', found: '243'

Test #17:

score: 0
Wrong Answer
time: 568ms
memory: 47032kb

input:

17
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
2 1 1 0
2 1 2 1
4 1 1 0
3 1 2 1
7 2 3 0
8 3 3 0
6 1 3 0
9 2 3 0
8 1 3 1
9 3 4 2
11 3 4 3
13 2 3 0
12 4 5 4
16 1 2 1
15 1 2 2
19 2 5 5
16 3 5 4
19 1 4 5
21 3 4 5
23 3 5 0
21 1 6 1
23 3 3 2
25 1 2 2
26 1 3 0
26 5 6 6
27 2 4 3
28 1 5 8
31 2 3 5
29 3 7 1
32 7 10 10
32...

output:

4 54 4 4 19 23 4427 42 1 71 32 615297 5 260 118132542 5 118747839 1035 354 571664977 1385 391701510 118752266 953635441 836268595 174000319 759248407 84494124 645188607 275458304 284476330 83874400 753291215 195489701 819246772 808549840 634538895 940476554 118132542 563558606 550664440 609803062 68...

result:

wrong answer 5th numbers differ - expected: '3', found: '19'

Test #18:

score: 0
Wrong Answer
time: 589ms
memory: 46688kb

input:

18
4
100000
1 1 1 0
1 1 1 0
3 1 2 1
2 1 2 0
2 2 2 0
5 1 3 1
6 1 1 1
6 2 3 2
6 1 3 2
9 1 4 1
10 2 3 1
12 1 3 0
10 1 4 2
11 2 5 0
12 4 5 1
14 2 4 1
15 5 6 2
16 4 5 5
18 3 3 5
18 1 6 4
18 3 4 4
21 2 4 3
21 4 7 4
23 7 9 3
23 1 5 3
25 3 5 3
26 5 6 2
25 1 7 4
29 3 4 6
30 4 11 2
29 1 3 3
29 1 5 6
32 9 12 0...

output:

47 2 3 96 4791 144 4791 617753 29031 103782456 43546 77368 67739 583416636 4886 33869 83282548 4838 103782456 649859673 104400209 630643759 104405047 752811796 741695458 318314504 687199092 169707554 337378036 55118957 431497770 62676502 184369356 290547827 771104231 368116120 286632943 771104184 59...

result:

wrong answer 3rd numbers differ - expected: '1', found: '3'

Test #19:

score: 0
Wrong Answer
time: 595ms
memory: 45960kb

input:

19
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
2 1 2 1
2 2 2 0
3 1 1 1
4 1 1 0
8 1 3 0
7 2 2 0
8 2 2 2
8 1 1 1
11 2 4 3
13 1 3 2
13 1 3 1
12 1 2 0
15 2 5 1
16 4 5 0
18 4 5 3
17 2 4 0
19 3 6 5
21 4 8 2
21 2 6 4
23 7 8 6
22 1 4 3
22 1 3 2
24 1 8 1
25 5 5 1
26 3 3 2
26 1 10 5
30 8 9 0
29 3 5 2
29 3 6 0
31 4 7 10
...

output:

3 1 43 4 1 2 3783 3827 1 15262 476441 76267 95312 282196 73844572 469080 423790374 792747340 373725 446727144 487289207 33722931 773072058 577855733 826786708 547895937 423790374 331067488 931841921 600301905 728519338 154065359 838727061 519124289 13978921 129486380 3826 31648854 590835853 57310706...

result:

wrong answer 4th numbers differ - expected: '1', found: '4'

Test #20:

score: 0
Wrong Answer
time: 580ms
memory: 46732kb

input:

20
4
100000
1 1 1 0
1 1 1 0
1 1 1 0
3 1 2 1
5 1 1 0
4 1 2 1
5 1 1 2
8 4 4 0
8 1 2 3
10 3 4 0
11 5 5 3
10 3 4 2
11 2 3 3
12 1 7 6
14 1 2 1
15 5 8 3
15 1 2 6
17 5 8 4
17 3 4 0
18 7 9 6
20 1 10 2
21 1 4 9
22 1 9 9
23 3 8 6
25 3 7 8
24 2 7 6
27 1 9 8
27 12 12 8
29 3 11 3
30 2 6 4
31 6 14 8
30 6 8 3
33 8...

output:

1 44 2 3387 3387 3 375912 1 51496556 839383311 710101064 3431 891255779 629929454 732394737 623273011 103054123 51875899 389661396 70430327 16627256 211287549 512317734 694261287 356409573 31769496 809826219 734811361 939560392 953061178 266118288 222970364 623273011 166951147 96734992 281994622 644...

result:

wrong answer 4th numbers differ - expected: '43', found: '3387'