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

Fixed submission:
N, W = map(int, input().split())
wt, vt = [], []
for _ in range(N):
    w, v = map(int, input().split())
    wt.append(w)
    vt.append(v)

dp = [[0] * (W + 5) for _ in range(105)]

for i in range(N):
    for j in range(W + 1):
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
        if 0 <= j - wt[i]:
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - wt[i]] + vt[i])
# print(dp)
print(dp[N][W])

Buggy submission (verdict: Runtime Error):
N, W = map(int, input().split())
wt, vt = [], []
for _ in range(N):
    w, v = map(int, input().split())
    wt.append(w)
    vt.append(v)

dp = [[0] * (W + 5) for _ in range(100)]

for i in range(N):
    for j in range(W + 1):
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
        if 0 <= j - wt[i]:
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - wt[i]] + vt[i])
# print(dp)
print(dp[N][W])
Problem p03294 (python)

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


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


N = int(input())
A = list(map(int, input().split()))
res = A[0]
for i in range(1, N):
    res = lcm(res, A[i])
res = res - 1
ans = 0
for a in A:
    ans += (res % a)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

N = int(input())
A = list(map(int, input().split()))
res = A[0]
for i in range(1, N):
    res = lcm(res, A[i])
res = res - 1
ans = 0
for a in A:
    ans += (res % a)
print(ans)
Problem p03324 (python)

Fixed submission:
def calc(x):
    ret = 0
    while x % 100 == 0:
        x /= 100
        ret += 1
    return ret

D, N = map(int, input().split())
cnt, val = 0, 0
while cnt < N:
    val += 1
    if calc(val) == D:
        cnt += 1
print(val)

Buggy submission (verdict: Runtime Error):
D, N = map(int, input().split())
X = [i * (100 ** D) for i in range(1, 100)]
print(X[N-1])
Problem p03338 (python)

Fixed submission:
N = int(input())
S = input()
if N == 2:
    print(len(set(S[0]).intersection(set(S[1]))))
else:
    ans = []
    for i in range(1, N-1):
        a = set(S[:i])
        b = set(S[i:])
        ans.append(len(a.intersection(b)))
    print(max(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
ans = []
for i in range(1, N-1):
    a = set(S[:i])
    b = set(S[i:])
    ans.append(len(a.intersection(b)))
print(max(ans))
Problem p03436 (python)

Fixed submission:
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]


def bfs(start, goal):
    q = [[start]]
    while len(q) > 0:
        path = q.pop(0)
        n = path[len(path) - 1]
        if n == goal:
            return path
        else:
            for sy, sx in zip(dy, dx):
                py = n[0] + sy
                px = n[1] + sx
                if py < 0 or H <= py:
                    continue
                if px < 0 or W <= px:
                    continue
                if S[py][px] == "#":
                    continue
                if visited[py][px]:
                    continue
                visited[py][px] = True
                x = (py, px)
                if x not in path:
                    new_path = path[:]
                    new_path.append(x)
                    q.append(new_path)
    return None


H, W = map(int, input().split())
S = []
for i in range(H):
    S.append([c for c in input()])
# print(S)
visited = [[False for _ in range(W)] for _ in range(H)]
start = (0, 0)
goal = (H-1, W-1)
ans = bfs(start, goal)
if ans is None:
    print(-1)
    exit()
# print(ans)
counter = 0
for i in range(H):
    for j in range(W):
        if (i, j) in ans:
            continue
        if S[i][j] == ".":
            counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]


def bfs(start, goal):
    q = [[start]]
    while len(q) > 0:
        path = q.pop(0)
        n = path[len(path) - 1]
        if n == goal:
            return path
        else:
            for sy, sx in zip(dy, dx):
                py = n[0] + sy
                px = n[1] + sx
                if py < 0 or H <= py:
                    continue
                if px < 0 or W <= px:
                    continue
                if S[py][px] == "#":
                    continue
                if visited[py][px]:
                    continue
                visited[py][px] = True
                x = (py, px)
                if x not in path:
                    new_path = path[:]
                    new_path.append(x)
                    q.append(new_path)

