Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S[] = input()
if S[2] == S[3]:
    if S[4] == S[5]:
        print(Yes)
    else:
        print(No)
else:
    print(No)

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

a = X / 500
b = X % 500
c = b / 5
    
print(a * 1000 + c * 5)

Fixed submission:
X = int(input())

a = int(X / 500)
b = X % 500
c = int(b / 5)
print(a * 1000 + c * 5)

Buggy python submission (verdict: Runtime Error):
a = X / 500
b = X % 500
c = b / 5
    
print(a * 1000 + c * 5)

Fixed submission:
X = int(input())

a = int(X / 500)
b = X % 500
c = int(b / 5)
print(a * 1000 + c * 5)
Buggy python submission (verdict: Runtime Error):
K = int(input())
N = int(input())
A = {}
for i in range(N):
    A[i] = int(input())
max = 0
for i in range(N):
    len = 0
    if i == 0:
        len = int(A[i] + (K - A[N - 1]))
    else:
        len = int(A[i] - A[i - 1])

    if len > max:
        max = len

print(K - max)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))
max = 0
for i in range(N):
    len = 0
    if i == 0:
        len = int(A[i] + (K - A[N - 1]))
    else:
        len = int(A[i] - A[i - 1])

    if len > max:
        max = len

print(K - max)
Buggy python submission (verdict: Runtime Error):
S = input().split()

if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")

Fixed submission:
S = input()

if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys

def main():
    field_y_length,field_x_length =  map(int, input().split())
    maze = [input() for i in range(field_y_length)]

    INF = 10**8
    
    max_distance = 0

    def bfs(sx,sy,gx,gy):
        distance = [[INF for i in range(field_x_length)] for j in range(field_y_length)]
        queue = []

        queue.insert(0,(sx,sy))

        distance[sy][sx] = 0

        while len(queue):
            x,y = queue.pop()

            if x == gx and y == gy:
                break

            for i in range(0,4):
                nx,ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]

                if (0 <= nx and nx < field_x_length and 0 <= ny):
                    if (ny < field_y_length and maze[ny][nx] != '#'):
                        if (distance[ny][nx] == INF):
                            queue.insert(0, (nx, ny))
                            distance[ny][nx] = distance[y][x] + 1
        
        return distance[gy][gx]

    for sx in range(field_x_length):
        for sy in range(field_y_length):
            if maze[sy][sx] == '#':
                continue
            for gx in range(field_x_length):
                for gy in range(field_y_length):
                    if maze[gy][gx] == '#' or (gx == sx and gy == sy):
                        continue
                    max_distance = max(max_distance,bfs(sx,sy,gx,gy))
    print(max_distance)
    

if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
from itertools import product

