Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03611 (python)

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

#for i in a:
#i=0
b=[0]*(10**5+10)
r=0
#while i<=n:
for i in a:
    b[i]+=1
    b[i+1]+=1
    b[i+2]+=1

print(max(b))

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

#for i in a:
#i=0
b=[0]*(10**5)
r=0
#while i<=n:
for i in a:
    b[i]+=1
    b[i+1]+=1
    b[i+2]+=1
t=max(b)
print(t)

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

#for i in a:
#i=0
b=[0]*(max(a)+2)
r=0
#while i<=n:
for i in a:
    b[i]+=1
    b[i+1]+=1
    b[i+2]+=1
print(max(b)-1)


    A=a.count(a[i]+1)
    M=a.count(a[i])
    C=a.count(a[i]-1)

    b[i]=A+M+C
i=0
def dfs(i,j):

    
    max(dfs(i+1,j),dfs(i,j+1))

print(max(b))

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

#for i in a:
#i=0
b=[0]*(max(a)+2)
r=0
#while i<=n:
for i in a:
    b[i]+=1
    b[i+1]+=1
    b[i+2]+=1
print(max(b-1))

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

#for i in a:
#i=0
b=[0]*n
r=0
#while i<=n:
for i in a:
    r=a[i]
    A=a.count(i+1)
    M=a.count(i)
    C=a.count(i-1)

    b=A+M+C

print(max(b))
Problem p04044 (python)

Fixed submission:
#! python3

N, L = [int(x) for x in input().strip().split(' ')]
S = []
for _ in range(N):
    S.append(input().strip())
S.sort()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
#文字列大好き
n,l = map(int, input().split())
s=[input() for _ in range(n)]

s=s.sort()
print(''.join(s))
#ans=''
#for i in s:
#    ans=ans+i

#print(ans)
Problem p02573 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000000)

n, m = map(int, input().split())
graph = [[] for _ in range(n+1)]
visited = [False for _ in range(n+1)]

# print("graph is : ", graph)
# print("visited is : ", visited)
def dfs(node):
    visited[node] = True
    ret = 0
    for child in graph[node]:
        if not visited[child]:
            ret += dfs(child)
    return ret + 1


