Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
import fractions
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=fractions.gcd(i,j)
      c=fractions.gcd(d,k)
      if i!=j and j!=k:
        x+=6*c
      elif i==j==k:
        x+=c
      else:
        x+=3*c
print(x)

Fixed submission:
k=int(input())
import math
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=math.gcd(i,j)
      c=math.gcd(d,k)
      if i!=j and j!=k:
        x+=6*c
      elif i==j==k:
        x+=c
      else:
        x+=3*c
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
import fractions
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=fractions.gcd(i,j)
      c=fractions.gcd(d,k)
      if i!=j and j!=k:
        x+=6*c
      elif (i!=j and j==k) or (k!=i and i==j):
        x+=3*c
      else:
        x+=c
print(x)

Fixed submission:
k=int(input())
import math
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=math.gcd(i,j)
      c=math.gcd(d,k)
      if i!=j and j!=k:
        x+=6*c
      elif i==j==k:
        x+=c
      else:
        x+=3*c
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
import fractions
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=fractions.gcd(i,j)
      c=fractions.gcd(d,k)
      if i!=j and j!=k and k!=i:
        x+=6*c
      elif (i!=j and j==k) or (j!=k and k==i) or (k!=i and i==j):
        x+=3*c
      else:
        x+=c
print(x)

Fixed submission:
k=int(input())
import math
x=0
c=0
d=0
for i in range(1,k+1):
  for j in range(i,k+1):
    for k in range(j,k+1):
      d=math.gcd(i,j)
      c=math.gcd(d,k)
      if i!=j and j!=k:
        x+=6*c
      elif i==j==k:
        x+=c
      else:
        x+=3*c
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
x+=-1
y+=-1
k=[]
z=0
for i in range(n):
  k.append(0)
for i in range(n-1):
  for j in range(i+1,n):
    z=min(abs(x-i)+1+abs(j-y),abs(x-i)+abs(j-x),abs(y-i)+abs(j-y),j-i)
    k[z]+=1
    z=0
for i in range(1,n):
  print(k[i])

Fixed submission:
n,x,y=map(int,input().split())
x+=-1
y+=-1
k=[]
z=0
for i in range(n):
  k.append(0)
for i in range(n-1):
  for j in range(i+1,n):
    z=min(abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x),j-i)
    k[z]+=1
    z=0
for i in range(1,n):
  print(k[i])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
c=[0]*len(a)
all=0
for i in range(len(a)-1):
  for j in range(i+1,len(a)):
    if a[i]==a[j] and i!=j:
      c[i]+=1
      c[j]+=1
      all+=1
for i in range(len(a)):
  print(int(all-c[i]))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=[0]*n
#a[i]は1以上n以下で、cの要素番号は0~n-1(acは1ずれている。)
all=0
for i in range(n):
  c[a[i]-1]+=1
for i in range(n):
  if c[i]>=2:
    d=c[i]*(c[i]-1)/2
    all+=d
