Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
for i in range(len(S)-len(T)+1):
	sub_S = S[i:i+len(T)]
	cnt = 0
	for j in range(len(T)):
		if sub_S[j] != T[j]:
			cnt += 1
	cnt_list.append(cnt)
print(min(cnt_list))

Fixed submission:
D,T,S =  map(int,input().split())
if D/S <= T:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))

Fixed submission:
S = input()
T = input()
cnt_list = []

for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

for i in range(len(S)-len(T)+1):
	sub_S = S[i:i+len(T)]
	cnt = 0
	for j in range(len(T)):
		if sub_S[j] != T[j]:
			cnt += 1
	cnt_list.append(cnt)
print(min(cnt_list))

Fixed submission:
S = input()
T = input()
cnt_list = []

for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))

Buggy python submission (verdict: Runtime Error):
for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))

Fixed submission:
S = input()
T = input()
cnt_list = []

for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
cnt_list = []

for j in range(len(S)-len(T)):
  sub_S  =  S[j:(j+len(S))]
  for k in range(len(T)-1):
    cnt = 0
    if T[k] != sub_S[k]:
      cnt += 1
    cnt_list.append(cnt)

print(min(cnt_list))
  

Fixed submission:
S = input()
T = input()
cnt_list = []

for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))


count = 0

for i in l:
    for j in l:
        for k in l:
            if l[i]+l[j]>l[k] & l[j]+l[k]>l[i] & l[k]+l[i]>l[j] & l[i!=j!=k:
                    count += 1

print(count)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))

count = 0

for i in range(0,n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[k]+l[i]>l[j] and l[i]!=l[j] and l[i]!=l[k] and l[j]!=l[k]:
                count += 1
                
print(count)
Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())

xy = [map(int, input().split()) for _ in range(5)]
x, y = [list(i) for i in zip(*xy)]


count = 0

for i, j in zip(x, y):
    if i*i + j*j <= d*d:
        count += 1

print(count)

Fixed submission:
n, d = map(int, input().split())

xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

count = 0

for i, j in zip(x, y):
    if i*i + j*j <= d*d:
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

count = 0

for i, j in zip(x, y):
    if i*i + j*j <= d*d:
        count += 1

print(count)

Fixed submission:
n, d = map(int, input().split())

xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

count = 0

for i, j in zip(x, y):
    if i*i + j*j <= d*d:
        count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
seven = 7
ans = 1

if k % 2 == 0:
    ans = -1
elif k == 1 or k == 7:
    ans = 1
else:
    while seven % k != 0:
        seven = seven * 10 + 7
        ans += 1

print(ans)


Fixed submission:
k = int(input())
seven = 7
ans = -1

for i in range(1,k+1):
    seven %= k
    if seven  == 0:
        ans = i
        break
    else:
        seven = seven * 10 + 7

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 1

for i in a:
    ans *= i

if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

ans = 1

for i in a:
    if i == 0:
        ans = 0

if ans != 0:
    for i in a:
        ans *= i
        if ans > 10**18:
            ans = -1
            break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())

max = 0

