Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y)/math.gcd(x, y)
E = lcm(C, D)
sample = B-A
ans = sample - ((B/C-A/C) + (B/D-A/D)-(B/E-A/E))
print(ans)

Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y)//math.gcd(x, y)
E = lcm(C, D)
sample = B-A
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)

Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)

Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A+1
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)


Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A+1
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)


Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A+1
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)


Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))

Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,D = map(int,input().split())
result = [i for i in range(A,B+1) if i%C!=0 and i%D!=0]
ans = len(result)
print(ans)


Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))
Buggy python submission (verdict: Runtime Error):
result=[]
N = int(input())
W = list(map(int,input().split()))
for i in range(1:N+1):
  a = W[:i]
  b = W[i+1:N]
  c = sum(a)
  d = sum(b)
  e = abs(c-d)
  result.append(e)
 
print(min(result))

Fixed submission:
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = [a,b,c]
print(min(d))

Buggy python submission (verdict: Runtime Error):
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = list(a,b,c)
print(min(d))

Fixed submission:
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = [a,b,c]
print(min(d))

Buggy python submission (verdict: Runtime Error):
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = list(a,b,c)
print(d.min())

Fixed submission:
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = [a,b,c]
print(min(d))
Buggy python submission (verdict: Runtime Error):
result=[]
N = int(input())
W = list(map(int,input().split()))
for i in range(1:N+1):
  a = W[:i]
  b = W[i+1:N]
  c = sum(a)
  d = sum(b)
  e = abs(c-d)
  result.append(e)
 
print(min(result))

Fixed submission:
N = int(input())
W = list(map(int, input().split()))
i = 0
W_sum = sum(W)
ans_l = []
tmp_l = 0
for i in range(N):
    tmp_l += W[i]
    if((W_sum-tmp_l) - tmp_l < 0):
        ans_l.append(-((W_sum-tmp_l) - tmp_l))
    else:
        ans_l.append((W_sum-tmp_l) - tmp_l)
print(min(ans_l))

Buggy python submission (verdict: Runtime Error):
result=[]
N = int(input())
W = list(map(int,input().split()))
for i in range(1:N+1):
  a = W[:i]
  b = W[i+1:N]
  c = sum(a)
  d = sum(b)
  e = abs(c-d)
  result.append(e)
 
print(min(result))


Fixed submission:
N = int(input())
W = list(map(int, input().split()))
i = 0
W_sum = sum(W)
ans_l = []
tmp_l = 0
for i in range(N):
    tmp_l += W[i]
    if((W_sum-tmp_l) - tmp_l < 0):
        ans_l.append(-((W_sum-tmp_l) - tmp_l))
    else:
        ans_l.append((W_sum-tmp_l) - tmp_l)
print(min(ans_l))
Buggy python submission (verdict: Runtime Error):
A,B = int(input())
if A<6:
  print(0)
elif A<13:
  print(B/2)
else:
  print(B)

Fixed submission:
A,B = map(int,input().split())
if A<6:
  print(0)