for i in range(n):
  print(int(all-(c[a[i]-1]-1)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=[[0]*len(a) for i in range(len(a))]
c=[]
all=0
for i in range(len(a)):
  c.append(0)
for i in range(len(a)):
  for j in range(len(a)):
    if a[i]==a[j] and i!=j:
      b[i][j]=1
      c[i]+=1/2
      c[j]+=1/2
      all+=0.5
for i in range(len(a)):
  print(int(all-c[i]))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=[0]*n
#a[i]は1以上n以下で、cの要素番号は0~n-1(acは1ずれている。)
all=0
for i in range(n):
  c[a[i]-1]+=1
for i in range(n):
  if c[i]>=2:
    d=c[i]*(c[i]-1)/2
    all+=d
for i in range(n):
  print(int(all-(c[a[i]-1]-1)))
Buggy python submission (verdict: Runtime Error):
from collections import deque
s=deque(input())
q=int(input())
direction=1
for i in range(q):
  k=deque(input().split())
  if k[0]=='1':
    direction*=(-1)
  if k[0]=='2':
    if k[1]=='1':
      if direction==1:
        s.appendleft(k[2])
      else:
        s.append(k[2])
    if k[1]=='2':
      if direction==1:
        s.append(k[2])
      else:
        s.appendleft(k[2])
if direction==-1:
  s.reverse()
print("".join(list(s)))

Fixed submission:
s=input()
z=0
for i in range(2):
  if s[i]==s[i+1]:
    z+=1
if z==2:
  print('No')
elif z<2:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
a=[[0]*3 for i in range(3)]
b=[]
for i in range(3):
  x=input().split()
  a[i][0]=x[0]
  a[i][1]=x[1]
  a[i][2]=x[2]
n=int(input())
for i in range(n):
  b.append(input())
for i in range(n):
  for j in range(9):
    if b[i]==a[j//3][j%3]:
      a[j//3][j%3]='X'
jud=[0,0,0,0]
z=0
res=0
for i in range(3):
  for j in range(2):
    if a[i][j]==a[i][j+1]:
      jud[0]+=1
    if a[j][i]==a[j+1][i]:
      jud[1]+=1
  if max(jud)>1:
    res-=1
for j in range(2):
  if a[j][j]==a[j+1][j+1]:
    jud[2]+=1
  if a[j][2-j]==a[j+1][2-j-1]:
    jud[3]+=1
  if max(jud)>1:
    res-=1
if res<0:
  print('Yes')
else:
  print('No')

Fixed submission:
n=int(input())
if n%2==0:
  print(n//2)
else:
  print((n+1)//2)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
A=int(a)
B=int(b)
C=int(c)
if  A==B and A!=C:
  print('Yes')
if  A==C and A!=B: 
  print('Yes')
if  B==C and B!=A: 
  print('Yes')
else: 
  print('No')


Fixed submission:
A,B,C = input().split()
if A==B and A!=C or B==C and B!=A or C==A and C!=B:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
if  A==B and A!=C:
  print('Yes')
if  A==C and A!=B: 
  print('Yes')
if  B==C and B!=A: 
  print('Yes')
else: 
  print('No')

Fixed submission:
A,B,C = input().split()
if A==B and A!=C or B==C and B!=A or C==A and C!=B:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
if A==B and A!=C:
  print('Yes')
if A==C and A!=B: 
  print('Yes')
if B==C and B!=A: 
  print('Yes')
else: 
  print('No')

Fixed submission:
A,B,C = input().split()
if A==B and A!=C or B==C and B!=A or C==A and C!=B:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
if A==B and A!=C: print('Yes')
if A==C and A!=B: print('Yes')
if B==C and B!=A: print('Yes')
else: print('No')

Fixed submission:
A,B,C = input().split()
if A==B and A!=C or B==C and B!=A or C==A and C!=B:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=input()
N=int(n)
A=input().split()
for i in range(N):
  if int(A[i])%2==0:
    if int(A[i])%5==0 or int(A[i])%3==0:
      x+=1
  else:
    x+=1
if x==N:
  print('APPROVED')
else:
  print('DENIED')


Fixed submission:
N=int(input())
A=input().split()
x=0
for i in range(N):
  if int(A[i])%2==0:
    if int(A[i])%5==0 or int(A[i])%3==0:
      x+=1
  else:
    x+=1
if x==N:
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=input().split()
for i in range(N):
  if int(A[i])%2==0:
    if int(A[i])%5==0 or int(A[i])%3==0:
      x+=1
  else:
    x+=1
if x==N:
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
N=int(input())
A=input().split()
x=0
for i in range(N):
  if int(A[i])%2==0:
    if int(A[i])%5==0 or int(A[i])%3==0:
      x+=1
  else:
    x+=1
if x==N:
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=input().split
for i in range(N):
  if int(A[i])%2==0:
    if int(A[i])%5==0 or int(A[i])%3==0:
      x+=1
  else:
    x+=1
if x==N:
  print('APPROVED')
else:
  print('DENIED')





Fixed submission:
N=int(input())
A=input().split()
x=0
for i in range(N):
  if int(A[i])%2==0:
    if int(A[i])%5==0 or int(A[i])%3==0:
      x+=1
  else:
    x+=1
if x==N:
  print('APPROVED')
else:
  print('DENIED')
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
a //= d
c //= a
print("Yes" if a >= c else "No")

Fixed submission:
a, b, c, d = map(int, input().split())
print("Yes" if (a + d - 1) // d >= (c + b - 1) // b else "No")
Buggy python submission (verdict: Runtime Error):
A, B, X = map(int, input().split())

n = int(X / A)
n = int(X / A) - B * len(str(n))

while X < A * n + B * len(str(n)):
    n -= 1

if n > 1000000000:
    n = 1000000000

if n < 0:
    n = 0

print(n)

Fixed submission:

S = input()

day = ['SUN','MON','TUE','WED','THU','FRI','SAT']

n = day.index(S)

print(7 - n)

Buggy python submission (verdict: Runtime Error):
A, B, X = map(int, input().split())

n = int(X / A)

while X < A * n + B * len(str(n)):
    n -= 1

if n > 1000000000:
    n = 1000000000

if n < 0:
    n = 0

print(n)



Fixed submission:

S = input()

day = ['SUN','MON','TUE','WED','THU','FRI','SAT']

n = day.index(S)

print(7 - n)

Buggy python submission (verdict: Runtime Error):
A, B, X = map(int, input().split())

n = 10 ** (len(str(X)) - 1)
n = int(X / A)

while X < A * n + B * len(str(n)):
    n -= 1

if n > 1000000000:
    n = 1000000000

if n < 0:
    n = 0

print(n)



Fixed submission:

S = input()

day = ['SUN','MON','TUE','WED','THU','FRI','SAT']

n = day.index(S)

print(7 - n)
Buggy python submission (verdict: Runtime Error):
import math

def main():
    inputs = input().split()
    inputs = [int(i) for i in inputs]

    a = inputs[0]
    b = inputs[1]

    g = gcd(a, b)
    d = {}

    min_n = min([a, b])

    for i in range(2, int(math.sqrt(min_n + 1))):
        while True:
            if g % i == 0:
                g /= i
                d[i] = i
            else:
                break

    print(len(d) + 1)

def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)

if __name__ == "__main__":
    main()


Fixed submission:
def main():
    n = int(input())

    if n % 2 == 0:
        print(0.5)
    else:
        print(float(int(n / 2)+1) / n)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else
    print('AGC')



Fixed submission:
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
L = list(map(int, input().split()))

if N == K:
    print(1)
elif N / K == 1:
    print(2)
else:
    print(int(N / (K-1)))


Fixed submission:
N = input()
S = 0

for i in N:
    S += int(i)

if int(N) % S == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
a = list(map(int, input().split()))

c = 0

while True:
    gusu = False

    for i, aa in enumerate(a):
        if gusu is False and a[i] % 2 == 0:
            a[i] /= 2
            gusu = True
            continue

    if gusu is False:
        break

    c += 1

print(c)


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

c = 0

for i, aa in enumerate(a):
    while a[i] % 2 == 0:
        a[i] /= 2
        c += 1

print(c)

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

c = 0

while True:
    gusu = False

    for i, aa in enumerate(a):
        if gusu is False and a[i] % 2 == 0:
            a[i] /= 2
            gusu = True

    if gusu is False:
        break

    c += 1

print(c)


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

c = 0

for i, aa in enumerate(a):
    while a[i] % 2 == 0:
        a[i] /= 2
        c += 1

print(c)
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
ai=int(a)
b=int(float(b)*100)//1

print(int(a*b/100))


Fixed submission:
a,b=input().split()
ai=int(a)
bi=int(float(b)*100)//1
bi=int(b.replace('.',''))

print(ai*bi//100)

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
ai=int(a)
b=int(float(b)*100//1)

print(int(a*b/100))


Fixed submission:
a,b=input().split()
ai=int(a)
bi=int(float(b)*100)//1
bi=int(b.replace('.',''))

print(ai*bi//100)

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
ai=int(a)
bf100=b*100

print(int(ai*bf100/100))

Fixed submission:
a,b=input().split()
ai=int(a)
bi=int(float(b)*100)//1
bi=int(b.replace('.',''))

print(ai*bi//100)
Buggy python submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input().split())
flg=False
for i in range(a,b+1):
  if i % k = 0:
    flg=True
    break
if flg:
  print('OK')
else:
  print('NG')
    

Fixed submission:
K = int(input())
A,B = map(int,input().split())

flg = False
for i in range(A,B+1):
  if i % K == 0:
    flg = True

if flg :
  print("OK")
else:
  print("NG")
Buggy python submission (verdict: Runtime Error):
import math

R = int(input())

print(2 * math.pai * R)

Fixed submission:
R = int(input())

print(2*3.141592*R)

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

R = int(input())

print(2 * math.pa * R)

Fixed submission:
R = int(input())

print(2*3.141592*R)
Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int,input().split())

ilist = list()
a=2*10**9
for i in range(R+1)[L:]:
  imod = i % 2019
  if imod in ilist:
    continue
  ilist.append(imod)
  for j in range(R+1)[i+1:]:
    jmod = j % 2019
    m = (imod * jmod) % 2019
    a = min(a,m)

print(a)

Fixed submission:
L,R = map(int,input().split())

ilist = list()
a=2*10**9
for i in range(R+1)[L:L+2020]:
  imod = i % 2019
  if imod in ilist:
    continue
  ilist.append(imod)
  for j in range(R+1)[i+1:i+1+2020]:
    jmod = j % 2019
    m = (imod * jmod) % 2019
    a = min(a,m)

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int,input().split())

a=2*10**9
for i in range(R+1)[L:]:
  for j in range(R+1)[i+1:]:
    imod = i % 2019
    jmod = j % 2019
    m = (imod * jmod) % 2019
    a = min(a,m)

print(a)

Fixed submission:
L,R = map(int,input().split())

ilist = list()
a=2*10**9
for i in range(R+1)[L:L+2020]:
  imod = i % 2019
  if imod in ilist:
    continue
  ilist.append(imod)
  for j in range(R+1)[i+1:i+1+2020]:
    jmod = j % 2019
    m = (imod * jmod) % 2019
    a = min(a,m)

print(a)
Buggy python submission (verdict: Runtime Error):
w,h,x,y = map(int,input().split())

s = (w*h/2)

if (w/2 == x and h/2 != y)
or (w/2 != x and h/2 == y) \
or (w == x and 0 == y) \
or (0 == x and h == y) \
or (w == x and h == y) \
or (0 == x and 0 == y)):
  print(s,0)
else:
  print(s,1)



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

s = (w*h/2)

if (w/2 == x and h/2 == y):
  print(s,1)
else:
  print(s,0)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input())

a=n-k

print(a)

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

a=0

if k != 1:
  a=n-k
 
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))

sum = 0
a_3 = int(a[3])
a_0 = a[0]
a_1 = a[1]

for i in range (a_3):
    if a_0 > 0:
        sum += 1
        a_0 -= 1
    elif a_0 == 0 and a_1 > 0:
        sum += 0
        a_1 -= 1
    else: sum -= 1
    
print(sum)

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

sum = 0
a_3 = a[3]
a_0 = a[0]
a_1 = a[1]
a_2 = a[2]


if a_3 <= a_0:
    print (a_3)
    
elif a_3 > a_0 and a_3 <= (a_0 + a_1):
    print (a_0)
    
else:
    sum = a_0 - (a_3 - a_0 - a_1)
    print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys

rl = sys.stdin.buffer.readline
INF = sys.maxsize

X = int(rl())
SS = [c for c in rl().strip()]

W = ord(b'W')
R = ord(b'R')

last_pos = len(SS)-1
swap_count = 0
for i in range(len(SS)):
  if SS[i] == W:
    for j in range(last_pos, i, -1):
      if SS[j] == R:
        tmp = SS[i]
        SS[i] = SS[j]
        SS[j] = tmp
        last_pos = j-1
        swap_count += 1
        break

print(swap_count)

Fixed submission:
#!/usr/bin/env python3
import sys
from collections import deque

rl = sys.stdin.buffer.readline
INF = sys.maxsize

X = int(rl())
SS = [c for c in rl().strip()]

W = ord(b'W')
R = ord(b'R')

WP = []
RP = []
for i in range(len(SS)):
  if SS[i] == W:
    WP.append(i)
  elif SS[i] == R:
    RP.append(i)

RP.reverse()

WP = deque(WP)
RP = deque(RP)

sc = 0
while len(WP) != 0 and len(RP) != 0:
  w = WP.popleft()
  r = RP.popleft()
  if w < r:
    sc += 1

print(sc)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1

if '0' in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
    if s > 10 ** 18:
        s = -1
        break
print(s)

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

if 0 in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
        if s > 10 ** 18:
            s = -1
            break
print(s)

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

if '0' in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
if s > 10 ** 18:
    s = -1
print(s)

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

if 0 in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
        if s > 10 ** 18:
            s = -1
            break
print(s)

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

if '0' in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
    if s > 10 ** 18:
        s = -1
print(s)

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

if 0 in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
        if s > 10 ** 18:
            s = -1
            break
print(s)

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

for i in range(n):
    s = s * a[i]
if s > 10 ** 18:
    s = -1
print(s)

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

if 0 in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
        if s > 10 ** 18:
            s = -1
            break
print(s)
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split())

if n == 0:
    print(0)
elif a == 0:
    print(0)
elif b == 0:
    print(n)
elif a >= n:
    print(n)
elif a+b > n > a:
    print(a)
else:
    q,mod = divmod(n, a+b)
    print(q*a + mod)

Fixed submission:
s = list(input())
if s[0] == s[1]:
    if s[1] == s[2]:
        print('No')
    else:
        print('Yes')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split())

if n == 0:
    print(0)
elif: a == 0:
    print(0)
elif b == 0:
    print(n)
elif a >= n:
    print(n)
elif a+b > n > a:
    print(a)
else:
    q,mod = divmod(n, a+b)
    print(q*a + mod)

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

q, mod  =divmod(n, a+b)
print(q*a + min(mod,a))

Buggy python submission (verdict: Runtime Error):
f a == 0:
    print(0)
elif a > n:
    print(n)
elif a+b > n:
    print(a)
else:
    q,mod = divmod(n, a+b)
    print(q*a + mod)

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

q, mod  =divmod(n, a+b)
print(q*a + min(mod,a))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf') for i in range(n)]
dp[0] = 0

def chmin(a, b):
    if a > b:
        return b
    else:
        return a
    
for i in range(n-1):
    if i == 0:
        dp[i+1] = abs(h[i+1] - h[i])
    else:
        for j in range(k):
            dp[i+1] = chmin(dp[i+1], dp[i-j] + abs(h[i+1] - h[i-j]))
print(dp[n-1])

Fixed submission:
n,k = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf') for i in range(n)]
dp[0] = 0

def chmin(a, b):
    if a > b:
        return b
    else:
        return a
    
for i in range(n-1):
    if i == 0:
        dp[i+1] = abs(h[i+1] - h[i])
    else:
        for j in range(k):
            dp[i+1] = chmin(dp[i+1], dp[i-j] + abs(h[i+1] - h[i-j]))
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
count = 0
for i in range(k+1):
    x = k - i
    for j in range(k+1):
        y = k - j
        for l in range(k+1):
            z = k - l
            ss = x+y+z
            if ss == s:
                count += 1
print(count)

Fixed submission:
k,s = map(int, input().split())
count = 0
for i in range(k+1):
    x = k - i
    for j in range(k+1):
        y = k - j
        z = s - x - y
        if 0 <= z <= k:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input)
