Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int):
    for i in range(N, 999):
        s = str(i)
        if s[0] == s[1] == s[2]:
            ret = s
            break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int):
    ret = ''
    for i in range(N, 1000):
        s = str(i)
        if s[0] == s[1] and s[1] == s[2]:
            ret = s
            break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(S: int, K: int):
    HOGE = 5000000000000000
    for c in S:
        if K == 0:
            ret = 1
            break
        if c == '1':
            K -= 1
        else:
            ret = c
            break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(S: int, K: int):
    for i in range(K):
        c = S[i]
        if c != '1':
            print(c)
            return
    print(1)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys

def calc(order, groups, D):
    ret = 0
    for i, G in enumerate(groups):
        target = order[i]
        for elm in G:
            #print(elm, target)
            ret += D[elm - 1][target]
    return ret

def dfs(idx, current, used, groups, D):
    if idx == 3:
        ret = calc(current, groups, D)
        return ret
    ret = float('inf')
    for i, u in enumerate(used):
        if not u:
            used[i] = True
            tmp = dfs(idx + 1, current + [i], used, groups, D)
            ret = min(ret, tmp)
            used[i] = False
    return ret

def solve(N: int, C: int, D: "List[List[int]]", c: "List[List[int]]"):
    groups = [[] for _ in range(3)]
    for i in range(N):
        for j in range(N):
            cc = c[i][j]
            groups[(i + j) % 3].append(cc)
    #print(groups)
    ret = dfs(0, [], [False] * C, groups, D)
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = [ [ int(next(tokens)) for _ in range(C) ] for _ in range(C) ]  # type: "List[List[int]]"
    c = [ [ int(next(tokens)) for _ in range(N) ] for _ in range(N) ]  # type: "List[List[int]]"
    solve(N, C, D, c)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys

def calc_(order, d):
    ret = 0
    for i in range(3):
        target = order[i]
        ret += d[i][target]
    return ret

def calc(G, target, D):
    ret = 0
    for elm in G:
        ret += D[elm - 1][target]
    return ret

def dfs(idx, current, used, d):
    if idx == 3:
        ret = calc_(current, d)
        return ret
    ret = float('inf')
    for i, u in enumerate(used):
        if not u:
            used[i] = True
            tmp = dfs(idx + 1, current + [i], used, d)
            ret = min(ret, tmp)
            used[i] = False
    return ret

def solve(N: int, C: int, D: "List[List[int]]", c: "List[List[int]]"):
    groups = [[] for _ in range(3)]
    for i in range(N):
        for j in range(N):
            cc = c[i][j]
            groups[(i + j) % 3].append(cc)
    #print(groups)
    d = [[] for _ in range(3)]
    for i, G in enumerate(groups):
        for j in range(C):
            d[i].append(calc(G, j, D))
    ret = dfs(0, [], [False] * C, d)
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = [ [ int(next(tokens)) for _ in range(C) ] for _ in range(C) ]  # type: "List[List[int]]"
    c = [ [ int(next(tokens)) for _ in range(N) ] for _ in range(N) ]  # type: "List[List[int]]"
    solve(N, C, D, c)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve_(S: str, K: int):
    mn = 'z'
    tmp = set()
    for i, c in enumerate(S):
        if c < mn:
            tmp = set()
            for j in range(5):
                tmp.add(S[i:i + j + 1])
            mn = c
        elif c == mn:
            for j in range(5):
                tmp.add(S[i:i + j + 1])
    #print(tmp)
    if len(tmp) < K:
        s = ''
        for c in S:
            if c != mn:
                s += c
        return solve_(s, K - len(tmp))
    else:
        tmp = list(tmp)
        tmp.sort()
        return tmp[K - 1]

def solve(S, K):
    ret = solve_(S, K)
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    K = int(next(tokens))  # type: int
    solve(s, K)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve_(S: str, K: int, used):
    #print(S, K, used)
    mn = 'z'
    tmp = set()
    for i, c in enumerate(S):
        if c < mn and not c in used:
            tmp = set()
            for j in range(5):
                tmp.add(S[i:i + j + 1])
            mn = c
        elif c == mn:
            for j in range(5):
                tmp.add(S[i:i + j + 1])
    if len(tmp) < K:
        used.append(mn)
        return solve_(S, K - len(tmp), used)
    else:
        tmp = list(tmp)
        tmp.sort()
        return tmp[K - 1]