for x in range(n+1):
    y = ((a*x)//b) - (a * (x//b))
    if y > max:
        max = y

print(max)

Fixed submission:
a, b, n = map(int, input().split())

x = min(b-1, n)

print((a*x)//b)
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
sum = 0

for a in range(1,k+1):
    for b in range(1,k+1): 
        for c in range(1,k+1):
            sum += math.gcd(math.gcd(a, b), c)

print(sum)

Fixed submission:
from math import gcd
k = int(input())
sum = 0

for a in range(1,k+1):
    for b in range(1,k+1): 
        x = gcd(a,b)
        for c in range(1,k+1):
            sum += gcd(x, c)

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
sum = 0

for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            x = math.gcd(a, b)
            sum += math.gcd(x, c)

print(sum)

Fixed submission:
from math import gcd
k = int(input())
sum = 0

for a in range(1,k+1):
    for b in range(1,k+1): 
        x = gcd(a,b)
        for c in range(1,k+1):
            sum += gcd(x, c)

print(sum)
Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input().split())

a = z

z = y
y = x
x = a

print(x y z)


Fixed submission:
x, y, z = map(int, input().split())

a = z
b = x
c = y

print(a, b, c)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
min = n
fin = 0

while n >= 0:
    n = n - k
    if n >= 0:
        min = n
    else:
        fin = abs(n)

if min < fin:
    print(min)
else:
    print(fin)


Fixed submission:
n, k = map(int, input().split())

x = n % k
y = abs(x - k)

if x  < y:
    print(x)
else:
    print(y)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
max = 0
ans = 0

for i in range(0,n-n%k):
    sum = 0
    for j in range(i,i+k):
        sum += p[j]
    if sum > max:
        e = []
        for j in range(i, i+k):
            e.append(p[j])

for i in range(k):
    x = 0
    for j in range(e[i]+1):
        x += j
    x /= e[i]
    ans += x    

print(ans)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
e = []

for i in range(n):
    e.append(p[i] + 1)

sum_e = [0]

for i in range(1,n+1):
    sum_e.append(sum_e[i-1]+e[i-1])

ans = []

for i in range(n-k+1):
    ans.append(sum_e[i+k]-sum_e[i])

print(max(ans)/2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
ans = 1

for i in range(1,n):
    if min(p[0:i]) >= p[i]:
        ans += 1

print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 1
p_min = p[0]

for i in range(1,n):    
    if p_min >= p[i]:
        ans += 1
    p_min = min(p_min, p[i])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = map(int, input().split())
ans = 0

for i in range(1,n+1):
    mod = 0
    while n > 0:
        mod += (i % 10)
        i //= 10
    if mod >= a and mod <= b:
        ans += mod

print(ans)


Fixed submission:
n, a, b = map(int, input().split())
ans = 0

for i in range(1,n+1):
    mod = 0
    div = i
    while div > 0:
        mod += (div % 10)
        div //= 10
    if mod >= a and mod <= b:
        ans += i

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = map(int, input().split())
ans = 0

for i in range(1,n+1):
    mod = 0
    while n != 0:
        mod = mod + (i % 10)
        i = i // 10
    if mod >= a and mod <= b:
        ans += mod

print(ans)


Fixed submission:
n, a, b = map(int, input().split())
ans = 0

for i in range(1,n+1):
    mod = 0
    div = i
    while div > 0:
        mod += (div % 10)
        div //= 10
    if mod >= a and mod <= b:
        ans += i

print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split()[:2])
arr = list(map(int, input().split()[:N]))


def pos(X):
    sum = 0
    for i in arr:
        sum += int(i/X)
        if i % X == 0:
            sum -= 1
    return sum <= K


low = 0
high = 10 ** 9
mid = 0
ans = 10**9

while low <= high:
    mid = int((low+high)/2)
    # print(low, mid, high)
    if(pos(mid)):
        ans = mid
        high = mid-1
    else:
        low = mid+1
    # print(pos(mid))
print(ans)


Fixed submission:
N, K = map(int, input().split()[:2])
arr = list(map(int, input().split()[:N]))


def pos(X):
    sum = 0
    for i in arr:
        sum += int(i/X)
        if i % X == 0:
            sum -= 1
    return sum <= K


low = 1
high = 10 ** 9
mid = 0
ans = 10**9

while low <= high:
    mid = int((low+high)/2)
    # print(low, mid, high)
    if pos(mid):
        ans = mid
        high = mid-1
    else:
        low = mid+1
    # print(pos(mid))
print(ans)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split()[:2])
arr = list(map(float, input().split()[:N]))


def pos(X):
    sum = 0
    for i in arr:
        sum += int((i-1)/X)
    return sum <= K


low = 0
high = 10 ** 9
mid = 0
ans = 10**9

while low <= high:
    mid = int((low+high)/2)
    # print(low, mid, high)
    if(pos(mid)):
        ans = mid
        high = mid-1
    else:
        low = mid+1
    # print(pos(mid))
print(ans)


Fixed submission:
N, K = map(int, input().split()[:2])
arr = list(map(int, input().split()[:N]))


def pos(X):
    sum = 0
    for i in arr:
        sum += int(i/X)
        if i % X == 0:
            sum -= 1
    return sum <= K


low = 1
high = 10 ** 9
mid = 0
ans = 10**9

while low <= high:
    mid = int((low+high)/2)
    # print(low, mid, high)
    if pos(mid):
        ans = mid
        high = mid-1
    else:
        low = mid+1
    # print(pos(mid))
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
sum=0
for _ in range(N):
    a,b=map(int,input().split())
    if(a==b):
        sum+=1
        if(sum==3):
            name=[]
            name.append("Yes")
    else:
        sum=0
    
if name[0]=="Yes":
    print("Yes")
else:
    print("No")

Fixed submission:
N=int(input())
sum=0
name=[]
for _ in range(N):
    a,b=map(int,input().split())
    if(a==b):
        sum+=1
        if(sum==3):
            name.append("Yes")
    else:
        sum=0
    
