QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#455261#8821. Nightmareucup-team123AC ✓424ms15064kbC++2011.1kb2024-06-26 02:58:492024-06-26 02:58:49

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 6792kb

input:

2 2
1 1
1 1

output:

1
1 
1 


result:

ok accepted

Test #2:

score: 0
Accepted
time: 2ms
memory: 10560kb

input:

3 5
4 4 3
4 4 3
3 3 2

output:

2
3 0 
3 0 
1 4 

result:

ok accepted

Test #3:

score: 0
Accepted
time: 342ms
memory: 8788kb

input:

500 2
1 0 1 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 0 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 1 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 0 1 0 0 ...

output:

423
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 accepted

Test #4:

score: 0
Accepted
time: 381ms
memory: 8400kb

input:

500 2
0 0 1 0 0 1 1 0 1 0 1 0 0 0 0 1 0 0 1 0 1 1 0 1 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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 accepted

Test #9:

score: 0
Accepted
time: 184ms
memory: 7544kb

input:

500 2
0 1 1 0 0 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 1 0 0 1 0 1 0 1 0 0 0 1 0 1 1 0 1 1 0 1 1 1 0 1 0 1 0 1 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 1 1 1 1 ...

output:

469
0 0 1 1 1 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 0 1 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 ...

result:

ok accepted

Test #10:

score: 0
Accepted
time: 193ms
memory: 8132kb

input:

500 2
0 0 0 1 0 1 0 0 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 0 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 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 1 1 1 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 1 0 1 1 0 1 0 1 1 0 0 1 0 0 1 1 1 1 1 1 0 0 1 1 0 1 1 0 0 1 0 1 1 1 0 1 0 0 ...

result:

ok accepted

Test #14:

score: 0
Accepted
time: 184ms
memory: 8092kb

input:

500 2
0 1 1 0 0 1 1 0 1 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 0 1 0 0 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 1 1 1 1 1 1 1 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 1 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 1 1 1 0 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 1 1 1 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 1 1 0 0 0 1 0 0 0 0 ...

output:

449
0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 1 1 1 0 0 1 1 0 1 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 1 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 0 1 0 1 0 0 ...

result:

ok accepted

Test #15:

score: 0
Accepted
time: 188ms
memory: 8252kb

input:

500 2
0 1 1 1 1 0 0 0 1 1 1 1 0 1 1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 1 0 0 1 0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0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 0 ...

result:

ok accepted

Test #17:

score: 0
Accepted
time: 360ms
memory: 6748kb

input:

500 2
0 0 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 1 1 1 0 1 0 1 1 0 1 1 0 0 1 1 ...

output:

451
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 accepted

Test #18:

score: 0
Accepted
time: 382ms
memory: 14812kb

input:

500 586939
348375 543104 2613 525830 529938 63001 57038 406207 446773 47968 73017 238901 268124 473469 570747 217880 286012 142821 179125 504343 438813 105553 332560 137383 123166 585260 335875 279206 541274 318826 12120 49682 487559 275080 491437 102596 71097 184988 184272 439469 251082 388754 2144...

output:

449
262023 170677 384564 300678 59286 257839 175858 299967 359728 422902 241004 165405 19454 58244 507546 304427 272737 492482 443776 235001 337528 16272 127048 185199 424938 486773 15237 578591 389566 226730 470948 131982 238103 468755 484993 504328 455064 204234 1680 405803 506980 236536 541882 54...

result:

ok accepted

Test #19:

score: 0
Accepted
time: 357ms
memory: 14536kb

input:

500 708479
430409 569258 261799 182975 708191 672266 333475 399713 455200 10787 513014 625082 198117 148705 160145 273910 434275 500198 432148 240056 148493 234124 337066 4702 519312 300692 543467 367352 301531 37892 595388 394191 252456 681305 3433 251169 388731 556515 689401 244646 463416 247313 3...

output:

422
0 0 354874 439768 469888 453617 279401 119028 271271 77201 450635 336862 656447 198390 675381 121124 681781 702948 568940 71601 78869 144862 259486 22701 181892 266217 155133 246003 192145 191439 83386 209234 33266 90053 302917 611524 696754 577454 598395 152352 55344 635933 272009 693690 42410 ...

result:

ok accepted

Test #20:

score: 0
Accepted
time: 385ms
memory: 14516kb

input:

500 536353
282284 26783 302619 745 270890 322461 121117 217171 372053 158072 353911 244194 270214 467598 52826 188240 61415 194385 28874 49172 73157 153266 187497 241906 343567 452564 142065 292558 320746 246948 302112 65546 172785 20319 353065 390695 501673 417771 204902 191768 389623 508148 115479...

output:

462
294470 483766 450020 453299 259982 439327 99737 381822 381745 295836 65535 188902 510717 476452 149116 95444 138972 379084 41472 490048 84974 434618 389495 177738 225376 486695 511355 435087 341954 429374 194190 250532 129879 89028 506783 364287 98849 319085 109326 113653 81102 185086 281778 118...

result:

ok accepted

Test #21:

score: 0
Accepted
time: 368ms
memory: 14600kb

input:

500 731539
13571 549608 603965 70150 187674 571744 319686 82634 170226 159605 247895 465047 546161 479622 397994 512183 666123 252309 35408 432021 398005 688503 303962 437442 221319 217584 541049 131946 632312 421528 31536 698830 251801 104075 388920 528314 541589 246062 717474 559558 87195 573748 1...

output:

430
174024 167098 280384 324549 462950 83869 164845 267749 409681 131463 345367 412773 326827 164291 539531 289868 110479 264962 182341 655823 267177 700986 693466 650471 94457 318506 359297 374721 536648 43841 654914 188192 676816 293899 46180 470920 358596 630657 77949 180973 22768 264833 422426 4...

result:

ok accepted

Test #22:

score: 0
Accepted
time: 406ms
memory: 14692kb

input:

500 792317
84947 16783 565500 552076 289228 244224 357468 734231 240096 129692 212949 615651 220944 470008 99547 601222 711272 201747 74877 538265 728111 530412 595302 669646 447968 782343 763934 466571 619363 538063 345390 259792 285393 628364 627346 506983 699490 643743 752307 760384 778585 560537...

output:

493
497583 768734 118812 278863 116820 500420 330111 573368 375738 204924 624054 60631 282034 430957 609940 654723 77413 695786 598972 500577 481831 562724 51332 468296 328903 546919 64819 307978 619819 221564 225845 603492 660052 1234 306068 27775 762341 682388 161259 269114 420488 747418 86277 293...

