Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a


def allgcd(d):
    if len(d) == 1:
        return d
    ret_gcd = d[0]
    for i in d:
        ret_gcd = gcd(ret_gcd, i)
    return ret_gcd


def maxNumVisitCity(N, X, x):
    if len(x) == 1:
        return abs(x[0] - X)

    d = []
    for i in x:
        d.append(abs(i - X))
    return allgcd(d)


def main():
    N, X = map(int, input().split())
    x = map(int, input().split())
    print(maxNumVisitCity(N, X, x))


if __name__ == '__main__':
    main()


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


def allgcd(d):
    if len(d) == 1:
        return d
    ret_gcd = d[0]
    for i in d:
        ret_gcd = gcd(ret_gcd, i)
    return ret_gcd


def maxNumVisitCity(N, X, x):
    if len(x) == 1:
        return abs(x[0] - X)

    d = []
    for i in x:
        d.append(abs(i - X))
    return allgcd(d)


def main():
    N, X = map(int, input().split())
    x = list(map(int, input().split()))
    print(maxNumVisitCity(N, X, x))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


def maxNumVisitCity(N, X, x):
    d = []
    for i in x:
        d.append(abs(i - X))
    return reduce(math.gcd, d)


def main():
    N, X = map(int, input().split())
    x = map(int, input().split())
    print(maxNumVisitCity(N, X, x))


if __name__ == '__main__':
    main()


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


def allgcd(d):
    if len(d) == 1:
        return d
    ret_gcd = d[0]
    for i in d:
        ret_gcd = gcd(ret_gcd, i)
    return ret_gcd


def maxNumVisitCity(N, X, x):
    if len(x) == 1:
        return abs(x[0] - X)

    d = []
    for i in x:
        d.append(abs(i - X))
    return allgcd(d)


def main():
    N, X = map(int, input().split())
    x = list(map(int, input().split()))
    print(maxNumVisitCity(N, X, x))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def calcPairOddAndEven(num):
    if num % 2 == 0:
        return int((num / 2))**2
    else:
        return int((num / 2)*num)


def main():
    numArray = [3, 6, 11, 50]
    for num in numArray:
        print(num, ":", calcPairOddAndEven(num))