elif A<13:
  print(B//2)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>=13:
  print(B)
elif A<=5:
    print(0)
else:
    print(B/2)
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>=13:
  print(B)
elif A<=5:
    print(0)
elif A>=6 and A<=12:
    print(B/2)


Fixed submission:
A,B = map(int,input().split())
if A<6:
  print(0)
elif A<13:
  print(B//2)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>12:
  print(B)
  elif A<6:
    print(0)
    else:
      print(B/2)
      

Fixed submission:
A,B = map(int,input().split())
if A<6:
  print(0)
elif A<13:
  print(B//2)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>12:
  pritn(B)
  elif A<6:
    print(0)
    else:
      print(B/2)
      

Fixed submission:
A,B = map(int,input().split())
if A<6:
  print(0)
elif A<13:
  print(B//2)
else:
  print(B)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=list(input())
S[K-1]=S[K-1].lower()
print("".join(K))

Fixed submission:
N,K = map(int,input().split())
S = input()
n = K-1
ans = ""
for i in range(N):
    if i == n:
        ans = ans +S[i].lower()
    else:
        ans = ans + S[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K-1]=='A':
  S[K-1]='a'
  elif S[K-1]=='B':
    S[K-1]='b'
    else:
      S[K-1]='c'
print(S)

Fixed submission:
N,K = map(int,input().split())
S = input()
n = K-1
ans = ""
for i in range(N):
    if i == n:
        ans = ans +S[i].lower()
    else:
        ans = ans + S[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K-1]=='A':
  S[K-1]='a'
elif S[K-1]=='B':
    S[K-1]='b'
else:
     S[K-1]='c'
print(S)

Fixed submission:
N,K = map(int,input().split())
S = input()
n = K-1
ans = ""
for i in range(N):
    if i == n:
        ans = ans +S[i].lower()
    else:
        ans = ans + S[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K-1]=='A':
  S[K-1]='a'
elif S[K-1]=='B':
    S[K-1]='b'
else:
     S[K-1]='c'
print(S)

Fixed submission:
N,K = map(int,input().split())
S = input()
n = K-1
ans = ""
for i in range(N):
    if i == n:
        ans = ans +S[i].lower()
    else:
        ans = ans + S[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K]=='A':
  S[K]='a'
elif S[K]=='B':
    S[K]='b'
else:
     S[K]='c'
print(S)


Fixed submission:
N,K = map(int,input().split())
S = input()
n = K-1
ans = ""
for i in range(N):
    if i == n:
        ans = ans +S[i].lower()
    else:
        ans = ans + S[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
D = int(input())
if D = 25:
  print("Christmas")
elif D = 24:
  print("Christmas Eve")
elif D = 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")

Fixed submission:
D = int(input())
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

Fixed submission:
X,Y = map(int,input().split())
ans = X+Y//2
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input)
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

Fixed submission:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input())
H = list(map(int,input()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

Fixed submission:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if N ==1:
  print('Hello World')
else:
  print(A+B)

Fixed submission:
N = int(input())
if N ==1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A+B)
Buggy python submission (verdict: Runtime Error):
N = input()
for i in range(3):
  if N[i] == '1':
    N[i] = '9'
  else:
    N[i] = '1'
 
print(N)

Fixed submission:
N = input()
print(N.translate(str.maketrans({'1': '9', '9': '1'})))
Buggy python submission (verdict: Runtime Error):
import statistics
N = list(map(int,input().split()))
A = max(N)
B = min(N)
C = median(N)
print(A*10+B+C)


Fixed submission:
import statistics
N = list(map(int,input().split()))
A = max(N)
B = min(N)
C = sum(N)-A-B
print(A*10+B+C)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N <105:
  print(0)
else:
  for i in range(105,N,2):
    temp=0
    for j in range(3,15,2):
        if i%j==0:
            temp+=1
    if temp==3:
        cnt+=1
print(cnt)

Fixed submission:
N = int(input())
cnt=0
if N <105:
  cnt =0
else:
  if N%2==0:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+1,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1
  else:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+3,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
A = list(map(int,input().split()))
ans = []
a = abs(A(0)-A(1))+abs(A(1)-A(2))##0→1→2
b = abs(A(0)-A(2))+abs(A(2)-A(1))##0→2→1
c = abs(A(1)-A(0))+abs(A(0)-A(2))##1→0→2
ans.append(a)
ans.append(b)
ans.append(c)
print(min(ans))


Fixed submission:
A = list(map(int,input().split()))
ans = []
a = abs(A[0]-A[1])+abs(A[1]-A[2])##0→1→2
b = abs(A[0]-A[2])+abs(A[2]-A[1])##0→2→1
c = abs(A[1]-A[0])+abs(A[0]-A[2])##1→0→2
ans.append(a)
ans.append(b)
ans.append(c)
print(min(ans))
Buggy python submission (verdict: Runtime Error):
S = input().split(",")
topping = S.count("o")
print(700+topping＊１００)

Fixed submission:
S = input()
topping = S.count("o")
ans = 700 + topping*100
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,X = map(int,input().split())
if A+B >=X and A<X:
  print('YES')
elif:
  print('NO')

Fixed submission:
A,B,X = map(int,input().split())
if A+B >=X and A<=X:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
S = input()
if S[0] != S[1] and S[0] != S[2] and S[1] != S[2]:
  print('Yes')
else:
  print('No)

Fixed submission:
S = input()
if S[0] != S[1] and S[0] != S[2] and S[1] != S[2]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
print(A(0)+B(1)+C(2))

Fixed submission:
A = input()
B = input()
C = input()
print(A[0]+B[1]+C[2])
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = list(map(int,input().split()))
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])
 
print(sum(A)-sum(B))

Fixed submission:
N = int(input())
A = int(input())
sample = N%500
if A >= sample:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])
 
print(sum(A)-sum(B))

Fixed submission:
N = int(input())
D = list(map(int,input().split()))
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])
 
print(sum(A)-sum(B))

Buggy python submission (verdict: Runtime Error):
N = int(input())
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])