result:

ok accepted

Test #23:

score: 0
Accepted
time: 395ms
memory: 14556kb

input:

500 788999
467390 293281 94689 510834 369049 599628 559595 729404 760483 569261 759601 265426 310089 132157 453862 195716 480683 235518 720559 665971 380400 424938 45862 246625 124077 537274 119830 619359 549385 626400 269482 260674 598657 576554 12504 593239 137071 59829 122033 293214 583569 428648...

output:

471
737460 648550 184869 457060 165845 262785 86575 367405 510075 341553 101720 631936 220391 189650 258637 264994 283512 673270 409422 72630 360930 216157 489865 668512 586076 576162 398347 273581 85613 489298 191410 746329 100777 190402 280433 233830 136391 644059 210094 450663 546058 569263 18493...

result:

ok accepted

Test #24:

score: 0
Accepted
time: 392ms
memory: 14796kb

input:

500 765521
159142 161816 248659 153740 378501 248839 82570 96584 608251 334043 386921 532144 67980 146244 223871 546582 723819 436866 562874 589721 127800 369341 180799 605736 157096 402949 475274 488804 440970 328121 526198 264775 742245 520758 710495 272547 680596 779 302583 81553 745247 240518 71...

output:

458
434629 558047 421967 567022 62450 736331 512737 487012 538449 739828 496977 135544 162179 550214 279834 538462 428880 609946 99903 103279 116808 525690 45352 564744 37209 178858 579938 503341 253018 468651 645905 357344 197079 751149 607519 408472 260653 531952 301791 239280 746879 91568 296118 ...

result:

ok accepted

Test #25:

score: 0
Accepted
time: 384ms
memory: 14868kb

input:

500 924743
244236 879063 368210 362213 103008 691288 501220 351123 892165 15730 193772 698417 88679 903715 605093 380580 373054 772553 533129 229564 780646 723026 557840 922477 828162 42265 888247 683525 45653 544975 63079 661940 699113 0 419635 679777 578214 496242 636962 248880 631041 162473 35456...

output:

430
515175 819136 405175 890226 343568 210696 676457 786743 417531 852732 336132 867949 118639 365007 775007 188545 652631 45786 427849 205670 376315 515240 275743 234133 396418 288399 593972 491820 636339 743930 768007 485419 682427 113778 23137 910975 695365 744965 272726 602009 73163 853888 38145...

result:

ok accepted

Test #26:

score: 0
Accepted
time: 376ms
memory: 13560kb

input:

500 528667
356442 159923 525463 56086 476091 154898 505863 272788 514507 222228 302954 140310 431024 428194 148563 528490 117955 198641 363452 359687 1545 33028 365983 9518 179356 303537 24207 173859 201783 389340 399337 342961 161976 302909 180978 212749 267464 249093 377318 486422 80988 243585 211...

output:

436
52769 443883 523482 442727 6167 269519 145440 374141 53498 409193 345172 109771 380137 211015 480763 155024 502600 181122 145836 268692 159000 358478 521146 75535 216635 162727 156287 250427 384398 148115 50154 332782 366986 372268 22835 345612 373269 182111 451478 60956 150316 503312 175213 378...

result:

ok accepted

Test #27:

score: 0
Accepted
time: 388ms
memory: 13808kb

input:

500 627643
344228 367558 49258 431868 272927 310750 468577 244314 218066 351337 297847 205353 594016 47667 526848 231930 350736 404286 156859 35005 305865 162302 197500 593997 575513 254921 545608 444956 143231 271147 89444 201858 465504 124100 65183 294503 320309 207812 311521 304440 136873 332226 ...

output:

468
201045 584358 199887 58353 11985 333078 325095 12364 143914 176011 608349 481244 413018 484070 439874 292769 438721 397287 480254 519796 258489 166981 452389 450952 134907 229921 554270 386477 279059 136336 551171 176896 619785 97830 250817 537707 368056 426891 599520 366344 328908 398913 121114...

result:

ok accepted

Test #28:

score: 0
Accepted
time: 383ms
memory: 14156kb

input:

500 881119
785527 688446 400798 864795 752811 427370 305276 335120 139198 440428 225723 515052 627362 101089 410079 52289 783834 795010 652273 68364 638260 214442 816240 331512 783495 260103 367060 744068 381212 450408 876718 794950 498940 735542 660098 267964 60287 229158 561450 177567 129341 28939...

output:

437
563982 42484 824678 279405 577869 207234 617152 641021 171871 119775 145255 637936 873117 248515 698529 371802 324182 810548 485411 272938 344214 472116 63574 334629 867084 294972 374634 376622 587462 531866 856327 452138 497655 233008 769847 475925 101976 420439 253676 811184 20915 64342 573693...

result:

ok accepted

Test #29:

score: 0
Accepted
time: 368ms
memory: 14828kb

input:

500 565039
320150 411550 139094 471000 287647 61660 395796 190482 530893 69280 549320 467451 551770 417285 312900 35288 515148 180836 438971 209209 290634 174460 151900 217364 91660 249166 180836 484933 135355 97112 498275 545745 103369 520446 339236 305093 546237 324510 258562 543706 211171 164849 ...

output:

426
552710 347339 424973 412928 552392 42147 461793 200476 461272 551016 418245 524924 371257 201251 273729 145282 387888 326873 404995 315561 294740 538032 489831 206227 144484 511965 417408 445306 514220 541504 433277 393445 227740 106525 471013 148390 532918 29407 314295 123059 170199 242645 2603...

result:

ok accepted

Test #30:

score: 0
Accepted
time: 390ms
memory: 14620kb

input:

500 803441
531499 190861 173677 285415 25495 788732 651678 561976 745996 396299 121797 78597 531534 200721 717497 579007 665944 449917 266591 348750 404603 775558 193881 76964 280693 785088 331299 10906 580209 243574 210696 785095 559461 273396 730026 103101 299419 76238 352678 678726 292761 543849 ...

output:

442
315704 260845 374969 152430 298896 362856 532991 8228 492500 766018 700359 471321 687022 313685 144142 482529 527014 515901 403756 291875 137647 547970 221327 332850 141013 729855 566898 225454 233617 611513 735922 704358 728760 89354 328824 566175 185865 437460 162871 270810 133019 658945 59119...

result:

ok accepted

Test #31:

score: 0
Accepted
time: 402ms
memory: 14144kb

input:

500 874063
637775 628280 669188 865652 105446 71178 406660 292361 577547 152887 563847 593456 255750 176211 139071 276131 673002 513275 458893 857466 651002 74198 552761 292265 251075 770299 181693 209601 774351 848649 8037 576081 103621 784688 856622 40183 674914 840986 226686 82499 515910 739831 3...

output:

458
92274 498897 453279 515080 354317 273994 390998 329916 201575 749959 795180 320339 629659 409286 360674 46999 200386 107565 543118 159412 741193 421444 441205 510943 212477 535533 187270 670774 355414 210033 282143 140300 96647 90858 804828 72250 225424 12036 511040 54547 632804 512189 676163 38...

result:

ok accepted

Test #32:

score: 0
Accepted
time: 392ms
memory: 13516kb

input:

500 548579
527514 414887 138172 417237 539313 388911 206623 468608 545062 312198 199524 277129 396148 359171 278642 258392 530391 29105 350078 545634 392866 97321 199124 473632 328076 449482 64000 234422 544237 59058 416621 518439 275036 182997 344419 356340 200856 249756 392228 160983 140823 398316...

output:

494
414555 529644 313766 228333 139828 326372 42771 141702 158595 251019 245212 475319 64346 141261 202365 400410 251306 88502 370141 78883 431883 463737 251844 115410 323738 95072 192880 327496 218858 149277 286618 2544 473800 99341 41317 291013 503844 216656 165759 3309 1111 228163 101185 426479 8...

result:

ok accepted

Test #33:

score: 0
Accepted
time: 41ms
memory: 11420kb

input:

500 5
4 3 2 2 4 1 2 2 0 3 1 2 3 0 2 0 4 3 0 4 4 3 1 0 1 4 1 1 3 0 4 3 0 4 2 3 2 3 3 3 4 0 1 2 1 2 2 4 0 0 4 2 2 3 1 2 2 4 2 1 3 1 4 3 0 1 3 1 3 2 1 1 3 1 4 3 0 2 0 2 4 4 3 4 0 0 1 4 0 1 2 2 0 4 4 0 1 2 3 0 2 4 4 4 0 0 1 0 2 4 2 3 3 3 4 0 3 1 1 3 4 4 4 2 1 0 3 2 3 2 0 2 4 1 1 3 3 1 0 4 3 1 4 3 0 3 4 ...

output:

50
1 1 4 3 2 1 2 0 3 2 3 3 1 2 3 0 0 2 0 2 2 4 2 2 2 3 2 4 2 1 2 0 0 1 4 0 2 1 1 3 2 1 3 1 2 4 2 1 2 3 
3 1 2 3 3 2 3 4 4 2 3 1 3 1 1 0 0 4 4 4 1 4 0 2 0 1 1 2 0 2 1 3 0 3 4 3 0 4 4 3 4 1 3 3 2 2 0 2 0 2 
2 0 2 0 2 2 1 2 2 2 4 2 4 4 3 0 2 4 2 1 1 3 2 4 2 2 2 1 3 2 2 4 0 1 2 4 3 1 4 1 0 4 4 2 2 1 4 2...

result:

ok accepted

Test #34:

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

input:

10 2
1 1 1 0 0 0 1 0 0 1
1 1 1 0 0 0 1 0 0 1
1 1 1 0 0 0 1 0 0 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
1 1 1 0 0 0 1 0 0 1
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 1 0 0 1

output:

1
1 
1 
1 
0 
0 
0 
1 
0 
0 
1 


result:

ok accepted

Test #35:

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

input:

10 2
1 0 0 1 1 0 0 0 1 1
0 1 1 1 1 0 1 1 0 1
0 1 1 1 1 0 1 1 0 1
1 1 1 0 0 0 1 1 1 0
1 1 1 0 0 0 1 1 1 0
0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 0 1 1 0 1
0 1 1 1 1 0 1 1 0 1
1 0 0 1 1 0 0 0 1 1
1 1 1 0 0 0 1 1 1 0

output:

2
0 1 
1 0 
1 0 
1 1 
1 1 
0 0 
1 0 
1 0 
0 1 
1 1 


result:

ok accepted

Test #36:

score: 0
Accepted
time: 2ms
memory: 8508kb

input:

10 2
0 1 0 0 1 0 0 0 1 1
1 1 0 1 0 1 1 0 0 1
0 0 1 0 0 1 1 0 1 0
0 1 0 0 1 0 0 0 1 1
1 0 0 1 1 1 1 0 1 0
0 1 1 0 1 1 1 0 0 1
0 1 1 0 1 1 1 0 0 1
0 0 0 0 0 0 0 0 0 0
1 0 1 1 1 0 0 0 0 0
1 1 0 1 0 1 1 0 0 1

output:

3
0 1 1 
0 0 1 
1 0 0 
0 1 1 
0 1 0 
1 1 1 
1 1 1 
0 0 0 
1 1 0 
0 0 1 


result:

ok accepted

Test #37:

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

input:

10 2
1 0 1 1 0 1 1 1 1 1
0 0 0 0 1 1 0 0 0 1
1 0 0 0 1 0 1 0 1 1
1 0 0 1 0 1 1 0 0 0
0 1 1 0 1 1 0 1 1 1
1 1 0 1 1 0 1 0 0 0
1 0 1 1 0 1 1 1 1 1
1 0 0 0 1 0 1 0 1 1
1 0 1 0 1 0 1 1 0 0
1 1 1 0 1 0 1 1 0 0

output:

6
0 0 0 0 0 1 
0 0 0 1 1 0 
0 1 0 0 0 1 
0 1 1 1 1 1 
1 1 0 0 1 0 
1 1 0 0 1 1 
0 0 0 0 0 1 
0 1 0 0 0 1 
0 0 1 1 1 1 
0 0 0 0 1 1 


result:

ok accepted

Test #38:

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

input:

10 2
0 0 1 1 0 0 0 1 0 1
0 1 1 1 1 1 0 1 1 1
1 1 1 0 0 0 0 1 1 1
1 1 0 0 1 1 0 1 1 0
0 1 0 1 1 0 0 0 0 0
0 1 0 1 0 1 1 1 0 0
0 0 0 0 0 1 1 0 0 0
1 1 1 1 0 1 0 0 1 1
0 1 1 1 0 0 0 1 0 1
1 1 1 0 0 0 0 1 1 1

output:

9
0 0 0 0 0 0 1 1 0 
0 0 0 0 0 0 0 0 1 
0 0 0 0 0 1 0 1 1 
0 0 0 0 0 0 0 1 1 
0 1 1 1 0 1 0 0 1 
0 0 1 1 1 1 0 0 1 
0 0 0 0 1 0 0 0 0 
1 1 0 0 0 0 1 0 1 
0 0 0 1 0 0 0 0 1 
0 0 0 0 0 1 0 1 1 


result:

ok accepted

Test #39:

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

input:

10 2
0 1 1 1 1 1 1 1 0 1
1 0 0 0 1 1 1 0 0 1
1 0 1 0 1 1 1 1 1 1
1 0 0 1 1 1 1 0 1 1
1 1 1 1 1 0 1 1 0 0
1 1 1 1 0 1 1 0 0 0
1 1 1 1 1 1 1 1 0 1
1 0 1 0 1 0 1 1 1 1
0 0 1 1 0 0 0 1 1 0
1 1 1 1 0 0 1 1 0 1

output:

10
0 0 0 0 0 0 0 0 1 1 
0 0 0 0 1 1 0 1 1 0 
0 0 0 0 0 0 0 0 0 1 
0 0 0 0 0 1 1 0 1 0 
0 0 0 1 1 1 0 1 0 1 
0 0 1 0 1 1 0 1 0 1 
1 1 1 1 0 0 1 1 0 1 
0 1 1 0 0 0 0 0 0 1 
0 0 0 0 0 0 0 1 1 1 
0 0 0 0 0 0 1 1 0 1 


result:

ok accepted

Test #40:

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

input:

10 2
0 0 1 1 1 0 0 1 0 0
0 1 1 0 0 1 0 0 1 1
1 1 0 0 0 0 1 1 1 0
1 0 0 1 1 1 1 1 0 1
1 0 0 1 1 1 1 0 1 0
0 1 0 1 1 1 1 0 1 1
0 0 1 1 1 1 0 0 0 1
1 0 1 1 0 0 0 0 1 0
0 1 1 0 1 1 0 1 0 1
0 1 0 1 0 1 1 0 1 1

output:

10
0 0 0 0 0 0 0 1 1 0 
0 0 0 0 0 0 0 0 0 1 
0 0 0 0 0 0 0 0 1 1 
0 0 0 1 1 1 1 1 0 0 
0 1 1 0 0 0 0 1 0 0 
0 0 0 0 1 0 1 1 1 1 
0 0 0 0 0 1 1 1 1 0 
0 0 0 0 0 0 1 0 1 0 
0 0 1 1 1 1 1 0 0 1 
1 1 0 0 1 0 1 1 1 1 


result:

ok accepted

Test #41:

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

input:

10 3
1 2 1 1 0 2 0 2 0 1
2 1 2 2 0 1 0 1 0 2
1 2 1 1 0 2 0 2 0 1
1 2 1 1 0 2 0 2 0 1
0 0 0 0 0 0 0 0 0 0
2 1 2 2 0 1 0 1 0 2
0 0 0 0 0 0 0 0 0 0
2 1 2 2 0 1 0 1 0 2
0 0 0 0 0 0 0 0 0 0
1 2 1 1 0 2 0 2 0 1

output:

1
2 
1 
2 
2 
0 
1 
0 
1 
0 
2 

result:

ok accepted

Test #42:

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

input:

10 3
2 2 1 0 2 0 1 0 2 2
2 1 2 1 2 0 0 1 2 1
1 2 1 2 1 0 0 2 1 2
0 1 2 2 0 0 1 2 0 1
2 2 1 0 2 0 1 0 2 2
0 0 0 0 0 0 0 0 0 0
1 0 0 1 1 0 1 1 1 0
0 1 2 2 0 0 1 2 0 1
2 2 1 0 2 0 1 0 2 2
2 1 2 1 2 0 0 1 2 1

output:

2
2 1 
0 2 
0 1 
2 2 
2 1 
0 0 
2 0 
2 2 
2 1 
0 2 

result:

ok accepted

Test #43:

score: 0
Accepted
time: 2ms
memory: 8592kb

input:

10 3
1 2 2 0 2 2 2 1 2 0
2 1 1 0 1 1 1 2 1 0
2 1 0 1 2 0 0 0 1 0
0 0 1 1 2 0 0 1 2 2
2 1 2 2 0 2 2 1 1 0
2 1 0 0 2 2 2 2 0 2
2 1 0 0 2 2 2 2 0 2
1 2 0 1 1 2 2 2 1 2
2 1 1 2 1 0 0 1 0 2
0 0 0 2 0 2 2 2 2 2

output:

3
0 0 1 
0 0 2 
1 1 2 
0 1 0 
2 2 2 
2 0 2 
2 0 2 
0 1 1 
1 2 2 
1 2 0 

result:

ok accepted

Test #44:

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

input:

10 3
2 2 1 2 2 0 1 1 0 1
2 2 1 1 1 2 0 1 2 2
1 1 0 1 2 0 0 1 2 1
2 1 1 0 0 2 2 1 0 0
2 1 2 0 1 1 2 1 1 2
0 2 0 2 1 1 0 2 2 2
1 0 0 2 2 0 0 2 1 1
1 1 1 1 1 2 2 0 2 0
0 2 2 0 1 2 1 2 2 0
1 2 1 0 2 2 1 0 0 0

output:

10
0 0 2 1 0 0 0 0 0 0 
0 1 0 2 2 0 0 1 0 2 
1 2 1 2 2 2 0 1 2 1 
0 0 2 1 0 2 2 0 2 1 
2 1 2 1 0 0 2 0 2 2 
0 1 0 0 0 0 0 2 2 1 
2 1 1 2 0 0 0 2 0 1 
1 2 1 2 0 0 0 0 2 2 
1 2 0 0 0 0 0 0 0 0 
0 0 1 2 0 0 0 0 0 2 

result:

ok accepted

Test #45:

score: 0
Accepted
time: 2ms
memory: 8860kb

input:

10 3
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0
1 0 1 1 2 0 2 1 2 2
1 1 1 1 1 2 0 0 1 2
0 1 0 2 2 1 0 0 1 0
1 2 2 0 1 2 1 1 0 0
1 1 0 0 0 2 2 0 0 1

output:

10
2 0 1 2 0 0 0 1 0 2 
0 0 0 0 0 0 2 2 2 2 
2 2 1 0 1 1 0 2 2 0 
1 0 2 2 0 0 0 1 1 0 
1 2 1 1 2 2 0 0 2 0 
0 0 0 1 0 0 0 0 2 1 
0 0 1 2 2 2 0 0 1 1 
0 0 0 0 1 1 0 0 2 0 
2 0 1 2 2 2 0 1 0 0 
0 0 0 0 0 0 0 0 0 2 

