Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- length = int(input())
- amount = int(input())
- last = -3
- need = 0
- for index in range(amount):
- broken = int(input())
- if broken and index - last >= length:
- need += 1
- last = index
- print(need)
Advertisement
Add Comment
Please, Sign In to add comment