def main():
    field_y_length,field_x_length =  map(int, input().split())
    maze = [input() for i in range(field_y_length)]

    INF = 10**8
    
    max_distance = 0

    def bfs(sy,sx):
        distance = [[INF for i in range(field_x_length)] for j in range(field_y_length)]
        queue = []

        queue.insert(0,(sy,sx))

        distance[sy][sx] = 0

        res = 0

        while len(queue):
            y,x = queue.pop()

            for i in range(0,4):
                ny,nx = y + [1, 0, -1, 0][i], x + [0, 1, 0, -1][i]

                if (0 <= nx and nx < field_x_length and 0 <= ny):
                    if (ny < field_y_length and maze[ny][nx] != '#'):
                        if (distance[ny][nx] == INF):
                            queue.insert(0, (ny, nx))
                            distance[ny][nx] = distance[y][x] + 1
                            res = max(res,distance[y][x] + 1)
        
        return res

    
    for y,x in product(range(field_y_length),range(field_x_length)):
        if maze[y][x] == '#':
            continue
        max_distance = max(max_distance,bfs(y,x))
    print(max_distance)
    

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
def main():
    A,B = map(int, input().split())
    print((A*B) // math.gcd(A,B))


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
import fractions
def main():
    A,B = map(int, input().split())
    print((A*B) // fractions.gcd(A,B))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    num_list = [int(i) for i in input().split()]
    order_list = []

    for order in range(1,N+1):
        num = num_list.index(order)+1
        order_list.append(num)
    
    print(" ".join(map(str,order_list)))

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N = int(input())
    num_list = [int(i) for i in input().split()]
    order_list = [0 for i in range(N)]

    for index,num in enumerate(num_list):
        order_list[num-1] = index+1
    
    print(" ".join(map(str,order_list)))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    result = 'Yes'
    S = str(input())
    for i in range(len(S)):
        if(i%2==0):#index=0は1文字目なので奇数ルール
            if(S[i]=='L'):
                result = 'No'
                break
        else:#偶数ルール
            if(S[i]=='R'):
                result = 'No'
                breakpoint
    print(result)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    result = 'Yes'
    S = str(input())
    for i in range(len(S)):
        if i % 2 == 0:
            if S[i] == 'L':
                result = 'No'
                break
        else:
            if S[i] == 'R':
                result = 'No'
                break
    print(result)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from builtins import enumerate, len

import numpy as np
import copy

N = int(input())
nums = []

for i in range(N):
    nums.append(int(input()))

a = np.array(nums)
maxIndex = [i for i, x in enumerate(a) if x == np.max(a)]

max1 = 0
max2 = 0

if(len(maxIndex)==1):
    nums2 = copy.copy(nums)
    nums2.pop(maxIndex[0])
    b = np.array(nums2)
    maxIndex2 = [i for i, x in enumerate(b) if x == np.max(b)]
    max1 = nums[maxIndex[0]]
    max2 = nums2[maxIndex2[0]]
else:
    max1 = nums[maxIndex[0]]
    max2 = nums[maxIndex[0]]

for num in nums:
    if(num!=max1):
        print(max1)
    else:
        print(max2)

Fixed submission:
N = int(input())
nums = []

for i in range(N):
    nums.append(int(input()))

nums_sorted = sorted(nums,reverse=True)
max1 = nums_sorted[0]
max2 = nums_sorted[1]

for num in nums:
    if(num!=max1):
        print(max1)
    else:
        print(max2)
Buggy python submission (verdict: Runtime Error):
def main():
    N,M = map(int, input().split())
    Xs = [int(s) for s in input().split()]

    # 目的地よりコマが多いなら操作は不要
    if N >= M:
        print(0)
        return

    Xs.sort()
    distance_list = []
    for i in range(M):
        if i == M-1:
            break
        distance = abs(Xs[i] - Xs[i+1])
        distance_list.append(distance)
    distance_list.sort(reverse=True)

    for i in range(N-1):
        distance_list.pop(i)

    print(sum(distance_list))


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N,M = map(int, input().split())
    Xs = [int(s) for s in input().split()]

    # 目的地よりコマが多いなら操作は不要
    if N >= M:
        print(0)
        return

    Xs.sort()
    distance_list = []
    for i in range(M):
        if i == M-1:
            break
        distance = abs(Xs[i] - Xs[i+1])
        distance_list.append(distance)
    distance_list.sort(reverse=True)

    for i in range(N-1):
        distance_list.pop(0)

    print(sum(distance_list))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    ABC = [int(s) for s in input().split()]
    sorted = ABC.sort()
    result = int(str(sorted[0])+str(sorted[1])) + sorted[2]
    print(result)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    inputs = [int(s) for s in input().split()]
    sorted_list = sorted(inputs,reverse=True)
    result = int(str(sorted_list[0])+str(sorted_list[1])) + sorted_list[2]
    print(result)

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

def main():
    s = input()
    K = int(input())
    substrings = []

    for i in range(len(s)):
        for ii in range(i,len(s)):
            if s[i:ii+1] not in substrings and len(s[i:ii+1]) <= K:
                substrings.append(s[i:ii+1])
    
    substrings.sort()
    print(substrings[K-1])
        

if __name__ == "__main__":
    main()


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

def main():
    s = input()
    K = int(input())
    substrings = []

    for i in range(len(s)):
        for ii in range(i,len(s)):
            if len(s[i:ii+1]) > K:
                break
            if s[i:ii+1] not in substrings:
                substrings.append(s[i:ii+1])
    
    substrings.sort()
    print(substrings[K-1])
        

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    s = input()
    K = int(input())
    substrings = []

    for i in range(len(s)):
        for ii in range(i,len(s)):
            if s[i:ii+1] not in substrings:
                substrings.append(s[i:ii+1])
    
    substrings.sort()
    print(substrings[K-1])
        

if __name__ == "__main__":
    main()


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

def main():
    s = input()
    K = int(input())
    substrings = []

    for i in range(len(s)):
        for ii in range(i,len(s)):
            if len(s[i:ii+1]) > K:
                break
            if s[i:ii+1] not in substrings:
                substrings.append(s[i:ii+1])
    
    substrings.sort()
    print(substrings[K-1])
        

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil((H * W) / 2))
import math
H, W = map(int, input().split())

print(math.ceil((H * W) / 2))

Fixed submission:
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil((H * W) / 2))
Buggy python submission (verdict: Runtime Error):
h, n = map(int, input().split())
a = map(int, input().split())
ans = "Yes" if sum(a) >= h else "No" 
print(ans)
         