if len(name)==0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
number=list(map(int,input().split()))
MOD = 10**9+7
sum=0
for i in range(N-1):
    for j in range(i+1,N):
        sum=(sum+((number[i]*number[j]%MOD)))%MOD
print(sum)

Fixed submission:
N=int(input())
number=list(map(int,input().split()))
MOD = 10**9+7
sum=sum(number)
s=sum%MOD
ans=0
for i in number:
    s-=i
    s%=MOD
    ans+=s*i
    ans%=MOD
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
number=list(map(int,input().split()))
MOD = 10**9+7
sum=0
total=0
for i in range(N-1):
    for j in range(i+1,N):
        sum=(sum+(((number[i]%MOD)*(number[j]%MOD))%MOD))%MOD
print(sum)

Fixed submission:
N=int(input())
number=list(map(int,input().split()))
MOD = 10**9+7
sum=sum(number)
s=sum%MOD
ans=0
for i in number:
    s-=i
    s%=MOD
    ans+=s*i
    ans%=MOD
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
number=list(map(int,input().split()))
MOD = 10**9+7
sum=[]
total=0
for i in range(N-1):
    for j in range(i+1,N):
        sum.append(((number[i]%MOD)*(number[j]%MOD))%MOD)
total=0
for i in range(len(sum)):
    total=(total+sum[i])%MOD
print(total)

Fixed submission:
N=int(input())
number=list(map(int,input().split()))
MOD = 10**9+7
sum=sum(number)
s=sum%MOD
ans=0
for i in number:
    s-=i
    s%=MOD
    ans+=s*i
    ans%=MOD
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
number=list(map(int,input().split()))
MOD = 1000000007
sum=0
for i in range(N-1):
    for j in range(i+1,N):
        sum+=number[i]*number[j]
print(sum%MOD)

Fixed submission:
N=int(input())
number=list(map(int,input().split()))
MOD = 10**9+7
sum=sum(number)
s=sum%MOD
ans=0
for i in number:
    s-=i
    s%=MOD
    ans+=s*i
    ans%=MOD
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
A=list(map(int,input().split()))
V=list()
for i in range(N-K+1):
  a=1
  for j in range(K):
    a=a*A[(i+j)]
  V.append(a)
for i in range((N-K)):
  if V[i]<V[i+1]:
    print("Yes")
  else:
    print("No")

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
V=list()
for i in range(N-K):
  if A[i]<A[K+i]:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N-K):
  a=1
  b=1
  for j in range(K):
    a=a*A[(i+j)]
    ##print(A[(i+j)],end=" ")
  ##print("")
  for j in range(K):
    b=b*A[(i+j+1)]
    ##print(A[(i+j+1)],end=" ")
  ##print("")
  ##print(a,b)
  if a<b:
    print("Yes")
  else:
    print("No")

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
V=list()
for i in range(N-K):
  if A[i]<A[K+i]:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
check=0
if (V>W) & (abs(A-B) / (V-W) <= T) & (abs(A-B) % (V-W) == 0):
    check=1
else:
    for i in range(T):
        if B>A:
            B=B+W
            A=A+V
        elif B<A:
            B=B-W
            A=A-V
        if A==B:
            check=1
            break
if check==1:
    print("YES")
else:
    print("NO")


Fixed submission:
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
D=abs(A-B)
S=V-W
if (S<=0):
    print("NO")
elif (D / S <= T):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
check=0
for i in range(T):
    if B>A:
        B=B+W
        A=A+V
    elif B<A:
        B=B-W
        A=A-V
    if A==B:
        check=1
        break
if check==1:
    print("YES")
else:
    print("NO")


Fixed submission:
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
D=abs(A-B)
S=V-W
if (S<=0):
    print("NO")
elif (D / S <= T):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
A=list(map(int,input().split()))
L=10**18
S=1
for i in range(N):
    S=S*A[i]
if S<=L:
    print(S)
else:
    print("-1")


Fixed submission:
N=int(input())
A=[]
A=list(map(int,input().split()))
A.sort(reverse=True)
L=10**18
S=1
if A[N-1]==0:
    print("0")
else:
    for i in range(N):
        S=S*A[i]
        if S>L:
            print("-1")
            break
    if S<=L:
        print(S)
Buggy python submission (verdict: Runtime Error):
S=input()split()
if S=="ABC":
    print("ARC")
else:
    print("ABC")