H, W = map(int, input().split())
S = []
for i in range(H):
    S.append([c for c in input()])
# print(S)
visited = [[False for _ in range(W)] for _ in range(H)]
start = (0, 0)
goal = (H-1, W-1)
ans = bfs(start, goal)
# print(ans)
counter = 0
for i in range(H):
    for j in range(W):
        if (i, j) in ans:
            continue
        if S[i][j] == ".":
            counter += 1
print(counter)
Problem p03455 (python)

Fixed submission:
def is_even(int_num):
    if int_num % 2 == 0:
        return True
    else:
        return False


def main():
    # start = time.time()
    inputs = input().split()
    a, b = int(inputs[0]), int(inputs[1])
    if is_even(a * b):
        print("Even")
    else:
        print("Odd")

    # print((time.time() - start) * 1000.0)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def is_even(int_num):
    if int_num % 2 == 0:
        return True
    else:
        return False


def main():
    # start = time.time()
    a, b = int(input()), int(input())
    if is_even(a * b):
        print("Even")
    else:
        print("Odd")

    # print((time.time() - start) * 1000.0)

 main()

Buggy submission (verdict: Runtime Error):
def is_even(int_num):
    if int_num % 2 == 0:
        return True
    else:
        return False


def main():
    # start = time.time()
    a, b = int(input()), int(input())
    if is_even(a * b):
        print("Even")
    else:
        print("Odd")

    # print((time.time() - start) * 1000.0)

if __name__ == "__main__":
    main()
Problem p03504 (python)

Fixed submission:
N, C = map(int, input().split())
MAX_N = (10 ** 5 + 5)
X = [[0] * MAX_N for _ in range(C)]

for _ in range(N):
    s, t, c = map(int, input().split())
    c -= 1
    X[c][s] += 1
    X[c][t + 1] -= 1
# print(X)
res = [[0] * MAX_N for _ in range(C)]
for c in range(C):
    for i in range(MAX_N - 1):
        res[c][i + 1] = res[c][i] + X[c][i]
# print(ans)
ans = 0
for i in range(MAX_N - 1):
    count = 0
    for c in range(C):
        if 0 < res[c][i]:
            count += 1
    ans = max(ans, count)
print(ans)

Buggy submission (verdict: Runtime Error):
N, C = map(int, input().split())
MAX_N = (10 ** 5 + 1)
X = [0] * MAX_N
for _ in range(N):
    s, t, c = map(int, input().split())
    X[s] += 1
    X[t+1] -= 1
# print(X)
ans = [0] * MAX_N
for i in range(MAX_N - 1):
    ans[i + 1] = ans[i] + X[i]
# print(ans)
print(max(ans))
Problem p03599 (python)