def solve(S, K):
    ret = solve_(S, K, [])
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    K = int(next(tokens))  # type: int
    solve(s, K)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(H: int, W: int, s: "List[str]"):
    def is_valid(i, j):
        if (i > 0 and s[i - 1][j] == '#' or 
            i < H - 1 and s[i + 1][j] == '#' or 
            j > 0 and s[i][j - 1] == '#' or 
            j < W - 1 and s[i][j + 1] == '#'):
            return True
        return False

    for i, R in enumerate(s):
        for j, c in enumerate(R):
            if c == '#' and not is_valid(i, j):
                print(NO)
                return
    print(YES)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(W) ]  # type: "List[str]"
    solve(H, W, s)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(H: int, W: int, s: "List[str]"):
    def is_valid(i, j):
        if (i > 0 and s[i - 1][j] == '#' or 
            i < H - 1 and s[i + 1][j] == '#' or 
            j > 0 and s[i][j - 1] == '#' or 
            j < W - 1 and s[i][j + 1] == '#'):
            return True
        return False

    for i, R in enumerate(s):
        for j, c in enumerate(R):
            if c == '#' and not is_valid(i, j):
                print(NO)
                return
    print(YES)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(H) ]  # type: "List[str]"
    solve(H, W, s)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, a: "List[int]", b: "List[int]"):
    conn = [[] for _ in range(N)]
    for i in range(N - 1):
        conn[a[i] - 1].append(b[i] - 1)
        conn[b[i] - 1].append(a[i] - 1)

    def dfs(idx, cur, conn, dis):
        dis[idx] = cur
        for nex in conn[idx]:
            if dis[nex] is None:
                dfs(nex, cur + 1, conn, dis)
        return None

    f_dis = [None] * N
    f_dis[0] = 0
    dfs(0, 0, conn, f_dis)

    s_dis = [None] * N
    s_dis[N - 1] = 0
    dfs(N - 1, 0, conn, s_dis)

    cnt = 0
    for i in range(N):
        if f_dis[i] <= s_dis[i]:
            cnt += 1

    if cnt > (N - cnt):
        ret = 'Fennec'
    else:
        ret = 'Snuke'
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, a, b)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys

YES = "Possible"  # type: str
NO = "Impossible"  # type: str

def solve(A: int, B: int):
    if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
        ret = YES
    else:
        ret = NO
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, K: int, a: "List[int]"):
    a.sort(reverse=True)
    dp = [False] * K
    dp[0] = True
    ret = 0
    for i in range(N):
        for j in range(K - 1, -1, -1):
            if dp[j]:
                if j + a[i] >= K:
                    ret = i + 1
                else:
                    dp[j + a[i]] = True
    print(N - ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, K, a)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, K: int, a: "List[int]"):
    a.sort(reverse=True)
    dp = [False] * K
    dp[0] = True
    ret = 0
    for i in range(N):
        for j in range(K - 1, -1, -1):
            if dp[j]:
                if j + a[i] >= K:
                    ret = i + 1
                else:
                    dp[j + a[i]] = True
    print(N - ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, K, a)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math
print(r * 2 * math.pi)

Fixed submission:
import math
print(int(input()) * 2 * math.pi)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
homeworks = [int(i) for i in input().split()]
print(-1 if sum(homeworks) > N else sum(homeworks) - N))

Fixed submission:
N,M = map(int,input().split())
homeworks = [int(i) for i in input().split()]
print(-1 if sum(homeworks) > N else N - sum(homeworks))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().splti())
homeworks = [int(i) for i in input().splti()]
print(-1 if sum(homeworks) > N else sum(homeworks) - N))

Fixed submission:
N,M = map(int,input().split())
homeworks = [int(i) for i in input().split()]
print(-1 if sum(homeworks) > N else N - sum(homeworks))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split)
magic = 0
ans = -1

while a > magic * 0.08 and b > magic * 0.1:
    if magic * 0.08 == a and  magic * 0.1 == b:
        ans = magic * 0.08
        break
    magic +=  1
print(ans)

Fixed submission:
a,b = map(int,input().split())
magic = 1
ans = -1

while a >= (magic * 0.08) // 1 and b >= ( magic * 0.1) // 1:
    if a == (magic * 0.08) // 1 and b == ( magic * 0.1) // 1:
        ans = magic
        break
    magic += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
s,t = input().split()
ans = map(int,input().split())
m = input()
if m == s:
  ans[0] -= 1
elif m == t:
  ans[1] -= 1
print(ans[0],ans[1])

Fixed submission:
s,t = input().split()
ans = [int(i) for i in input().split()]
m = input()
if m == s:
  ans[0] -= 1
elif m == t:
  ans[1] -= 1
print(ans[0],ans[1])
Buggy python submission (verdict: Runtime Error):
print('',join(input().split()))

