Buggy python submission (verdict: Runtime Error):
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
Max = 0
Sum = 0

for i in range(n-d+1):
  left = a[i]
  right = a[i+d-1]
  
  if i == 0:
    Sum = sum(a[i:i+d])
  else:
    Sum = Sum + right - left
    
  if Sum >= Max:
    Max = Sum
    ans = a[i:i+d]    
  else:
    pass

ans = np.array(ans)
ans = ans*0.5 + 0.5
print(sum(ans))

Fixed submission:
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
Max = 0
Sum = 0
a = np.array(a)
a = a*0.5 + 0.5
ans = []

if d == 1:
  print(max(a))
elif n == d:
  print(sum(a))
else:
  for i in range(n-d+1):
    left = a[i]
    right = a[i+d-1]

    if i == 0:
      Sum = sum(a[i:i+d])
      Max = sum(a[i:i+d])
      ans = a[i:i+d]
    else:
      Sum = Sum + right - a[i-1]

      if Sum >= Max:
        Max = Sum
        ans = a[i:i+d]
      else:
        pass

  print(sum(ans))

Buggy python submission (verdict: Runtime Error):
import numpypy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
a = np.array(a)

Max = 0

for i in range(n-d+1):
  Sum = a[i:i+d].sum()
 
  if Sum >= Max:
    Max = Sum
    ans = a[i:i+d]    
  else:
    pass
  
ans = ans*0.5 + 0.5
print(ans.sum())

Fixed submission:
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
Max = 0
Sum = 0
a = np.array(a)
a = a*0.5 + 0.5
ans = []

if d == 1:
  print(max(a))
elif n == d:
  print(sum(a))
else:
  for i in range(n-d+1):
    left = a[i]
    right = a[i+d-1]

    if i == 0:
      Sum = sum(a[i:i+d])
      Max = sum(a[i:i+d])
      ans = a[i:i+d]
    else:
      Sum = Sum + right - a[i-1]

      if Sum >= Max:
        Max = Sum
        ans = a[i:i+d]
      else:
        pass

  print(sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
a = np.array(a)

Max = 0

for i in range(n-d+1):
  Sum = a[i:i+d].sum()
 
  if Sum >= Max:
    Max = Sum
    ans = a[i:i+d]    
  else:
    pass
  
ans = ans*0.5 + 0.5
print(ans.sum())

Fixed submission:
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
Max = 0
Sum = 0
a = np.array(a)
a = a*0.5 + 0.5
ans = []

if d == 1:
  print(max(a))
elif n == d:
  print(sum(a))
else:
  for i in range(n-d+1):
    left = a[i]
    right = a[i+d-1]

    if i == 0:
      Sum = sum(a[i:i+d])
      Max = sum(a[i:i+d])
      ans = a[i:i+d]
    else:
      Sum = Sum + right - a[i-1]

      if Sum >= Max:
        Max = Sum
        ans = a[i:i+d]
      else:
        pass

  print(sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
Max = 0

for i in range(n-d+1):
  Sum = sum(a[i:i+d])
 
  if Sum >= Max:
    Max = Sum
    ans = a[i:i+d]    
  else:
    pass
  
ans = np.array(ans)
ans = ans*0.5 + 0.5
print(sum(ans))

Fixed submission:
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
Max = 0
Sum = 0
a = np.array(a)
a = a*0.5 + 0.5
ans = []

if d == 1:
  print(max(a))
elif n == d:
  print(sum(a))
else:
  for i in range(n-d+1):
    left = a[i]
    right = a[i+d-1]

    if i == 0:
      Sum = sum(a[i:i+d])
      Max = sum(a[i:i+d])
      ans = a[i:i+d]
    else:
      Sum = Sum + right - a[i-1]

      if Sum >= Max:
        Max = Sum
        ans = a[i:i+d]
      else:
        pass

  print(sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))

a = np.array(a)

e = a*0.5 + 0.5
ans = 0

for i in range(n-d+1):
  Sum = sum(e[i:i+d])
  
  if Sum >= ans:
    ans = Sum
  else:
    pass
  
print(ans)

Fixed submission:
import numpy as np
n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
Max = 0
Sum = 0
a = np.array(a)
a = a*0.5 + 0.5
ans = []

if d == 1:
  print(max(a))
elif n == d:
  print(sum(a))
else:
  for i in range(n-d+1):
    left = a[i]
    right = a[i+d-1]

    if i == 0:
      Sum = sum(a[i:i+d])
      Max = sum(a[i:i+d])
      ans = a[i:i+d]
    else:
      Sum = Sum + right - a[i-1]

      if Sum >= Max:
        Max = Sum
        ans = a[i:i+d]
      else:
        pass

  print(sum(ans))