Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int, input().split())

import functools

@functools.lru_cache(maxsize=None)
def calc_strength(sugar, water):
    if water == 0: return -1
    return sugar * 100 / (sugar + water)

@functools.lru_cache(maxsize=None)
def f(strength, sugar, water):
    cand = []
    for x in ((C, 0), (D, 0), (0, 100*A), (0, 100*B)):
        s, w = sugar + x[0], water + x[1]
        if s + w <= F and s * 100 <= w * E:
            cand.append(f(calc_strength(s, w), s, w))
    if cand: return sorted(cand, reverse=True)[0]
    return (strength, sugar + water, sugar)
    
print(f(-1, 0, 0)[1:])

Fixed submission:
A,B,C,D,E,F = map(int, input().split())

import functools
import sys
sys.setrecursionlimit(10**5)

@functools.lru_cache(maxsize=None)
def calc_strength(sugar, water):
    if water == 0: return -1
    return sugar * 100 / (sugar + water)

@functools.lru_cache(maxsize=None)
def f(strength, sugar, water):
    cand = [(strength, sugar + water, sugar)]
    for x in ((C, 0), (D, 0), (0, 100*A), (0, 100*B)):
        s, w = sugar + x[0], water + x[1]
        if s + w <= F and s * 100 <= w * E:
            cand.append(f(calc_strength(s, w), s, w))
    return max(cand)
    
print(*f(-1, 0, 0)[1:])
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = [int(x) for x in input().split()]

total = sum(A)

ans = math.inf
nusuke = 0
for a in A[:-1]:
    nusuke += a
    ans = min(ans, abs(nusuke - (total - nusuke)))

print(ans)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

total = sum(A)

ans = float('inf')
nusuke = 0
for a in A[:-1]:
  nusuke += a
  ans = min(ans, abs(nusuke - (total - nusuke)))

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]

c = 1
for i in range(n):
  if c == 2:
    print(i + 1)
    exit(0)
  c = a[c]
print(-1)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

c = 1
for i in range(n):
  c = a[c - 1]
  if c == 2:
    print(i + 1)
    exit(0)

print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

n = int(input())
a = [int(input()) for _ in range(n)]

rm = {}
for i, x in enumerate(a):
  rm.setdefault(x, set()).add(i + 1)

p = set()
for i in range(n):
  if 1 in rm.get(2, []):
    print(i + 1)
    exit(0)
  d = rm.get(2, set()) - p
  if len(d) == 0: break
  n = reduce(lambda a, x: a.union(rm.get(x, set())), d, d)
  rm[2] = d.union(n)
  p = p.union(d)
print(-1)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

c = 1
for i in range(n):
  c = a[c - 1]
  if c == 2:
    print(i + 1)
    exit(0)

print(-1)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

def bf(links, n, st=1):
    inf = float('inf')
    dj = [inf] * (n + 1)
    dj[st] = 0
    for i in range(N):
        updated = False
        for link in links:
            fn, tn, lc = link
            lc *= -1
            if dj[fn] + lc < dj[tn]:
                dj[tn] = dj[fn] + lc
                updated = True
        if not updated: break
    else:
        pn = dj[-1]
        for i in range(N):
            updated = False
            for link in links:
                fn, tn, lc = link
                lc *= -1
                if dj[fn] + lc < dj[tn]:
                    dj[tn] = dj[fn] + lc
                    updated = True
            if not updated: break
        return inf if pn != dj[-1] else -dj[-1]
    return -dj[-1]

links = []
for _ in range(M):
    links.append([int(x) for x in input().split()])

print(bf(links, N, 1))


Fixed submission:
N, A, B = map(int, input().split())
H = sorted(int(input()) for _ in range(N))

import bisect, math
def f(ll, ul):
    if ul == ll: return ll
    cur = (ll + ul) // 2
    r = H[bisect.bisect_right(H, B * cur):]
    p = sum(math.ceil((x - B * cur) / (A - B)) for x in r)

    if p == cur:
        return cur
    elif p < cur:
        return f(ll, cur)
    else:
        return f(cur + 1, ul)

print(f(0, math.ceil((H[-1]) / B)))

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
H = sorted(int(input()) for _ in range(N))