Fixed submission:
s = input().split()
print(s[1]+s[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
data = [int(i) for i input().split()]
ans = 0
for i in range(n):
  for j in range(i+1,n):
    ans += data[i]*data[j]
print(ans)

Fixed submission:
n = int(input())
data = [int(i) for i in input().split()]
ans = 0
for i in range(n-1):
  for j in range(i+1,n):
    ans += data[i]*data[j]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n,k,q = map(int,input().split())
data = np.array([k for i in range(n)])

  
for i in range(q):
  answer = int(input()) - 1
  data -= 1
  data[answer] += 1
  
for i in data:
  print('Yes' if i > 0 else 'No')
  

Fixed submission:
n,k,q = map(int,input().split())
parti = range(n)
res = [0 for i in parti]
data = [0 for i in parti]

for i in range(q):
  answer = int(input()) - 1
  data[answer] += 1

for key,val in enumerate(data):
  if val + k - q > 0:
    index = int(key)
    res[index] = 1
for i in res:
  print('Yes' if i else 'No')
Buggy python submission (verdict: Runtime Error):
a = input()
s = input() if a < 3200 else 'red'
print(s)

Fixed submission:
a = int(input())
s = input() if a >= 3200 else 'red'
print(s)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(max(a+b,a*b,a-b)

Fixed submission:
a,b = map(int, input().split())
print(max(a+b,a*b,a-b))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(max(a+b,a*b,a-

Fixed submission:
a,b = map(int, input().split())
print(max(a+b,a*b,a-b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_max = 0
data = [int(input()) for i in range(n)]
a_max = max(data)
flag = True if a_max == a_max(data.remove(a_max)) else False
for i in range(n):
  if data[i] == a_max and not flag:
    tmp = data.pop(data[i])
    print(max(data))
    data.append(tmp,0)
    
  else:
  	print(a_max)

Fixed submission:
n = int(input())
a_max = 0
data = [int(input()) for i in range(n)]
a_max = max(data)
flag = True if 2 <= data.count(a_max) else False
for i in range(n):
  if data[i] == a_max and not flag:
    tmp = data.pop(i)
    print(max(data))
    data.insert(tmp,0)
    
  else:
  	print(a_max)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a_max = 0
data = [int(input()) for i in range(n)]
a_max = max(data)
flag = True if a_max == a_max(data.remove(a_max)) else False
for i in range(n):
  if data[i] == a_max and not flag:
    tmp = data.pop(data[i])
    print(max(data))
    data.append(tmp)
    
  else:
  
  	print(a_max)

Fixed submission:
n = int(input())
a_max = 0
data = [int(input()) for i in range(n)]
a_max = max(data)
flag = True if 2 <= data.count(a_max) else False
for i in range(n):
  if data[i] == a_max and not flag:
    tmp = data.pop(i)
    print(max(data))
    data.insert(tmp,0)
    
  else:
  	print(a_max)
Buggy python submission (verdict: Runtime Error):
n,k = map(int. input().split())
s = input()

change = s[k-1].lower()
print(s[:k] + change + s[k+1:])


Fixed submission:
n,k = map(int, input().split())
s = input()

change = s[k-1].lower()
print(s[:k-1] + change + s[k:])
Buggy python submission (verdict: Runtime Error):
data = [int(input()) for i in range(6)]
print('Yay!' if data[-2] - data[0] =< data[-1] else ':(')

Fixed submission:
data = [int(input()) for i in range(6)]
print('Yay!' if data[-2] - data[0] <= data[-1] else ':(')

Buggy python submission (verdict: Runtime Error):

data = [int(input()) for i in range(6)]
print('Yay!' if data[-2] - data[0] =< data[-1] else ':(')


Fixed submission:
data = [int(input()) for i in range(6)]
print('Yay!' if data[-2] - data[0] <= data[-1] else ':(')
Buggy python submission (verdict: Runtime Error):
N = int(input())
red_num = 0
for i in input():
  if i == 'R':
    red_num += 1
print('Yes' if res > N else 'No')

Fixed submission:
N = int(input())
red_num = 0
blue_num = 0
for i in input():
  if i == 'R':
    red_num += 1
  else:
    blue_num += 1
print('Yes' if red_num > blue_num else 'No')
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())

t=[1]
for i in range(2, int(b/2)):
    if a%i == 0 and b%i == 0:
        t.append(i)
print(t[k-1])

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

t=[]
for i in range(1, min(a,b)+1):
    if a%i == 0 and b%i == 0:
        t.append(i)
t = sorted(t,reverse=True)
print(t[k-1])

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())

t=[1]
for i in range(2,b):
    if a%i==0 and b%i == 0:
        t.append(i)
print(t[k-1])

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

t=[]
for i in range(1, min(a,b)+1):
    if a%i == 0 and b%i == 0:
        t.append(i)
t = sorted(t,reverse=True)
print(t[k-1])

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
if a < b:
    a,b = b,a
t=[1]
for i in range(2,b//2):
    if a%i==0 and b%i == 0:
        t.append(i)
print(t[k-1])

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

t=[]
for i in range(1, min(a,b)+1):
    if a%i == 0 and b%i == 0:
        t.append(i)
t = sorted(t,reverse=True)
print(t[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
res = 0
while True:
    a = s.find('01')
    b = s.find('10')
    if a != -1 or b != -1:

        if a != -1:
            if b != -1:
                if a < b:
                    s = s[:a] + s[a + 2:]
                    res += 2
                else:
                    s = s[:b] + s[b + 2:]
                    res += 2
            else:
                s = s[:a] + s[a + 2:]
                res += 2
        else:
            s = s[:b] + s[b + 2:]
            res += 2
    else: break

print(res)

Fixed submission:
s = input()
a = s.count('0')
b = s.count('1')
if a > b:
    print(b * 2)
elif a < b:
    print(a * 2)
elif a==b and a!=0 and b!= 0:
    print(a * 2)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
res = 0
while N > 0:
  x,u = map(int, input().split())
  res += x if u == 'JPY' else x*380000
  
  N -= 1
print(res)

Fixed submission:
n = int(input())
jpy = 0
btc = 0
for i in range(n):
    num,cur_t = input().split()
    if cur_t =='JPY':
        jpy += int(num)
    else:
        btc += float(num)
print(jpy+btc*38*10**4)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
data = [int(input()) for i in range(N)]
i = 0
a_i = None
res = 1
pre_i = 0
while data[i] != 2:
    a_i = data[i]
    if pre_i == a_i:
        res = -1
        break

    pre_i = i + 1
    i = data[i] -1
    res += 1
print(res)



Fixed submission:
N = int(input())
data = [int(input()) for i in range(N)]
i = 0
a_i = None
res = 1
pre_i = 0
time = -1
while data[i] != 2:
    a_i = data[i]
    if pre_i == a_i or time == N:
        res = -1
        break

    pre_i = i + 1
    i = data[i] -1
    time += 1
    res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
a = int(input())
print('ABC' if 1200 

Fixed submission:
a = int(input())
print('ABC' if 1200 > a else 'ARC')
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
print(a*b if a*b > d*c els

Fixed submission:
a,b,c,d = map(int, input().split())
if a*b < c*d:
    a,b = c,d
print(a*b)
Buggy python submission (verdict: Runtime Error):
    n, i = map(int, input().split())
    print(n - i + 1)

Fixed submission:
n, i = [int(_) for _ in input().split()]
print(n - i + 1)
Buggy python submission (verdict: Runtime Error):
len = input()
print(len**3)


Fixed submission:
len = int(input())
print(len**3)

Buggy python submission (verdict: Runtime Error):
len = input()
print(len**3)


Fixed submission:
len = int(input())
print(len**3)
Buggy python submission (verdict: Runtime Error):
a = input()
if a = "ABC":
    print("ARC")
else:
    print("ABC")

Fixed submission:
a = input()
if a == "ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
N ,Blue,Red = map(int,input().split())

ans = N //(A+B) *A
rem = N % (A+B)
ans += min(rem,A)
print(ans)

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

ans = N //(A+B) *A
rem = N % (A+B)
ans += min(rem,A)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = list(map(int,input().split()))
c.sort(reverse=True)
for i in range(0,b):
    c[i] = 0
print(sum(c))

Fixed submission:
a,b = map(int,input().split())
c = list(map(int,input().split()))
if len(c) <= b:
    b = len(c) 
c.sort(reverse=True)
for i in range(0,b):
    c[i] = 0
print(sum(c))
Buggy python submission (verdict: Runtime Error):
N,K, M = map(int,input().split())
A = list(map(int,input().split()))

ans = M*N-sum(A)

if ans > K:
    print(-1)
elif ans < 0:
    print(0)
else:
    print(ans)



Fixed submission:
a = input()
b = chr(ord(a)+1)
print(b)
Buggy python submission (verdict: Runtime Error):
K,M = map(int,input().split())
if 500*K >= X:
    print("Yes")
else:
    print("No")

Fixed submission:
K,M = map(int,input().split())
if 500*K >= M:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
N = int(input())
print(nextprime(N-1))



Fixed submission:
X = int(input())

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n + 1):
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

prime_list = primes(100100)

for i in prime_list:
    if X <= i:
        print(i)
        exit()