result:

ok accepted

Test #48:

score: 0
Accepted
time: 35ms
memory: 12628kb

input:

10 999983
900098 802402 520434 486042 694910 841635 935386 505713 9608 649949
802402 340817 164002 3557 340269 604474 506230 908379 166012 245746
520434 164002 996037 189604 273951 298459 470013 277257 472321 974461
486042 3557 189604 371943 393534 406992 782080 87700 638744 396130
694910 340269 273...

output:

1
618188 
549155 
658621 
35656 
69956 
40621 
655160 
778652 
492942 
717578 

result:

ok accepted

Test #49:

score: 0
Accepted
time: 37ms
memory: 13276kb

input:

10 999983
768262 558804 277458 285926 439630 134615 762784 898190 597074 76197
558804 380890 749912 788141 492653 293208 11856 38114 210623 202926
277458 749912 868265 662363 729079 763549 637459 326921 676018 239713
285926 788141 662363 981831 666411 873784 187770 90098 854651 529364
439630 492653 ...

output:

2
221930 828739 
581490 643607 
128830 563569 
745197 865768 
610313 300412 
620825 802519 
347761 350705 
259353 52499 
112720 24186 
486105 27773 

result:

ok accepted

Test #50:

score: 0
Accepted
time: 35ms
memory: 13084kb

input:

10 999983
385940 204279 342337 542867 378185 549096 256235 125820 158688 728987
204279 72506 894700 353069 450763 87057 165993 378073 992646 138662
342337 894700 218152 616944 458774 743752 234752 567849 916677 824505
542867 353069 616944 675186 788277 532898 187587 218019 898388 455523
378185 45076...

output:

3
611289 626923 56157 
336419 120036 81856 
222092 991549 238171 
994584 565230 263600 
333923 127174 71402 
233904 235010 480297 
332828 342496 418399 
862649 359279 694901 
191584 616815 642436 
0 0 743612 

result:

ok accepted

Test #51:

score: 0
Accepted
time: 36ms
memory: 13232kb

input:

10 999983
425921 385949 583550 335993 701366 299727 429383 136809 972617 284460
385949 840342 535563 307758 388917 307642 867627 42356 239900 163012
583550 535563 558920 379956 751958 132524 203381 703911 940347 828640
335993 307758 379956 759081 863512 667611 928047 599794 412688 130111
701366 3889...

output:

10
975988 438768 994312 989656 347557 536300 868361 12402 512872 254000 
475614 48755 440339 834244 24637 708223 941386 796891 746775 869293 
0 0 957137 842059 377790 699696 833867 458978 921311 129154 
0 0 511357 872124 420403 605306 0 510252 451375 33143 
0 0 543415 274219 38208 199814 0 0 41690 3...

result:

ok accepted

Test #52:

score: 0
Accepted
time: 38ms
memory: 12460kb

input:

10 999983
927130 398272 505832 858589 95614 813668 267988 860311 408347 279012
398272 928160 167756 270068 485788 725503 910864 495299 935879 838766
505832 167756 910188 396194 213412 718498 403332 875248 815660 833250
858589 270068 396194 817050 895301 878811 521319 567337 615109 729030
95614 48578...

output:

11
934985 505919 485868 136932 862321 12156 334248 167124 348853 723530 569809 
409190 181603 47739 140416 234039 136496 97000 48500 283228 436535 658191 
0 0 797873 393235 848568 372948 269349 634666 798981 240211 411930 
0 0 457468 85047 859465 293186 262554 131277 964744 711350 23939 
0 0 0 0 209...

result:

ok accepted

Test #53:

score: 0
Accepted
time: 36ms
memory: 12272kb

input:

10 999983
498039 257046 662783 228246 818936 655312 727785 300272 255829 965115
257046 303781 323258 41182 936918 738766 727887 147787 827039 276312
662783 323258 61125 294495 814151 924632 78764 127981 375093 597064
228246 41182 294495 680708 594432 523824 77403 392441 439663 985823
818936 936918 8...

output:

11
391631 524015 130921 565452 772430 374655 281420 646708 102216 275187 460406 
366233 669803 591123 795553 0 536222 178800 518916 968751 814966 680559 
85119 829745 820252 410126 0 837065 766044 221999 247167 272310 466422 
0 0 540545 770264 0 789246 852230 84012 610436 966928 988037 
0 0 734579 8...

result:

ok accepted

Test #54:

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

input:

10 999983
794854 842086 610105 159750 765999 139819 402779 735423 634341 965059
842086 78734 923242 62440 311760 970720 420675 108858 809356 125840
610105 923242 646882 315889 328927 52993 946670 206674 108625 725029
159750 62440 315889 234902 461980 796928 904896 873016 710238 15827
765999 311760 3...

output:

10
905812 600621 913142 73216 721456 459649 312130 702147 830586 337068 
531006 128027 180378 917923 0 932735 415090 36525 936694 262355 
396047 207889 297094 247480 0 642596 211366 148490 169337 74325 
0 0 554529 341694 0 514063 313426 465054 498038 328168 
0 0 170005 643950 0 0 570515 432941 21626...

result:

ok accepted

Test #55:

score: 0
Accepted
time: 10ms
memory: 7560kb

input:

499 2
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 ...

output:

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

result:

ok accepted

Test #56:

score: 0
Accepted
time: 11ms
memory: 6736kb

input:

499 2
1 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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 accepted

Test #61:

score: 0
Accepted
time: 375ms
memory: 8528kb

input:

499 2
0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 1 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 1 1 ...

output:

497
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 accepted

Test #62:

score: 0
Accepted
time: 10ms
memory: 9272kb

input:

499 3
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 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
0 1 
0 1 
1 1 
2 2 
2 0...

result:

ok accepted

Test #64:

score: 0
Accepted
time: 8ms
memory: 8848kb

input:

499 3
1 1 0 0 0 0 2 2 0 2 1 0 0 2 1 0 0 2 0 2 2 1 2 1 2 0 0 1 2 1 1 2 0 0 1 0 1 1 1 1 0 1 1 1 2 0 1 0 2 2 2 0 2 2 1 0 1 2 0 2 1 1 0 1 1 0 0 2 1 1 2 2 2 0 0 2 2 2 2 1 2 2 2 1 2 2 0 0 1 0 2 0 1 0 2 1 0 0 2 2 0 2 1 1 2 2 2 1 1 1 0 0 0 0 2 1 0 0 2 1 0 1 0 1 0 0 0 0 2 0 1 0 1 0 0 1 1 1 2 2 0 2 0 2 0 1 1 ...

