qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

#N = int(input())
N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))

dp = np.arange(K + A[-1]+1) >= 0
for i in range(K, -1, -1):
    if np.all(dp[A+i]):
        dp[i] = False
#    print(i, dp[i],A+i,dp[A+i])
#print(dp)

if dp[0]:
    ans = 'Frist'
else:
    ans = 'Second'
print(ans)

Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

#N = int(input())
N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))

dp = [True for i in range(K + 1)]
for i in range(K, -1, -1):
    if dp[i]:
        for a in A:
            if i - a >= 0:
                dp[i - a] = False

#    print(i, dp[i],A+i,dp[A+i])
#print(dp)

if dp[0]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)
Buggy code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()

dp = [-1 for i in range(n+1)]

dp[0] = -1

for i in range(1,n+1):
  if a[0] > i:
    dp[i] = -1
    continue
    
  for j in a:
    if dp[i-j] == -1:
      dp[i] = 1
      break

if dp[n] == -1:
  print('Second')
else:
  print('First')
    
    

Fixed code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = [0 for _ in range(k + 1)]
for i in range(1, k + 1):
    for j in a:
        if i >= j:
            if dp[i - j] == 0:
                dp[i] = 1
        if dp[i] == 1:
            break
print("First" if dp[k] else "Second")
Buggy code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1+1234)

for i in range(0,k+1):
    if dp[i] == 0:
        for x in a:
            dp[min(i+x,k)] =1

print("First" if dp[k] else "Second")

Fixed code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1+1234)

for i in range(0,k+1):
    if dp[i] == 0:
        for x in a:
            dp[min(i+x,k+1)] =1

print("First" if dp[k] else "Second")
Buggy code:
n,k = map(int,input().split())
arr = list(map(int,input().split()))

dp = [False]*(k+1)

for stones in range(k+1):
    for x in arr:
        if stones >= x and dp[stones-x] == False:
            dp[stones] = True

print(dp)

if dp[k]:
    print("First")
else:
    print("Second")


Fixed code:
n,k = map(int,input().split())
arr = list(map(int,input().split()))

dp = [False]*(k+1)

for stones in range(k+1):
    for x in arr:
        if stones >= x and dp[stones-x] == False:
            dp[stones] = True

if dp[k]:
    print("First")
else:
    print("Second")
Buggy code:
N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	for i in L:
		if fn(n-i) == 1:
			dp[n] = 0
			return 0
	dp[n] = 1
	return 1
for l in range(1, 	K):
	fn(l)
if fn(K) == 0:
	print("First")
else:
	print("Second")

Fixed code:
N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
# dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	if n == 0:
		dp[n] = 0
		return dp[n]
	ans = 0
	for i in L:
		if n >= i:
			if fn(n-i) == 0:
				ans = 1
				break
	dp[n] = ans		
	return dp[n]
for l in range(K):
	fn(l)
if fn(K) == 1:
	print("First")
else:
	print("Second")
Buggy code:
n, k = map(int, input().split())
stones = list(map(int, input.split()))

dp = [False for _ in range(k+1)]

for i in range(1, k+1):
  for j in stones:
    if i >= j and dp[i-j] == False:
      dp[i] = True
      continue
      
if dp[k]:
  print('First')
else:
  print('Second')

Fixed code:
n, k = map(int, input().split())
stones = list(map(int, input().split()))

dp = [False for _ in range(k+1)]

for i in range(1, k+1):
  for j in stones:
    if i >= j and dp[i-j] == False:
      dp[i] = True
      continue
      
if dp[k]:
  print("First")
else:
  print("Second")
