Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print((len(s)*k)//2)
elif s[0] == s[len(s)-1]:
    for i in range(1,len(l)-1):
        c2 = c2 + l[i]//2
    print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)



Fixed submission:
s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print((len(s)*k)//2)
elif s[0] == s[len(s)-1]:
    if len(s)==1:
        print(k//2)
    else:
        for i in range(1,len(l)-1):
            c2 = c2 + l[i]//2
        print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)

Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print(len(s)*k//2)
elif s[0] == s[len(s)-1]:
    for i in range(1,len(l)-1):
        c2 = c2 + l[i]//2
    print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)

Fixed submission:
s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print((len(s)*k)//2)
elif s[0] == s[len(s)-1]:
    if len(s)==1:
        print(k//2)
    else:
        for i in range(1,len(l)-1):
            c2 = c2 + l[i]//2
        print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
l = []
l2 = []
for i in range(q):
    l.append(int(input()))
for i in range(0,n):
    if k + l.count(i+1) - q>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n,k,q = map(int,input().split())
l = [0]*n
l2 = []
for i in range(q):
    l[int(input())-1] += 1
for i in range(0,n):
    if k + l[i] - q>0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
l = []
l2 = []
for i in range(q):
    l.append(int(input()))
for i in range(0,n):
    l2.append(l.count(i+1))
for i in range(0,n):
    if k + l2[i] - q>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n,k,q = map(int,input().split())
l = [0]*n
l2 = []
for i in range(q):
    l[int(input())-1] += 1
for i in range(0,n):
    if k + l[i] - q>0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
l = input()
t = input().sprit()
c = 0
for i in range(0,3):
  if l[i] == t[i]:
    c = c+1
  else:
    continue

print(c)


Fixed submission:
l = input()
t = input()
c = 0
for i in range(0,3):
  if l[i] == t[i]:
    c = c+1
  else:
    continue

print(c)

Buggy python submission (verdict: Runtime Error):
l = list(input().sprit())
t = list(input().sprit())
c = 0
for i in range(0,2):
  if l[i] == t[i]:
    c = c+1
  else:
    continue

print(c)

Fixed submission:
l = input()
t = input()
c = 0
for i in range(0,3):
  if l[i] == t[i]:
    c = c+1
  else:
    continue

print(c)
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().sprit()))
a = l[0]
b = l[1]
if b == 1:
    print(0)
else:
    print((b-1//a)+1)


Fixed submission:
l = list(map(int,input().split()))
a = l[0]
b = l[1]
if b == 1:
    print(0)
else:
    if (b-1)%(a-1) == 0:
        print((b-1)//(a-1))
    else:
        print((b-1)//(a-1)+1)

Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().sprit()))
a = l[0]
b = l[1]
if b == 1:
    print(0)
else:
    print((b+1) // a+1)

Fixed submission:
l = list(map(int,input().split()))
a = l[0]
b = l[1]
if b == 1:
    print(0)
else:
    if (b-1)%(a-1) == 0:
        print((b-1)//(a-1))
    else:
        print((b-1)//(a-1)+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
i = 0
c = 0
l2 = []
while i < n-1:
    if l[i] >= l[i+1]:
        c = c+1
        i = i+1
    else :
        l2.append(c)
        c = 0
        i = i+1
print(max(l2))

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
i = 0
c = 0
l2 = []
while i < n-1:
    if l[i] >= l[i+1]:
        c = c+1
        i = i+1
    else :
        l2.append(c)
        c = 0
        i = i+1
l2.append(c)
print(max(l2))
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split))
A = l[0]
B = l[1]
print(max(A+B,A-B,A*B))

Fixed submission:
l = list(map(int,input().split()))
A = l[0]
B = l[1]
print(max(A+B,A-B,A*B))
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
k = l[0]
x = l[1]
for i in range(x-k+1,x+k)
print(i )

Fixed submission:
l = list(map(int,input().split()))
k = l[0]
x = l[1]
for i in range(x-k+1,x+k):
    print(i )
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.append(10**9)
m = 'Yes'
for i in range(0,n-1)
  if l[n-i-1] <= l[n-i]:
    continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)


Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.append(1000000000)
m = 'Yes'
for i in range(0,n-1):
  if l[n-i-1] <= l[n-i]:
    continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.append(10**9)
m = 'Yes'
for i in range(0,n-1)
  if l[n-i-1] <= l[n-i]:
    Continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    Break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)


Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.append(1000000000)
m = 'Yes'
for i in range(0,n-1):
  if l[n-i-1] <= l[n-i]:
    continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.append(10**9)
m = 'Yes'
for i in range(0,n)
  if l[n-i-1] <= l[n-i]:
    Continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    Break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.append(1000000000)
m = 'Yes'
for i in range(0,n-1):
  if l[n-i-1] <= l[n-i]:
    continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
for i in range(0,n+1):
  if a[i] > b[i]:
    c = c + b[i]
  elif a[i] <= b[i]:
    c = c + a[i]
    b[i] = b[i] - a[i]
    if b[i] < a[i+1]:
      c = c + b[i]
      a[i+1] = a[i+1] - b[i]
    else:
      c = c + a[i+1]
      a[i+1] = 0
print(c)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
for i in range(0,n):
  if a[i] > b[i]:
    c = c + b[i]
  elif a[i] <= b[i]:
    c = c + a[i]
    b[i] = b[i] - a[i]
    if b[i] < a[i+1]:
      c = c + b[i]
      a[i+1] = a[i+1] - b[i]
    else:
      c = c + a[i+1]
      a[i+1] = 0
print(c)
Buggy python submission (verdict: Runtime Error):
r = map(int,input())
print(3*r**2)

Fixed submission:
r = int(input())
print(3*(r**2))

Buggy python submission (verdict: Runtime Error):
r = map(int, input())
print(3 * (r ** 2))

Fixed submission:
r = int(input())
print(3*(r**2))

Buggy python submission (verdict: Runtime Error):
r = map(int,input())
print(3*(r**2))

Fixed submission:
r = int(input())
print(3*(r**2))
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
n = l[0]
d = l[1]

if n % (2d+1) == 0:
  print(n // (2d+1))
else:
  print(n // (2d+1) + 1)

Fixed submission:
l = list(map(int,input().split()))
n = l[0]
d = l[1]

if n % (2*d+1) == 0:
  print(n // (2*d+1))
else:
  print(n // (2*d+1) + 1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for _ in range(n):
  l.append(int(input()))
m = max(l)
for i in range(0,n):
    if l[i] != m:
      print(m)
    else:
      l.pop(i)
      p = max(l)
      print(p)
      l.insert(i,m)

Fixed submission:
import copy
n = int(input())
l = []
for _ in range(n):
  l.append(int(input()))
m = max(l)
k = copy.copy(l)
k.remove(m)
m2 = max(k)
for i in range(0,n):
    if l[i] != m:
      print(m)
    else:
      print(m2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split())).sort()
a = l[n//2]
b = l[n//2 + 1]

print(b-a)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l = sorted(l)
a = l[n//2 - 1]
b = l[n//2]
 
print(b-a)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
import math
def Fa(x):
    return math.factorial(x)

for i in range(1,k+1):
    print((Fa(n-k+1)*Fa(k-1)//(Fa(i-1)*Fa(k-i)*Fa(n-k+1-i)*Fa(i)))%(10**9 +7))
  

Fixed submission:
n, k = map(int, input().split())
import math
def Fa(x):
    return math.factorial(x)

for i in range(1,k+1):
    if k-i < 0 or n-k+1-i < 0:
        print(0)
    else:
        print((Fa(n-k+1)*Fa(k-1)//(Fa(i-1)*Fa(k-i)*Fa(n-k+1-i)*Fa(i)))%(10**9 +7))
Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int,input().split())
e = (c*d)//(math.gcd(c,d))
l = [c,d,e]
l2 = [0,0,0]
for i in range(0,3):
    if a%l[i] == 0:
        l2[i] = b//l[i] - a//l[i] +1
    else:
        l2[i] = b//l[i] - a//l[i]
print(b-a+1 -l2[0] -l2[1] + l2[2])

Fixed submission:
import fractions
a, b, c, d = map(int,input().split())
e = c*d//fractions.gcd(c,d)
l = [c,d,e]
l2 = [0,0,0]
for i in range(0,3):
    if a%l[i] == 0:
        l2[i] = b//l[i] - a//l[i] +1
    else:
        l2[i] = b//l[i] - a//l[i]
print(b-a+1 -l2[0] -l2[1] + l2[2])

Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int,input().split())
e = c*d//math.gcd(c,d)
l = [c,d,e]
l2 = [0,0,0]
for i in range(0,3):
    if a%l[i] == 0:
        l2[i] = b//l[i] - a//l[i] +1
    else:
        l2[i] = b//l[i] - a//l[i]
print(b-a+1 -l2[0] -l2[1] + l2[2])

Fixed submission:
import fractions
a, b, c, d = map(int,input().split())
e = c*d//fractions.gcd(c,d)
l = [c,d,e]
l2 = [0,0,0]
for i in range(0,3):
    if a%l[i] == 0:
        l2[i] = b//l[i] - a//l[i] +1
    else:
        l2[i] = b//l[i] - a//l[i]
print(b-a+1 -l2[0] -l2[1] + l2[2])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
lb = []
la = []
c = 0
for _ in range(n):
    a,b = map(int,input().split())
    l.append([b,a])
l = sorted(l)
for i in range(0,n):
    lb.append(l[i][0])
    la.append(l[i][1])

for i in range(0,n):
    if lb[i] < sum(la[:i+1]):
        c = 1
        break
    else:
        continue
if c == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
l = []
c = 0
d = 0
for _ in range(n):
    a,b = map(int,input().split())
    l.append([b,a])
l = sorted(l)


for i in range(0,n):
    if l[i][0] < d + l[i][1]:
        c = 1
        break
    else:
        d = d+ l[i][1]
        continue
if c == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = {}
lb = []
la = []
c = 0
for _ in range(n):
    a,b = map(int,input().split())
    l[b] = a
l = sorted(l.items())
for i in range(0,n):
    lb.append(l[i][0])
    la.append(l[i][1])

for i in range(0,n):
    if lb[i] < sum(la[:i+1]):
        c = 1
        break
    else:
        continue
if c == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
l = []
c = 0
d = 0
for _ in range(n):
    a,b = map(int,input().split())
    l.append([b,a])
l = sorted(l)


for i in range(0,n):
    if l[i][0] < d + l[i][1]:
        c = 1
        break
    else:
        d = d+ l[i][1]
        continue
if c == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
l = list(map(input().split()))
x = l[0]
a = l[1]
if x < a:
  print('0')
else:
  print('10')

Fixed submission:
l = list(map(int, input().split()))
x = l[0]
a = l[1]
if x < a:
  print('0')
else:
  print('10')
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
p = list[0]
q = list[1]
r = list[2]
print(min([p+q,q+r,r+p]))


Fixed submission:
l = list(map(int,input().split()))
p = l[0]
q = l[1]
r = l[2]
print(min(p+q,q+r,r+p))

Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
p = list[0]
q = list[1]
r = list[2]
print(min(p+q,q+r,r+p))

Fixed submission:
l = list(map(int,input().split()))
p = l[0]
q = l[1]
r = l[2]
print(min(p+q,q+r,r+p))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split))
b = list(map(int,input().split))
c = 0

for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)


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

for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
b = []
c = 0
for _ in range(n):
  a.append(int(input()))
for _ in range(n):
  b.append(int(input()))
for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)

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

for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)
Buggy python submission (verdict: Runtime Error):
lis = map(int,list(input().split()))
lis.sort()
if lis == [5,5,7]:
  print('YES')
else:
  print('NO')


Fixed submission:
lis = list(map(int,input().split()))
lis.sort()
if lis == [5,5,7]:
  print('YES')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
lis = list(input().split())
lis.sort()
if lis = [5,5,7]:
  print('YES')
else:
  print('NO')

Fixed submission:
lis = list(map(int,input().split()))
lis.sort()
if lis == [5,5,7]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n=int(intput())
print(int((n**2-n)//2))

Fixed submission:
n=int(input())
print((n**2-n)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
seq = list(map(int,input().split()))
ans = "YES"

for i in range(N):
    for j in range(i+1, N):
        if seq[i] == seq[j]:
            ans = "NO"
            break
    if ans == "NO":
        break

print(ans)

Fixed submission:
N = int(input())
seq = list(map(int,input().split()))
ans = "YES"

seq.sort()

for i in range(N-1):
    if seq[i] == seq[i+1]:
        ans = "NO"
        break


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

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

print(ans)

Fixed submission:
n = int(input())
seq = list(map(int,input().split()))
ans = 1
minim = n

for i in range(1, n):
    minim = min(minim, seq[i-1])
    if minim > seq[i]:
        ans += 1

print(ans)

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

for i in range(1, len(seq)):
    if seq[i] <= n - i + 2:
        for j in range(0, i+1):
            if seq[j]<seq[i]:
                break
            if j==i:
                ans += 1

print(ans)

Fixed submission:
n = int(input())
seq = list(map(int,input().split()))
ans = 1
minim = n

for i in range(1, n):
    minim = min(minim, seq[i-1])
    if minim > seq[i]:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
memo1 = 0
memo2 = 0
ans = 0
stra = ""
strb = ""
str1 = ""
str2 = ""

for a in range(1,10):
    for b in range(1,10):
        stra = str(a)
        strb = str(b)
        for i in range(1, n+1):
            str1 = str(i)[0]
            str2 = str(i)[-1]
            if str1 == stra and str2 == strb:
                memo1 += 1
            if str1 == strb and str2 == stra:
                memo2 += 1
        ans += memo1 * memo2
        memo1 = 0
        memo2 = 0



print(ans)

Fixed submission:
n = int(input())
memo1 = 0
memo2 = 0
ans = 0
stra = ""
strb = ""
str1 = ""
str2 = ""

for a in range(1,10):
    for b in range(1,10):
        stra = str(a)
        strb = str(b)
        for i in range(1, n+1):
            str1 = str(i)[0]
            str2 = str(i)[-1]
            if str1 == stra and str2 == strb:
                memo1 += 1
            if str1 == strb and str2 == stra:
                memo2 += 1
        ans += memo1 * memo2
        memo1 = 0
        memo2 = 0



print(ans)
Buggy python submission (verdict: Runtime Error):
import math

a = list(map(int,input().split()))

print(int(a[0]*a[1]/math.gcd(a[0],a[1])))

Fixed submission:
import fractions

a = list(map(int,input().split()))

print(int(a[0]*a[1]/fractions.gcd(a[0],a[1])))
Buggy python submission (verdict: Runtime Error):
import math
N = len(str(input()))
K = int(input())
print((math.factorial(N) // (math.factorial(N-K) * math.factorial(K)))*(9**K))

Fixed submission:
import math
N = int(input())
l = len(str(N))
K = int(input())
def calc(a, b, c):
    t = 0
    if a-b-1>=0:
        t = (math.factorial(a-1) // (math.factorial(a-b-1) * math.factorial(b)))*(9**(b))
    if b==1:
        t2 = int(str(c)[0])
    else:
        t2 = (math.factorial(a-1) // (math.factorial(a-b) * math.factorial(b-1)))*(9**(b-1))*(int(str(c)[0])-1)
    t3 = 0
    try:
        n = int(str(c)[1:])
        if 2<=b<=len(str(n))+1:
            t3 = calc(len(str(n)), b-1, n)
    except:
        pass
    return t+t2+t3

if l>=K:
    print(calc(l, K, N))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
H, A = map(int, input.split())
print((H+A-1)//A)

Fixed submission:
H, A = map(int, input().split())
print((H+A-1)//A)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))
result = 0
for i in range(1,N+1):
    if P[i-1]==min(P[:i]):
        result += 1
print(result)

Fixed submission:
N = int(input())
P = [0] + list(map(int, input().split()))
result = 0
minVal = P[1]
for i in range(1,N+1):
    minVal = min(minVal, P[i])
    if P[i]==minVal:
        result += 1
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
[n,k]=[int(x) for x in input().split()]
p=[int(x) for x in input().split()]

def kitai(x):
	sum = x*(1+x)/2
	return sum/x

max=0
for i in range(n-k+1):
	sum=0
	for j in range(k):
		sum+=kitai(p[i+j])
	if sum>max:
		max=sum
	
print(max)	

Fixed submission:
[n,k]=[int(x) for x in input().split()]
P=[int(x) for x in input().split()]

E=[0]*n #期待値=E[i]
S=[0]*(n+1) #累積和=S[i+1]=E[0]+E[1]+...+E[i](S[0]=0)

for i in range(n):
	E[i]=(1+P[i])/2
	S[i+1]=S[i]+E[i]
max=0
for i in range(k,n+1):
	if S[i]-S[i-k] > max:
		max=S[i]-S[i-k]
print(max)
Buggy python submission (verdict: Runtime Error):
[n,m] = [int(x) for x in input().split()]
ac=[0]*(n+1)
wa=[0]*(n+1)
cnt_ac=0
cnt_wa=0
for i in range(m):
	p,s=input().split()
	p=int(p)
	if s=="AC":
		if	fac[p]==0:
			cnt_ac+=1
			cnt_wa+=wa[p]
			ac[p]=1
		
	else: 
		wa[p]+=1

print(int(cnt_ac),int(cnt_wa))

Fixed submission:
[n,m] = [int(x) for x in input().split()]
ac=[0]*(n+1)
wa=[0]*(n+1)
cnt_ac=0
cnt_wa=0
for i in range(m):
	p,s=input().split()
	p=int(p)
	if s=="AC":
		if ac[p]==0:
			cnt_ac+=1
			cnt_wa+=wa[p]
			ac[p]=1
	else: 
		wa[p]+=1

print(int(cnt_ac),int(cnt_wa))
Buggy python submission (verdict: Runtime Error):
def lcm (a,b):
	if a<b:
		t=a
		a=b
		b=t
	x=a*b
	r=a%b
	while r!=0:
		a=b
		b=r
		r=a%b
	return x/b

[n, m]=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
i=0
a_lcm=a[0]
for i in range(n-1):
	a_lcm = lcm(a_lcm,a[i+1])

print(int(((m*2/a_lcm)+1)/2))

Fixed submission:
[s,t] = [int(x) for x in input().split()]
if 500*s >= t:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
x = int(input())
if x==2:
	print(2)
elif x==3:
	print(3)
else:
	print(nextprime(x))


Fixed submission:
x=int(input())

import math

def trial_division(target):
    dest = int(math.sqrt(target))
 
    for i in range(2,dest):
        if target % i == 0:
            #print("False")
            return
    print(x)
    exit()

while 1:
    trial_division(x)
    x+=1

Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
x = int(input())
if x==2:
	print(int(2))
elif x==3:
	print(int(3))
else:
	print(nextprime(x))

Fixed submission:
x=int(input())

import math

def trial_division(target):
    dest = int(math.sqrt(target))
 
    for i in range(2,dest):
        if target % i == 0:
            #print("False")
            return
    print(x)
    exit()

while 1:
    trial_division(x)
    x+=1

Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
x = int(input())
if x==2:
	print(int(2))
elif x ==3:
	print(int(3))
else:
	print(int(nextprime(x)))

Fixed submission:
x=int(input())

import math

def trial_division(target):
    dest = int(math.sqrt(target))
 
    for i in range(2,dest):
        if target % i == 0:
            #print("False")
            return
    print(x)
    exit()

while 1:
    trial_division(x)
    x+=1
Buggy python submission (verdict: Runtime Error):
num = int(input())
str = list(input())
alp = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
out=""
for i in range(len(str)):
	for l in range(len(alp)):
		if str[i]==alp[l]:
			out+=alp[l+num]
			break
print(out)


Fixed submission:
num = int(input())
str = list(input())
alp = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
out=""
for i in range(len(str)):
	for l in range(len(alp)):
		if str[i]==alp[l]:
			out+=alp[(l+num)%26]
			break
print(out)
Buggy python submission (verdict: Runtime Error):
r=input()
print(r*r)

Fixed submission:
r=int(input())
r=r*r
print(r)