def contest():
    print(calcPairOddAndEven(int(input()))

if __name__ == '__main__':
    contest()

Fixed submission:
def calcPairOddAndEven(num):
    if num % 2 == 0:
        return int((num / 2))**2
    else:
        return int(num / 2)*int(num / 2 + 1)


def main():
    numArray = [3, 6, 11, 50]
    for num in numArray:
        print(num, ":", calcPairOddAndEven(num))


def contest():
    print(calcPairOddAndEven(int(input())))

if __name__ == '__main__':
    contest()
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
print(int(N/K)**3+[int((N+K/2)/K)**3][K%2])

Fixed submission:
N, K = map(int,input().split())
print(int(N/K)**3+[int((N+K/2)/K)**3,0][K%2])

Buggy python submission (verdict: Time Limit Exceeded):
def logic(N, K):
    if K == 1:
        return N**3
    count = 0
    for a in range(1, N + 1):
        b_s = K - (a % K)
        for b in range(b_s, N + 1, K):
            for c in range(b_s, N + 1, K):
                if (b + c) % K == 0:
                    count += 1
    return count

def main():
    N, K = map(int, input().split())
    print(logic(N, K))

if __name__ == '__main__':
    main()

Fixed submission:
N, K = map(int,input().split())
print(int(N/K)**3+[int((N+K/2)/K)**3,0][K%2])

Buggy python submission (verdict: Time Limit Exceeded):
def logic(N, K):
    count = 0
    for a in range(1, N + 1):
        b_s = K - (a % K)
        for b in range(b_s, N + 1, K):
            for c in range(b_s, N + 1, K):
                if (b + c) % K == 0:
                    count += 1
    return count

def main():
    N, K = map(int, input().split())
    print(logic(N, K))

if __name__ == '__main__':
    main()

Fixed submission:
N, K = map(int,input().split())
print(int(N/K)**3+[int((N+K/2)/K)**3,0][K%2])

Buggy python submission (verdict: Runtime Error):
def is calc(N, K):
  count = 0
  for a in range(1, N):
    for b in range(1, N):
      c = N - a - b
      if c > 0:
        if a + b % N == 0 and b + c % N == 0 and a + c % N == 0:
          count += 1
  return count

if __name__ == '__main__':
  N, K = map(int, input().split())
  print(calc(N, K))

Fixed submission:
N, K = map(int,input().split())
print(int(N/K)**3+[int((N+K/2)/K)**3,0][K%2])
Buggy python submission (verdict: Runtime Error):
def logic(S, K):
    if len(S) == 1:
        return int(S)
    if S[0:5] == "11111":
        return 1
    a = S.replace("1", "")
    return int(a[0])


if __name__ == '__main__':
    print(logic(input(), input()))


Fixed submission:
def logic(S, K):
    if len(S) == 1:
        return int(S)
    if S[0:int(K)].replace("1","") == "":
        return 1
    a = S.replace("1", "")
    if len(a) == 0:
        return 1
    return int(a[0])


if __name__ == '__main__':
    print(logic(input(), input()))
Buggy python submission (verdict: Runtime Error):
def calc(a):
  for a4 in range(26):
    for a7 in range(16):
      if a4*4+a7*7 is a:
        return "Yes"
  return "No"

if __name__ == '__main__':
  calc(int(input())
      

Fixed submission:
def calc(a):
  for a4 in range(26):
    for a7 in range(16):
      if a4*4+a7*7 == a:
        return "Yes"
  return "No"

if __name__ == '__main__':
  print(calc(int(input())))

Buggy python submission (verdict: Runtime Error):
def calc(a):
  a = int(input())
  for a4 in range(26):
    for a7 in range(16):
      if a4*4+a7*7 is a:
        return "Yes"
  return "No"

if __name__ == '__main__':
  calc(int(input())
      

Fixed submission:
def calc(a):
  for a4 in range(26):
    for a7 in range(16):
      if a4*4+a7*7 == a:
        return "Yes"
  return "No"

if __name__ == '__main__':
  print(calc(int(input())))
Buggy python submission (verdict: Runtime Error):
C = ["ABC", "ARC" , "AGC"]
A = int(input())
print(C[(A>1200)+(A>2800)]

Fixed submission:
a = int(input())
print("ABC" if a<1200 else "ARC" if a<2800 else "AGC")

Buggy python submission (verdict: Runtime Error):
a = int(input())
print(["ABC","ARC","AGC"][a<1200, a<2800, a>=2800])

Fixed submission:
a = int(input())
print("ABC" if a<1200 else "ARC" if a<2800 else "AGC")
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
a = n%1000
b = 1000-a
if b=1000:
  print(0)
else:
  print(b)

Fixed submission:
n = int(input())
 
a = n%1000
b = 1000-a
if b==1000:
  print(0)
else:
  print(b)

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

a = n%1000
b = 1000-a
if b=1000:
  print(0)
else:
  print(a)

Fixed submission:
n = int(input())
 
a = n%1000
b = 1000-a
if b==1000:
  print(0)
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
N =int(input())
list ={"AC"=0, "WA"=0, "TLE"=0, "RE"=0 }
 
for i in range(N):
  words = input()
  list[words]+=1
 
print("AC x "+str(list["AC"]))
print("WA x "+str(list["WA"]))
print("TLE x "+str(list["TLE"]))
print("RE x "+str(list["RE"]))

Fixed submission:
N =int(input())
list ={"AC":0, "WA":0, "TLE":0, "RE":0 }
 
for i in range(N):
  words = input()
  list[words]+=1
 
print("AC x "+str(list["AC"]))
print("WA x "+str(list["WA"]))
print("TLE x "+str(list["TLE"]))
print("RE x "+str(list["RE"]))

Buggy python submission (verdict: Runtime Error):
N =int(input())
list ={"AC"=0, "WA"=0, "TLE"=0, "RE"=0 }

for i in range(s):
  words = input()
  list[words]+=1

print("AC x "+str(list["AC"]))
print("WA x "+str(list["WA"]))
print("TLE x "+str(list["TLE"]))
print("RE x "+str(list["RE"]))


Fixed submission:
N =int(input())
list ={"AC":0, "WA":0, "TLE":0, "RE":0 }
 
for i in range(N):
  words = input()
  list[words]+=1
 
print("AC x "+str(list["AC"]))
print("WA x "+str(list["WA"]))
print("TLE x "+str(list["TLE"]))
print("RE x "+str(list["RE"]))
Buggy python submission (verdict: Runtime Error):
s =int( input())
a = s[-1]
if a in [2, 4, 5, 7, 9]:
  print('hon')
elif a in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')

Fixed submission:
s =int( input()[-1])
if s in [2, 4, 5, 7, 9]:
  print('hon')
elif s in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = N[-1]
if a in [0,1,6,8]:
  print("pon")
elif a=="3":
  print("bon")
else:
  print("hon")


Fixed submission:
s =int( input()[-1])
if s in [2, 4, 5, 7, 9]:
  print('hon')
elif s in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = N[-1]
if a in [0,1,6,8]:
  print("pon")
elif a in [3]:
  print("bon")
else:
  print("hon")


Fixed submission:
s =int( input()[-1])
if s in [2, 4, 5, 7, 9]:
  print('hon')
elif s in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = N[-1]
if a="0","1","6","8":
  print("pon")
elif a="3":
  print("bon")
else:
  print("hon")


Fixed submission:
s =int( input()[-1])
if s in [2, 4, 5, 7, 9]:
  print('hon')
elif s in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = N[-1]
if a="0","1","6","8":
  print("pon")
  elif a="3":
    print("bon")
    else:
      print("hon")

Fixed submission:
s =int( input()[-1])
if s in [2, 4, 5, 7, 9]:
  print('hon')
elif s in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')
Buggy python submission (verdict: Runtime Error):
S = input()
k = int(input())
if len(S)<=k:
  print(S)
else:
  print(S[:k]+"...")
 


Fixed submission:
k = int(input())
S = input()

if len(S)<=k:
  print(S)
else:
  print(S[:k]+"...")

Buggy python submission (verdict: Runtime Error):
S = input()
k = int(input())
if S.len()<=k:
  print(S)
else:
  print(S[:k]+"...")
 


Fixed submission:
k = int(input())
S = input()

if len(S)<=k:
  print(S)
else:
  print(S[:k]+"...")

Buggy python submission (verdict: Runtime Error):
S = input()
k = int.input()
if S.len()<=k:
  print(S)
else:
  print(S[:k]+"...")
 


Fixed submission:
k = int(input())
S = input()

if len(S)<=k:
  print(S)
else:
  print(S[:k]+"...")

Buggy python submission (verdict: Runtime Error):
S = input()
k = int.input()
if S.len()<=K:
  print(S)
else:
  print(S[:K]+"...")
 

Fixed submission:
k = int(input())
S = input()

if len(S)<=k:
  print(S)
else:
  print(S[:k]+"...")
Buggy python submission (verdict: Runtime Error):
s,t = input()
if t[:-1]==s:
  print("Yes")
else:
  print("No")


Fixed submission:
s= input()
t = input()
if t[:-1]==s:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s,t = input()
if t[:-1]=s:
  print("Yes")
else:
  print("No")

Fixed submission:
s= input()
t = input()
if t[:-1]==s:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s ,w = input(). int(" ")

s=int(s)
w=int(w)

if w >= s :
  print("unsafe")
else :
  print("safe")

Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy python submission (verdict: Runtime Error):
S,W=input().split("")
S=int(S)

W=int(W)

if W >= S:
  print("unsafe")
else:
  print("safe")


Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy python submission (verdict: Runtime Error):
S,W=input().sep("")
S=int(S)

W=int(W)

if W >= S:
  print("unsafe")
else:
  print("safe")


Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy python submission (verdict: Runtime Error):
S,W=input(),sep(",")
S=int(S)

W=int(W)

if W >= S:
  print("unsafe")
else:
  print("safe")


Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy python submission (verdict: Runtime Error):
S,W=input(),sep(",")
S=int(S)

W=int(W)

if W >= S:
  print("unsafe")
else:
    print("safe")


Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy python submission (verdict: Runtime Error):
S,W=input(),sep(",")
S=int(S)

W=int(W)

if W >= S:
  print("unsafe")
  else:
    print("safe")


Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

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

W=input()
W=int(W)

if W>=S:
  print("unsafe")
else:
    print("safe")


Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

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

W=input()
W=int(W)

if W>=S:
  print("unsafe")
  else:
    print("safe")

Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")

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

W=input()
W=int(W)

if W>S:
  print("unsafe")
  else:
    print("safe")

Fixed submission:
s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))

A=sum(a)
if n-A<0:
  print(-1)
else :
    print(n-A)


Fixed submission:
R=float(input())

print(R*2*3.141592)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=list(map(int,input().split()))

A=sum(a)
if N-A<0:
  print(-1)
else :
    print(N-A)


Fixed submission:
R=float(input())

print(R*2*3.141592)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=list(map(int,input().split()))

A=sum(a)
if N-A<0:
  print(-1)
  else :
    print(N-A)


Fixed submission:
R=float(input())

print(R*2*3.141592)

Buggy python submission (verdict: Runtime Error):
R=(float.input())

print(R**2*3.141592)


Fixed submission:
R=float(input())

print(R*2*3.141592)

Buggy python submission (verdict: Runtime Error):
R=(float.input())

print(R**2*3.14)

Fixed submission:
R=float(input())

print(R*2*3.141592)
Buggy python submission (verdict: Runtime Error):
n = input()

if "7" in n:
  print("Yes")
  else:
    print("No")

Fixed submission:
n = input()

if "7" in n:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int,input().split()))
ans = 1
for i in range(N):
    ans = ans*L[i]