Buggy code:
# K - Stones
def main():
    N, K, *A = map(int, open(0).read().split())
    dp = [False] * (K + 1)  # dp[i] := a player can win if i stones remain in their turn. (dp[0] := lose)
    for i in range((K + A[0] - 1) // A[0]):
        if dp[i]:
            continue
        for a in A:
            if i + a > K:
                break
            dp[i + a] = True
    print("First" if dp[-1] else "Second")


if __name__ == "__main__":
    main()


Fixed code:
# K - Stones
def main():
    N, K, *A = map(int, open(0).read().split())
    dp = [False] * (K + 1)  # dp[i] := a player can win if i stones remain in their turn. (dp[0] := lose)
    for i in range(K):
        if dp[i]:
            continue
        for a in A:
            if i + a > K:
                break
            dp[i + a] = True
            if dp[-1]:
                print("First")
                return
    print("Second")


if __name__ == "__main__":
    main()
Buggy code:
# K - Stones
def main():
    N, K, *A = map(int, open(0).read().split())
    dp = [False] * (K + 1)
    for i in range(1, K + 1):
        if dp[i]:
            continue
        for a in A:
            if i + a > K:
                break
            dp[i + a] = True
    print("First" if dp[-1] else "Second")


if __name__ == "__main__":
    main()


Fixed code:
# K - Stones
def main():
    N, K, *A = map(int, open(0).read().split())
    dp = [False] * (K + 1)
    for i in range(K):
        if dp[i]:
            continue
        for a in A:
            if i + a > K:
                break
            dp[i + a] = True
    print("First" if dp[-1] else "Second")


if __name__ == "__main__":
    main()
Buggy code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k=map(int,input().split())
A=list(map(int,input().split()))
dp = [False]*(k+1)
for left in range(k+1):
  for i, ai in enumerate(A):
    if left - ai >= 0:dp[left] |= dp[left-ai]
print("First"if dp[k] else "Second")

    


Fixed code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k=map(int,input().split())
A=list(map(int,input().split()))
mina = min(A)
dp = [0]*(k+1)
for left in range(k+1):
  win = False
  for i, ai in enumerate(A):
    if left - ai >= 0 and dp[left-ai] == 0:
      win = True
    dp[left] = (1 if win else 0)
print("First"if dp[k] else "Second")
Buggy code:
def main():
  n,k=map(int,input().split())
  num=[int(i) for i in input().split()]
  
  dp=[0]*(k+1)
  for i in range(k):
    flag=False
    for j in range(n):
      if dp[max(i+1-num[j],0)]==0:
        flag=True
        break
    if flag:
      dp[i+1]=1
    else:
      continue
  if dp[k]:
    print('First')
  else:
    print('Second')          
if __name__=='__main__':
  main()

Fixed code:
def main():
  n,k=map(int,input().split())
  num=[int(i) for i in input().split()]
  
  dp=[0]*(k+1)
  for i in range(k):
    flag=False
    for j in range(n):
      if i+1-num[j]>=0:
        if  dp[i+1-num[j]]==0:
          flag=True
          break
    if flag:
      dp[i+1]=1
    else:
      continue
  if dp[k]:
    print('First')
  else:
    print('Second')          
if __name__=='__main__':
  main()
Buggy code:
n, k = map(int, input().split())
l = list(map(int, input().split()))

dp = [-1]*(k+1)
dp[0] = 0

for i in range(1, k+1):
  for j in range(n):
    if i - l[j] >= 0:
      dp[i] = 1 - dp[i-l[j]]
      
if dp[k] == 0:
  print('Second')
else:
  print('First')

Fixed code:
n,k = map(int,input().split())
aa = list(map(int,input().split()))

dp = [-1]*(k+1)

for i in range(1,k+1):
  for j in range(n):
    if i >= aa[j]:
      dp[i] = max(dp[i],-dp[i-aa[j]])

if dp[k]>0:
  print('First')  
else:
  print('Second')
Buggy code:
n,k = map(int,input().split())
al = list(map(int,input().split()))

dp = [float("inf") for i in range(k+1)]

for i in range(al[0]):
    dp[i] = 0 

for i in range(k):
    for a in al:
        if i+a <= k:
            dp[i+a] = dp[i] + 1


if dp[-1] % 2 == 0:
    print("Second")
else:
    print("First")



Fixed code:
n,k = map(int,input().split())
al = list(map(int,input().split()))

dp = [0 for i in range(k+1)]

for i in range(k+1):
    for a in al:
        if a <= i:
            if dp[i-a] == 0:
                dp[i] = 1


if dp[-1] % 2 == 0:
    print("Second")
else:
    print("First")
Buggy code:
def stones(k, moves):
    winnable = [False] * (k + 1)
    for i in range(1, k+1):
        winnable[i] = not all(winnable[i - j] for j in moves if j <= i)
    print([int(x) for x in winnable])
    return ["Second", "First"][winnable[k]]

def main():
    n, k = [int(x) for x in input().split()]
    moves = [int(x) for x in input().split()]
    return stones(k, moves)

print(main())

Fixed code:
def stones(k, moves):
    winnable = [False] * (k + 1)
    for i in range(1, k+1):
        winnable[i] = not all(winnable[i - j] for j in moves if j <= i)
    return ["Second", "First"][winnable[k]]

def main():
    n, k = [int(x) for x in input().split()]
    moves = [int(x) for x in input().split()]
    return stones(k, moves)

print(main())
Buggy code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1)
dp[0]=0

