Under construction

Still being built. Things may change

Balmer's Peak Theory

Interview

Time limit1sMemory limit1024 MB

Summary
Count the hours when the alcohol consumed in the last L hours keeps blood alcohol concentration between 0.129 and 0.138 until the test starts.
Level

Easy3 of 10

Topics
Sliding window, Array
Solved
No attempts yet

문제

Balmer's Peak theory holds that a person whose blood alcohol concentration CC is in the range 0.129≤C≤0.1380.129 \leq C \leq 0.138 gains superhuman programming ability. Giryeong follows this theory, so until the coding test starts, he will try to keep his blood alcohol concentration in that range for as long as possible. Each hour he drinks a fixed amount of alcohol, and the alcohol he has consumed is broken down after a set amount of time. Find how long Giryeong can keep his blood alcohol concentration between 0.1290.129 and 0.1380.138 from now until the coding test. The concentration increase is calculated as the alcohol amount A×0.001A \times 0.001, and the initial blood alcohol concentration is 00.

입력

The first line contains the time N(1≤N≤1 000 000)N(1 \leq N \leq 1\ 000\ 000) remaining until the coding test and the duration L(1≤L≤10 000,L≤N)L(1 \leq L \leq 10\ 000, L \leq N) of the alcohol intake, separated by a space.

The second line contains the alcohol amounts ai(0≤ai≤200)a_i(0 \leq a_i \leq 200) in the drinks, separated by spaces.

출력

Print the number of hours during which the blood alcohol concentration CC stays within 0.129≤C≤0.1380.129 \leq C \leq 0.138.

Examples2

  1. Example 1

    Input
    5 3
    45 44 44 43 40
    
    Expected output
    2
    
  2. Example 2

    Input
    2 1
    129 138
    
    Expected output
    2