output:

3
0 1 0 
2 1 2 
0 0 1 
0 0 0 
0 0 2 
0 0 0 
0 2 2 
2 2 2 
1 0 2 
0 2 1 
0 1 1 
1 0 0 
2 0 0 
1 2 0 
2 1 2 
2 0 2 
2 0 0 
2 2 1 
2 0 1 
2 2 0 
2 2 2 
2 1 2 
2 2 0 
1 1 0 
2 2 1 
2 0 2 
2 0 2 
2 1 2 
0 2 2 
1 1 0 
0 1 0 
1 2 1 
0 0 0 
1 0 1 
2 1 0 
2 0 0 
2 1 2 
2 1 0 
2 1 0 
1 1 1 
1 0 1 
1 1 1 
0 1 ...

result:

ok accepted

Test #65:

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

input:

499 3
0 1 1 2 1 1 0 0 1 1 0 2 2 2 0 0 1 2 0 0 2 1 0 2 0 2 1 1 2 1 2 0 1 2 2 1 0 0 2 2 1 2 1 2 0 1 2 1 1 2 0 0 2 2 1 1 0 1 2 2 2 1 2 1 1 2 1 0 1 2 2 1 0 0 1 1 2 0 0 1 0 0 1 1 2 1 0 2 1 2 0 2 1 2 2 0 0 0 1 1 1 0 1 1 1 2 2 0 1 0 2 1 1 0 0 2 1 2 1 1 0 0 0 1 2 0 0 1 2 1 1 1 1 2 2 1 2 2 0 0 0 0 1 0 1 2 0 ...

output:

10
0 2 1 2 2 1 0 0 2 0 
2 1 1 1 2 0 0 1 2 1 
0 2 1 2 1 1 1 1 2 0 
0 1 2 2 1 1 2 0 0 0 
1 0 2 2 2 0 1 2 0 2 
2 0 2 0 1 1 2 2 1 1 
2 0 2 2 1 2 2 2 1 1 
1 1 1 0 2 2 1 1 0 2 
1 2 0 0 1 1 1 2 0 2 
2 2 2 1 2 2 0 2 1 0 
0 1 0 1 0 0 1 2 1 2 
0 0 2 1 1 1 0 0 2 2 
0 0 2 0 2 2 0 2 0 2 
0 2 1 1 0 0 0 1 2 1 
1 1...

result:

ok accepted

Test #66:

score: 0
Accepted
time: 91ms
memory: 9192kb

input:

499 3
0 2 2 1 1 0 2 1 1 2 2 0 1 0 0 0 0 0 2 2 1 0 0 1 0 0 0 1 1 2 1 1 1 1 2 1 1 1 1 0 1 2 0 1 2 2 2 1 1 1 1 1 2 2 1 1 0 0 2 2 2 1 1 2 1 2 1 1 2 0 1 0 0 2 2 2 0 1 1 1 2 0 1 0 2 1 0 0 0 0 2 1 1 0 0 1 0 1 0 2 0 0 1 2 1 0 1 2 2 1 1 0 2 2 2 2 1 0 0 0 0 1 0 0 0 0 1 2 2 0 2 1 2 0 0 0 1 2 2 1 2 0 2 2 0 1 1 ...

output:

100
0 0 0 0 1 2 0 0 1 2 0 0 0 2 0 0 1 1 1 2 0 0 0 0 1 0 2 1 2 1 0 0 1 0 2 0 0 0 1 2 0 2 2 0 1 1 0 2 2 1 1 2 0 1 0 2 0 1 2 0 0 0 1 1 0 2 1 0 0 1 0 0 0 2 2 1 2 1 2 0 0 1 2 0 0 0 0 0 0 0 2 0 0 0 2 1 2 2 1 1 
2 0 2 1 1 2 2 1 0 0 0 1 1 1 0 1 2 1 2 1 0 1 1 0 0 0 2 2 1 1 2 2 0 2 0 0 1 1 1 2 1 2 2 1 2 2 2 0...

result:

ok accepted

Test #67:

score: 0
Accepted
time: 381ms
memory: 12552kb

input:

499 3
1 1 2 1 1 2 1 0 1 2 2 1 1 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 1 1 1 1 2 1 0 0 2 1 2 2 2 0 2 2 2 0 1 1 2 0 0 2 1 1 0 0 2 1 2 0 2 1 0 1 2 1 2 1 0 2 0 0 2 0 2 1 0 2 0 0 0 0 1 1 0 2 0 1 2 1 2 1 0 2 2 1 0 2 0 0 2 1 0 2 1 1 1 2 1 1 1 2 0 0 1 1 0 0 2 0 0 0 2 2 2 1 ...

result:

ok accepted

Test #69:

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

input:

499 999983
970837 427661 805761 200148 399828 346930 330428 982688 709181 324151 524971 183334 923458 82142 473534 510545 870154 18642 47931 569563 419485 305754 583850 439217 66776 812819 27536 471682 789059 710166 645270 514327 404542 546798 479171 41395 696425 288117 294318 305008 666751 32186 90...

output:

1
204434 
614004 
179653 
836061 
133950 
40777 
649002 
1844 
53208 
479625 
601316 
418838 
866196 
826209 
463929 
109772 
746296 
271555 
537118 
625529 
972314 
551779 
583301 
364901 
322045 
146753 
965420 
992247 
976679 
598338 
301533 
309481 
473829 
341173 
837476 
747236 
435134 
506479...

result:

ok accepted

Test #70:

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

input:

499 999983
533875 87744 626216 37778 731741 168794 445497 743977 863692 923447 231444 923414 652989 504098 790116 196619 807203 40663 144203 354992 326588 246947 662427 387876 715651 47913 585267 320718 308716 209040 304198 957834 265517 330433 385011 370722 74984 210539 926382 883135 988103 67790 6...

output:

2
589503 821766 
874906 585621 
373351 16343 
918823 303238 
756092 197909 
237714 400417 
342186 86958 
688607 121008 
39250 142428 
605567 11501 
103010 999969 
37285 215369 
83419 638149 
692787 487978 
75720 828342 
387179 665581 
479622 378182 
786571 889854 
203990 790689 
900385 13603 
388533...

