Telephones
InterviewTime limit1sMemory limit64 MB
Add the fewest phones to empty desks so a ring hops from the first desk to the last with each hop spanning at most D.
Problem
A room holds desks in one row from left to right, each desk next to the following one. Some desks hold one telephone, and the rest are empty.
Every telephone is broken. The telephone on desk rings when the telephone on desk rings and .
The first desk and the last desk always hold a telephone. At the start the leftmost telephone rings. To make the telephone on the last desk ring, you place new telephones on empty desks. Find the smallest number of new telephones.
Input
The first line contains two positive integers and (, ).
The second line contains numbers separated by spaces, each of them or . If the -th number is , the -th desk from the left holds a telephone. If it is , that desk is empty.
Output
Print the smallest number of new telephones on the first line.
Hint
In the test cases worth points in total, holds.