H - Hidden Sequence

Languages: C, C++, Java, Python, Kotlin
Time & Memory limits: (details)

Input

Output

Sample test(s)

Input
10 7 0 0 1 2 10 11 3 101 109 55 1 10 3 10 2 4 1 9 2 5 3 6 6 10
Output
8 7 4 7 5 5 5
Input
15 10 10 0 -9 3 3 4 6 -6 -4 -4 -11 -1 1 -2 0 3 10 3 12 5 6 3 15 10 15 6 6 3 5 1 1 12 14 4 10
Output
7 9 3 12 7 2 3 2 4 6

Hints