Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D +=l[i]
  if D <= x:
    c += 1
print(c)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
print(c)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  else:
    li.append(D)
    
if max(li) > x:
  print(n+1)
else:
  print(c)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  li.append(D)
if max(li) > x:
  print(n+1)
else:
  print(c)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  else:
    break
print(c)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  elif:
    break
print(c)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input().split()))
a=0
b=0
li = []
for i in range(1,n):
  for j in range(1,i+1):
    a += w[j-1]
  for k in range(i+1,n+1):
    b += w[k]
  li.append(abs(a-b))
  a = 0
  b = 0
  
print(min(li))

Fixed submission:
n = int(input())
w = list(map(int,input().split()))
a=0
b=0
li = []
for i in range(1,n):
  for j in range(1,i+1):
    a += w[j-1]
  for k in range(i+1,n+1):
    b += w[k-1]
  li.append(abs(a-b))
  a = 0
  b = 0
  
print(min(li))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
mod = 1000000007
lis = []

if n ==  1 and m == 0:
  print(1)
  exit()
  
if 1 not in a:
  lis.append(1)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(2)
    
elif 1 in a:
  lis.append(0)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(1)


for i in range(3,n+1):
  if i in a:
    lis.append(0)
  else:
    lis.append((lis[i-2] + lis[i-3])%mod)
    
print(lis[-1])

Fixed submission:
n,m = map(int,input().split())
a = set(int(input()) for i in range(m))
mod = 1000000007
lis = []
 
if n ==  1 and m == 0:
  print(1)
  exit()
  
if 1 not in a:
  lis.append(1)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(2)
    
elif 1 in a:
  lis.append(0)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(1)
 
 
for i in range(3,n+1):
  if i in a:
    lis.append(0)
  else:
    lis.append((lis[i-2] + lis[i-3])%mod)
    
print(lis[-1])
Buggy python submission (verdict: Runtime Error):
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and int(lst1[1]) >=13) or (lst1[0] =="00" and lst1[1] == "00"):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

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

if s[k-1] == 'A':
  s[k-1] = 'a'
elif s[k-1] == 'B':
  s[k-1] = 'b'
else:
  s[k-1] = 'c'
  
for i in s:
  ans += i
  
print(ans)

Buggy python submission (verdict: Runtime Error):
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

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

if s[k-1] == 'A':
  s[k-1] = 'a'
elif s[k-1] == 'B':
  s[k-1] = 'b'
else:
  s[k-1] = 'c'
  
for i in s:
  ans += i
  
print(ans)
Buggy python submission (verdict: Runtime Error):
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

Fixed submission:
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and int(lst1[1]) >=13) or (lst1[0] =="00" and lst1[1] == "00"):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12:
      print("MMYY")
elif 0<int(lst1[1])<=12:
      print("YYMM")

Buggy python submission (verdict: Runtime Error):
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<lst1[0] <=12 and int(lst1[1])>=13:
      print("MMYY")
elif 0<lst1[1]<=12 and int(lst1[0])>=13:
      print("YYMM")

Fixed submission:
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and int(lst1[1]) >=13) or (lst1[0] =="00" and lst1[1] == "00"):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12:
      print("MMYY")
elif 0<int(lst1[1])<=12:
      print("YYMM")

Buggy python submission (verdict: Runtime Error):
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<lst1[0] <=12:
      print("MMYY")
elif 0<lst1[1]<=12:
      print("YYMM")

Fixed submission:
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and int(lst1[1]) >=13) or (lst1[0] =="00" and lst1[1] == "00"):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12:
      print("MMYY")
elif 0<int(lst1[1])<=12:
      print("YYMM")
Buggy python submission (verdict: Runtime Error):
s = input()
l = 0
lenmax = 0
 
for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
lenmax = max(lenmax,l)
print(lenmaax)

Fixed submission:
s = input()
l = 0
lenmax = 0
 
for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
lenmax = max(lenmax,l)
print(lenmax)
Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = list(input())
lis = [0]*(len(s))

for i in range(len(s)-1):
  if s[i]+s[i+1] == 'AC':
    lis[i],lis[i+1] = 0.5,0.5
    

for j in range(q):
  l,r = map(int,input().split())
  su = sum(lis[l-1:r])
  if lis[l-1] == 0.5 and lis[l-2] == 0.5 and lis[r-1] == 0.5 and lis[r]==0.5:
    su -= 1
  print(int(su))

Fixed submission:
#累積和的な

n,q = map(int,input().split())
s = input() + 'A' 
li = [0]*(n+1)

for i in range(n):
  li[i+1] = li[i] + (1 if s[i] + s[i+1] == 'AC' else 0)
  