if ans <= 10**18 and i == N-1:
    print(ans)
elif ans >= 10**18 and i == N-1:
    print("-1")


Fixed submission:
import sys
N = int(input())
L = list(map(int,input().split()))
ans = 1

if 0 in L:
    print(0)
    sys.exit()

for i in L:
    ans = ans*i
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int,input().split()))
ans = 1
for i in range(N):
    ans = ans*L[i]
    if ans <= 10**18 and i == N-1:
        print(ans)
        break
    elif ans >= 10**18 and i == N-1:
        print("-1")
        break


Fixed submission:
import sys
N = int(input())
L = list(map(int,input().split()))
ans = 1

if 0 in L:
    print(0)
    sys.exit()

for i in L:
    ans = ans*i
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
input()
towers = list(map(int, input().split()))

ans = []
count = 0
for x in range(len(towers)-1):
  if towers[x] >= towers[x+1]:
    count+=1
  else:
    ans.append(count)
    count = 0
    
print(ans.max())

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

max = 0
count = 0
for x in range(N-1):
  if H[x]>=H[x+1]:
    count += 1
  else:
    if max < count:
      max = count
    count=0
if max < count:
  max = count
print(max)
Buggy python submission (verdict: Runtime Error):
N = int(input())

array = list(map(int, input().split())).sort()