result:

ok accepted

Test #71:

score: 0
Accepted
time: 49ms
memory: 13548kb

input:

499 999983
2937 547009 321576 824612 108353 810578 665998 252457 601828 968640 174756 690117 339121 770842 954234 528779 527546 353945 914902 14559 260774 272457 762505 48537 651979 127362 818807 743546 548176 144903 988235 942670 405772 519014 525108 252319 203885 219287 367589 964377 121564 779920...

output:

3
707755 803174 724722 
829703 722465 592260 
65241 825719 70250 
76570 909164 107733 
89485 285388 822204 
447630 87292 997076 
248170 81855 682133 
239850 821923 7157 
607012 21846 460206 
784113 135402 876439 
157934 320347 801564 
201202 574986 986560 
429949 277167 828634 
539017 110765 78843 
...

result:

ok accepted

Test #72:

score: 0
Accepted
time: 60ms
memory: 14016kb

input:

499 999983
350266 429618 856147 184280 953449 569731 295774 868477 664109 572685 197012 150590 921369 781202 169142 576692 489388 532752 219999 803116 605984 6721 950639 538213 127269 811205 390011 502900 990578 552900 837552 314528 283675 175485 711919 174439 938650 751597 302168 804145 248474 4823...

output:

10
561210 166264 121196 232601 415497 763492 836127 381282 704513 438798 
153061 220224 64267 427360 529531 419088 995684 462113 862400 856982 
812072 19348 507371 289546 265243 397825 857927 117420 490054 20307 
797804 31978 435865 669833 441261 446764 519763 789987 588828 439498 
414622 658410 206...

result:

ok accepted

Test #73:

score: 0
Accepted
time: 132ms
memory: 13708kb

input:

499 999983
154837 490171 476591 873989 603733 657654 189694 679255 64938 355287 767618 589748 244490 696038 728838 399418 318743 508835 471628 933958 970459 267200 947576 205658 192267 599249 335696 971422 76494 835127 19056 807798 427743 696911 209000 774724 801939 907222 260519 380696 645885 82187...

output:

100
967584 477709 150794 471843 632902 632746 547997 977440 502207 791613 59797 588063 781045 200129 732928 81946 188873 300107 228990 104026 686630 380938 347975 361664 72713 103139 261126 735734 500135 338306 747538 479903 537503 803680 13973 566336 603442 791912 948265 492122 993583 361144 360617...

result:

ok accepted

Test #74:

score: 0
Accepted
time: 418ms
memory: 14500kb

input:

499 999983
314402 626365 979397 783929 542573 97984 833545 67295 310723 203584 51160 425325 40635 443117 737034 380554 804627 322739 276948 200239 481288 116176 614901 216077 587236 907837 10079 82016 202133 817148 600225 969847 552970 802825 889201 856139 185058 591275 846774 770071 635713 470421 9...

output:

500
50787 437780 124801 451471 4103 311183 563267 109832 326965 299777 359458 130002 101201 717366 120581 637899 574927 636338 807920 570613 694636 623337 924011 790590 267427 544172 861024 470209 639686 512957 171095 533023 876066 277945 990729 807927 131011 896480 602688 120865 94236 724889 123310...

result:

ok accepted

Test #75:

score: 0
Accepted
time: 419ms
memory: 15064kb

input:

499 999983
522565 659600 221619 337137 300499 935742 527918 80030 449590 559604 551624 210976 285716 108170 10016 392287 837766 503228 212998 614044 16231 651431 732096 967078 256577 139093 730149 31629 397097 526318 269534 7531 806611 997960 559072 637334 880503 370833 709258 507474 702839 751215 1...

output:

499
887760 521591 852945 1564 29805 113487 511343 388336 930836 627579 603509 898323 589617 719776 536348 741963 738897 849284 889426 716364 565416 109186 814947 415357 67332 926357 976937 191937 386982 206151 456191 400844 445090 936501 866726 621707 362407 242445 410918 67054 517583 60718 157170 4...

result:

ok accepted

Test #76:

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

input:

500 2
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 ...

output:

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

result:

ok accepted

Test #77:

score: 0
Accepted
time: 11ms
memory: 7652kb

input:

500 2
1 1 0 1 1 1 1 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 1 1 ...

output:

2
0 1 
0 1 
1 0 
0 1 
0 1 
1 1 
0 1 
1 1 
1 1 
0 0 
1 0 
1 0 
0 1 
1 0 
0 1 
1 1 
1 1 
1 0 
0 1 
0 1 
1 1 
1 1 
1 0 
0 1 
1 0 
0 1 
0 0 
0 0 
1 0 
1 1 
0 0 
0 1 
0 0 
0 1 
0 0 
1 0 
0 1 
1 1 
1 1 
0 1 
1 1 
1 0 
0 1 
0 0 
0 1 
1 0 
0 0 
0 1 
1 0 
1 1 
0 0 
1 0 
0 1 
0 0 
0 1 
1 0 
0 1 
1 1 
1 0 
1 1...

result:

ok accepted

Test #78:

score: 0
Accepted
time: 12ms
memory: 9532kb

input:

500 2
1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 0 1 0 0 1 0 ...

output:

3
0 0 1 
0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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 accepted

Test #82:

score: 0
Accepted
time: 383ms
memory: 10600kb

input:

500 2
1 1 0 1 1 0 0 0 1 1 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 1 1 0 1 ...

output:

499
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 accepted

Test #83:

score: 0
Accepted
time: 7ms
memory: 9844kb

input:

500 3
1 2 2 0 0 2 1 0 2 0 1 1 1 2 0 1 2 0 1 0 0 1 1 1 1 0 1 1 0 2 0 1 2 1 1 1 0 0 1 2 1 2 1 0 1 0 1 2 0 0 1 1 2 1 1 0 2 1 2 0 0 1 0 1 1 2 0 2 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 0 2 2 2 2 2 1 0 2 2 2 0 2 1 0 0 2 1 1 0 0 2 1 2 1 0 0 0 1 2 0 1 1 2 1 0 1 1 2 0 1 0 2 2 0 0 0 1 1 0 0 1 1 1 1 0 0 2 2 2 1 1 2 1 2 0 0 2 2 2 2 2 0 2 2 1 1 2 0 2 1 2 2 0 2 1 1 2 2 0 2 2 1 2 0 0 0 2 2 0 1 0 0 2 2 2 1 1 0 0 2 2 2 0 2 0 2 2 0 0 0 1 1 2 1 2 0 2 1 1 1 ...