Fixed submission:
A, B, C, D, E, F = tuple(map(int, input().split()))
max_con = 0
res = (100 * A, 0)
for i in range(F // (100 * A) + 1):
    for j in range(F // (100 * B) + 1):
        if i == 0 and j == 0:
            continue
        wat = (A * i + B * j)
        x = 100 * wat
        if F < x:
            continue
        for k in range(wat * E // C + 1):
            for l in range(wat * E // D + 1):
                y = C * k + D * l
                if wat * E < y:
                    continue
                total = x + y
                if F < total:
                    continue
                if max_con < y / total:
                    max_con = y / total
                    res = (total, y)
                    # print(x + y, y)
print(*res)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = tuple(map(int, input().split()))
max_con = 0
res = None
for i in range(31):
    for j in range(31):
        for k in range(31):
            for l in range(31):
                x = 100 * A * i + 100 * B * j
                y = C * k + D * l
                if x + y != 0 and x + y <= F and y <= (x // 100) * E \
                        and max_con < y / (x + y):
                    max_con = y / (x + y)
                    res = (x + y, y)
                    # print(x + y, y)
print(*res)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = tuple(map(int, input().split()))
max_con = 0
res = None
for l in range(100*A, F+1, 100):
    if l % (100 * A) == 0 or l % (100 * B) == 0:
        for e in range(1, E*(l//100)+1):
            if (e % C == 0 or e % D == 0) and  l + e <= F:
                if max_con < e / (l + e):
                    max_con = e / (l + e)
                    res = (l+e, e)
print(*res)
Problem p03633 (python)

Fixed submission:
# 最大公約数
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)


N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
    print(T[0])
    exit()

base = lcm(T[0], T[1])
for i in range(2, N):
    base = lcm(base, T[i])
print(base)

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

N = int(input())
T = [int(input()) for _ in range(N)]
base = lcm(T[0], T[1])
for i in range(2, N):
    base = lcm(base, T[i])
print(base)
Problem p03640 (python)

Fixed submission:
H,W=map(int,input().split())
N=int(input())
a=list(map(int,input().split()))
a_all=[]
c=[[""]*W for i in range(H)]

for i in range(N):
    b=[i+1]*a[i]
    a_all.extend(b)

i=0
for j in range(H):
    if j%2==0:
        for k in range(W):
            c[j][k]=str(a_all[i])
            i+=1
    else:
        for k in range(W-1,-1,-1):
            c[j][k]=str(a_all[i])
            i+=1

for i in range(H):
    print(" ".join(c[i]))

Buggy submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
N = int(input())
A = list(map(int, input().split()))
res = [["" for _ in range(W)] for h in range(H)]
start_y, start_x = 0, -1
pos_y, pos_x = start_y, start_x
dy, dx = 0, 1
for idx, a in enumerate(A, 1):
    for i in range(a):
        pos_x += dx
        pos_y += dy
        res[pos_y][pos_x] = str(idx)
        if pos_x == W - 1:
            if dy == 0:
                dx = 0
                dy = 1
            else:
                dx = -1
                dy = 0
        elif not pos_y == 0 and pos_x == 0:
            if dy == 0:
                dx = 0
                dy = 1
            else:
                dx = 1
                dy = 0
res = ["".join(x) for x in res]
res = "\n".join(res)
print(res)
Problem p03660 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
N = int(input())
edges = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)

dist = [0] * N
def dfs(u, d, p=-1):
    global dist
    dist[u] = d
    for v in edges[u]:
        if v == p:
            continue
        dfs(v, d + 1, u)
    return dist

dist1 = dfs(0, 0, -1)
dist = [0] * N
dist2 = dfs(N - 1, 0, -1)

cnt = 0
for d1, d2 in zip(dist1, dist2):
    if d1 <= d2:
        cnt += 1
if N - cnt < cnt:
    print("Fennec")
else:
    print("Snuke")

Buggy submission (verdict: Runtime Error):
N = int(input())
edges = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)

dist = [0] * N
def dfs(u, d, p=-1):
    global dist
    dist[u] = d
    for v in edges[u]:
        if v == p:
            continue
        dfs(v, d + 1, u)
    return dist

dist1 = dfs(0, 0, -1)
dist = [0] * N
dist2 = dfs(N - 1, 0, -1)

cnt = 0
for d1, d2 in zip(dist1, dist2):
    if d1 <= d2:
        cnt += 1
if N - cnt < cnt:
    print("Fennec")
else:
    print("Snuke")
Problem p03994 (python)

Fixed submission:
s = input()
K = int(input())
base_count = ord("z") + 1
ans = ""
for c in s:
    t = (base_count - ord(c)) % 26
    if t <= K:
        ans += "a"
        K -= t
    else:
        ans += c
if K > 0:
    K = K % 26
    ans = ans[:-1] + chr((ord(ans[-1]) + K))
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
K = int(input())
base_count = ord("z") + 1
ans = ""
for c in s:
    if (base_count - ord(c)) <= K:
        ans += "a"
        K -= (base_count - ord(c))
    else:
        ans += c
if K > 0:
    ans = ans[:-1] + chr(ord(ans[-1]) + K)
print(ans)
Problem p02718 (python)

Fixed submission:
n ,m = map(int, raw_input().split())
A = sorted(list(map(int, raw_input().split())), reverse = True)
divider = sum(A) / (4.0 * m) 

stack = 0

for a in A:
    if a >= divider:
        stack += 1

if stack >= m:
    print 'Yes'
else:
    print 'No'

Buggy submission (verdict: Runtime Error):
    def ans():
        n ,m = map(int, raw_input().split())
        A = list(map(int, raw_input().split()))
     
        divider = sum(A) / (4 * m + 1e-16)
     
        stack = 0
        for a in A:            
            if a >= divider:
                stack += 1
     
            if stack == m:
                return "Yes"
        return "No"        
     
     
    print ans()
Problem p02675 (python)

Fixed submission:
N=input()
n=int(N)%10

if n==2:
  print('hon')
elif n==4:
  print('hon')
elif n==5:
  print('hon')
elif n==7:
  print('hon')
elif n==9:
  print('hon')
elif n==0:
  print('pon')
elif n==1:
  print('pon')
elif n==6:
  print('pon')
elif n==8:
  print('pon')
elif n==3:
  print('bon')

Buggy submission (verdict: Runtime Error):
n=input()
N=n//10

if n=2　or 4 or 5 or 7 or 9:
  print(hon)
elif n=0 or 1 or 6 or 8:
  print(pon)
else:
  print(bon)
Problem p02677 (python)

Fixed submission:
import math
HL,ML,h,m=(int(x) for x in input().split())
HW=float((60*h+m)/2)
MW=float(6*m)

if HW > MW:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(math.radians(w))))
else:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(math.radians(-w))))