print(sum(A)-sum(B))


Fixed submission:
N = int(input())
D = list(map(int,input().split()))
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])
 
print(sum(A)-sum(B))
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = X//(500*A)
b = X//(100*B)
c = X//(50*C)
ans = 0
for l in range(a+1):
    for m in range(b+1):
        for n in range(c+1):
            if 500*l+100*m+50*n ==X:
                ans += 1
print(ans)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for l in range(A+1):
    for m in range(B+1):
        for n in range(C+1):
            if 500*l+100*m+50*n ==X:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = X//(500*A)
b = X//(100*B)
c = X//(50*C)
ans = 0
for l in range(a+1):
    total=[]
    d = 500*l
    total.append(d)
    for m in range(b+1):
        e = 100*m
        total.append(e)
        for n in range(c+1):
            f = 50*n
            total.append(f)
            if sum(total) ==X:
                ans += 1
print(ans)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for l in range(A+1):
    for m in range(B+1):
        for n in range(C+1):
            if 500*l+100*m+50*n ==X:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = X//(500*A)
b = X//(100*B)
c = X//(50*C)
total = []
ans = 0
for l in range(a+1):
  d = 500*l
  total.append(d)
  for m in range(b+1):
    e = 100*m
    total.append(e)
    for n in range(c+1):
      f = 50*n
      total.append(f)
      if sum(total) ==X:
        ans += 1
print(ans)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for l in range(A+1):
    for m in range(B+1):
        for n in range(C+1):
            if 500*l+100*m+50*n ==X:
                ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
A = list(map(input().split()))
a = A[0]
b = A[1]
n = len(b)
a = int(a)
b = int(b)
jud = a*10**(n)+b
m = int(jud**.5)
if abs(m*m-jud)< 1e-6:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b = map(int,input().split())
c = a*b
if c%2==0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
A = list(map(input().split()))
a = A[0]
b = A[1]
n = len(b)
a = int(a)
b = int(b)
print(n)
jud = a*10**(n)+b
m = int(jud**.5)
print(jud)
if abs(m*m-jud)< 1e-6:
  print('Yes')
else:
  print('No')


Fixed submission:
a = int(input().replace(" ", ""))
 
b = a**0.5
c = b - int(b)
 
if c == 0.0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
if X==Y:
  print("=")
  elif X<Y:
  print("<")
  else:
  print(">")
  end

Fixed submission:
x,y = map(str, input().split())
 
print(">" if x > y else "<" if x < y else "=")

Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
if X==Y;
  print("=")
  elif X<Y;
  print("<")
  else;
  print(">")

Fixed submission:
x,y = map(str, input().split())
 
print(">" if x > y else "<" if x < y else "=")

Buggy python submission (verdict: Runtime Error):
X =  int(input())
Y =  int(input())
if X < Y;
print("<")
elif X=Y;
print("=")
else;
print(">")

Fixed submission:
x,y = map(str, input().split())
 
print(">" if x > y else "<" if x < y else "=")

Buggy python submission (verdict: Runtime Error):
X = 
Y = 
if X < Y;
print("<")
elif X=Y;
print("=")
else;
print(">")

Fixed submission:
x,y = map(str, input().split())
 
print(">" if x > y else "<" if x < y else "=")
Buggy python submission (verdict: Runtime Error):
s = input()
N = len(s)
for i in range(N):
  if i%2 ==1:
    s.pop(i)
print(s)
    

Fixed submission:
S = input()
print(S[::2])
Buggy python submission (verdict: Runtime Error):
S = input()
str = "abcdefghijklmnopqrstuvwxyz"
l1 = list(str)
l2 = list(S)
l3 = list(set(l1)-set(l2))
l3.sort()
print(l3[0])


Fixed submission:
S = input()
str = "abcdefghijklmnopqrstuvwxyz"
l1 = list(str)
l2 = list(S)
l3 = list(set(l1)-set(l2))
l3.sort()
if len(l3)==0:
    print("None")
else:
    print(l3[0])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
while True:
  for i in range(1,7):
    b = 2^(7-i)
    c = N%b
    if c ==0:
      break
    else:
      continue
    break
print(b)

Fixed submission:
N = int(input())
while True:
    for i in range(7):
        b = 2**(6-i)
        if b <= N:
            break
    break
print(b)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
R = []
for i in range(M):
  r = list(map(int,input().split()))
  R.append(r)

for l in range(N):
  ans = []
  ans = [i for i in R if i = l ]
  print(len(ans))
  