for i in range(1,k+1):
    for j in range(n):
        if i-a[j]>=0:
            dp[i]=1
            dp[i]= dp[i] and dp[i-a[j]]
    dp[i]=(dp[i]+1)%2
print("First" if dp[k] else "Second")

Fixed code:
n,k = map(int, input().split())
a = list(map(int, input().split()))

dp = [0]*(k+1)

for i in range(a[0]):
    dp[i] = 2

for i in range(a[0],k+1):
    for j in a:
        if(j > i):
            dp[i] = 2
            break
        if(dp[(i-j)]==2):
            dp[i] = 1
            break
        dp[i] = 2

if(dp[k] == 1):
    print('First')
else:
    print('Second')
Buggy code:
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*(k+1)
for i in range(k+1):
    for j in range(n):
        if i>=j and dp[i-j]==0:
            dp[i]=1
if dp[k]==0:
    print('Second')
else:
    print('First')

Fixed code:
n, k = map(int, input().split())
arr = list(map(int, input().split()))
dp = [0] * (k + 1)
dp[0] = 0
for i in range(k + 1):
    for j in arr:
        if i >= j and not dp[i - j]:
            dp[i] = 1
print("First" if dp[-1] else "Second")
Buggy code:
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[[0,0]  for j in range(K+1)]
dp[0][1]=1
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i][0]=max(dp[i-a[j]][1],dp[i][0])
            dp[i][1]=max(dp[i-a[j]][0],dp[i][1])
if dp[K][0]:
    print("First")
else:
    print("Second")

Fixed code:
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[0 for j in range(K+1)]
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i]=max((dp[i-a[j]]+1)%2,dp[i])
if dp[K]:
    print("First")
else:
    print("Second")
Buggy code:
def solve():
    k, a = read()
    result = think(k, a)
    write(result)


def read():
    n, k = read_int(2)
    a = read_int(n)
    return k, a


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(k, a):
    max_n = 100
    max_k = 10 ** 5

    # dp[i] = True/False; True means First player win if num of stone is i
    dp = [False] * (max_n * max_k + 1)

    for i in range(len(dp)):
        for elem in a:
            if i >= elem:
                dp[i] |= not dp[i - elem]

    return dp[k]


def write(result):
    if result:
        print('First')
    else:
        print('Second')


if __name__ == '__main__':
    solve()

Fixed code:
def solve():
    k, a = read()
    result = think(k, a)
    write(result)


def read():
    n, k = read_int(2)
    a = read_int(n)
    return k, a


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(k, a):
    max_n = 100

    # dp[i] = True/False; True means First player win if num of stone is i
    dp = [False] * (k + max_n + 1)

    for i in range(len(dp)):
        for elem in a:
            if i >= elem:
                dp[i] |= not dp[i - elem]

    return dp[k]


def write(result):
    if result:
        print('First')
    else:
        print('Second')


if __name__ == '__main__':
    solve()