Buggy submission (verdict: Runtime Error):
import math
HL,ML,h,m=(int(x) for x in input().split())
HW=int((60*h+m)/2)
MW=int(6*m)

if HW >= MW:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(math.radians(w))))
else:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(mthradians(-w))))

Buggy submission (verdict: Runtime Error):
import math
HL,ML,h,m=(int(x) for x in input().split())
HW=int((60*h+m)/2)
MW=int(6*m)

print(HW,MW)

if HW >= MW:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(math.radians(w))))
else:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(mthradians(-w))))
Problem p02675 (python)

Fixed submission:
n=int(input())
last=n % 10
hon=[2,4,5,7,9]
pon=[0,1,6,8]
bon=[3]
if last in hon:
  print("hon")
if last in pon:
  print("pon")
if last in bon:
  print("bon")

Buggy submission (verdict: Runtime Error):
n=int(raw_input())
last=n % 10
hon=[2,4,5,7,9]
pon=[0,1,6,8]
bon=[3]
if last in hon:
  print("hon")
if last in pon:
  print("pon")
if last in bon:
  print("bon")
Problem p02675 (python)

Fixed submission:
N=input()
m=int(N[-1])
if m== 2 or m==4 or m==5 or m==7 or m==9:
  print("hon")
elif m==0 or m==1 or m==6 or m==8:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
N=int(input())
m=N[-1]
if m== 2 or m==4 or m==5 or m==7 or m==9:
  print("hon")
elif m==0 or m==1 or m==6 or m==8:
  print("pon")