Fixed submission:
S=input()
if S=="ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split())
#print(N,K)
D=[[0 for i in range(N)] for j in range(K)]
#print(D)

for i in range(K):
    d=int(input())
    #print("d=",d)
    S=list(map(int, input().split()))
    #print("S=",S)
    for j in range(d):
        #print(S[j])
        D[(d-1)][S[j]-1] = 1
#print(D)
a = [0, 0, 0]
for i in range(K):
    a=list(map(sum, zip(a, D[:][i])))
    #print(a)
#print(a)
ans = 0
for i in a:
    if i == 0:
        ans = ans + 1
print(ans)

Fixed submission:
import numpy as np
N,K=map(int, input().split())
D = np.zeros((K, N))
for i in range(K):
    d=int(input())
    A=np.array(list(map(int, input().split())))
    for j in range(len(A)):
        D[i][A[j]-1] = 1
ans = D.sum(axis=0)
print(sum(ans == 0))
Buggy python submission (verdict: Time Limit Exceeded):
K,N=map(int,input().split())
#print(K,N)
A=list(map(int,input().split()))
#print(A)
#print(A[1:N])
#print(A[0:(N-1)])

D0 = 0
for i in range(N-1):
    D = A[1:N][i] - A[0:(N-1)][i]
    if D > D0:
        D0 = D
z = K - A[N-1] + A[0]
if z > D0:
    D0 = z
print(K - D0)


Fixed submission:
K,N=map(int,input().split())
#print(K,N)
A=list(map(int,input().split()))
#print(A)
#print(A[1:N])
#print(A[0:(N-1)])

D = max([i-j for i,j in zip(A[1:N], A[0:(N-1)])])
#print(D)
z = K - A[N-1] + A[0]
if z > D:
    D = z
print(K - D)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,K=map(int,input().split())
P=np.array(list(map(int,input().split())))

max_value=0
for i in range(N-K+1):
    if max_value < sum(P[i:i+K]):
        max_value = sum(P[i:i+K])
        max_i = i
max_vector = P[max_i:max_i+K]

sum_ex = 0
for i in range(K):
    sum_ex = sum_ex + sum(np.arange(max_vector[i]+1)) / max_vector[i]
print(sum_ex)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
    A=A-1
else:
    B=B-1
print(A,B)
Buggy python submission (verdict: Runtime Error):
H,N=map(int, input().split())
v = list(input().split())
v = [int(x) for x in v]
if H <= sum(v):
    print("Yes")
else:
    print("No")

Fixed submission:
import math
H,A=map(int, input().split())
print(math.ceil(H / A))
Buggy python submission (verdict: Runtime Error):
K,X = map(int, input().split())
v = 500 * K
if s >= X:
    print("Yes")
else:
    print("No")


Fixed submission:
K,X = map(int, input().split())
v = 500 * K
if v >= X:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a1 = max(a - k, 0)
if a1 >= 1:
    a2 = b
else:
    a2 = a + b - k
if a2 < 0:
    a2 = 0
print(a1, a2)


Fixed submission:
a,b,k = map(int, input().split())
a1 = max(a - k, 0)
if a1 >= 1:
    a2 = b
else:
    a2 = a + b - k
if a2 < 0:
    a2 = 0
print(a1, a2)
Buggy python submission (verdict: Runtime Error):
print(6-input()-input())

Fixed submission:
A = int(input())
B = int(input())
print(6 - A - B)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

s = deque(input())
q = int(input())
rev = 0 # revが0のとき先頭、1のとき後尾

for _ in range(q):
    t = input().split()

    if len(t) == 1:
        rev ^= 1
    else:
        if rev == 1:
            if t[1] == '1':
                s.append(t[2])
            else:
                s.appendleft(t[2])
        else:
            if t[1] == '1':
                s.appendleft(t[2])
            else:
                s.append(t[2])

if rev == 1:
    s.reverse()

for i in range(len(s)):
    print(s[i],end='')

print()


Fixed submission:
s = input()
q = int(input())

rev = 0
front = ""
back = ""
all_rev = 0

for i in range(q):
    t = input().split()

    # T_1 = 1の時
    if len(t) == 1:
        rev += 1
        all_rev += 1

    # T_1 = 2の時
    else:
        if rev%2 == 1:
            if t[1] == '1':
                back = back + t[2]
            else:
                front = t[2] + front
        else:
            if t[1] == '1':
                front = t[2] + front
            else:
                back = back + t[2]

# 反転するとき
if all_rev%2 == 1:
    s = s[::-1]
    front,back = back[::-1],front[::-1]