Buggy code:
N, K = map(int, input().split())
a = list(map(int, input().split()))
dp = [[-1,0] for i in range(K+1)]
for i in range(K+1):
    for j in range(N):
        if i+a[j]<=K:
            if dp[i+a[j]][1] == 0:
                dp[i+a[j]][0] = dp[i][0]*(-1)
                dp[i+a[j]][1] = 1
            else:
                dp[i+a[j]][0] = 1
if dp[K][0] == 1:
    print('First')
else:
    print('Second')

Fixed code:
N, K = map(int, input().split())
a = list(map(int, input().split()))
dp = [0]*(K+1)

for i in range(K):
    if dp[i]==0:
        for j in a:
            if i+j<=K:
                dp[i+j] = 1

print("First" if dp[K]==1 else "Second")
Buggy code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[False]*(k+1)
for j in range(1,k+1):
  for i in a:
    if 0<=j-i and dp[j-1]==False:
      dp[j]=True
if dp[k]:
  print('First')
else:
  print('Second')

Fixed code:
n,k= map(int,input().split())
a=list(map(int,input().split()))

dp=[0]*(k+1)

for i in range(1,k+1):
    for j in a:
        if(j<=i):
            if(dp[i-j]==0):
                dp[i]=1


if(dp[k]==1):
    print('First')
else:
    print('Second')
Buggy code:
n,k = map(int,input().split())
A = [int(i) for i in input().split()]

dp = ["Secocd"]+["First"]*k
for i in range(1,k+1):
    win = "Second"
    for a in A:
        if i-a >= 0 and dp[i-a] == "Second":
            win = "First"
    dp[i] = win
print(dp[k])


Fixed code:
n,k = map(int,input().split())
A = [int(i) for i in input().split()]
dp = ["Second"] + ["First"]*k
for i in range(1,k+1):
    win = "Second"
    for j in range(n):
        if i-A[j] >= 0 and dp[i-A[j]] == "Second":
            win = "First"
    dp[i] = win
print(dp[k])
Buggy code:
N,K = map(int,input().split())
A = list(map(int,input().split()))

dp = [0 for _ in range(K+1)]

for i in range(K):
    for j in range(N):
        if i-A[j] >= 0:
            dp[i] |= not dp[i-A[j]]
            
if dp[K]:
    print('First')
else:
    print('Second')

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

dp = [False for _ in range(K + 1)]

for i in range(1, K + 1):
    for j in range(N):
        if i >= A[j]:
            dp[i] |= not dp[i - A[j]]

if dp[K]:
    print("First")
else:
    print("Second")
Buggy code:
n, k = map(int, input().split())
a_s = list(map(int, input().split()))
dp = ["Second"] * (k + 1)
for i in range(k + 1):
    if dp[i] == "Second":
        for a in a_s:
            ii = i + a
            if ii <= k:
                dp[ii] = "First"
print(dp)


Fixed code:
n, k = map(int, input().split())
a_s = list(map(int, input().split()))
dp = ["Second"] * (k + 1)
for i in range(k + 1):
    if dp[i] == "Second":
        for a in a_s:
            ii = i + a
            if ii <= k:
                dp[ii] = "First"
print(dp[-1])
Buggy code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [False] * (K + 1)

for i in range(K):
    for j in range(N):
        if i - A[j] >= 0:
            dp[i + 1] |= not dp[i - A[j]]

if dp[K]:
    print('First')
else:
    print('Second')

# print(dp)


Fixed code:
N, K = map(int, input().split())
a = list(map(int, input().split()))
dp = [False] * (K + 1)
for i in range(1, K + 1):
    for j in range(N):
        if i - a[j] >= 0:
            dp[i] |= not dp[i - a[j]]

if dp[K]:
    print('First')
else:
    print('Second')
Buggy code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [False]*(k+1)
for i in range(1, k):
    flag = False
    for ai in a:
        if i-ai >= 0 and  not dp[i-ai]:
            flag = True
            break
    dp[i] = flag

if dp[-1]:
    print("First")
else:
    print("Second")

Fixed code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [False]*(k+1)
for i in range(1, k+1):
    flag = False
    for ai in a:
        if i-ai >= 0 and  not dp[i-ai]:
            flag = True
            break
    dp[i] = flag

