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


def solve(K: int, S: int):
    ans = 0
    for i in range(K+1):
        for j in range(K+1):
            for r in range(K+1):
                if(i+j+r == S):
                    ans += 1

    print(ans)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = int(next(tokens))  # type: int
    solve(K, S)

if __name__ == '__main__':
    main()


Fixed submission:
k,s = (int(_) for _ in input().split())

ans = 0
for x in range(k+1):
    for y in range(k+1):
        z = s-x-y
        if(0 <= z <= k):
            ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = (int(_) for _ in input().split())

ans = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if(x+y+z == s):
                ans += 1
                
print(ans)

Fixed submission:
k,s = (int(_) for _ in input().split())

ans = 0
for x in range(k+1):
    for y in range(k+1):
        z = s-x-y
        if(0 <= z <= k):
            ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
## ABC 048 b
a,b,x = (int(_) for _ in input().split())

c = 0
for i in range(a, b+1):
    if(i%x == 0):
        c += 1
        
print(c)

Fixed submission:
## ABC 048 b
a,b,x = (int(_) for _ in input().split())

if(a != 0):
    print(b//x - (a-1)//x)
else:
    print(b//x + 1 )
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32
from bisect import bisect_left, bisect_right

def solve(N: int, a: "List[int]"):
    x = [[i+1, a[i]] for i in range(N)]

    x = sorted(x, key=lambda x:x[1])
    x1 = [i for i,j in x]
    x2 = [j for i,j in x]

    ans = 0
    for i in range(N):
        p = bisect_left(x2, x1[i])
        if x1[i] == x2[p]:
            if x2[i] == x1[p]:
                ans += 1

    print(ans//2)

    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(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32
from bisect import bisect_left, bisect_right

def solve(N: int, a: "List[int]"):
    # x = [[i+1, a[i]] for i in range(N)]

    # x = sorted(x, key=lambda x:x[1])
    # x1 = [i for i,j in x]
    # x2 = [j for i,j in x]

    # ans = 0
    # for i in range(N):
    #     p = bisect_left(x2, x1[i])
    #     if not (0 <= p < N):
    #         continue
    #     if x1[i] == x2[p] and x2[i] == x1[p]:
    #         ans += 1

    # print(ans//2)

    ans = 0
    for i in range(N):
        if a[a[i]-1] == i+1:
            ans += 1

    print(ans//2)


    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(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

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


def solve(s: str):
    N = len(s)
    from collections import Counter
    for i in range(N-1):
        for j in range(i+1, N):
            c = Counter(list(s[i:j+1]))
            if(c.most_common()[0][1] > (j-i+1)//2):
                print(i+1, j+1)
                exit()

    print(-1,-1)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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
    solve(s)

if __name__ == '__main__':
    main()


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


def solve(s: str):
    N = len(s)
    
    for i in range(N-1):
        if(s[i] == s[i+1]):
            print(i+1, i+2)
            exit()
        else:
            if(i < N-2 and s[i] == s[i+2]):
                print(i+1, i+3)
                exit()
    
    print(-1,-1)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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
    solve(s)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
l,r,d = map(int,input.split())
print((l-r+1) // d)


Fixed submission:
l,r,d = map(int,input().split())
print(r//d - (l-1)//d)

Buggy python submission (verdict: Runtime Error):
l,r,d=map(int,input.split())
print((l-r+1)//d)


Fixed submission:
l,r,d = map(int,input().split())
print(r//d - (l-1)//d)

Buggy python submission (verdict: Runtime Error):
l,r,d = map(int,input().split())
print((r//d - l//d)


Fixed submission:
l,r,d = map(int,input().split())
print(r//d - (l-1)//d)

Buggy python submission (verdict: Runtime Error):
l,r,d = map(str,input.split())
l = int(l)
r = int(r)
d = int(d)
print((r-l+1)//d)



Fixed submission:
l,r,d = map(int,input().split())
print(r//d - (l-1)//d)

Buggy python submission (verdict: Runtime Error):
l,r,d = map(int,input.split())
print((r-l+1)//d)


Fixed submission:
l,r,d = map(int,input().split())
print(r//d - (l-1)//d)

Buggy python submission (verdict: Runtime Error):
l,r,d = map(int,input.split())
print((l-r+1)//d)

Fixed submission:
l,r,d = map(int,input().split())
print(r//d - (l-1)//d)
Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a(1+a+a*a))

Fixed submission:
a = int(input())
print(a*(1+a+a*a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
q = int(input())
for i in range(q):
  a,b = map(int,input().split())
  for j in range(n):
    if A[j] == a:
      A[j] = b
  print(sum(A))
  

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
cnt = [0]*(10**5+1)
sumA = sum(A)
for a in A:
  cnt[a] += 1
        
for query in range(Q):
  b,c = map(int,input().split())
  sumA += cnt[b]*(c-b)
  cnt[c] += cnt[b]
  cnt[b] = 0
  print(sumA)
Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
if n != 0:
  p = sorted(map(int,input().split()))
aa = []
for i in range(1,101):
  if not i in p:
    aa.append(i)
bb = []
if len(aa) != 0:
  for A in aa:
    eee = abs(x-A)
    bb.append(eee)

ans = bb.index(min(bb))
if abs(x-(-1)) <= min(bb):
  print(-1)
elif abs(x-101) <= min(bb):
  print(101)
else:
  print(aa[ans])



Fixed submission:
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
if n != 0:
  p = sorted(map(int,input().split()))
aa = []
for i in range(1,101):
  if not i in p:
    aa.append(i)
bb = []
if len(aa) == 0:
  if abs(x-(0)) <= abs(x-101):
    print(0)
    exit()
  else:
    print(101)
    exit()
else:
  for A in aa:
    eee = abs(x-A)
    bb.append(eee)

ans = bb.index(min(bb))
if abs(x-(0)) <= min(bb):
  print(0)
  exit()
elif abs(x-101) < min(bb):
  print(101)
  exit()
else:
  print(aa[ans])
  exit()

Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
if n != 0:
  p = sorted(map(int,input().split()))
aa = []
for i in range(1,101):
  if not i in p:
    aa.append(i)
bb = []
for A in aa:
  eee = abs(x-A)
  bb.append(eee)

ans = bb.index(min(bb))
print(aa[ans])



Fixed submission:
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
if n != 0:
  p = sorted(map(int,input().split()))
aa = []
for i in range(1,101):
  if not i in p:
    aa.append(i)
bb = []
if len(aa) == 0:
  if abs(x-(0)) <= abs(x-101):
    print(0)
    exit()
  else:
    print(101)
    exit()
else:
  for A in aa:
    eee = abs(x-A)
    bb.append(eee)

ans = bb.index(min(bb))
if abs(x-(0)) <= min(bb):
  print(0)
  exit()
elif abs(x-101) < min(bb):
  print(101)
  exit()
else:
  print(aa[ans])
  exit()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(n):
  for j in range(n):
    if A[i] % A[j] == 0 and i != j:
      ans += 1
      break
print(n - ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
a.append(0)
b = {}
c = 0
for i in range(n):
    if a[i] not in b:
        for j in range(1, 10**6//a[i]+1):
            b[a[i]*j] = 1
        if a[i] != a[i+1]:
            c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
import collections
import math

n = int(input())
B = [1,2,6,10,15,21,28,36,45,55]
ans = 0

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
if is_prime(n) == True:
  print(1)
  exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c = collections.Counter(prime_factorize(840))  
C = c.values()
for i in range(len(C)):
  for j in range(len(B)):
    if C[i] < B[j]:
      ans += j+1
      break

print(ans)


Fixed submission:
import collections
import math

n = int(input())
B = [1,3,6,10,15,21,28,36,45,55,66,78,91,105]
ans = 0

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
if is_prime(n) == True:
  print(1)
  exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = collections.Counter(prime_factorize(n))  
for v in c.values():
  for j in range(len(B)):
    if v < B[j]:
      ans += j
      break
      
print(ans)

Buggy python submission (verdict: Runtime Error):
import sympy
n = int(input())
B = [1,2,6,10,15,21,28,36,45,55]
ans = 0
import math
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

if is_prime(n) == True:
  print(ans)
  exit()


A = sympy.factorint(n)
for v in A.values():
  for i in range(len(B)):
    if v <= B[i]:
      cnt = 1
    else:
      cnt = 0
    if cnt == 0:
      ans += i+1
print(ans)

Fixed submission:
import collections
import math

n = int(input())
B = [1,3,6,10,15,21,28,36,45,55,66,78,91,105]
ans = 0

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
if is_prime(n) == True:
  print(1)
  exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = collections.Counter(prime_factorize(n))  
for v in c.values():
  for j in range(len(B)):
    if v < B[j]:
      ans += j
      break
      
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
AB = [int(input().split()) for _ in range(n)]
 
A = AB[::2]
B = AB[1::2]
 
A.sort()
B.sort()
 
if N % 2 == 0:
    n = N // 2
    med1 = A[n - 1] + A[n]
    med2 = B[n - 1] + B[n]
    x = med2 - med1 + 1
else:
    n = N // 2
    med1 = A[n]
    med2 = B[n]
    x = med2 - med1 + 1
 
print(x)

Fixed submission:
N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
 
A = []
B = []
for i in range(N):
  A.append(AB[i][0])
  B.append(AB[i][1])
A.sort()
B.sort()
if N % 2 == 0:
    n = N // 2
    med1 = A[n-1] + A[n]
    med2 = B[n-1] + B[n]
    x = med2 - med1 + 1
else:
    n = N // 2
    med1 = A[n]
    med2 = B[n]
    x = med2 - med1 + 1
    
print(x)
Buggy python submission (verdict: Runtime Error):
from collections import deque
n, m = map(int, input().split())

dist = [-1] * (n + 1)
roots = [[] for i in range(n + 1)]

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

ans = [-1] * (n + 1)
ans[1] = 0
dist[1] = 0
q = deque()
q.append(1)

while q:
    now = q.popleft()

    for next_v in roots[now]:
        if not dist[next_v] == -1:
            continue
        dist[next_v] = dist[now] + 
        ans[next_v] = now
        q.append(next_v)
if -1 in ans[1:]:
    print('No')
else:
    print('Yes')
    for i in range(2, len(ans)):
        print(ans[i])

Fixed submission:
from collections import deque

N, M = map(int, input().split())
G = [[] for _ in range(N)]

for _ in range(M):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  G[a].append(b)
  G[b].append(a)

q = deque([0])
dist = [-1]*N
dist[0] = 0

while q:
  v = q.popleft()
  for nv in G[v]:
    if dist[nv] == -1:
      dist[nv] = v+1
      q.append(nv)

print("Yes")
print(*dist[1:], sep="\n")

Buggy python submission (verdict: Runtime Error):
inf = 10**5+1
n,m = map(int,input().split())
p = [inf]*n
for _ in range(n):
  a,b = map(int,input().split())
  A = max(a,b)
  B = min(a,b)
  if p[A-1] > B:
    p[A-1] = B
  if p[B-1] > A:
    p[B-1] = A
p[0] = 'Yes'
if max(p[1:]) == 10**5+1:
  print('No')
else:
  for i in range(len(p)):
    print(p[i])



Fixed submission:
from collections import deque

N, M = map(int, input().split())
G = [[] for _ in range(N)]

for _ in range(M):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  G[a].append(b)
  G[b].append(a)

q = deque([0])
dist = [-1]*N
dist[0] = 0

while q:
  v = q.popleft()
  for nv in G[v]:
    if dist[nv] == -1:
      dist[nv] = v+1
      q.append(nv)

print("Yes")
print(*dist[1:], sep="\n")
Buggy python submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
A = list(map(int,input().split()))
A.sort(key=lambda x: x[0])
money = 0
ans = 0
for i in range(n):  
  c = A[i][0]
  a = A[i][1:]
  aa = min(a)
  money += c
  ans += aa
  if ans >= x:
    print(money())
    exit()
print(-1)


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

A = [[] for _ in range(n)]
c = [0] * n

for i in range(n):
    c_as = list(map(int, input().split()))
    c[i], A[i] = c_as[0], c_as[1:]

INF = 10**9
ans = INF
    
for s in range(0, 1 << n):
    smart = [0] * m
    cost_sum = 0
    for i in range(n):
        if (s >> i) % 2 == 0:continue
        cost_sum += c[i]
        for j in range(m):
            smart[j] += A[i][j]
    ok = True
    for j in range(m):
        if smart[j] < X:
            ok = False
    if ok:
        ans = min(ans, cost_sum)

if ans == INF:
    ans = -1

print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
A = [i**5 for _ in range(1500)]
for i in range(1500):
  for j in range(1500):
    if A[i]  == x + A[j]:
      print(A[i],A[j])
      break


Fixed submission:
X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
for i in range(2000):
  for j in range(-1000,1999):
    if i**5 - j**5 == x:
      print(i,j)
      break


Fixed submission:
X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
for i in range(2000):
  for j in range(-2000,2000):
    if i**5 - j**5 == x:
      print(i,j)
      break


Fixed submission:
X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
for i in range(4000):
  for j in range(-2000,4000):
    if i**5 - j**5 == x:
      print(i,j)
      break


Fixed submission:
X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
N = [i for i in range(n)]
A = list(map(int,input().split()))
L = [N[i]+A[i] for i in range(n)]
R = [N[j]-A[j] for j in range(n)]
ans = 0
for i in range(n):
  for j in range(i+1,n):
    if L[i] == R[j]:
      ans += 1
print(ans)



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

X = dict()
ans = 0
for i in range(N):
    L = i + A[i]
    if L not in X:
        X[L] = 1
    else:
        X[L] += 1

for i in range(N):
    R = i - A[i]
    if R in X:
        ans += X[R]
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n = int(input())
  N = [i for i in range(n)]
  A = list(map(int,input().split()))
  ans = 0
  for i in range(n):
    for j in range(i+1,n):
      if N[j]-N[i] == A[i] + A[j]:
        ans += 1
  print(ans)

if __name__ == '__main__':
    main()

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

X = dict()
ans = 0
for i in range(N):
    L = i + A[i]
    if L not in X:
        X[L] = 1
    else:
        X[L] += 1

for i in range(N):
    R = i - A[i]
    if R in X:
        ans += X[R]
        
print(ans)

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


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

X = dict()
ans = 0
for i in range(N):
    L = i + A[i]
    if L not in X:
        X[L] = 1
    else:
        X[L] += 1

for i in range(N):
    R = i - A[i]
    if R in X:
        ans += X[R]
        
print(ans)

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



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

X = dict()
ans = 0
for i in range(N):
    L = i + A[i]
    if L not in X:
        X[L] = 1
    else:
        X[L] += 1

for i in range(N):
    R = i - A[i]
    if R in X:
        ans += X[R]
        
print(ans)

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

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

X = dict()
ans = 0
for i in range(N):
    L = i + A[i]
    if L not in X:
        X[L] = 1
    else:
        X[L] += 1

for i in range(N):
    R = i - A[i]
    if R in X:
        ans += X[R]
        
print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
ans = 0
a = 100
While a < x:
  a = a**1.01
  ans += 1  
print(ans)


Fixed submission:
X = int(input())
y = 100
ans = 0
while True:
  ans += 1
  y += y//100
  if X <= y:
    break
print(ans)

Buggy python submission (verdict: Runtime Error):
x = int(input())
ans = 0
for _ in range():
  a = 100**1.01
  ans += 1
  if a >= x:
    exit()
print(ans)

Fixed submission:
X = int(input())
y = 100
ans = 0
while True:
  ans += 1
  y += y//100
  if X <= y:
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
ptint(2*n*math.pi)

Fixed submission:
import math
n = int(input())
print(2*n*math.pi)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))

ans=[0]*n

for i in l:
    ans[i-1]+=1

for j in ans:
    print(j)

Fixed submission:
N,K = map(int, input().split())
min_num = 0
max_num = 0
for i in range(K):
    min_num += i
    max_num += N - i
ans = max_num - min_num + 1
for i in range(K, N+1):
    min_num += i
    max_num += N - i
    ans += max_num - min_num + 1
print(ans%(10**9 + 7))
Buggy python submission (verdict: Runtime Error):
s = str(input())
if s[0]==7 or s[1]==7 or s[2]==7:
  print('Yes')
else:
  print('No'9

Fixed submission:
s = str(input())
if s[0]=='7' or s[1]=='7' or s[2]=='7':
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

print("c"),
print("a"),
print("b"),

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

print(c,a,b)

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

print('b,a,c')

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

print(c,a,b)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n <= 0:
  break
m = abs(n)
l = abs(m-k)
print(min(m,l))

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

print(min(N%K,abs(N%K-K)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n == 0:
  n = 0
else:
  break
m = abs(n-k)
print(min(n,m))

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

print(min(N%K,abs(N%K-K)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n == 0:
  n = 0
else:
  m = abs(n-k)
print(min(n,m))

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

print(min(N%K,abs(N%K-K)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n == 0:
  n = 0
else:
  m = abs(n-k)
print(min(n,abs(n-k))

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

print(min(N%K,abs(N%K-K)))
Buggy python submission (verdict: Runtime Error):
s = str(input())
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N =[1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51]
K =int(input())
print(N[K+1])

Fixed submission:
N =[1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51]
K =int(input())
print(N[K-1])

Buggy python submission (verdict: Runtime Error):
N =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K =int(input())
print(N[K+1])

Fixed submission:
N =[1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51]
K =int(input())
print(N[K-1])