a = 1000 - N
print(a)

Fixed submission:
a = int(input(""))
if 1000 >= a:
    print(1000 - a)
elif 2000 >= a > 1000:
    print(2000 - a)
elif 3000 >= a > 2000:
    print(3000 - a)
elif 4000 >= a > 3000:
    print(4000 - a)
elif 5000 >= a > 4000:
    print(5000 - a)
elif 6000 >= a > 5000:
    print(6000 - a)
elif 7000 >= a > 6000:
    print(7000 - a)
elif 8000 >= a > 7000:
    print(8000 - a)
elif 9000 >= a > 8000:
    print(9000 - a)
else:
    print(10000 - a)
Buggy python submission (verdict: Runtime Error):
1 N = int(input())
2 s = [input() for i in range(N)]
3 for v in ['AC', 'WA', 'TLE', 'RE']:
4 print('{0} x {1}'.format(v, s.count(v)))

Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
 print('{0} x {1}'.format(v, s.count(v)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
c = str(input())

head = 0
tail = -1
count = 0

while head < N and tail+N >= 0:
    if c[head] == "W":
        while c[tail] == "W":
            tail -= 1
        if head >= N + tail:
            print(count)
            exit()
        tail -= 1
        count += 1
    head += 1
print(count)

Fixed submission:
N = int(input())
c = str(input())

head = 0
tail = -1
count = 0

while head < N:
    if c[head] == "W":
        while tail >= -N and c[tail] == "W":
            tail -= 1
        if head >= N + tail:
            print(count)
            exit()
        tail -= 1
        count += 1
    head += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
c = str(input())

head = 0
tail = -1
count = 0

while head < N:
    if c[head] == "W":
        while c[tail] == "W":
            tail -= 1
        if head >= N + tail:
            print(count)
            exit()
        tail -= 1
        count += 1
    head += 1
print(count)

Fixed submission:
N = int(input())
c = str(input())

head = 0
tail = -1
count = 0

while head < N:
    if c[head] == "W":
        while tail >= -N and c[tail] == "W":
            tail -= 1
        if head >= N + tail:
            print(count)
            exit()
        tail -= 1
        count += 1
    head += 1
print(count)