K-Periodic Array
371A1000· newbie1s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
6 22 1 2 2 2 1
Output
1
Sample 2of 3
Input
8 41 1 2 1 1 1 2 1
Output
0
Sample 3of 3
Input
9 32 1 1 1 2 1 1 1 2
Output
3
58%
371A.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)