print(front + s + back)

Buggy python submission (verdict: Runtime Error):
from collections import deque

s = deque(input())
q = int(input())
rev = 0 # revが0のとき先頭、1のとき後尾

for _ in range(q):
    t = input().split()

    if len(t) == 1:
        rev ^= 1
    else:
        if rev == 1:
            if t[1] == '1':
                s.append(t[2])
            else:
                s.appendleft(t[2])
        else:
            if t[1] == '1':
                s.appendleft(t[2])
            else:
                s.append(t[2])

if rev == 1:
    s.reverse()

for i in range(len(word)):
    print(s[i],end='')

print()


Fixed submission:
s = input()
q = int(input())

rev = 0
front = ""
back = ""
all_rev = 0

for i in range(q):
    t = input().split()

    # T_1 = 1の時
    if len(t) == 1:
        rev += 1
        all_rev += 1

    # T_1 = 2の時
    else:
        if rev%2 == 1:
            if t[1] == '1':
                back = back + t[2]
            else:
                front = t[2] + front
        else:
            if t[1] == '1':
                front = t[2] + front
            else:
                back = back + t[2]

# 反転するとき
if all_rev%2 == 1:
    s = s[::-1]
    front,back = back[::-1],front[::-1]

print(front + s + back)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = (int(x) for x in input().split())
P = list(int(x) for x in input().split())

for i in range(N):
    sam = P[i]
    P[i] = (sam+1)/2

ans = 0
total = 0

for i in range(N-K+1):
    total = sum(P[:K+i]) - sum(P[:i])

    if ans < total:
        ans = total

print(ans)
    



Fixed submission:
N,K = (int(x) for x in input().split())
P = list(int(x) for x in input().split())

for i in range(N):
    sam = P[i]
    P[i] = (sam+1)/2

total1 = 0

for i in range(K):
    total1 += P[i]

ans = total1
total2 = 0

for i in range(N-K):

    total1 += P[K+i]
    total2 += P[i]
    
    if ans < total1 - total2:
        ans = total1 - total2


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = (int(x) for x in input().split())
P = list(int(x) for x in input().split())

for i in range(N):
    sam = P[i]
    P[i] = (sam+1)/2

total = [0] * (N-K+1)

for i in range(N-K+1):
    total[i] = sum(P[:K+i]) - sum(P[:i])

print(max(total))
    



Fixed submission:
N,K = (int(x) for x in input().split())
P = list(int(x) for x in input().split())

for i in range(N):
    sam = P[i]
    P[i] = (sam+1)/2

total1 = 0

for i in range(K):
    total1 += P[i]

ans = total1
total2 = 0

for i in range(N-K):

    total1 += P[K+i]
    total2 += P[i]
    
    if ans < total1 - total2:
        ans = total1 - total2


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = (int(x) for x in input().split())
cor = 0
mis = 0
numList = []
misList = {}

for _ in range(M):

    num,ans = input().split()

    if num not in numList:
        if num not in misList.keys():
            misList[num] = 0
            
        if ans == 'AC':
            cor += 1
            numList.append(num)
            mis += misList[num]
            misList.pop(num)
        else:
            misList[num] += 1

print(cor,mis)





Fixed submission:
N,M = (int(x) for x in input().split())
cor = 0
mis = 0
numList = [0] * N
misList = [0] * N

for _ in range(M):
    num,ans = input().split()

    if ans == 'WA':
        misList[int(num)-1] += 1
    else:
        if numList[int(num)-1] == 0:
            mis += misList[int(num)-1]
            cor += 1
            numList[int(num)-1] = 1

print(cor,mis)

Buggy python submission (verdict: Time Limit Exceeded):
N,M = (int(x) for x in input().split())
cor = 0
mis = 0
numList = []
misList = {}

for _ in range(M):

    num,ans = input().split()

    if num not in numList:
        if num not in misList.keys():
            misList[num] = 0
            
        if ans == 'AC':
            cor += 1
            numList.append(num)
            mis += misList[num]
        else:
            misList[num] += 1

print(cor,mis)





Fixed submission:
N,M = (int(x) for x in input().split())
cor = 0
mis = 0
numList = [0] * N
misList = [0] * N

for _ in range(M):
    num,ans = input().split()

    if ans == 'WA':
        misList[int(num)-1] += 1
    else:
        if numList[int(num)-1] == 0:
            mis += misList[int(num)-1]
            cor += 1
            numList[int(num)-1] = 1

print(cor,mis)