if dp[-1]:
    print("First")
else:
    print("Second")
Buggy code:
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
a = tuple(map(int,input().split()))

dp = [True] + [False]*k
for i in range(1,k+1):
    judge = False
    for j in range(n):
        if i-a[j] >= 0 and dp[i-a[j]]:
            judge = True
    dp[i] = judge
if dp[k]:
    print('First')
else:
    print('Second')

Fixed code:
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
a = tuple(map(int,input().split()))

dp = [False] + [True]*k
for i in range(1,k+1):
    judge = False
    for j in range(n):
        if i-a[j] >= 0 and not dp[i-a[j]]:
            judge = True
    dp[i] = judge

if dp[k]:
    print('First')
else:
    print('Second')
Buggy code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, K = map(int, input().split())
S = list(map(int, input().split()))
dp = [0]*(K+1)

for i in range(K+1):
    if dp[i] == 0:
        for s in S:
            if i+s > K:
                continue
            else:
                dp[i+s] = 1
    print(dp)
if dp[K]:
    print("First")
else:
    print("Second")


Fixed code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, K = map(int, input().split())
S = list(map(int, input().split()))
dp = [0]*(K+1)

for i in range(K+1):
    if dp[i] == 0:
        for s in S:
            if i+s > K:
                continue
            else:
                dp[i+s] = 1
if dp[K]:
    print("First")
else:
    print("Second")
Buggy code:
n,k=map(int,input().split())
a=list(map(int,input().split()))

dp=[False]*(k+1)
for i in range(0,k+1):
    for j in a:
        if i>=j and  dp[i-j]==False:
            dp[i]=True 
            
print(dp)
print ("First" if dp[k] else "Second")

Fixed code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
dp = [0] * (k+1)
dp[0] = 1
for i in range(1,k+1):
  for j in a:
    if i-j >= 0 and dp[i-j] ==1:
      dp[i] = 0
      break
  else:
    dp[i] = 1
print("Second" if dp[k] else "First")
Buggy code:
a, b, c = map(int, input().split())

if a+b < c:
    ans = 1
else:
    ans = 0
if a <= c:
    ans += a+2*b
else:
    ans += c+2*b
    
print(ans)

Fixed code:
a,b,c = map(int, input().split())
if a+b < c: ans = b*2+a+1
elif a+b==c: ans = b*2+a
else: ans = b+c
print(ans)
Buggy code:
from sys import stdin
A, B, C = [int(_) for _ in stdin.readline().rstrip().split()]
if A+B+1 >= C:
    print(B+1)
else:
    print(B*2+A+1)

Fixed code:
from sys import stdin
A, B, C = [int(_) for _ in stdin.readline().rstrip().split()]
if A+B+1 >= C:
    print(B+C)
else:
    print(B*2+A+1)
Buggy code:
a,b,c=map(int,input().split());print(b+min(c,b+1))

Fixed code:
a,b,c=list(map(int,input().split()));print(min(c,a+b+1)+b)
Buggy code:
a,b,c=map(int,input().split())
if a+b<c:
    print(b+a+b)
elif a+b==c:
    print(b+a+b+1)
else:
    print(b+c)

Fixed code:
a,b,c = map(int,input().split())
ans = 0
if a+b <= c:
    ans += a+b
    if ans == c:
        ans += b
    elif ans < c:
        ans += b+1
else:
    ans += b+c
print(ans)
Buggy code:
a, b, c = map(int, input().split())

cnt = 0
if a + b >= c:
    ans = a + b
else:
    ans = a + b + 2

print(cnt)

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

cnt = 0
if a + b + 1>= c:
    ans = b + c
else:
    ans = b + a + b + 1

print(ans)
Buggy code:
from collections import Counter,defaultdict,deque
from heapq import heapify,heappop,heappush
import sys,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a,b,c = inpl()
if a + b + 1 >=  c:
    print(a+c)
else:
    print(a+b+1+b)