result:

ok accepted

Test #90:

score: 0
Accepted
time: 52ms
memory: 13572kb

input:

500 999983
600084 354810 695356 694963 740261 976441 931057 451539 787514 587432 200361 32666 114363 223120 835769 636984 224102 884977 125791 54271 689191 288315 644648 920841 890752 754003 975055 395378 815025 326844 843860 832939 991340 164903 166709 179020 535873 242232 36311 719958 235327 71948...

output:

1
266982 
461710 
361901 
490076 
181761 
403421 
98574 
386774 
44979 
943046 
835335 
742899 
700429 
244545 
703518 
430496 
664716 
738269 
64794 
505580 
219950 
660540 
190424 
468690 
564676 
951695 
405084 
428907 
591325 
880540 
973026 
618892 
376165 
720595 
597218 
24736 
308673 
743971...

result:

ok accepted

Test #91:

score: 0
Accepted
time: 50ms
memory: 13436kb

input:

500 999983
236502 259388 894933 389412 31132 492352 66219 179383 751611 835854 894625 29869 505740 86443 436263 959089 919590 476734 315614 576241 87773 696110 869650 847487 323821 127730 110369 712354 250464 960583 20330 823541 310976 89061 548334 677494 249773 674827 906238 117481 542986 251993 29...

output:

2
56843 910731 
726648 348012 
651388 159384 
531846 977013 
630285 859875 
774771 650793 
235737 523589 
178780 250381 
846840 182693 
379829 369679 
309437 203003 
322074 80814 
51614 314155 
856446 231685 
309037 554986 
178164 334436 
566992 314107 
829516 398130 
978296 697204 
727274 827772 
8...

result:

ok accepted

Test #92:

score: 0
Accepted
time: 50ms
memory: 13432kb

input:

500 999983
845665 40567 300445 360428 563105 631843 737281 289393 555114 908486 644983 798289 576515 139561 368173 474784 846747 372571 528775 291224 654637 59085 787713 221324 423820 530796 34969 404718 155974 346920 872305 21318 837913 197827 521695 345572 287218 932851 173228 801211 103457 391690...

output:

3
596661 959659 481173 
983237 878760 939718 
969008 573182 327514 
393492 754677 169078 
732720 312561 782376 
173306 732908 671284 
536055 895712 420776 
280731 463924 226885 
770468 228639 47993 
393609 515809 439740 
437093 131563 447977 
166697 447143 947806 
912432 5124 59496 
153987 446914 36...

result:

ok accepted

Test #93:

score: 0
Accepted
time: 60ms
memory: 13852kb

input:

500 999983
352638 3005 134609 158861 456935 487024 104305 501997 243595 664916 384997 818185 795608 396730 923463 33639 53077 887112 774020 382111 671811 462942 567818 67904 322375 229385 683518 979314 487183 536673 964850 665968 149320 472237 261544 18617 859314 465017 19885 537509 472299 897402 90...

output:

10
903310 353990 700917 448896 899380 674464 847690 983491 729390 348638 
704312 548267 8822 168629 880566 458697 346775 255033 79148 140504 
593748 630085 150523 122750 869626 933199 833180 893354 309640 979887 
309661 735357 379741 644426 543574 323223 567992 21480 143429 659329 
159406 273973 573...

result:

ok accepted

Test #94:

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

input:

500 999983
564414 184652 203275 785086 214667 381329 50398 492658 576572 68633 496317 742540 933273 167019 39155 68937 593470 407060 92281 343556 938557 458676 251350 803932 313687 413828 562249 119551 774099 380723 866898 650428 20020 400344 526016 398187 392697 690617 930161 405280 517232 987985 5...

output:

100
955933 811245 867558 281017 504116 639018 481936 528951 182415 494625 674228 423051 461553 683481 639634 253797 605226 765911 576271 302890 770995 499879 7318 803213 930537 308634 122226 643312 976251 702931 158219 685984 95521 311055 819128 560185 586227 156213 251890 120200 277805 667152 41614...

result:

ok accepted

Test #95:

score: 0
Accepted
time: 423ms
memory: 14584kb

input:

500 999983
408207 353421 412650 918446 272083 59504 213237 578503 520887 313427 285379 75257 796484 161024 118820 628274 690923 337630 991340 445603 325771 393393 251429 68301 472810 60629 108211 252846 459336 844975 61058 135355 280774 475274 628694 53345 654572 534617 694749 702577 961067 956206 1...

output:

500
297978 716857 287190 313165 574287 63089 296592 237798 383754 674996 364458 284112 189060 197610 639937 669725 329639 631430 618142 112814 526200 797565 270925 587007 735441 965922 143024 204042 170712 14933 150591 255305 314655 424782 858659 72666 790236 754147 725594 472469 593436 608725 22410...

result:

ok accepted

Test #96:

score: 0
Accepted
time: 424ms
memory: 14532kb

input:

500 999983
382361 289975 349242 485522 253727 296806 446856 44186 627260 757617 500243 252398 818192 483600 765365 375268 953847 282377 937493 749855 462748 614289 853317 62709 917896 488953 484053 446068 304193 553543 813861 525322 369029 501387 165716 836725 730925 351900 82530 246841 316218 71813...

output:

501
362797 673874 61185 635486 700333 380353 983161 811678 594623 722170 86902 680770 353367 645731 730013 708943 972967 741385 146920 231275 331071 264993 143797 474087 286386 754830 927354 151617 772611 953983 798167 92719 631626 871667 283652 889164 193424 46976 838784 818365 330903 706783 542076...

result:

ok accepted

Test #97:

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

input:

2 2
0 0
0 1

output:

1
0 
1 


result:

ok accepted

Test #98:

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

input:

2 2
1 1
1 0

output:

2
0 1 
1 1 


result:

ok accepted

Test #99:

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

input:

2 3
1 2
2 1

output:

1
1 
2 

result:

ok accepted

Test #100:

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

input:

2 3
0 2
2 0

output:

3
2 2 1 
1 1 1 

result:

ok accepted

Test #101:

score: 0
Accepted
time: 40ms
memory: 12384kb

input:

2 999983
700497 278087
278087 124569

output:

1
241213 
611583 

result:

ok accepted

Test #102:

score: 0
Accepted
time: 37ms
memory: 12532kb

input:

2 999983
444859 312909
312909 932115

output:

2
508915 783847 
151482 697019 

result:

ok accepted

Extra Test:

score: 0
Extra Test Passed