ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1895. Steaks on Board

Here are some tests.
Posted by vectorlmn 15 Apr 2025 20:32
input:
10 3
10
2 4 8 9 9 10 11 18 22 29
output:
8
0 1
0 3
0 3
1 8
1 8
3 9
8 9
9 17
17 21
21 28

input:
10 3
50
70 113 132 135 135 136 140 140 140 144 194 231 242 275 287 337 359 362 381 391 418 432 436 478 530 541 551 553 560 560 567 575 594 631 634 646 649 676 702 728 738 771 824 858 889 907 922 933 976 987
output:
75
60 69
103 112
125 131
125 131
125 134
130 134
130 139
130 139
131 139
134 143
184 193
221 230
232 241
265 274
277 286
327 336
352 358
352 358
371 380
381 390
408 417
426 431
426 431
468 477
520 529
531 540
543 550
543 552
550 552
550 552
565 566
565 566
584 593
624 630
624 630
639 645
639 645
666 675
692 701
718 727
728 737
761 770
814 823
848 857
879 888
897 906
912 921
923 932
966 975
977 986