else
  print("bon"
Problem p03086 (python)

Fixed submission:
s = input()
ans = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        if all('ACGT'.count(c) == 1 for c in s[i:j+1]):
            ans = max(ans, j-i+1)

print(ans)

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

cnt = 0
q = []
now = 0

for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'T' or s[i] == 'C' or s[i] == 'G':
        cnt += 1
    else:
        q.append(cnt)
        cnt = 0

print(max(q))
Problem p02994 (python)

Fixed submission:
n,l = map(int,input().split())
a_list = []
for i in range(1,n+1):
    #print(i)
    a_list.append(l+i-1)

if int(a_list[n-1])<0:
    a_list.remove(a_list[n-1])

if int(a_list[0])>0:
    a_list.remove(a_list[0])

if 0 in a_list:
    a_list.remove(0)
'''
エラーコード    if int(a_list[n])<0:
               IndexError: list index out of range
if int(a_list[n-2])<0:
    a_list.remove(a_list[n-1])
'''
print(sum(a_list))

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
a_list = []
for i in range(1,n+1):
    #print(i)
    a_list.append(l+i-1)
if int(a_list[0])>0:
    a_list.remove(a_list[0])
if 0 in a_list:
    a_list.remove(0)
if int(a_list[n-1])<0:
    a_list.remove(a_list[n-1])
print(sum(a_list))
Problem p03105 (python)

Fixed submission:
import math
a, b, c = map(int, input().split())

if a > b:
    print("0")
else :
    if b >= a * c:
        print(c)
    else :
        print(math.floor(b/a))

Buggy submission (verdict: Runtime Error):
import math
A = int(input())
B = int(input())
C = int(input())
if A > B:
    print(0)
else :
    if B >= A * C:
        print(C)
    else :
        print(math.floor(B/A))

Buggy submission (verdict: Runtime Error):
import math
A = int(input())
B = int(input())
C = int(input())

if B >= A * C:
    print(C)
else :
    print(math.floor(B/A))
if A > B:
    print(0)
Problem p02760 (python)

Fixed submission:
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
a4 = set()
a5 = set()
a6 = set()
a7 = set()
a8 = set()
a4.update({a1[0],a2[1],a3[2]})
a5.update({a1[2],a2[1],a3[0]})
a6.update({a1[0],a2[0],a3[0]})
a7.update({a1[1],a2[1],a3[1]})
a8.update({a1[2],a2[2],a3[2]})
n = int(input())
B =set()
for i in range(n):
    b = int(input())
    B.add(b)
if set(a1) <= B or set(a2) <= B or set(a3) <= B or a4 <= B or a5 <= B or a6 <= B or a7 <= B or a8 <= B:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = [map(int,input().split()) for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[0][1],a[1][1],a[2][1]]
a8 = [a[0][2],a[1][2],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= set(B) or set(a2) <= set(B) or set(a3) <= set(B) or set(a4) <= set(B) or set(a5) <= set(B) or set(a6) <= set(B) or set(a7) <= set(B) or set(a8) <= set(B):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = [input().split() for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[1][0],a[1][1],a[2][1]]
a8 = [a[2][0],a[2][1],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= B or set(a2) <= B or set(a3) <= B or set(a4) <= B or set(a5) <= B or set(a6) <= B or set(a7) <= B or set(a8) <= B:
    print('Yes')
else:
    print('No')
Problem p02761 (python)

Fixed submission:
n,m = map(int,input().split())
digit = ['-2']*n
for i in range(m):
    s,c = input().split()
    s = int(s)
    if digit[s-1] == '-2' or digit[s-1] == c:
        digit[s-1] = c
    else:
        digit[s-1] = '-1'
if ('-1' in digit) or (len(digit)!=1 and digit[0] == '0' and digit[1] == '-2'):
    print(-1)
else:
    if digit[0] != '-2' or (len(digit)==1 and digit[0] == '-2'):
        print("".join(digit).replace('-2','0'))
    else:
        digit[0] = '1'
        print("".join(digit).replace('-2','0'))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
digit = ['-2']*n
for i in range(m):
    s,c = input().split()
    s = int(s)
    if digit[s-1] == '-2' or digit[s-1] == c:
        digit[s-1] = c
    else:
        digit[s-1] = '-1'
if ('-1' in digit) or (len(digit)!=1 and digit[0] == '0'):
    print(-1)
else:
    print("".join(digit.replace('-2','0')))
Problem p02772 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
even = [i for i in a if i%2 ==0]
count = 0 
for i in even:
    if i%3 == 0 or i%5 ==0:
        count += 1
print('APPROVED' if count == len(even) else 'DENIED')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().strip().split())
for number in a:
    if number%2==0:
        if number%3==0 or number%5==0:
            flag = 1
            continue
        else:
            flag = 0
            print('DENIED')
            break
if flag == 1:
    print('APPROVED')
Problem p03035 (python)

Fixed submission:
def wheel(a,b):
    if a>=13:
        return b
    if a>=6 and a<=12:
        return int(b/2)
    if a<=5:
        return 0   
a,b = map(int, input().split())
print(wheel(a,b))

Buggy submission (verdict: Runtime Error):
def wheel(a,b):
    if a>=13:
        return b
    if a>=6 and a<=12:
        return b/2
    if a<6:
    return 0   
a,b = map(int, input().split())
print(wheel(a,b))

Buggy submission (verdict: Runtime Error):
def wheel(a,b):
    if a>=13:
        return b
    if a>=6 and a<=12:
        return b/2
    if a<6
    return 0   
a,b = map(int, input().split())
print(wheel(a,b))
Problem p03037 (python)

Fixed submission:
c = []
d = []
n,m = map(int, input().split())
for i in range(m):
    a,b = map(int,input().split())
    c.append(a)
    d.append(b)
minl = max(c)   
maxr = min(d)
if minl>maxr:
    print(0)
else:
    print(maxr-minl+1)

Buggy submission (verdict: Runtime Error):
c = []
d = []
n,m = map(int, input().split())
for i in range(m):
    a,b = map(int,input().split())
    c.append(a)
    d.append(b)
minl = max(c)   
maxr = min(d)
if min1>maxr:
    print(0)
else:
    print(maxr-minl+1)

Buggy submission (verdict: Runtime Error):
a = []
b = []
n,m = map(int, input().split())
for i in range(m):
    a,b = map(int,input().split())
    a.append(a)
    b.append(b)
minl = max(a)   
maxr = min(b)
print(maxr-minl)
Problem p03059 (python)

Fixed submission:
def biscuit(a,b,t):
    i = 1
    while i*a<=t:
        i = i+1
    return b*(i-1)
    
a,b,t = map(int, input().split())
print(biscuit(a,b,t))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        temp = a % b
        a = b
        b = temp
    return a
def blackbord(n,a):
    return max(list(hcf(a[i],j) for i in range(len(a)) for j in a[0:i] + a[i + 1:]))
n = int(input())
a=list(map(int, input().split()))
print(blackbord(n,a))
Problem p03067 (python)

Fixed submission:
def Ways(a,b,c):
    if c>=min(a,b) and c<=max(a,b):
        return 'Yes'
    else:
        return 'No'

a,b,c = map(int, input().split())
print(Ways(a,b,c))

Buggy submission (verdict: Runtime Error):
def Ways(a,b,c):
    if c>=a and c<=b:
        return 'Yes'
    else:
        return 'No'

a,b,c = map(int, input().split())
print(Ways(a,b,c)))
Problem p03068 (python)

Fixed submission:
def eee(s,k):
    a = s[k-1]
    k = list(filter(lambda x:x!=a,s))
    z = ''.join(s)
    for i in k:
        z = z.replace(i,'*')
    return z

n = int(input())
s = list(input())
k = int(input())
print(eee(s,k))

Buggy submission (verdict: Runtime Error):
def eee(s,k):
    a = s[k]
    for i in range(len(s)):
        if s[i]!=a:
            s[i] = '*'            
    return ''.join(s)

n = int(input())
s = list(input())
k = int(input())
print(eee(s,k))
Problem p03071 (python)

Fixed submission:
def button(a,b):
    if a==b:
        return int(a)+int(b)
    else:
        return 2*int(max(a,b))-1
a,b = map(int, input().split())
print(button(a,b))

Buggy submission (verdict: Runtime Error):
def button(a,b):
    if a==b:
        return int(a)+int(b)
    else:
        return 2*int(max(a,b))-1
a = int(input())
b = int(input())
button(a,b)

Buggy submission (verdict: Runtime Error):
def button(a,b):
    if a>b:
        return 2*int(a)-1
    if a<b:
        return 2*int(b)-1
    if a==b:
        return int(a)+int(b)
a = input()
b = input()
button(a,b)