Fixed submission:
a, b = map(int, input().split())
ans  = -(-a//b)
print(ans)
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())
h,w = map(int,input().split())
prin((H-h)*(W-w))

Fixed submission:
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))
Buggy python submission (verdict: Runtime Error):
t = int(input())
x = int(input())
print(t/x)

Fixed submission:
t,x = map(int, input().split())
print(t/x)
Buggy python submission (verdict: Runtime Error):
a,c = map(int, input().split())
print(a*c*//2)

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

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

Fixed submission:
a,b,c = map(int, input().split())
print(a*b//2)
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
print(x + (y//2))

Fixed submission:
x, y =map(int, input().split())
print(x+y//2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
X = list(map(int, input()))
minSum = 0
for i in X:
    minSum += min(i, K - i) * 2
print(minSum)

Fixed submission:
N = int(input())
K = int(input())
X = list(map(int, input().split()))
minSum = 0
for i in X:
    minSum += min(i, K - i) * 2
print(minSum)
Buggy python submission (verdict: Runtime Error):
a, b= map(int, input().split())
x = False
for i in [a, b, a+b]:
  if i%3 == 0:
    x = True
print("Possible" if x else "Impossible"

Fixed submission:
a, b= map(int, input().split())
if a%3 == 0:
  print("Possible")
elif b%3 == 0:
  print("Possible")
elif (a+b)%3 == 0:
  print("Possible")
else:
  print("Impossible")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
count = 0


for i in range(600):
  if a == b and b == c:
    break
  a,b,c = a//2, b//2, c//2
  a, b, c = b + c, a + c, a + b
ans = i if i < 600 else -1
print(-1

Fixed submission:
a,b,c = map(int,input().split())
for i in range(600):
  if a&1 or b&1 or c&1:
    break
  a,b,c = a//2, b//2, c//2
  a, b, c = b + c, a + c, a + b
ans = i if i < 500 else -1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
q = int(input())
q1 = [list(map(str,input().split())) for i in range(q)]

ap = ["", ""]
revCount = 0

for j in q1:
  if j[0] == "1":
    revCount = (revCount+1) % 2

  else:
    if revCount == 0:
      ap[j[1] - 1] = ap[j[1] - 1] + j[2]
    else:
      ap[j[1] - 2] = ap[j[1] - 2] + j[2]
        

if revCount == 0:
  ap[0] = ap[0][::-1]
  print(ap[0] + s + ap[1])

else:
  aps = (s+ap[1])[::-1]
  print(aps + ap[0])


Fixed submission:
s = input()
q = int(input())
q1 = [list(map(str,input().split())) for i in range(q)]

ap = ["", ""]
revCount = 0

for j in q1:
  if j[0] == "1":
    revCount = revCount ^ 1

  else:
    ind = revCount ^ int(j[1]) - 1
    ap[ind] = ap[ind] + j[2]

if revCount == 0:
  ap[0] = ap[0][::-1]
  print(ap[0] + s + ap[1])

else:
  aps = (s+ap[1])[::-1]
  print(aps + ap[0])
Buggy python submission (verdict: Runtime Error):
l = [input() for i in range(n)]
l.sort()
i = 0
count = 1
ans = []
max = 1
while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if count >= max:
      max = count
    if i == n-1:
      ans.append([l[n-1], count])

  else:
      ans.append([l[i],count])
      count = 1
      i += 1

for i in ans:
  if i[1] == max:
    print(i[0])





Fixed submission:
n = int(input())
l = [str(input()) for i in range(n)]
l.sort()
i = 0
count = 1
ans = []
max = 1
while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if count >= max:
      max = count
    if i == n-1:
      ans.append([l[n-1], count])

  else:
      ans.append([l[i],count])
      count = 1
      i += 1

if max == 1:
  ans.append([l[n-1], 1])
      
for i in ans:
  if i[1] == max:
    print(i[0])

Buggy python submission (verdict: Runtime Error):
l = [input() for i in range(n)]
l.sort()
i = 0
max = 1
count = 1
ans = []

while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if i == n-1 and count >= max:
      ans.append(l[n-1])

  else:
    if count >= max:
      max = count
      ans.append(l[i])
      count = 1
      i += 1
    else:
      count = 1
      i += 1

if max == 1:
  ans.append(l[n-1])
      
for i in ans:
  print(i)


Fixed submission:
n = int(input())
l = [str(input()) for i in range(n)]
l.sort()
i = 0
count = 1
ans = []
max = 1
while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if count >= max:
      max = count
    if i == n-1:
      ans.append([l[n-1], count])

  else:
      ans.append([l[i],count])
      count = 1
      i += 1

if max == 1:
  ans.append([l[n-1], 1])
      
for i in ans:
  if i[1] == max:
    print(i[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
ans = 1
if n == 1:
  if l[0] == 0:
    print(1)
  else:
    print(0)

elif n == 2:
  if l[0] ==0 and l[1] == 1:
    print(1)
  else:
    print(0)

else:
  if l[0] != 0:
    print(0)
  else:
    a = [0]*n
    for i in range(n):
      a[l[i]] += 1

    if a[0] != 1:
      print(0)
    else:
      for i in range(n-1):
        if a[i]!=0 and a[i+1]!=0:
          ans = ans * (a[i]**a[i+1])
        else:
          break

      print(ans%n = int(input())
l = list(map(int,input().split()))
ans = 1
if n == 1:
  if l[0] == 0:
    print(1)
  else:
    print(0)

elif n == 2:
  if l[0] ==0 and l[1] == 1:
    print(1)
  else:
    print(0)

else:
  if l[0] != 0:
    print(0)
  else:
    a = [0]*n
    for i in range(n):
      a[l[i]] += 1

    if a[0] != 1:
      print(0)
    else:
      for i in range(n-1):
        if a[i]!=0 and a[i+1]!=0:
          ans = ans * (a[i]**a[i+1])
        else:
          break

      print(ans%998244353)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
ans = 1
t = 1
if n == 1:
  if l[0] == 0:
    print(1)
  else:
    print(0)
 
elif n == 2:
  if l[0] ==0 and l[1] == 1:
    print(1)
  else:
    print(0)
 
else:
  if l[0] != 0:
    print(0)
  else:
    a = [0]*n
    for i in range(n):
      a[l[i]] += 1
 
    if a[0] != 1:
      print(0)
    else:
      for i in range(n-1):
        if a[i]==0 and a[i+1]!=0:
          t = 0
          
        elif a[i]!=0 and a[i+1]!=0:
          ans = ans * (a[i]**a[i+1])
      if t == 1:
        print(ans%998244353)
      else:
        print(0)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:
  print(0):
else:
  print(int((n-1)*n/2))

Fixed submission:
n=int(input())

print(int((n-1)*n//2))
Buggy python submission (verdict: Runtime Error):
n=int(input())
list=list(map(int,input().split()))
list2=sorted(list)
if n%2==0:
  print(list[n/2]-list[n/2-1])
else:
  print(0)


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

print(list[int(n/2)]-list[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
list=list(map(int,input().split()))
list2=sort(list)
if n%2==0:
  print(list[n/2]-list[n/2-1])
else:
  print(0)

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

print(list[int(n/2)]-list[int(n/2)-1])
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
li=[]
for i in range(1,n+1):
  li.append(l+i-1)
print(sum(li)-li[li.index(min(list(map(abs,li))))])

Fixed submission:
n,l=map(int,input().split())
li=[]
for i in range(1,n+1):
  li.append(l+i-1)
print(sum(li)-[i for i in li if abs(i)==min(list(map(abs,li)))][0])
Buggy python submission (verdict: Runtime Error):
W,H,x,y=map(int,input().split())
if x,y==int(W/2),int(H/2):
  print(W*H,1)
else:
  print(W*H,0)

Fixed submission:
W,H,x,y=map(int,input().split())
if float(x)==W/2 and float(y)==H/2:
  print(W*H/2,1)
else:
  print(W*H/2,0)
Buggy python submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))
count=0
for i in range(1,n):
  if li[i] >= max(li[0:i])
    count +=1
print(count+1)

Fixed submission:
n=int(input())
li=list(map(int,input().split()))
count=0
for i in range(1,n):
  if li[i] >= max(li[0:i]):
    count +=1
print(count+1)
Buggy python submission (verdict: Runtime Error):
n=input()
li=list(n)
if len(n)==1:
  print(0)
elif len(n)%2==0:
  counta=0 
  countb=0
  a=list("10"*int((int(n)/2)))
  b=list("01"*int((int(n)/2)))
  for i in range(len(n)):
    counta+= abs(int(li[i])-int(a[i]))
    countb+=abs(int(li[i])-int(b[i]))
  print(min(counta,countb))

elif len(n)%2==1 and len(n) != 1:
  countaa=0 
  countbb=0
  aa=list("10"*int(((int(n)-1)/2))+"1")
  bb=list("01"*int(((int(n)-1)/2))+"0")
  for i in range(len(n)):
    countaa+=abs(int(li[i])-int(aa[i]))
    countbb+=abs(int(li[i])-int(bb[i]))
  print(min(countaa,countbb))

Fixed submission:
n=input()
li=list(n)
if len(n)==1:
  print(0)
elif len(n)%2==0:
  counta=0 
  countb=0
  a=list("10"*int((int(len(n))/2)))
  b=list("01"*int((int(len(n))/2)))
  for i in range(len(n)):
    counta+= abs(int(li[i])-int(a[i]))
    countb+=abs(int(li[i])-int(b[i]))
  print(min(counta,countb))

elif len(n)%2==1 and len(n) != 1:
  countaa=0 
  countbb=0
  aa=list("10"*int(((int(len(n))-1)/2))+"1")
  bb=list("01"*int(((int(len(n))-1)/2))+"0")
  for i in range(len(n)):
    countaa+=abs(int(li[i])-int(aa[i]))
    countbb+=abs(int(li[i])-int(bb[i]))
  print(min(countaa,countbb))

Buggy python submission (verdict: Runtime Error):
n=input()
li=list(n)
if len(n)==1:
  print(0)
elif len(n)%2==0 and len(n) != 1:
  counta=0 
  countb=0
  a=list("10"*int((int(n)/2)))
  b=list("01"*int((int(n)/2)))
  for i in range(len(n)):
    counta+= abs(int(li[i])-int(a[i]))
    countb+=abs(int(li[i])-int(b[i]))
  print(min(counta,countb))

elif len(n)%2==1 and len(n) != 1:
  countaa=0 
  countbb=0
  aa=list("10"*int(((int(n)-1)/2))+"1")
  bb=list("01"*int(((int(n)-1)/2))+"0")
  for i in range(len(n)):
    countaa+=abs(int(li[i])-int(a[i]))
    countbb+=abs(int(li[i])-int(b[i]))
  print(min(countaa,countbb))

Fixed submission:
n=input()
li=list(n)
if len(n)==1:
  print(0)
elif len(n)%2==0:
  counta=0 
  countb=0
  a=list("10"*int((int(len(n))/2)))
  b=list("01"*int((int(len(n))/2)))
  for i in range(len(n)):
    counta+= abs(int(li[i])-int(a[i]))
    countb+=abs(int(li[i])-int(b[i]))
  print(min(counta,countb))

elif len(n)%2==1 and len(n) != 1:
  countaa=0 
  countbb=0
  aa=list("10"*int(((int(len(n))-1)/2))+"1")
  bb=list("01"*int(((int(len(n))-1)/2))+"0")
  for i in range(len(n)):
    countaa+=abs(int(li[i])-int(aa[i]))
    countbb+=abs(int(li[i])-int(bb[i]))
  print(min(countaa,countbb))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a + b >= c + 1:
  print(b+c)
elif a==b==c==0:
  print(0)
elif a+b=c:
  print(b+c)
else:
  print(a+2*b+1)


Fixed submission:
a,b,c=map(int,input().split())
if a + b >= c :
  print(b+c)
elif a==b==c==0:
  print(0)
else:
  print(a+2*b+1)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a + b >= c:
  print(b+c)
else:
  print(a+2b)
  
  

Fixed submission:
a,b,c=map(int,input().split())
if a + b >= c :
  print(b+c)
elif a==b==c==0:
  print(0)
else:
  print(a+2*b+1)
Buggy python submission (verdict: Runtime Error):
x(1),y(1),x(2),y(2)=map(int,input().split())
for i in range(3,5):
  x(i)=x(i-1)+y(i-2)-y(i-1)
  y(i)=y(i-1)+x(i-1)-x(i-2)
print(x(3) y(3) x(4) y(4))


Fixed submission:
x1,y1,x2,y2=map(int,input().split())
x3=x2+y1-y2
y3=y2+x2-x1
x4=x3+y2-y3
y4=y3+x3-x2
print(x3,y3,x4,y4)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
for i in range(k,n):
  if li[i-1]<=0:
    q.append(-li[i-k])
  elif li[i-k]>=0:
    q.append(li[i-1])
  else:
    q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))

Fixed submission:
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
if k==n:
  q.append(li[n-1]-li[0]+min(abs(li[n-1]),abs(li[0])))
else:
  for i in range(k,n+1):
    if li[i-1]<0:
      q.append(-li[i-k])
    elif li[i-k]>0:
      q.append(li[i-1])
    else:
      q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
for i in range(k,n):
  if li[i-1]<0:
    q.append(-li[i-k])
  elif li[i-k]>0:
    q.append(li[i-1])
  else:
    q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))


Fixed submission:
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
if k==n:
  q.append(li[n-1]-li[0]+min(abs(li[n-1]),abs(li[0])))
else:
  for i in range(k,n+1):
    if li[i-1]<0:
      q.append(-li[i-k])
    elif li[i-k]>0:
      q.append(li[i-1])
    else:
      q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
for i in range(k,n):
  if i<0 or i-k+1>0:
    q.append(li[i-1]-li[i-k])
  else:
    q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))

    

Fixed submission:
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
if k==n:
  q.append(li[n-1]-li[0]+min(abs(li[n-1]),abs(li[0])))
else:
  for i in range(k,n+1):
    if li[i-1]<0:
      q.append(-li[i-k])
    elif li[i-k]>0:
      q.append(li[i-1])
    else:
      q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))