Fixed submission:
N,M = map(int,input().split())
R = []
for i in range(M):
  a = list(map(int,input().split()))
  b = a[0]
  c = a[1]
  R.append(b)
  R.append(c)
  
for l in range(1,N+1):
  ans = []
  ans = [i for i in R if i == l ]
  print(len(ans))
Buggy python submission (verdict: Runtime Error):
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)//2 =< K:
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)

Fixed submission:
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)//2 <= K and (S-l)>=0:
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)

Buggy python submission (verdict: Runtime Error):
K,S = map(int,input().split())
div = (K+1)//3
one = 0
three = 0
six = 0
for l in range(div):
  for m in range(l+1,div):
    for n in range(m+1,div):
      if l+m+n == S:
        six +=1
if S%3 == 0:
  one = 1
for i in range(K+1):
  if (S-i)%2 ==0 and S%3!=0:
    two +=1

print(one+3*three+6*six)

Fixed submission:
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)//2 <= K and (S-l)>=0:
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())
cnt = 0
for l in range(K+1):
  for m in range(K+1):
    for n in range(K+1):
      if l+m+n == S:
        cnt +=1
print(cnt)        


Fixed submission:
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)//2 <= K and (S-l)>=0:
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
S = list(S)
S.reverse()
T = []
n = len(S)
for i in range(n):
  T.append(S[i])
  mojiretu = ''.join(T)
  if mojiretu == "maerd" or mojiretu == "remaerd" or mojiretu == "esare" or mojiretu == "resare":
    T =[]
 
N = len(T)
if N == 0:
  print("YES")
else:
  print("NO")

Fixed submission:
S = input()
S = list(S)
S.reverse()
T = []
n = len(S)
for i in range(n):
  T.append(S[i])
  mojiretu = ''.join(T)
  m = len(mojiretu)
  if mojiretu == "maerd" or mojiretu == "remaerd" or mojiretu == "esare" or mojiretu == "resare":
    T =[]
  elif m==8:
      break
N = len(T)
if N == 0:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
S = list(S)
S.reverse()
T = []
n = len(S)
for i in range(n):
  T.append(S[i])
  mojiretu = ''.join(T)
  if mojiretu == "maerd" or mojiretu == "remaerd" or mojiretu == "esare" or mojiretu == "resare":
    T =[]

N = len(T)
if N == 0:
  print("YES")
else:
  print("NO")

Fixed submission:
S = input()
S = list(S)
S.reverse()
T = []
n = len(S)
for i in range(n):
  T.append(S[i])
  mojiretu = ''.join(T)
  m = len(mojiretu)
  if mojiretu == "maerd" or mojiretu == "remaerd" or mojiretu == "esare" or mojiretu == "resare":
    T =[]
  elif m==8:
      break
N = len(T)
if N == 0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N,L = map(int,input().split())

for i in range(N):
  S.append(input())
S.sort()
ans="".join(S)
print(ans)


Fixed submission:
N,L = map(int,input().split())
S=[]
for i in range(N):
  S.append(input())
S.sort()
ans="".join(S)
print(ans)

Buggy python submission (verdict: Runtime Error):
N,L = map(int,input().split())
S = []
for i in range(N):
  S.append(list(input()))

S.sort()
print(sum(S))

Fixed submission:
N,L = map(int,input().split())
S=[]
for i in range(N):
  S.append(input())
S.sort()
ans="".join(S)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
import itertools
# print(math.gcd(1000000000, 1000000000))

N = int(input())
monsters = list(map(int, input().split()))

result = 10 ** 9 + 1

for comb in list(itertools.combinations(monsters,2)):
    gcd = fractions.gcd(comb[0], comb[1]) 
    if gcd < result:
        result = gcd

print(result)

Fixed submission:
import fractions
import itertools
from functools import reduce
# print(math.gcd(1000000000, 1000000000))


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
monsters = list(map(int, input().split()))

result = 10 ** 9 + 1

print(gcd(*monsters))

Buggy python submission (verdict: Runtime Error):
import math
import itertools
# print(math.gcd(1000000000, 1000000000))

N = int(input())
monsters = list(map(int, input().split()))

result = 10 ** 9 + 1

for comb in list(itertools.combinations(monsters,2)):
    gcd = math.gcd(comb[0], comb[1]) 
    if gcd < result:
        result = gcd

print(result)

Fixed submission:
import fractions
import itertools
from functools import reduce
# print(math.gcd(1000000000, 1000000000))


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
monsters = list(map(int, input().split()))

result = 10 ** 9 + 1

print(gcd(*monsters))