Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def P(n,r):
  s = 1
  for i in range(r+1, n+1):
    s = s*i
  return s

def cmb(n,r):
  if n == r:
    return 1
  else:
    return P(n,r) // P(n-r,0)

N = int(input())
S = []
ans = 0
n = 1

for i in range(N):
  s = list(input())
  s.sort()
  S.append(s)

S.sort()

for i in range(N-1):
  if S[i] == S[i+1]:
    n += 1
  elif n >= 2:
    ans += cmb(n,2)
    n = 1
  else:
    n = 1
  
if S[N-1] == S[N-2]:
  ans += cmb(n,2)
  
print(ans)

Fixed submission:
import collections

N = int(input())
S = []

for i in range(N):
  s = input()
  ss = [i for i in s]
  ss.sort()
  s = ''.join(ss)
  S.append(s)
  
c = collections.Counter(S)
ans = 0

for b in c:
  ans += c[b] * (c[b] - 1) // 2
  
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def fac(n):
  s = 1
  for i in range(1, n+1):
    s = s*i
  return s

def cmb(n,r):
  if n == r:
    return 1
  else:
    return fac(n) // (fac(r)*fac(n-r))

N = int(input())
S = []
ans = 0
n = 1

for i in range(N):
  s = list(input())
  s.sort()
  
  S.append(s)
  
S.sort()

for i in range(N-1):
  if S[i] == S[i+1]:
    n += 1
  elif n >= 2:
    ans += cmb(n,2)
    n = 1
  else:
    n = 1
  
if S[N-1] == S[N-2]:
  ans += cmb(n,2)
  
print(ans)

Fixed submission:
import collections

N = int(input())
S = []

for i in range(N):
  s = input()
  ss = [i for i in s]
  ss.sort()
  s = ''.join(ss)
  S.append(s)
  
c = collections.Counter(S)
ans = 0