Fixed code:
from collections import Counter,defaultdict,deque
from heapq import heapify,heappop,heappush
import sys,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a,b,c = inpl()
if a + b + 1 >=  c:
    print(b+c)
else:
    print(a+b+1+b)
Buggy code:
a, b, c = [ int(v) for v in input().split() ]
print(b+min(c,a+b))

Fixed code:
a, b, c = [ int(v) for v in input().split() ]
print(b+min(c,a+b+1))
Buggy code:
a = input("enter : ")
b = list(a)
m = " ";
b.append(m)
c = [];
k = "";
h = "";
for j in range(len(b)):
     if b[j] != " ":
         h = h + b[j]
     else:
         c.append(h)
         h = ""

d = 0;
if int(c[2])-1>int(c[0])+int(c[1]):
    d = int(c[0])+int(c[1])+int(c[1])+1
else:
    d = int(c[1])+int(c[2])
print(d)
    


Fixed code:
a = input("")

b= list(a)
m = " ";
b.append(m)
c = [];
k = "";
h = "";
for j in range(len(b)):
     if b[j] != " ":
         h = h + b[j]
     else:
         c.append(h)
         h = ""

d = 0;
if int(c[2])-1>int(c[0])+int(c[1]):
    d = int(c[0])+int(c[1])+int(c[1])+1
else:
    d = int(c[1])+int(c[2])
print(d)
Buggy code:
a,b,c = map(int, input().split())

if (c+1 > (a+b)):
    ans = a + 2*b + 1
else:
    ans = c+b
print(ans)

Fixed code:
a,b,c = map(int, input().split())
ans = 0
if a + b > c:
    ans = c + b
elif a + b == c:
    ans = c + b
else:
    ans = a + (b * 2) + 1
print(ans)
Buggy code:
#!/usr/bin/python
# coding: UTF-8

a, b, c = map(int,input().split("/"))

if a * b == 0:
  print(0)
elif a + b >= c:
  print(b + c)
else:
  print(a + b * 2 + 1)

Fixed code:
#!/usr/bin/python
# coding: UTF-8

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

if a + b >= c:
  print(b + c)
else:
  print(a + b * 2 + 1)
Buggy code:
a, b, c = map(int, input().split())

if c < a+b:
  print(b+c)
else:
  print(a+2*b+1)

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

tg_c = b + c
dt_c = a + b

if c <= dt_c:
  print(tg_c)
else:
  print(a+b*2+1)
Buggy code:
a, b, c = map(int, input().split())
ans = 0
if b < c:
    ans += 2 * b
    c -= b
    if c > a:
        ans += a
    else:
        ans += c

else:
    ans = ans + b + c

print(ans)


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

if a+b < c:
    ans = 1+a+2*b
else:
    ans = 0
    if a <= c:
        ans += a+(c-a)*2+(b-c+a)
    elif a>= c:
        ans += c+b
    
print(ans)
Buggy code:
a, b, c = map(int, input().split())

if a + b == 0:
    print(1)
elif c - 1 > a + b:
    print(a + b + 2)
else:
    print(b + c)

Fixed code:
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 code:
A = list(map(int, input().split()))
print(min(A[0]+1, A[2])+A[1])

Fixed code:
A = list(map(int, input().split()))
print(min(A[0]+A[1]+1, A[2])+A[1])
Buggy code:
###A - Poisonous Cookies
A, B, C = map(int, input().split())

if (A + B) >= C:
    print(A + B + 1)
else:
    print(C + 1)

Fixed code:
###A - Poisonous Cookies
A, B, C = map(int, input().split())

if (A + B) >= C:
    print(B + C)
else:
    print(A + 2*B + 1)
Buggy code:
  a,b,c = [int(s) for s in input().split(" ")]
  ret = min(a+b+1,c) + b
  print(ret)

Fixed code:
a,b,c = [int(s) for s in input().split(" ")]
ret = min(a+b+1,c) + b
print(ret)
Buggy code:
a,b,c=map(int,input().split())
d=a+b
total=0
if c>=d:
    total=2*d
else:
    total=c+d
print(total-a)

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