import bisect, math
def f(ll, ul):
    if ul - ll == 1: return ll
    cur = (ll + ul) // 2
    r = H[bisect.bisect_right(H, B * cur):]
    p = sum(math.ceil((x - B * cur) / (A - B)) for x in r)

    if p == cur:
        return cur
    elif p < cur:
        return f(ll, cur)
    else:
        return f(cur + 1, ul)

print(f(0, math.ceil((H[-1]) / B) + 1))

Fixed submission:
N, A, B = map(int, input().split())
H = sorted(int(input()) for _ in range(N))

import bisect, math
def f(ll, ul):
    if ul == ll: return ll
    cur = (ll + ul) // 2
    r = H[bisect.bisect_right(H, B * cur):]
    p = sum(math.ceil((x - B * cur) / (A - B)) for x in r)

    if p == cur:
        return cur
    elif p < cur:
        return f(ll, cur)
    else:
        return f(cur + 1, ul)

print(f(0, math.ceil((H[-1]) / B)))
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())

import bisect
A = []
for _ in range(N):
    bisect.insort_left(A, tuple(int(x) for x in input().split()))

acc = 0
for x in A:
    a, b = x
    acc += b
    if acc >= K:
        print(a)
        break

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

from heapq import *
q = []
for _ in range(N):
    heappush(q, tuple(int(x) for x in input().split()))

acc = 0
while q:
    a, b = heappop(q)
    acc += b
    if acc >= K:
        print(a)
        break
Buggy python submission (verdict: Runtime Error):
from functools import reduce
from copy import deepcopy

n = int(input())

def dadd(t, s): 
    for k,v in s.items():
        t[k] = t.get(k, 0) + v 
    return t