for j in range(q):
  l,r = map(int,input().split())
  print(li[r-1] - li[l-1])
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
dict = {}
su = 0
kounyu = 0

for i in range(n):
  A,B = map(int,input().split())
  dict[A] = B

d = sorted(dict.items())

for i in range(10**12):
  if d[i][1] >= m - kounyu:
    print(su + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  su += d[i][1]*d[i][0]

Fixed submission:
n,m = map(int,input().split())
dict = {}
su = 0
kounyu = 0
 
for i in range(n):
  A,B = map(int,input().split())
  if A in dict:
    dict[A] += B  #同じAがありうる！！！！！！
  else:
    dict[A] = B
  

d = sorted(dict.items())
 
for i in range(10**99):
  if d[i][1] >= m - kounyu:
    print(su + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  su += d[i][1]*d[i][0]

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
dict = {}
sum = 0
kounyu = 0

for i in range(n):
  A,B = map(int,input().split())
  dict[A] = B

d = sorted(dict.items())

for i in range(10**12):
  if d[i][1] >= m - kounyu:
    print(sum + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  sum += d[i][1]*d[i][0]



Fixed submission:
n,m = map(int,input().split())
dict = {}
su = 0
kounyu = 0
 
for i in range(n):
  A,B = map(int,input().split())
  if A in dict:
    dict[A] += B  #同じAがありうる！！！！！！
  else:
    dict[A] = B
  

d = sorted(dict.items())
 
for i in range(10**99):
  if d[i][1] >= m - kounyu:
    print(su + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  su += d[i][1]*d[i][0]

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
dict = {}
sum = 0
kounyu = 0

for i in range(n):
  A,B = map(int,input().split())
  dict[A] = B

d = sorted(dict.items())

for i in range(n):
  if d[i][1] >= m - kounyu:
    print(sum + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  sum += d[i][1]*d[i][0]

Fixed submission:
n,m = map(int,input().split())
dict = {}
su = 0
kounyu = 0
 
for i in range(n):
  A,B = map(int,input().split())
  if A in dict:
    dict[A] += B  #同じAがありうる！！！！！！
  else:
    dict[A] = B
  

d = sorted(dict.items())
 
for i in range(10**99):
  if d[i][1] >= m - kounyu:
    print(su + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  su += d[i][1]*d[i][0]
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
lst = []
for i in range(1,101):
  if a%i==0 and b%i==0:
    lst.append(i)
print(sorted(lst)[len(lst)-k])

Fixed submission:
a,b,c = map(int,input().split())
if b//a >= c:
  print(c)
else:
  print(b//a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
xu = [list(int,input().split()) for i in range(n)]
sigma = 0

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + int(xu[j][0])*380000
  else:
    sigma = sigma + int(xu[j][0])
    
print(sigma)

Fixed submission:
n = int(input())
xu = [list(input().split()) for i in range(n)]
sigma = 0

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + float(xu[j][0])*380000
  else:
    sigma = sigma + float(xu[j][0])
    
print(sigma)

Buggy python submission (verdict: Runtime Error):
n = int(input())
xu = [list(map(int,input().split())) for i in range(n)]
sigma = 0

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + xu[j][0]*380000
  else:
    sigma = sigma + xu[j][0]
    
print(sigma)

Fixed submission:
n = int(input())
xu = [list(input().split()) for i in range(n)]
sigma = 0

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + float(xu[j][0])*380000
  else:
    sigma = sigma + float(xu[j][0])
    
print(sigma)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = sorted(list(map(int,input().split())))
s = 0

for i in l[:-1]:
  s += i
  
if l[0] < s:
  print("Yes")
else:
  print("No")

Fixed submission:
t,x = map(int,input().split())
print(float(t/x))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
if m <= n:
  print(0)
  exit()

if n%2 == 0:
  cutl = n//2 - 1
  cutr = len(x)+1-(n//2)
else:
  cutl = (n//2)
  cutr = len(x)-1+(n//2)

lis = x[cutl:cutr]
l = []

for i in range(len(lis)-1):
  l.append(abs(lis[i] - lis[i+1]))

print(lis[-1] - lis[0] -max(l))


Fixed submission:
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
if m <= n:
  print(0)
  exit()

l = []

for i in range(len(x)-1):
  l.append(x[i+1] - x[i])
  
l.sort(reverse = True)

for i in range(n-1):
  l[i] = 0
  
print(sum(l))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
if m == 1:
  print(0)
  exit()

if n%2 == 0:
  cutl = n//2 - 1
  cutr = len(x)+1-(n//2)
else:
  cutl = (n//2)
  cutr = len(x)-1+(n//2)

lis = x[cutl:cutr]
l = []

for i in range(len(lis)-1):
  l.append(abs(lis[i] - lis[i+1]))

print(lis[-1] - lis[0] -max(l))

Fixed submission:
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
if m <= n:
  print(0)
  exit()

l = []

for i in range(len(x)-1):
  l.append(x[i+1] - x[i])
  
l.sort(reverse = True)

for i in range(n-1):
  l[i] = 0
  
print(sum(l))
Buggy python submission (verdict: Runtime Error):
多分再帰使うんだろうね

Fixed submission:
import itertools
 
n = int(input())
H = list(map(int, input().split()))
 
count = 0
h_max = max(H)
for i in range(1, h_max + 1): #これが水位を上げる役割をしているのか
    watering = [(1 if h >= i else 0) for h in H] #これ以上いらないなら0　いるなら1
 
    itrs = itertools.groupby(watering)
    watering_group = [k for k, v in itrs if sum(list(v)) > 0] #ｋは要素の数字そのもの，連続するｋの並び
    count += sum(watering_group)

print(count)
Buggy python submission (verdict: Runtime Error):
s = list(input())
lst = []
lst2 = []

for i in range(7):
  lst.append(int(s[i]+s[i+1]+s[i+2]))
  lst2.append(abs(753-lst[i]))
  
print(min(lst2))


Fixed submission:
s = list(input())
lst = []
lst2 = []

for i in range(len(s)-2):
  lst.append(int(s[i]+s[i+1]+s[i+2]))
  lst2.append(abs(753-lst[i]))
  
print(min(lst2))
Buggy python submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
minabs = 10**10

for i in range(n):
  if abs(a-(t-h[i]*0.006)) < minabs:
    minabs = abs(a-(t-h[i]*0.006))
    j = i

print(j+1)

Fixed submission:
x,y = map(int,input().split())
print(int(x + y/2))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = []
numl = [[] for i in range(n+1)]
l = [list(map(int,input().split())) for i in range(m)]
 
for i in l:
  numl[i[0]].append(i[1])

for i in numl:
  i.sort()
  
for i in l:
  print(str(i[0]).zfill(6) + str((numl[i[0]].index(i[1]))+1).zfill(6))

Fixed submission:
n,m = map(int,input().split())
L = [[] for i in range(n)]
ans = [None]*m
l = [list(map(int,input().split())) for i in range(m)]

for i in range(len(l)):
  L[l[i][0]-1].append([l[i][1],i+1])
  
for ind,lis in enumerate(L):
  lis.sort()
  for j in range(len(lis)):
    ans[lis[j][1] - 1] = str(ind+1).zfill(6) + str(j+1).zfill(6)
    
print(*ans,sep = '\n')

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = []
numl = [[] for i in range(n+1)]
l = [list(map(int,input().split())) for i in range(m)]

for i in l:
  numl[i[0]].append(i[1])

for i in numl:
  i.sort()
  
for i in l:
  print(str(i[0]).zfill(6) + str((numl[i[0]].index(i[1]))+1).zfill(6))

Fixed submission:
n,m = map(int,input().split())
L = [[] for i in range(n)]
ans = [None]*m
l = [list(map(int,input().split())) for i in range(m)]

for i in range(len(l)):
  L[l[i][0]-1].append([l[i][1],i+1])
  
for ind,lis in enumerate(L):
  lis.sort()
  for j in range(len(lis)):
    ans[lis[j][1] - 1] = str(ind+1).zfill(6) + str(j+1).zfill(6)
    
print(*ans,sep = '\n')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
if n == 1:
  print("Hello World")
elif n == 2:
  print(a+b)

Fixed submission:
n = int(input())
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
if n == 1:
  print("Hello World")
else:
  print(a+b)

Fixed submission:
n = int(input())
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = int(input())
B = int(input())
print("Hello World" if n==1 else A + B)

Fixed submission:
n = int(input())
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
a = list(input())
b = []
for i in a:
  if i = "1":
    b.append("9")
  else:
    b.append("1")
print("".join(b))

Fixed submission:
a = input()
print(a.replace("1","x").replace("9","1").replace("x","9"))

Buggy python submission (verdict: Runtime Error):
a =input()
print(a.replace("1","x"),replace("9","1").replace("x","9"))

Fixed submission:
a = input()
print(a.replace("1","x").replace("9","1").replace("x","9"))

Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a.replace(1,x).replace(9,1).replace(x,9))

Fixed submission:
a = input()
print(a.replace("1","x").replace("9","1").replace("x","9"))

Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a.replace(1,x),replace(9,1).replace(x,9))

Fixed submission:
a = input()
print(a.replace("1","x").replace("9","1").replace("x","9"))
Buggy python submission (verdict: Runtime Error):
N,M,X,Y = map(int,input().split())
x = list(input())
y = list(input())
print(x)
if X >= Y:
  print("War")
  exit()
else:
  Z = Y
  
if int(max(x)) < Z and int(min(y)) >= Z:
  print("No War")
else:
  print("War")

Fixed submission:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if max(max(x),X) < min(min(y),Y):
  print("No War")
else:
  print("War")
Buggy python submission (verdict: Runtime Error):
k = input()
if k % 2 == 0:
  print(k*k/4)
else:
  print((k//2)*((k//2)+1))

Fixed submission:
k = int(input())
 
if k%2 == 0:
  print((k//2)**2)
else:
  print((k//2)*((k//2)+1))
Buggy python submission (verdict: Runtime Error):
n,i = map(int(),input().split())
print(n-i+1)

Fixed submission:
n,i = map(int,input().split())
print(n-i+1)
Buggy python submission (verdict: Runtime Error):
import numpy as np
h,w = map(int,input().split())
a = [input() for i in range(h)]
d = "."
c = 0

for i in range(h):
  if len(set(a[i])) == 1 and a[i][0] == d:
    a.remove(a[i])

at = np.array(a)
tr = at.T

for i in range(w):
  if len(set(tr[i])) == 1 and tr[i][0] == d:
    a.remove(tr[i])
    
att = np.array(tr)
trr = att.T

for j in range(len(trr)):
  print("".join(trr[j]))


Fixed submission:
import numpy as np

h,w = map(int,input().split())
a = [list(input()) for i in range(h)]
ans1 = []
ans2 = []

for i in a:
  if '#' in i:
    ans1.append(i)
    
gyouretu = np.array(ans1)
gyouretuT = gyouretu.T

for i in gyouretuT:
  if '#' in i:
    ans2.append(i)
    
ans = np.array(ans2)
answer = ans.T

for i in answer:
  print(''.join(i))
Buggy python submission (verdict: Runtime Error):
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(s[0])
elif s[0] == '1' and s[:k] == ['1']*k and len(s) != 1:
  print(s[1])
elif s[0] == '1' and s[1] != '1':
  print(s[1])
elif s[0]!='1':
  print(s[0])

Fixed submission:
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(1)
  exit()
elif s[0] != '1':
  print(s[0])
  exit()

if k > 100:
  for i in s:
    if i != '1':
      print(i)
      exit()
  print(1)
  
else:
  for i in s[:k]:
    if i != '1':
      print(i)
      exit()
  print(1)
  exit()

Buggy python submission (verdict: Runtime Error):
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(s[0])
if s[0] == '1' and s[:k] == ['1']*k and len(s) != 1:
  print(s[1])
elif s[0]!='1':
  print(s[0])

Fixed submission:
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(1)
  exit()
elif s[0] != '1':
  print(s[0])
  exit()

if k > 100:
  for i in s:
    if i != '1':
      print(i)
      exit()
  print(1)
  
else:
  for i in s[:k]:
    if i != '1':
      print(i)
      exit()
  print(1)
  exit()

Buggy python submission (verdict: Runtime Error):
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(s[0])
if s[0] == '1' and s[:k] == ['1']*k:
  print(s[1])
elif s[0]!='1':
  print(s[0])

Fixed submission:
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(1)
  exit()
elif s[0] != '1':
  print(s[0])
  exit()

if k > 100:
  for i in s:
    if i != '1':
      print(i)
      exit()
  print(1)
  
else:
  for i in s[:k]:
    if i != '1':
      print(i)
      exit()
  print(1)
  exit()

Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

if s[0] == '1':
  print(s[1])
else:
  print(s[0])

Fixed submission:
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(1)
  exit()
elif s[0] != '1':
  print(s[0])
  exit()

if k > 100:
  for i in s:
    if i != '1':
      print(i)
      exit()
  print(1)
  
else:
  for i in s[:k]:
    if i != '1':
      print(i)
      exit()
  print(1)
  exit()

Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
sumtmp = 0

for i in s:
  sumlen += int(i)**(5 * (10)**15)
  if sumtmp >= k:
    print(i)

Fixed submission:
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(1)
  exit()
elif s[0] != '1':
  print(s[0])
  exit()

if k > 100:
  for i in s:
    if i != '1':
      print(i)
      exit()
  print(1)
  
else:
  for i in s[:k]:
    if i != '1':
      print(i)
      exit()
  print(1)
  exit()
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n%k ==0:
  print(0)
elif n < k:
  print((1)
else:
  print((n//k) - 1)

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

Fixed submission:
a = sorted(list(map(int,input().split())))
print(a[2] - a[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
  a.append(int(input())-1)
  
print(sum(a))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
print(sum(a)-n)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 == 0:
  print(N)
else:
  print(2N)

Fixed submission:
N = int(input())
if N%2 == 0:
  print(N)
else:
  print(2*N)