print(array[N//2]-array[N//2-1])

Fixed submission:
N = int(input())

array = sorted(list(map(int, input().split())))

print(array[N//2]-array[N//2-1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
ans = A[0]
INF = 1000000000000000000
for i in range(1,n):
    ans = ans * A[i]
    if ans > INF:
        ans = -1
print(ans)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A.sort()
ans = A[0]
INF = 1000000000000000000
for i in range(1,n):
    l,r = len(str(ans)),len(str(A[i]))
    if l+r > 21:
        ans = -1
        break
    else:
        ans = ans * A[i]
        if ans > INF:
            ans = -1
            break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
ans = A[0]
INF = 10**18
for i in range(1,n):
    ans = ans * A[i]
    if ans > INF:
        ans = -1
print(ans)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A.sort()
ans = A[0]
INF = 1000000000000000000
for i in range(1,n):
    l,r = len(str(ans)),len(str(A[i]))
    if l+r > 21:
        ans = -1
        break
    else:
        ans = ans * A[i]
        if ans > INF:
            ans = -1
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = 0
ans = r*g*b
for i in range(1,n-1):
    m = min(i,n-i-1)
    for j in range(1,m+1):
        A,B,C = s[i],s[i-j],s[i+j]
        if A != B and A != C and B != C:
            ans -= 1
if r == 0 or g == 0 or b == 0:
    ans = 0
elif r == 1 or g == 1 or b == 1:
    ans = 1
print(ans)
n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = 0
ans = r*g*b
for i in range(1,n-1):
    m = min(i,n-i-1)
    for j in range(1,m+1):
        A,B,C = s[i],s[i-j],s[i+j]
        if A != B and A != C and B != C:
            ans -= 1
if r == 0 or g == 0 or b == 0:
    ans = 0
elif r == 1 or g == 1 or b == 1:
    ans = 1
print(ans)


Fixed submission:
n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
ret = 0
for i in range(1,n-1):
    m = min(i,n-i-1)
    for j in range(1,m+1):
        A,B,C = s[i],s[i-j],s[i+j]
        if A != B and A != C and B != C:
            ret += 1
ans = r*g*b - ret
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
import copy
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n = int(input())
A = list(map(int,input().split()))
aset = set(A)
aDict = {}
for aName in aset:
    aDict.update({aName:0})
for a in A:
    aDict[a] += 1

for k in range(n):
    ans = 0
    aDict[A[k]] -= 1
    for i in aset:
        if aDict[i] == 1 or aDict[i] == 0:
            continue
        else:
            ans += cmb(aDict[i],2)
    print(ans)
    aDict[A[k]] += 1

Fixed submission:
from operator import mul
from functools import reduce
import copy
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n = int(input())
A = list(map(int,input().split()))
aset = set(A)
aDict = {}
for aName in aset:
    aDict.update({aName:0})
for a in A:
    aDict[a] += 1

combNumDict = {}
sum = 0
for i in aset:
    if aDict[i] == 0 or aDict[i] == 1:
        tmpsum = 0
    else:
        tmpsum = cmb(aDict[i],2)
    combNumDict.update({i:tmpsum})
    sum += tmpsum
for i in range(n):
    k = A[i]
    if aDict[k] == 1:
        print(sum)
    else:
        if aDict[k] == 2:
            tmp = 1
        else:
            tmp = cmb(aDict[k],2)-cmb(aDict[k]-1,2)
        print(sum-tmp)
Buggy python submission (verdict: Runtime Error):
s = input()
if s = "AAA" or s = "BBB":
    print("No")
else:
    print("Yes")

Fixed submission:
s = input()
if s == "AAA" or s == "BBB":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
sc = []
for _ in range(m):
    sc.append(list(map(int,input().split())))
ans = -1
flag = False
if n == 1:
    tmp = sc[0][1]
    for x in sc:
        s = x[0]
        c = x[1]
        if tmp != c:
            break
        ans = tmp
elif n == 2:
    tmp = [-1,-1]
    for x in sc:
        s = x[0]
        c = x[1]
        if tmp[s-1] != c and tmp[s-1] != -1:
            flag = True
            break
        if s == 1 and c == 0:
            flag = True
            break
        tmp[s-1] = c
    if tmp[0]==-1:
        tmp[0] = 1
    if tmp[1]==-1:
        tmp[1] = 0
    if not flag:
        ans = tmp[0]*10+tmp[1]
else:
    tmp = [-1,-1,-1]
    for x in sc:
        s = x[0]
        c = x[1]
        if tmp[s-1] != c and tmp[s-1] != -1:
            flag = True
            break
        if s == 1 and c == 0:
            flag = True
            break
        tmp[s-1] = c
    if tmp[0]==-1:
        tmp[0] = 1
    if tmp[1]==-1:
        tmp[1] = 0
    if tmp[2]==-1:
        tmp[2] = 0
    if not flag:
        ans = tmp[0]*100+tmp[1]*10+tmp[2]
print(ans)

Fixed submission:
n,m = map(int,input().split())
sc = []
for _ in range(m):
    sc.append(list(map(int,input().split())))
tmp = [-1,-1,-1]
flag = False
for b in sc:
    s = b[0]
    c = b[1]
    if n >1 and s == 1 and c == 0:
        flag = True
        break
    if tmp[s-1] != -1 and tmp[s-1] != c:
        flag = True
        break
    tmp[s-1] = c
ans = 0

if not flag:
    for i in range(n):
        if tmp[i] == -1:
            if n == 1:
                tmp[i] = 0
            elif i == 0:
                tmp[i]=1
            else:
                tmp[i]=0
    for i in range(n):
        m = 10**(n-1-i)
        ans = ans + tmp[i]*m
else:
    ans = -1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
l = []
for x in p:
    tmp = 1.0+0.5*(float(x)-1.0)
    l.append(tmp)
max = 0
for i in range(n-k+1):
    tmp = sum(l[i:i+k])
    if tmp >= max:
        max = tmp
print(max)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
l = []
for x in p:
    tmp = 1.0+0.5*(float(x)-1.0)
    l.append(tmp)
max = sum(l[:k])
now = max
for i in range(k,n):
    now = now + l[i] - l[i-k]
    if now >= max:
        max = now
print(max)
Buggy python submission (verdict: Runtime Error):
n = int(input())
Y = [list(map(int,input().split())) for _ in range(n)]
X = []
for y in Y:
    X.append(y[0]-y[1],y[0]+y[1])
X.sort()
ans = n
right = X[0][1]
for i in range(1,n):
    left = X[i][0]
    if left < right:
        ans -= 1
    else:
        right = X[i][1]
print(ans)

Fixed submission:
n = int(input())
Y = [list(map(int,input().split())) for _ in range(n)]
X = []
for y in Y:
    X.append([y[0]+y[1],y[0]-y[1]])
X.sort()
ans = n
right = X[0][0]
for i in range(1,n):
    left = X[i][1]
    if left < right:
        ans -= 1
    else:
        right = X[i][0]
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
flag = 0
for i in range(n):
  if s[i] == "A":
    flag = 1
  elif s[i] == "B" and flag == 1:
    flag = 2
  elif s[i] == "C" and flag == 2:
    cnt += 1
    flag = 0
  else:
    flag = 0
print(cnt)

Fixed submission:
k,x = map(int,input().split())
if k*500 >= x:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())
for _ in range(k):
    if a > 0:
        a-=1
    elif b > 0:
        b-=1
    else:
        break
print("{} {}".format(a,b))

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

if k >= a:
    k = k-a
    a = 0
    if k >= b:
        b = 0
    else:
        b = b - k
else:
    a = a-k
print(a,b)
Buggy python submission (verdict: Runtime Error):
a = map(int,input().split())
print(a*a*a)


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