for _ in range(m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

rets = []
for node in range(1, n+1):
    if not visited[node] :
        counts = dfs(node)
        rets.append(counts)
print(max(rets))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
graph = [[] for _ in range(n+1)]
visited = [False for _ in range(n+1)]

# print("graph is : ", graph)
# print("visited is : ", visited)
def dfs(node):
    visited[node] = True
    ret = 0
    for child in graph[node]:
        if not visited[child]:
            ret += dfs(child)
    return ret + 1


for _ in range(m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

rets = []
for node in range(1, n+1):
    if not visited[node] :
        counts = dfs(node)
        rets.append(counts)
print(max(rets))
Problem p03493 (python)

Fixed submission:
s = input()
s = [int(i) for i in s]
ans = sum(s)
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
counter = 0
if(s[0]=="1"):
    ++counter
if(s[1]=="1):
    ++counter
if(s[2]=="1):
    ++counter

print(counter)
Problem p02553 (python)

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

print(max(X[1]*X[2], X[3]*X[0], X[0]*X[2],X[1]*X[3]))

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

print(max{X[0]*X[1], X[1]*X[2], X[2]*X[3], X[3]*X[0], X[0]*X[2],
         X[1]*X[3]})
Problem p02554 (python)

Fixed submission:
N = int(input())

num = 10**N - 2*(9**N) + 8**N
print(num % (10**9 + 7))

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

num = N*(N-1)*(10**(N-2))/ (10**9 +7)
print(num)

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

num = (N*(N-1)*10**(N-2)) / (10**9 +7)
print(num)
Problem p02576 (python)

Fixed submission:
N,X,T = input().split()

N = int(N)
X = int(X)
T = int(T)

if N % X != 0:
  A = ((N // X) + 1 ) * T
else:
  A = (N/X) * T
print(int(A))

Buggy submission (verdict: Runtime Error):
N,X,T = input(int()).split()


if N % X != 0:
  A = ((N // X) + 1 ) * T
else:
  A = (N/X) * T
print(int(A))

Buggy submission (verdict: Runtime Error):
N,X,T = input().split()


A = ((N // X) + 1 ) * T
print(int(A))

Buggy submission (verdict: Runtime Error):
N,X,T = input(int()).split()

A = ((N // X) + 1 ) * T
print(int(A))

Buggy submission (verdict: Runtime Error):
N,X,T = input(int()).split()

A = ((N // X) + 1 ) * T
print(A)
Problem p02631 (python)

Fixed submission:
from functools import reduce

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

x = reduce(lambda x, y: x ^ y, A)
print(*[x ^ a for a in A])

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

x = reduce(lambda x, y: x ^ y, A)
print(*[x ^ a for a in A])
Problem p02867 (python)

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

A = sorted(enumerate(A), key=lambda x: x[1])
B = sorted(enumerate(B), key=lambda x: x[1])

flag = False
for i in range(N):
  if A[i][1] > B[i][1]:
    print('No')
    break
  elif i > 0 and A[i][1] <= B[i-1][1]:
    flag = True
else:
  if flag:
    print('Yes')
  else:
    D = dict((a[0], b[0]) for a, b in zip(A, B))
    count = 0
    x = D[0]
    while x != 0:
      x = D[x]
      count += 1
    print('Yes' if count < N-1 else 'No')

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

A = sorted(enumerate(A), key=lambda x: x[1])
B = sorted(enumerate(B), key=lambda x: x[1])

flag = False
for i in range(N):
  if A[i][1] > B[i][1]:
    print('No')
    braek
  elif A[i][0] == B[i][0]:
    flag = True
  elif i > 0 and A[i][1] <= B[i-1][1]:
    flag = True
else:
  if flag:
    print('Yes')
  else:
    print('No')
Problem p02958 (python)

Fixed submission:
N, *P = list(map(int, open(0).read().split()))
count = sum(p != i + 1 for i, p in enumerate(P))

print('YES' if count <= 2 else 'NO')

Buggy submission (verdict: Runtime Error):
N, *p = list(map(int, input().split()))
print(p)
count = 0
for i in range(N):
  if p[i] != i + 1:
    count += 1

if count <= 2:
  print('YES')
else:
  print('NO')
Problem p02975 (python)

Fixed submission:
from collections import Counter

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

c = Counter(A)
if len(c) == 3:
    x, y, z = c.keys()
    ans = (c[x] == c[y] == c[z]) and (x ^ y == z)
elif len(c) == 2:
    ans = (0 in c) and (c[0] * 3 == N)
elif len(c) == 1:
    ans = 0 in c
else:
    ans = False
print('Yes' if ans else 'No')

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

if N % 3:
    ans = len(set(A)) == 1
else:
    c = Counter(A)
    if len(c) != 3:
        ans = False
    else:
        x, y, z = c.keys()
        ans = (x | y == z)
print('Yes' if ans else 'No')
Problem p03076 (python)

Fixed submission:
import math
 
T = list(map(int, (input() for _ in range(5))))
T2 = [math.ceil(t / 10) * 10 for t in T]
m = max(t2 - t for t, t2 in zip(T, T2))
print(sum(T2) - m)

Buggy submission (verdict: Runtime Error):
T = list(map(int, (input() for _ in range(5))))
T2 = [math.ceil(t / 10) * 10 for t in T]
m = max(t2 - t for t, t2 in zip(T, T2))
print(sum(T2) - m)
Problem p03086 (python)

Fixed submission:
S = input()
count, max_count = 0, 0
for s in S:
  if s in 'ACGT':
    count += 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(max_count)

Buggy submission (verdict: Runtime Error):
S = input()
l = re.findall(r'[ACGT]+', S)
if l:
  print(max(map(len, l)))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import re

S = input()
m = max(map(len, re.findall(r'[ACGT]+', S)))
print(m)
Problem p03262 (python)

Fixed submission:
from fractions import gcd
from functools import reduce

n, x0 = map(int, input().split())
X = list(map(int, input().split()))

print(reduce(gcd, (abs(x - x0) for x in X)))

Buggy submission (verdict: Runtime Error):
import numpy as np

n, x0 = map(int, input().split())
X = list(map(int, input().split()))

print(np.gcd.reduce([x - x0 for x in X]))

Buggy submission (verdict: Runtime Error):
import math

n, x0 = map(int, input().split())
X = list(map(int, input().split()))

g = X.pop() - x0
for x in X:
    g = math.gcd(g, x - x0)
print(g)
Problem p03361 (python)

Fixed submission:
import sys

H, W = map(int, input().split())
S = ['.'*(W+2)] + ['.' + input() + '.' for _ in range(H)] + ['.'*(W+2)]
for i in range(1, H+1):
  for j in range(1, W+1):
    if S[i][j] == '#':
      for x, y in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        if S[i+x][j+y] == '#':
          break
      else:
        print('No')
        sys.exit()
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = ['.'*(W+2)] + ['.' + input() + '.' for _ in range(H)] + ['.'*(W+2)]
for i in range(1, H+1):
  for j in range(1, W+1):
    if S[i][j] == '#':
      for x, y in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        if S[i+x][j+y] == '#':
          break
      else:
        print('No')
        return
else:
  print('Yes')
Problem p03471 (python)

Fixed submission:
import sys
 
N, Y = map(int, input().split())
 
if N * 10000 >= Y:
  for a in range(Y // 10000 + 1):
    if a * 10000 + (N - a) * 5000 >= Y:
      for b in range((Y - a * 10000) // 5000 + 1):
        c = (Y - a * 10000 - b * 5000) // 1000
        if a + b + c == N:
          print(a, b, c)
          sys.exit()
print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())

if N * 10000 >= Y:
  for a in range(Y // 10000 + 1):
    if a * 10000 + (N - a) * 5000 >= Y:
      for b in range((Y - a * 10000) // 5000 + 1):
        c = (Y - a * 10000 - b * 5000) // 1000
        if a + b + c == N:
          print(a, b, c)
          return
print(-1, -1, -1)
Problem p04012 (python)

Fixed submission:
from collections import defaultdict

a = defaultdict(int)
for w in input():
  a[w] += 1
print('Yes' if sum(c % 2 for c in a.values()) == 0 else 'No')

Buggy submission (verdict: Runtime Error):
a = defaultdict(int)
for w in input():
  a[w] += 1
print('Yes' if sum(c % 2 for c in a.values()) == 0 else 'No')
Problem p02639 (python)

Fixed submission:
numbers = input().split(" ")
num = numbers.index("0")
print(num + 1)

Buggy submission (verdict: Runtime Error):
a = input().split(" ")
base = int(a[0])
count = int(a[1])
if count == 0:
  print(base)
else:
  num = list(map(int, input().split()))  

  i = 0
  while i <= count:
    if num.count(base - i) == 0:
      print(num.count(base - i))
      print(base - i)
      break
    elif num.count(base + 1) == 0:
      print(num.count(base + i))
      print(base + i)
      break
    else:
      i += 1
Problem p03633 (python)

Fixed submission:
import math
        
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = T[0]

for i in range(1, N):
    ans = ans * T[i] // math.gcd(ans, T[i])

print(ans)

Buggy submission (verdict: Runtime Error):
import math
        
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = T[0]

for i in range(1, N):
    ans = int((ans * T[i]) / math.gcd(ans, T[i]))

print(ans)

Buggy submission (verdict: Runtime Error):
import math
        
N = int(input())
T = []
ans = 1
for i in range(N):
    T.append(int(input()))

for i in range(N):
    ans = int((ans * T[i]) / math.gcd(ans, T[i]))

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
N = int(input())
T = []
ans = 1
for i in range(N):
    T.append(int(input()))

for i in range(N):
    ans = (ans * T[i]) / gcd(ans, T[i]) 

print(int(ans))
Problem p03816 (python)

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

B = list(set(A))

if len(B) % 2 == 0:
    print(len(B) - 1)
else:
    print(len(B))

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

A.sort()
i = 0
print(A)
while i < len(A) - 2:
    if A[i] == A[i + 1]:
        A.pop(i)
        A.pop(i + 2)
    else:
        i += 1
    print(i,A)

if A[-1] == A[-2]:
    print(len(A) - 1)
else:
    print(len(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
i = 0

while i < len(A) - 2:
    if A[i] == A[i + 1]:
        A.pop(i)
        A.pop(i + 2)
        i -= 1
    else:
        i += 1

print(len(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
i = 0

while i < len(A) - 2:
    if A[i] == A[i + 1]:
        A.pop(i)
        A.pop(i + 2)
    else:
        i += 1

print(len(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
i = 1

while i < len(A) - 1:
    if A[i] == A[i - 1] or A[i] == A[i + 1]:
        A.pop(i - 1)
        A.pop(i + 1)
    i += 1

print(len(A))
Problem p02621 (python)

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

Buggy submission (verdict: Runtime Error):
import sympy
import sys
sys.setrecursionlimit(10**6)

N = int(input())
div = []
for i in range(1,N+1):
    f = sympy.divisor_count(i)
    div.append(f*i)

print(sum(div))
Problem p02639 (python)

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

for i in range(5):
    if x[i] == 0:
        print(i+1)
    else:
      pass

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

for i in range(X+1):
    foot=i*2+(X-i)*4
    if foot==Y:
        print('Yes')
        exit()

print('No')
Problem p02681 (python)

Fixed submission:
S = str(input())
T = str(input())
a = 0


if len(T)-len(S)==1:
    for i in range(len(S)):
        if S[i] == T[i]:
            a += 1

if a == len(S):
    print('Yes')
else:
    print('No')

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

if A >= K:
    print(K)
elif  A < K <= A+B:
    print(A)
elif A+B < K <= A+B+C:
    print(A-(K-A-B))
Problem p02717 (python)

Fixed submission:
a, b, c = input().split()

a1 = b
b1 = a
a2 = c
c1 = a1

print(a2, b1, c1)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

A = sum(a)
a.sort(reverse=True)
print(a)

if a[m-1] >= A/(4*m):
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

A = sum(a)
a.sort(reverse=True)

if a[m-1] >= A/(4*m):
    print("Yes")
else:
    print("No")
Problem p02718 (python)

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

A = sum(a)
a.sort(reverse=True)

if a[m-1] >= A/(4*m):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

A = sum(a)
l = a.sort(reverse=True)

if l[m-1] >= A/(4*m):
    print("Yes")
else:
    print("No")
Problem p02747 (python)

Fixed submission:
S = str(input())
 
S1 = S.replace("hi", "")
if S1 == "":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = str(input())

S.replace("hi", "")
if S = "":
  print("Yes")
else:
  print("No")

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

for i in (len(n) - 1):
    if n[i] == h and n[i+1] ==i:
        print("Yes")
    else:
        print("No")

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

for i in (len(n)):
    if n[i] == h and n[i+1] ==i:
        print("Yes")
    else:
        print("No")
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())

print(int((a+b)*h/2))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())

print(2(a+b)*h)
Problem p04011 (python)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

AC=0

for i in range(1,N+1):
    if i <= K:
        AC += X
    else:
        AC += Y

print(AC)

Buggy submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())

AC=0

if N > K:
    for _ in range(K):
        AC += X
    
    for _ in range(N-K):
        AC += Y

    print(AC)

else:
    for _ in range(K):
        AC += X
        print(AC)
Problem p04030 (python)

Fixed submission:
s = str(input())

ans = []

for i in range(len(s)):
    if s[i] == '1':
        ans.append('1')
    elif s[i] == '0':
        ans.append('0')
    elif s[i] == 'B':
        ans = ans[:-1]

print(''.join(ans))

Buggy submission (verdict: Runtime Error):
s = input()

n = s.index('B')

s.pop(n-1)
print(s)
Problem p02573 (python)

Fixed submission:
import sys
class UnionFind():
    def __init__(self, n):
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x


N, M = map(int, input().split())
info = [tuple(map(int, s.split())) for s in sys.stdin.readlines()]
#print(info)

uf = UnionFind(N)

for a, b in info:
    a -= 1; b -= 1
    uf.union(a, b)

ans = min(uf.parents)

print(-ans)

Buggy submission (verdict: Runtime Error):
import sys
class UnionFind():
    def __init__(self, n):
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x


N, M = map(int, input().split())
info = [tuple(map(int, s.split())) for s in sys.stdin.readlines()]
#print(info)

uf = UnionFind(N)

for a, b in info:
    a -= 1; b -= 1
    uf.union(a, b)

#ans = min(uf.parents)

print(-ans)
Problem p02582 (python)

Fixed submission:
s = input()
#print(s[0])
if s[0]==s[1]==s[2]=="R":
    print(3)
elif s[0]=="R" and s[1]=="R":
    print(2)
elif s[1]=="R" and s[2]=="R":
    print(2)
elif s[0]=="R":
    print(1)
elif s[1]=="R":
    print(1)
elif s[2]=="R":
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
x,k,d = map(int,input().split())
x = abs(x)
if x//d > k:
  print(x-k*d)
elif (k-x//d)%2 == 0:
  print(x%d)
else:
  print(d-x%d)
Problem p02630 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = sum(a)
#print(ans)
q = int(input())
import collections
cc = collections.Counter(a)
#print(cc)
for i in range(q):
    b,c = map(int,input().split())
    tmp = cc[b]
    cc[b] = 0
    s=s-b*tmp+c*tmp
    cc[c]+=tmp
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = sum(a)
#print(ans)
q = int(input())
import collections
cc = collections.Counter(a)
#print(cc)
for i in range(q):
    b,c = map(int,input().split())
    tmp = cc[b]
    cc[b] = 0
    s=s-b*tmp+c*tmp
    cc[c]+=tmp
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = sum(a)
#print(ans)
q = int(input())
import collections
cc = collections.Counter(a)
print(cc)
for i in range(q):
    b,c = map(int,input().split())
    tmp = cc[b]
    cc[b] = 0
    s=s-b*tmp+c*tmp
    cc[c]+=tmp
    print(s)
Problem p02677 (python)

Fixed submission:
import numpy as np
import math
a,b,h,m = map(int, input().split())
ty = ((h*60+m)/60)/12
ta = (m)/60
if abs(ty-ta)>0.5:
    k = 1-abs(ty-ta)
else:
    k = abs(ty-ta)
#print(k)
if h*60+m==12*m:
    print(abs(b-a))
else:
    ans = a**2+b**2-2*a*b*(np.cos(k*2*math.pi))
    print(math.sqrt(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
a,b,h,m = map(int, input().split())
ty = ((h*60+m)/60)/12
ta = (m)/60
if abs(ty-ta)>0.5:
    k = 1-abs(ty-ta)
else:
    k = abs(ty-ta)
#print(k)
if h*60+m==12*m
    print(b-a)
else:
    ans = a**2+b**2-2*a*b*(np.cos(k*2*math.pi))
    print(math.sqrt(ans))
Problem p02730 (python)

Fixed submission:
a=input()
#b=reversed(a)
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]
 
if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]
 
if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")
Problem p02755 (python)

Fixed submission:
import sys
 
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()
print(-1)

Buggy submission (verdict: Runtime Error):
a = input()
q = int(input())
b = 0
for i in range(q):
    qi=input()
    if qi==str(1):
        b = b+1
    else:
        qi = qi.split()
        if (int(qi[1])+b)%2==1:
            a = qi[2] + a
        else:
            a = a + qi[2]
if b%2==1:
    a = a[::-1]
    print(a)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
aa, bb = map(int,input().split())
a = aa / 0.08
b = bb / 0.1
c = []
if (a-int(a))<0.5:
    for i in range(12):
        if (b-int(b))<0.1:
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
        else:
            for j in range(10):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
else:
    for i in range(13):
       if (b-int(b))<0.1:
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
        else:
            for j in range(10):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                    pass
if c==[]:
    print(-1)
elif (int(a)+i)<=0:
    print(-1)
else:
    print(*c[:1])

Buggy submission (verdict: Runtime Error):
aa, bb = map(int,input().split())
a = aa / 0.08
b = bb / 0.1
c = []
if (a-int(a))<0.5:
    for i in range(12):
        if (b-int(b))<0.1:
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
        else:
            for j in range(10):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
else:
    for i in range(13):
       if (b-int(b))<0.1:
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
        else:
            for j in range(10):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                    pass
if c==[]:
    print(-1)
elif (int(a)+i)<=0:
    print(-1)
else:
    print(*c[:1])