for b in c:
  ans += c[b] * (c[b] - 1) // 2
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
S = sum(A)
T = [0] * N
for i in range(N-1):
  c = S
  for j in range(N // 2):
    c -= 2 * A[(i+(j+1)*2) % N - 1]
  print(c, end = " ")

c = S
for j in range(N // 2):
  c -= 2 * A[(N-1+(j+1)*2) % N - 1]
print(c)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
a = 0
for i in range(N):
  a += A[i] * (-1) ** i
b = a
print(a, end = " ")

for i in range(0, N-2):
  b = 2 * A[i] - b
  print(b, end = " ")

print(2 * A[N-2] - b)
Buggy python submission (verdict: Runtime Error):
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
N, K = map(int, input().split())
s = (10 ** 9) + 7
n = N - K + 1

for i in range(1, K+1):
  S = (i * comb(n, i) * comb(K, i)) // K
  print(S % s)

Fixed submission:
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
N, K = map(int, input().split())
s = (10 ** 9) + 7
n = N - K + 1

if N >= 2 * K -1:
  for i in range(1, K+1):
    S = (i * comb(n, i) * comb(K, i)) // K
    print(S % s)
else:
  for i in range(1, N-K+2):
      S = (i * comb(n, i) * comb(K, i)) // K
      print(S % s)
  for i in range(N-K+2, K+1):
      print(0)
Buggy python submission (verdict: Runtime Error):
import sys

S = input()

for i in range(3):
  if S[i] = S[i+1]:
    print("Bad")
    sys.exit()
print("Good")
  

Fixed submission:
import sys

S = input()

for i in range(3):
  if S[i] == S[i+1]:
    print("Bad")
    sys.exit()
print("Good")
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = []
dp = [0] * N
for i in range(M):
  A.append(int(input()))

  
for i in range(2):
  if not((i+1) in A):
    dp[i] = 1 + dp[i-1] + dp[i-2]
    
for i in range(2,N):
  if not((i+1) in A):
    dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)

Fixed submission:
from collections import deque

N, M = map(int,input().split())

A = deque()
dp = [0] * N
for i in range(M):
  A.append(int(input()))
A.append(N+1)

if N == 1:
  print(1)

elif N == 2:
  if 1 in A:
    print(1)
  else:
    print(2)
    
else:
  a = A.popleft()
  if a != 1:
    dp[0] = 1
  else:
    a = A.popleft()
    
  if a != 2:
    dp[1] = dp[0] + 1
  else:
    a = A.popleft()
    
  for i in range(2,N):
    if a != i+1:
      dp[i] = dp[i-1] + dp[i-2]
    else:
      a = A.popleft()
  print(dp[-1]%1000000007)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort()
BC = []

for i in range(M):
  bc = [int(i) for i in input().split()]
  BC.append(bc)

BC = sorted(BC, key=lambda x: x[1])
BC.reverse()

k = 0
for i in BC:
  if k == N:
    break
  if i[1] <= A[k]:
    break
  for j in range(i[0]):
    if k == N:
      break
    if i[1] > A[k]:
      A[k] = i[1]
      k += 1
    else:
      break

print(sum(A))


Fixed submission:
A, B = map(int, input().split())
if A >= 13:
  print(B)
elif A >= 6:
  print(B // 2)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort()
BC = []

for i in range(M):
  bc = [int(i) for i in input().split()]
  BC.append(bc)

BC = sorted(BC, key=lambda x: x[1])
BC.reverse()

k = 0
for i in BC:
  if k = N:
    break
  if i[1] <= A[k]:
    break
  for j in range(i[0]):
    if i[1] > A[k]:
      A[k] = i[1]
      k += 1
    else:
      break

print(sum(A))

Fixed submission:
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort()
BC = []

for i in range(M):
  bc = [int(i) for i in input().split()]
  BC.append(bc)

BC = sorted(BC, key=lambda x: x[1])
BC.reverse()

k = 0
for i in BC:
  if k == N:
    break
  if i[1] <= A[k]:
    break
  for j in range(i[0]):
    if k == N:
      break
    if i[1] > A[k]:
      A[k] = i[1]
      k += 1
    else:
      break

print(sum(A))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort()
BC = []

for i in range(M):
  bc = [int(i) for i in input().split()]
  BC.append(bc)

BC = sorted(BC, key=lambda x: x[1])
BC.reverse()

k = 0
for i in BC:
  if i[1] <= A[k]:
    break
  for j in range(i[0]):
    if i[1] > A[k]:
      A[k] = i[1]
      k += 1
    else:
      break

print(sum(A))

Fixed submission:
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort()
BC = []

for i in range(M):
  bc = [int(i) for i in input().split()]
  BC.append(bc)

BC = sorted(BC, key=lambda x: x[1])
BC.reverse()

k = 0
for i in BC:
  if k == N:
    break
  if i[1] <= A[k]:
    break
  for j in range(i[0]):
    if k == N:
      break
    if i[1] > A[k]:
      A[k] = i[1]
      k += 1
    else:
      break

print(sum(A))
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N= map(int, input().split())
c = 0
for i in range(N//R + 1):
  for j in range(N//G + 1):
    for k in range(N//B + 1):
      if R * i + G * j + B * k == N:
        c += 1
print(c)

Fixed submission:
R, G, B, N= map(int, input().split())
c = 0
S = [R, G, B]
S.sort()
R = S[2]
G = S[1]
B = S[0]

if S[0] == 1:
  for i in range(N//R + 1):
    for j in range(N//G + 1):
      if R * i + G * j <= N:
        c += 1
else:
  for i in range(N//R + 1):
    for j in range(N//G + 1):
      for k in range(N//B + 1):
        if R * i + G * j + B * k == N:
          c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N= map(int, input().split())
c = 0
for i in range(N//R + 1):
  for j in range(N//G + 1):
    for k in range(N//B + 1):
      if R * i + G * j + B * k == N:
        c += 1
print(c)
        

Fixed submission:
R, G, B, N= map(int, input().split())
c = 0
S = [R, G, B]
S.sort()
R = S[2]
G = S[1]
B = S[0]

if S[0] == 1:
  for i in range(N//R + 1):
    for j in range(N//G + 1):
      if R * i + G * j <= N:
        c += 1
else:
  for i in range(N//R + 1):
    for j in range(N//G + 1):
      for k in range(N//B + 1):
        if R * i + G * j + B * k == N:
          c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = 0
t = 0
u = 0
A = []
for i in range(N):
  m = input()
  A.append(m)
  u += m.count("AB")
  if m[0] == B:
    s += 1
  if m[-1] == A:
    t += 1
u += min(s, t)
print(u)

Fixed submission:
N = int(input())
s = 0
t = 0
u = 0
v = 0
for i in range(N):
    m = input()
    u += m.count("AB")
    if m[0] == "B" and m[-1] == "A":
        v += 1
    else:
        if m[0] == "B":
            s += 1
        if m[-1] == "A":
            t += 1
if s == 0 and t == 0 and v != 0:
    u += v - 1
    print(u)
elif s == 0 or t == 0:
    u += v
    print(u)
else: 
    u += min(s - 1, t - 1) + v + 1
    print(u)
Buggy python submission (verdict: Runtime Error):
A, B = map(int,iput().split())

if A > B:
  print(2 * A - 1)
elif A < B:
  print(2 * B - 1)
else:
  print(A + B)

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

if A > B:
  print(2 * A - 1)
elif A < B:
  print(2 * B - 1)
else:
  print(A + B)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
tr = []

for i in range(5):
  tr.append(int(input())

print(math.ceil(N/min(tr)))


Fixed submission:
import math

N = int(input())
tr = []

for i in range(5):
  tr.append(int(input()))
            
print(math.ceil(N / min(tr))+4)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
print("NO")

Fixed submission:
N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7))

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
print("NO")


Fixed submission:
N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7)

Fixed submission:
N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = []
B = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    A.append(x1)
    B.append(y1)
    
yen = 0
num = 0
while num < M:
    a  = min(A)
    ind = A.index(a)
    
    if num + B[ind] <= M:
        yen += a * B[ind]
        num += B[ind]
        del A[ind]
        del B[ind]
    else:
        yen += a * (M - num)
        break
print(yen)

Fixed submission:
N, M = map(int, input().split())
S = []
C = 0
cost = 0
for i in range(N):
  a, b = map(int, input().split()) 
  S.append((a, b))
S.sort()
for i in range(N):
  if S[i][1] + C < M:
    C += S[i][1]
    cost += S[i][0] * S[i][1]
  else:
    cost += (M-C) * S[i][0]
    break
print(cost)
Buggy python submission (verdict: Runtime Error):
Ot = 0
N = int(input())
for i in range (N):
    X = input().split()
    x = int(X[0])
    if X[1] == "BTC":
        Ot += x * 380000
    else:
        Ot += x
print(Ot)

Fixed submission:
Ot = 0
N = int(input())
for i in range (N):
    X = input().split()
    x = float(X[0])
    if X[1] == "BTC":
        Ot += x * 380000
    else:
        Ot += x
print(Ot)

Buggy python submission (verdict: Runtime Error):
Ot = 0
N = int(input())
for i in range (N):
  X = input().split()
  x = int(X[0])
  if X[1] == "BTC":
    Ot += x * 380000
  else:
    Ot += x
print(Ot)

Fixed submission:
Ot = 0
N = int(input())
for i in range (N):
    X = input().split()
    x = float(X[0])
    if X[1] == "BTC":
        Ot += x * 380000
    else:
        Ot += x
print(Ot)
Buggy python submission (verdict: Runtime Error):
N = input()
A = [int(i) for i in input().split()]

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(A))

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

N = int(input())
A = [int(i) for i in input().split()]
K = gcd(A[0], A[1])

for i in range(2, N):
    K = gcd(K, A[i])

print(K)
Buggy python submission (verdict: Runtime Error):
NM = [int(x) for x in input().split()]
N = NM[0]
M = NM[1]
X = [int(x) for x in input().split()]
X.sort()
print(X)
LL = 0
if N > M:
    #print(LL)
else:
    L = [0] * (M - 1)
    for i in range (0, M - 1):
        L[i] = X[i + 1] - X[i]
    L.sort()
    #print(L)
    for i in range(0, M - N):
        LL += L[i]
    print(LL)

Fixed submission:
NM = [int(x) for x in input().split()]
N = NM[0]
M = NM[1]
X = [int(x) for x in input().split()]
X.sort()
#print(X)
LL = 0
if N > M:
    print(LL)
else:
    L = [0] * (M - 1)
    for i in range (0, M - 1):
        L[i] = X[i + 1] - X[i]
    L.sort()
    #print(L)
    for i in range(0, M - N):
        LL += L[i]
    print(LL)
Buggy python submission (verdict: Runtime Error):
L = [int(x) for x in input().split]
L.sort()
print(L[1] * L[2] / 2)

Fixed submission:
L = [int(x) for x in input().split()]
L.sort()
print(L[1] * L[0] // 2)

Buggy python submission (verdict: Runtime Error):
L = [int(x) for x in input().split]
L.sort()
print(L[1] * L[1] / 2)

Fixed submission:
L = [int(x) for x in input().split()]
L.sort()
print(L[1] * L[0] // 2)

Buggy python submission (verdict: Runtime Error):
L = [int(x) for x in input().split]
L.sort()
print(L[1] * L[1])

Fixed submission:
L = [int(x) for x in input().split()]
L.sort()
print(L[1] * L[0] // 2)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0] * N


for i in range(1, N):
  c = 10 ** 4 * N
  j=0 if i<K else i-K
  H = h[i]
  for k,l in zip(dp[j:i], h[j:i]):
    c1 = k + abs(l-H)
    c = min(c1, c)
  dp[i] = c
print(dp[-1])

Fixed submission:
N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0] * N

for i,H in enumerate(h):
  if i != 0:
    j=0 if i<K else i-K
    dp[i] = min(k + abs(l-H) for k,l in zip(dp[j:i], h[j:i]))
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0] * N


for i in range(1, N):
  c = 10 ** 4 * N
  j=0 if i<K else i-K
  for k in range(j, i):
    c1 = dp[k] + abs(h[i]-h[k])
    #print(c1)
    c = min(c1, c)
  dp[i] = c
  #print(dp)
print(dp[-1])

Fixed submission:
N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [0] * N

for i,H in enumerate(h):
  if i != 0:
    j=0 if i<K else i-K
    dp[i] = min(k + abs(l-H) for k,l in zip(dp[j:i], h[j:i]))
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()

S = len(s)
T = len(t)

dp = [[""] * T for i in range(S)]

for i, SS in enumerate(s):
    for j, TT in enumerate(t):
        ii = max(0,i-1)
        jj = max(0,j-1)
        if SS == TT:
            dp[i][j] = dp[ii][jj] + SS
        else:
            if len(dp[i][jj]) > len(dp[ii][j]):
                dp[i][j] = dp[i][jj]
            else:
                dp[i][j] = dp[ii][j]
print(dp[-1][-1])

Fixed submission:
s = input()
t = input()

S, T = len(s), len(t)

dp = [[0] * (T+1) for i in range(S+1)]

for i, SS in enumerate(s):
    for j, TT in enumerate(t):
        if SS == TT:
            dp[i+1][j+1] = dp[i][j] + 1
        else:
            dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])

ans = ""
while i+1 and j+1:
    if dp[i+1][j+1] == dp[i][j+1]:
        i -= 1
    elif dp[i+1][j+1] == dp[i+1][j]:
        j -= 1
    else:
        ans = s[i] + ans
        i -= 1
        j -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def solve(l, r, A, dp):
    #print(l,r)
    if r - l < 2:
        return max(A[l:r + 1])

    x1 = solve(l + 2, r, A, dp)#dp[l + 2][r] if dp[l + 2][r] != -1 else solve(l + 2, r, A, dp)
    x2 = solve(l + 1, r - 1, A, dp)#dp[l + 1][r - 1] if dp[l + 1][r - 1] != -1 else solve(l + 1, r - 1, A, dp)
    x3 = solve(l, r - 2, A, dp)#dp[l][r - 2] if dp[l][r - 2] != -1 else solve(l, r - 2, A, dp)

    #dp[l][r] = max(min(x1, x2) + A[l], min(x2, x3) + A[r])

    return max(min(x1, x2) + A[l], min(x2, x3) + A[r])#dp[l][r]


N = int(input())
A = [int(i) for i in input().split()]
dp = [[-1] * N for i in range(N)]
print(2*solve(0, N-1, A, dp)-sum(A))


Fixed submission:
def solve(l, r, A, dp):
    if r - l < 2:
        return max(A[l:r + 1])

    x1 = dp[l + 2][r] if dp[l + 2][r] != -1 else solve(l + 2, r, A, dp)
    x2 = dp[l + 1][r - 1] if dp[l + 1][r - 1] != -1 else solve(l + 1, r - 1, A, dp)
    x3 = dp[l][r - 2] if dp[l][r - 2] != -1 else solve(l, r - 2, A, dp)

    dp[l][r] = max(min(x1, x2) + A[l], min(x2, x3) + A[r])

    return dp[l][r]


N = int(input())
A = [int(i) for i in input().split()]
dp = [[-1] * N for i in range(N)]
print(2*solve(0, N-1, A, dp)-sum(A))
Buggy python submission (verdict: Runtime Error):
D = int(input())
C = "Chiristmas"
if 22 <= D <= 25:
  for i in range(D, 25):
    C += " Eve"
	print(C)

Fixed submission:
D = int(input())
C = "Christmas"
if 22 <= D <= 25:
	for i in range(D, 25):
		C += " Eve"
	print(C)
Buggy python submission (verdict: Runtime Error):
S = input()
SS = int(S)
for i in range(0, 9):
    for j in range(0, i):
        for k in range(0, j):
            X = int(S[k] + S[j] + S[i])
            if abs(753 - X) < SS:
                SS = abs(753 - X)
print(SS)

Fixed submission:
S = input()
SS = int(S)
for i in range(0, len(S) - 2):
            X = int(S[i: i + 3])
            if abs(753 - X) < SS:
                SS = abs(753 - X)
print(SS)
Buggy python submission (verdict: Runtime Error):
N = input()
if N == 1:
  print("Hello World")
else:
  A = input()
  B = input()
  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):
A, B = map(int, input()split())
if (A * B) % 2 == 1:
  print("Yes")
else:
  print("No")

Fixed submission:
A, B = map(int, input().split())
if (A * B) % 2 == 1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())

k = -1
while S[k+1] == "1":
  k += 1

if K <= k:
  print(1)
else:
  print(S[k+1])

Fixed submission:
import sys
S = input()
K = int(input())

for i in range(K):
  if S[i] != "1":
    print(S[i])
    sys.exit()
print(1)

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

k = -1
while S[k+1] == "1":
  k += 1
  print(k)

if K <= k:
  print(1)
else:
  print(S[k+1])

Fixed submission:
import sys
S = input()
K = int(input())

for i in range(K):
  if S[i] != "1":
    print(S[i])
    sys.exit()
print(1)
Buggy python submission (verdict: Runtime Error):
N, K = map(int input().split())
if N % K == 0:
  print(0)
else:
  print(1)

Fixed submission:
N, K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
N, K = map(int input().split())
if N == K:
  print(0)
else:
  print(1)

Fixed submission:
N, K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
A = [int(x) for x in input()split()]
A.sort()
print(A[2] - A[0])

Fixed submission:
A = [int(x) for x in input().split()]
A.sort()
print(A[2] - A[0])
Buggy python submission (verdict: Runtime Error):
def mm(N, A, x):
  S = 0
  for i in range(N):
    S += abs(A[i] - x)
  return S

N = int(input())
A = []
j = 0
for i in input().split():
  j += 1
  A.append(int(i)-j)
A.sort()
if N % 2 == 0:
  print(mm(N, A, A[N//2]))
else:
  print(min(mm(N, A, A[N//2]), mm(N, A, A[N//2 + 1])))

Fixed submission:
def mm(N, A, x):
  S = 0
  for i in range(N):
    S += abs(A[i] - x)
  return S

N = int(input())
A = []
j = 0
for i in input().split():
  j += 1
  A.append(int(i)-j)
A.sort()
if N % 2 == 0:
  print(mm(N, A, A[N//2]))
elif N == 1:
  print(0)
else:
  print(min(mm(N, A, A[N//2]), mm(N, A, A[N//2 + 1])))
Buggy python submission (verdict: Runtime Error):
S = input()
print(700 + S.count(o) * 100)

Fixed submission:
S = input()
print(700 + S.count("o") * 100)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int,input().split())
for i in range(A, B + 1):
  if i - A < K or B - i < K:
    print(i)

Fixed submission:
A, B, K = map(int,input().split())
if B - A < 2 * K:
    for i in range(A, B + 1):
        print(i)
else:
    for i in range(A, A + K):
        print(i)
    for i in range(B - K + 1, B + 1):
        print(i)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
c = 0
for i in range(A, B + 1):
  if str(i) = str(i)[::-1]
  c += 1
print(c)

Fixed submission:
A, B = map(int, input().split())
c = 0
for i in range(A, B + 1):
    if str(i) == str(i)[::-1]:
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [int(i) for i in range(S)]
if "Y" in S:
  print("Four")
else:
  print("Three")

Fixed submission:
N = int(input())
S = input().split()
if "Y" in S:
    print("Four")
else:
    print("Three")
Buggy python submission (verdict: Runtime Error):
from collections import deque

H, W = map(int, input().split())
S = [input() for i in range(H)]

q = deque()
q.append((0, 0))
dist = [[0 for j in range(W)] for i in range(H)]
dr = [(1,0),(-1,0),(0,1),(0,-1)]

while (True):
    r = q.popleft()
    x = r[1]
    y = r[0]
    now = dist[y][x]
    if y == H-1 and x == W-1:
        break
    for d in range(4):
        nx = x + dr[d][0]
        ny = y + dr[d][1]
        if 0 <= nx < W and 0 <= ny < H:
            if S[ny][nx] != "#" and dist[ny][nx] == 0:
                dist[ny][nx] = now+1
                q.append((ny,nx))
sharp = sum([i.count("#") for i in S])
print(H * W - now - sharp - 1)

Fixed submission:
from collections import deque

H, W = map(int, input().split())
S = [input() for i in range(H)]
g = 0
q = deque()
q.append((0, 0))
dist = [[0 for j in range(W)] for i in range(H)]
dr = [(1,0),(-1,0),(0,1),(0,-1)]

while len(q):
    r = q.popleft()
    x = r[1]
    y = r[0]
    now = dist[y][x]
    if y == H-1 and x == W-1:
        g = 1
        break
    for d in range(4):
        nx = x + dr[d][0]
        ny = y + dr[d][1]
        if 0 <= nx < W and 0 <= ny < H:
            if S[ny][nx] != "#" and dist[ny][nx] == 0:
                dist[ny][nx] = now+1
                q.append((ny,nx))

sharp = sum([i.count("#") for i in S])
if  g == 1:
  print(H * W - now - sharp - 1)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input())
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")

Fixed submission:
a, b = map(int,input().split())
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
print("Yes") if int(int(input().gsub(" ", "")) ** (1/2)) ** 2 = int(input().gsub(" ", "") else print("No")

Fixed submission:
N = int("".join(input().split()))
if int((N**(1/2))) **2 == N:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input() 
if S[A] == "-" and (S[0:A]+S[A+1:B]).isdigit():
    print("Yes")
else:
    print("No")

Fixed submission:
M = int(input())
print(48 - M)
Buggy python submission (verdict: Runtime Error):
import sys

S = input()
c = 0


op = len(S) - 1  # すき間の個数

for i in range(2 ** op):
  T = ""
  for j in range(op_cnt):
    T += S[j]
    if ((i >> j) & 1):
      T += "+"
    else:
      T += "-"
  T += S[op_cnt]
  if eval(T) == 7:
    print(T+"=7")
    sys.exit()

Fixed submission:
import sys

S = input()
c = 0


op = len(S) - 1  # すき間の個数

for i in range(2 ** op):
  T = ""
  for j in range(op):
    T += S[j]
    if ((i >> j) & 1):
      T += "+"
    else:
      T += "-"
  T += S[op]
  if eval(T) == 7:
    print(T+"=7")
    sys.exit()
Buggy python submission (verdict: Runtime Error):
R=int(input())
G=int(input())
print(2G-R)

Fixed submission:
R=int(input())
G=int(input())
print(2*G-R)
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, intput().split())
print(A^B^C)

Fixed submission:
A, B, C = map(int, input().split())
print(A^B^C)

Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, intput().split())
print(A ^ B ^ C)

Fixed submission:
A, B, C = map(int, input().split())
print(A^B^C)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N[0]=="9" or N[1]=="9":
  print("Yes")
else:
  print("No")

Fixed submission:
N=input()
if N[0]=="9" or N[1]=="9":
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
x,t=map(int,input())
print(x-t) if x-t>0 else print(0)

Fixed submission:
x,t=map(int,input().split())
print(x-t) if x-t>0 else print(0)