def pfd(c, i): 
    for j in range(2, i // 2 + 1): 
        if i % j == 0:
            d = i // j
            return dadd(deepcopy(c[j]), c.get(d, dict()))
    return { i: 1 } 

p,c = {},{}
for i in range(2, n + 1): 
    q = pfd(c, i)
    c[i] = q 
    dadd(p, q)

tot = reduce(lambda a,(k,v): a * (v + 1), p.items(), 1)
print(tot % (10 ** 9 + 7)) 

Fixed submission:
from functools import reduce
from copy import deepcopy

n = int(input())

def dadd(t, s): 
    for k,v in s.items():
        t[k] = t.get(k, 0) + v 
    return t

def pfd(c, i): 
    for j in range(2, i // 2 + 1): 
        if i % j == 0:
            d = i // j
            return dadd(deepcopy(c[j]), c.get(d, dict()))
    return { i: 1 } 

p,c = {},{}
for i in range(2, n + 1): 
    q = pfd(c, i)
    c[i] = q 
    dadd(p, q)

tot = reduce(lambda a,v: a * (v + 1), p.values(), 1)
print(tot % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
import re
s = input()
print("A%sC" % re.match('AtCoder (.).* Contest', s)[1])

Fixed submission:
import re
s = input()
print("A%sC" % re.match('AtCoder (.).* Contest', s).group(1))
Buggy python submission (verdict: Runtime Error):
import re
s = input()
print("A%sC" % re.match('AtCoder (.).* Contest', s)[1])

Fixed submission:
a,b,x = map(int, input().split())
print(b // x - (a - 1) // x)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
s = int(input())

def c(b):
    cur = n
    acc = 0
    while cur != 0:
        div, mod = divmod(cur, b)
        acc += mod
        cur = div
    return acc

def f():
    if n == s:
        return (n + 1)
    if n < s:
        return -1
    rt = math.ceil(math.sqrt(n))
    for b in range(2, rt + 1):
        if c(b) == s: return b
    for p in range(rt, 0, -1):
        q = s - p
        x = n - q
        b = x // p
        # if x % p == 0 and b > q and b > p and q >= 0:
        if c(b) == s:
            return b
    return -1
    
print(f())        

Fixed submission:
import math
n = int(input())
s = int(input())

def c(b):
    cur = n
    acc = 0
    while cur != 0:
        div, mod = divmod(cur, b)
        acc += mod
        cur = div
    return acc

def g(b):
    if b > n: return n
    return sum(divmod(n,b))

def f():
    if n == s:
        return (n + 1)
    if n < s:
        return -1
    rt = math.ceil(math.sqrt(n))
    for b in range(2, rt + 1):
        if c(b) == s: return b
    for p in range(rt - 1, 0, -1):
        q = s - p
        x = n - q
        b = x // p
        if g(b) == s:
            return b
    return -1
    
print(f())
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=[int(s) for s in input().split()]
cnt=0
mx=max(l)
for i in range(1,mx+1):
  k=i
  arc=0
  abc=0
  for j in range(len(l)):
    if l[j]>=k:
      arc+=1
    else:
      abc+=1
  if arc==abc:
    cnt+=1
print(cnt)

Fixed submission:
n=int(input())
l=[int(s) for s in input().split()]
cnt=0
l.sort()
print(l[n//2]-l[n//2-1])
Buggy python submission (verdict: Runtime Error):
    n,m=map(int,input().split())
    maxl=1
    minr=n
    while m:
      l,r=map(int,input().split())
      maxl=max(maxl,l)
      minr=min(minr,r)
      m-=1
    print(max(0,minr-maxl+1))

Fixed submission:
n,m=map(int,input().split())
maxl=1
minr=n
while m:
  l,r=map(int,input().split())
  maxl=max(maxl,l)
  minr=min(minr,r)
  m-=1
print(max(0,minr-maxl+1))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
maxl=1
minr=N
while m:
  l,r=map(int,input().split())
  maxl=max(maxl,l)
  minr=min(minr,r)
  m-=1
print(max(0,maxl-minr+1))


Fixed submission:
n,m=map(int,input().split())
maxl=1
minr=n
while m:
  l,r=map(int,input().split())
  maxl=max(maxl,l)
  minr=min(minr,r)
  m-=1
print(max(0,minr-maxl+1))
Buggy python submission (verdict: Runtime Error):
a = [int(i) for i in input().split()]
if a[0]*a[1] > a[2]:
  return c
else:
  return a[0]*a[1]

Fixed submission:
n, a, b = (int(i) for i in input().split())
if n*a > b:
  print(b)
else:
  print(n*a)

Buggy python submission (verdict: Runtime Error):
a, b, c = (int(i) for i in input().split())
if a*b >= c:
  return c
else:
  return a*b

Fixed submission:
n, a, b = (int(i) for i in input().split())
if n*a > b:
  print(b)
else:
  print(n*a)

Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())

result = 2019

for i in range(2019):
    if L+i > R-1:
        break;
    for j in range(i+1, 2019):
        if(L+j > R):
            break
        else:
            result = min(result,((L+i)*(L+j))%2019)

print(result)

Fixed submission:
N,A,B = map(int, input().split())
print(min(N*A,B))
Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int, input().split())

result = 2019
for i in range(L,R):
    for j in range(i+1,R+1):
        result = min(result,(i*j)%2019)

print(result)

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

result = 2019

for i in range(2019):
    if L+i > R-1:
        break;
    for j in range(i+1, 2019):
        if(L+j > R):
            break
        else:
            result = min(result,((L+i)*(L+j))%2019)

print(result)
Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
if r-n >= 2019:
  print(0)
  sys.exit(0)
mini = 2019
#nM = n % 2019
#rM = r % 2019
for i in range(n, r+1):
  for j in range(i+1, r+1):
    mini = min((i*j)%2019, mini)
print(mini)

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

if n * a < b:
  print(n * a)
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
if r-n >= 2019:
  print(0)
  sys.exit(0)
mini = 2019
#nM = n % 2019
#rM = r % 2019
for i in range(n, r+1):
  for j in range(i+1, r+1):
    mini = min((i*j)%2019, mini)
print(mini)

Fixed submission:
import sys
n, r = map(int, input().split())
if r-n >= 2019:
  print(0)
  sys.exit(0)
mini = 2019
#nM = n % 2019
#rM = r % 2019
for i in range(n, r+1):
  for j in range(i+1, r+1):
    mini = min((i*j)%2019, mini)
print(mini)

Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
if r - n >= 2019:
  print(0)
  sys.exit(0)
min = 2019
#nM = n % 2019
#rM = r % 2019
for i in range(n, r+1):
  for j in range(i+1, r+1):
    min = min((i*j)%2019, min)
print(min)

Fixed submission:
import sys
n, r = map(int, input().split())
if r-n >= 2019:
  print(0)
  sys.exit(0)
mini = 2019
#nM = n % 2019
#rM = r % 2019
for i in range(n, r+1):
  for j in range(i+1, r+1):
    mini = min((i*j)%2019, mini)
print(mini)
Buggy python submission (verdict: Runtime Error):
x,y,z = map(int, input().split())
D = x * y
T=z
 if  D < T :
     print(D)
 else : print(T)

Fixed submission:
x,y,z = map(int, input().split())
D = x * y
T=z
if  D < T :
      print(D)
else : print(T)

Buggy python submission (verdict: Runtime Error):
x,y,z = map(int, input().split())
D = x * y
T=z
 if  D < T :
      print(D)
 else : print(T)

Fixed submission:
x,y,z = map(int, input().split())
D = x * y
T=z
if  D < T :
      print(D)
else : print(T)

Buggy python submission (verdict: Runtime Error):
x,y,z = map(int, input().split())
D=x*y
T=z
 if D<T:
  print(D)
 else:  print(T)

Fixed submission:
x,y,z = map(int, input().split())
D = x * y
T=z
if  D < T :
      print(D)
else : print(T)

Buggy python submission (verdict: Runtime Error):
x,y,z = map(int, input().split())
D=x*y
T=z
 if( D<T,print(D))
 else(D>T,print(T)
  

Fixed submission:
x,y,z = map(int, input().split())
D = x * y
T=z
if  D < T :
      print(D)
else : print(T)

Buggy python submission (verdict: Runtime Error):
input(taxi)
input(train)
print(train+taxi)

Fixed submission:
x,y,z = map(int, input().split())
D = x * y
T=z
if  D < T :
      print(D)
else : print(T)

Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,iput(),split())
if A*N<B :
  print(A*N)
else:
    print(B)

Fixed submission:
N,A,B=map(int,input().split())
if A*N<B :
  print(A*N)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
A,B,N=map(int,iput(),split())
if A*N<B :
  print(A*N)
else:
    print(B)

Fixed submission:
N,A,B=map(int,input().split())
if A*N<B :
  print(A*N)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
A,B,N=map(int,iput(),split())
if A*N<B :
  print("A*N")
else:
  print("B")

Fixed submission:
N,A,B=map(int,input().split())
if A*N<B :
  print(A*N)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,iput(),split())
if A*N<B :
  print(A*N)
else:
    print(B)

Fixed submission:
N,A,B=map(int,input().split())
if A*N<B :
  print(A*N)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,iput(),split())
if A*N<B :
  print("A*N")
else:
    print("B")

Fixed submission:
N,A,B=map(int,input().split())
if A*N<B :
  print(A*N)
else:
  print(B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,iput(),split())
if A*N<B :
  print"A*N"
  else:
    print"B"

Fixed submission:
N,A,B=map(int,input().split())
if A*N<B :
  print(A*N)
else:
  print(B)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
N, K = map(int, input().split())
mod = 10**9 + 7
G = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
def p(n, k):
    x = 1
    for i in range(k):
        x *= n - i
        x %= mod
    return x
def f(x, par):
    L = len(G[x])
    if x == par:
        if L <= K-1:
            ans = K*p(K-1,L) % mod
        else:
            return 0
    elif x != par:
        if L-1 <= K-2:
            ans = p(K-2,L-1)
        else:
            return 0
    for i in G[x]:
        if i != par:
            ans *= f(i, x)
            ans %= mod
    return ans
print(f(0, 0))


Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
arr2=[0]*n
for i in range(0,2*n,2):
  arr2[i//2]=arr[i%n]
ans=[0]*n
s=sum(arr)//2
cum=[0]*n
start=sum(arr2[:n//2])
cum[0]=start
l=n//2
for i in range(n):
  start=start+arr2[(i+l)%n]-arr2[i]
  cum[(i+1)%n]=start
for i in range(n):
  ans[(n-1+i*2)%n]=(s-cum[i])*2
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numpy.linalg import solve

n = int(input())
a = [int(i)*2 for i in input().split()]

x = []
for i in range(n-1):
    temp = [0]*n
    temp[i] = 1
    temp[i+1] = 1
    x.append(temp)

temp = [0]*n
temp[0] = 1
temp[n-1] = 1
x.append(temp)

x = np.array(x)
a = np.array(a)
#print(x)
#print(a)

y = solve(x, a)
ans = ""
for i in y:
    ans+=str(int(i))+" "

print(ans[0:len(ans)-1])



Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
arr2=[0]*n
for i in range(0,2*n,2):
  arr2[i//2]=arr[i%n]
ans=[0]*n
s=sum(arr)//2
cum=[0]*n
start=sum(arr2[:n//2])
cum[0]=start
l=n//2
for i in range(n):
  start=start+arr2[(i+l)%n]-arr2[i]
  cum[(i+1)%n]=start
for i in range(n):
  ans[(n-1+i*2)%n]=(s-cum[i])*2
print(*ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
 
N = int(input())
X = [int(i) for i in input().split()]
a = np.eye(N)
b = np.roll(a, 1, axis=1)
A = a + b
 
Y = np.linalg.solve(A, X)
 
Y = list(map(lambda x: str(int(x*2)), Y))
print(' '.join(Y))

Fixed submission:
a = [int(i) for i in input().split()]
x = a[0] * a[1]
y = a[2]

if (x<y):
  print(x)
else:
  print(y)
Buggy python submission (verdict: Runtime Error):
import numpy


N, D = (int(i) for i in input().split())
X = [[int(i) for i in input().split()] for i in range(N)]
print([D, N])
print(X)

a = numpy.array(X[0])
b = numpy.array(X[1])
u = b - z
print(numpy.linalg.norm(u))

Fixed submission:
import math as ma

def dist(a, b, D):
  r = 0
  for i in range(D):
    r = r + (a[i]-b[i])**2

  return ma.sqrt(r)

N, D = (int(i) for i in input().split())
X = [[int(i) for i in input().split()] for i in range(N)]

ret = 0
for i in range(N):
  for j in range(i+1, N):
    d = dist(X[i], X[j], D)
    if (d == int(d)):
      ret = ret + 1

print(ret)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数Nの入力
N = int(input())

# 整数Aの入力
A = int(input())

# 整数Bの入力
B = int(input())

if N*A >= B:
    print(B)
else:
    print(N*A) 

Fixed submission:
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())

if a*b >= c:
    print(c)
else:
    print(a*b)
Buggy python submission (verdict: Runtime Error):
import sys

n,m = input().split()
n,m = int(n), int(m)


list = []

count = 0
lMin, rMax = -1, -1

for i in range(0,m) :
    l, r = input().split()

    list.append((int(l),int(r)))

    if lMin == -1 and rMax == -1:
        lMin, rMax = list[i]
    else:
        if lMin < list[i][0] :
            lMin = list[i][0]
            
        if rMax > list[i][1] :
            rMax = list[i][1]

print(rMax - lMin +1)

Fixed submission:
import sys

old, yen = input().split()

if int(old) >= 13 :
    print(yen)
elif int(old) >= 6 :
    print(int(int(yen)/2))
else :
    print(0)
Buggy python submission (verdict: Runtime Error):
import sys

n,m = input().split()
n,m = int(n), int(m)

l, r = [],[]

count = 0

for i in range(1,m) :
    l[i], r[i] = input().split()
    l[i], r[i]  = int(l[i]), int( r[i] )

    if l[i] <= m and m <= r[i] :
        count = count + m - l[i] 


Fixed submission:
import sys

n,m = input().split()
n,m = int(n), int(m)


list = []

count = 0
lMin, rMax = -1, -1

for i in range(0,m) :
    l, r = input().split()

    list.append((int(l),int(r)))

    if lMin == -1 and rMax == -1:
        lMin, rMax = list[i]
    else:
        if lMin < list[i][0] :
            lMin = list[i][0]
            
        if rMax > list[i][1] :
            rMax = list[i][1]

count = rMax - lMin +1

if count < 0 : 
    count = 0

print(count)
Buggy python submission (verdict: Runtime Error):
N = input()
aryA = input().split(" ")

N = int(N)
aryA = [int(s) for s in aryA]
n = len(aryA)

tot = []
totlist = []
b = N

for m in range(b):
    for x in range(n):
        tot.append(abs(aryA[x] - (m + x + 1)))
    totlist.append(sum(tot))

print(min(totlist))

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

def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(2, N))

Buggy python submission (verdict: Runtime Error):
import math
N = input()
N = int(N)
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(2, N))

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

def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(2, N))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = str(input())

if K == 1:
	S = S[K-1].lower() + S[K:N]
elif K == N:
	S = S[0:N-1] + S[N].lower()
else:
	S = S[0:K-1] + S[K-1].lower() + S[K:N]

print(S)

Fixed submission:
N, K = map(int, input().split())
S = str(input())

if K == 1:
	S = S[K-1].lower() + S[K:N]
elif K == N:
	S = S[0:N-1] + S[N-1].lower()
else:
	S = S[0:K-1] + S[K-1].lower() + S[K:N]

print(S)
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int, input().split()))
l.sort()
print(l[N/2-1]-l[N/2])

Fixed submission:
N = int(input())
l = list(map(int, input().split()))
l.sort()
print(l[len(l)//2] - l[len(l)//2-1])
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print((a+b+1)//c)


Fixed submission:
a,b = map(int, input().split())
print((a+b+1)//2)

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print((a+b)//c + 1)

Fixed submission:
a,b = map(int, input().split())
print((a+b+1)//2)
Buggy python submission (verdict: Runtime Error):
string = input().split()
for i in range(len(string) - 1):
  if string[i] == string[i+1]
  	return print('Bad')
  
return print('Good')

Fixed submission:
def main():
    string = input()
    for i in range(len(string) - 1):
        if string[i] == string[i + 1]:
            return "Bad"
    return "Good"

print(main())
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    tasks = [tuple(map(int, input().split())) for _ in range(N)]
    tasks.sort(key=lambda x: x[1])
    time = 0
    for A, B in tasks:
        time += A
        if B < time:
            return 'No'
    return 'Yes'

print(main())


Fixed submission:
import fractions

A, B, C, D = map(int, input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def count_multiple(n):
    return (B // n) - ((A - 1) // n)

def count_not_multiple(n):
    return (B - A + 1) - count_multiple(n)

cnm = count_not_multiple
print(cnm(C) + cnm(D) - cnm(lcm(C, D)))

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)

def count_multiple(n):
    return (B // n) - ((A - 1) // n)

def count_not_multiple(n):
    return (B - A + 1) - count_multiple(n)

cnm = count_not_multiple
print(cnm(C) + cnm(D) - cnm(lcm(C, D)))


Fixed submission:
import fractions

A, B, C, D = map(int, input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def count_multiple(n):
    return (B // n) - ((A - 1) // n)

def count_not_multiple(n):
    return (B - A + 1) - count_multiple(n)

cnm = count_not_multiple
print(cnm(C) + cnm(D) - cnm(lcm(C, D)))
Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv

n = int(args[1])
a = int(args[2])
b = int(args[3])

train = n * a
bus = b

if(train < bus):
  train
else:
  bus


Fixed submission:
import sys

n,a,b = input().split(' ')


n = int(n)
a = int(a)
b = int(b)

train = n * a
bus = b

if(train < bus):
  print(train)
else:
  print(bus)

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

args = sys.argv

n = int(args[1])
a = int(args[2])
b = int(args[3])

train = n * a
bus = b

if(train < bus):
  print(train)
else:
  print(bus)


Fixed submission:
import sys

n,a,b = input().split(' ')


n = int(n)
a = int(a)
b = int(b)

train = n * a
bus = b

if(train < bus):
  print(train)
else:
  print(bus)

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

args = sys.argv

n = args[1]
a = args[2]
b = args[3]

train = n * a
bus = b

if(train < bus):
  print(train)
else:
  print(bus)
  

Fixed submission:
import sys

n,a,b = input().split(' ')


n = int(n)
a = int(a)
b = int(b)

train = n * a
bus = b

if(train < bus):
  print(train)
else:
  print(bus)
Buggy python submission (verdict: Runtime Error):
for i in range(N+1):
    X = set(S[:i])
    Y = set(S[i:])
    
    if len(X & Y) > ans:
        ans = len(X & Y)

print(ans)


Fixed submission:
N = int(input())
S = str(input())
ans = 0

for i in range(N+1):
    X = set(S[:i])
    Y = set(S[i:])
    Z = X & Y
    if len(Z) > ans:
        ans = len(Z)

print(ans)