Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())
count=0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i+j+k==S:
                count+=1
print(count)

Fixed submission:
K,S=map(int,input().split())
count=0
for i in range(K+1):
    for j in range(K+1):
        if K>=S-i-j>=0:
            count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(x)for x in input().split()]
B=[]
if N%2==0:
    B= sorted([2*i-1 for i in range(1,N//2+1)]*2)
    if sorted(A)==B:
        ans=(pow(2,N/2))%(10**9+7)
    else:
        ans=0
else:
    B= [0]+sorted([2*i for i in range(1,N//2+1)]*2)
    if sorted(A)==B:
        ans=(pow(2,(N-1)/2))%(10**9+7)
    else:
        ans=0
print(int(ans))

Fixed submission:
A,op,B=input().split()
if op=='-':
    print(int(A)-int(B))
else:
    print(int(A)+int(B))
Buggy python submission (verdict: Time Limit Exceeded):
sa = input()
sb = input()
sc = input()
turn = sa[0]
sa = sa[1:]
while True:
    if turn == 'a':
        if not sa:
            win = 'A'
            break
        else:
            turn = sa[0]
            sa = sa[1:]
    if turn == 'b':
        if not sb:
            win = 'B'
            break
        else:
            turn = sb[0]
            sb = sb[1:]
    if turn == 'c':
        if not sc:
            win = 'C'
            break
        else:
            turn = sc[0]
            sc = sc[1:]

Fixed submission:
a=int(input())
b=int(input())
h=int(input())
ans=(a+b)*h/2
print(int(ans))
Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
D=[]
E=[]
F=[]
s=a
x=len(A)
y=len(B)
z=len(C)
for i in range(len(A)):
    D.append(A[i])
for i in range(len(B)):
    E.append(B[i]) 
for i in range(len(C)):
    F.append(C[i])
while x>=0 and y>=0 and z>=0:
    if s==a:
        if x==0:
            print("A")
            break
        else:
            count=D[0]
            D.pop(0)
            x-=1
    elif s==b:
        if y==0:
            print("B")
            break
        else:
            count=E[0]
            E.pop(0)
            y-=1
    elif s==c:
        if z==0:
            print("C")
            break
        else:
            count=F[0]
            F.pop(0)
            z-=1
 

Fixed submission:
sa = input()
sb = input()
sc = input()
turn = sa[0]
sa = sa[1:]
while True:
    if turn == 'a':
        if not sa:
            win = 'A'
            break
        else:
            turn = sa[0]
            sa = sa[1:]
    if turn == 'b':
        if not sb:
            win = 'B'
            break
        else:
            turn = sb[0]
            sb = sb[1:]
    if turn == 'c':
        if not sc:
            win = 'C'
            break
        else:
            turn = sc[0]
            sc = sc[1:]
print(win)

Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
D=[]
E=[]
F=[]
s=a
x=len(A)
y=len(B)
z=len(C)
for i in range(len(A)):
    D.append(A[i])
for i in range(len(B)):
    E.append(B[i]) 
for i in range(len(C)):
    F.append(C[i])
while x>=0 and y>=0 and z>=0:
    if s==a:
        if x==0:
            print("A")
            break
        else:
            count=D[0]
            D.pop(0)
            x-=1
    elif s==b:
        if y==0:
            print("B")
            break
        else:
            count=E[0]
            E.pop(0)
            y-=1
    else:
        if z==0:
            print("C")
            break
        else:
            count=F[0]
            F.pop(0)
            z-=1
 
    

Fixed submission:
sa = input()
sb = input()
sc = input()
turn = sa[0]
sa = sa[1:]
while True:
    if turn == 'a':
        if not sa:
            win = 'A'
            break
        else:
            turn = sa[0]
            sa = sa[1:]
    if turn == 'b':
        if not sb:
            win = 'B'
            break
        else:
            turn = sb[0]
            sb = sb[1:]
    if turn == 'c':
        if not sc:
            win = 'C'
            break
        else:
            turn = sc[0]
            sc = sc[1:]
print(win)
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if K < A:
    print(K)
elif K =< A+B:
    print(A)
else:
    print(A + (K-A-B)*-1)

Fixed submission:
A, B, C, K = map(int, input().split())
if K < A:
    print(K)
elif K <= A+B:
    print(A)
else:
    print(A + (K-A-B)*-1)

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())

cards = [1]*A + [0]*B + [-1]*C
print(sum(cards[:K]))

Fixed submission:
A, B, C, K = map(int, input().split())
if K < A:
    print(K)
elif K <= A+B:
    print(A)
else:
    print(A + (K-A-B)*-1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))

L = []
R = []
for i, A in enumerate(A_list):
    L.append(i+A)
    R.append(i-A)

ans = 0
for l in L:
    ans += R.count(l)

print(ans)


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

L = []
R = []
for i, A in enumerate(A_list):
    L.append(i+A)
    R.append(i-A)


import collections
r_dict = collections.Counter(R)
ans = 0
for l in L:
    ans += r_dict.get(l, 0)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, N = map(int, input().split())

l = []
if N < B:
    for x in range(N+1):
        l.append(math.floor(A*x/B) - A*math.floor(x/B))
else:
    for x in range(B):
        l.append(math.floor(A*x/B) - A*math.floor(x/B))

print(max(l))
# print(l)


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

x = min(B-1, N)
print(math.floor(A*x/B) - A*math.floor(x/B))

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, N = map(int, input().split())

l = []
if N < B:
    for x in range(N+1):
        l.append(math.floor(A*x/B) - A*math.floor(x/B))
else:
    for x in range(B+1):
        l.append(math.floor(A*x/B) - A*math.floor(x/B))

print(max(l))
# print(l)


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

x = min(B-1, N)
print(math.floor(A*x/B) - A*math.floor(x/B))

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, N = map(int, input().split())

l = []
for x in range(N+1):
    l.append(math.floor(A*x/B) - A*math.floor(x/B))

print(max(l))


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

x = min(B-1, N)
print(math.floor(A*x/B) - A*math.floor(x/B))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
item_list = []
for n in range(N):
    item = str(input())
    if item_list.count(item) == 0:
        item_list.append(item)

print(len(item_list))


Fixed submission:
N = int(input())
item_list = []
for n in range(N):
    item_list.append(str(input()))

#     item = str(input())
#     if item_list.count(item) == 0:
#         item_list.append(item)
#
# print(len(item_list))

item_set = (set(item_list))
print(len(item_set))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N, K = map(int, input().split())

total = 0
for i in range(K, N+2):
    sum_list = []
    for l in list(itertools.combinations(range(N+1), i)):
        sum_list.append(sum(l))
    total += len(set(sum_list))
    # print(total)
    # print("~~~")

print(total)


Fixed submission:
import itertools

N, K = map(int, input().split())
mod = (10 ** 9 + 7)

def calc(i):
    small = i * (i - 1) //2
    large = i * (2 * N - i + 1) // 2
    return large - small + 1

total = 0
for i in range(K, N+2):
    total += calc(i)
    total %= mod

print(total)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

K = int(input())

sum = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            sum += reduce(math.gcd, [a, b, c])

print(sum)


Fixed submission:
import math
from functools import reduce

K = int(input())
sum = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        AB_gcd = math.gcd(a, b)
        for c in range(1, K+1):
            sum += math.gcd(AB_gcd, c)

print(sum)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if(N%9==0):
	print('Yes')
else
	print('No')

Fixed submission:
N=int(input())
if(N%9==0):
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
a = input()

print(a+a**2+a**3)

Fixed submission:
a = int(input())

print(a+a**2+a**3)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
cnt = 0
for x,y in  S,T:
	if x!=y:
		cnt += 1

print(cnt)

Fixed submission:
S = input()
T = input()
slen = len(S)

cnt = 0
for i in  range(0,slen):
	if S[i] !=T[i]:
		cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
T = map(int,imput().split())
cnt = 0
for x,y in  S,T:
	if x!=y:
		cnt += 1

print(cnt)

Fixed submission:
S = input()
T = input()
slen = len(S)

cnt = 0
for i in  range(0,slen):
	if S[i] !=T[i]:
		cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())

price = list(map(int,input(),split()))

price.sort()

for p in range(1,K):
	ans  += price[p]

print(ans)


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

price = list(map(int,input().split()))

price.sort()

ans = sum(price[:K])
print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())

price = list(map(int,input(),split()))

price.sort

for p in range(1,K):
	ans  += price[p]

print(ans)


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

price = list(map(int,input().split()))

price.sort()

ans = sum(price[:K])
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

num = str(stdin.read())

total = 0
for n in num:
  total += int(n)
 
if total % 9 == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
from sys import stdin

num =stdin.read().strip()

lst = [int(n) for n in num]
if sum(lst) % 9 == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
import sys

data = str(sys.stdin().read())

def multiple_nine():
  total = 0
  for num in data:
    total += int(num)
  if total % 9 == 0:
    return "Yes"
  else:
    return "No"

Fixed submission:
from sys import stdin

num =stdin.read().strip()

lst = [int(n) for n in num]
if sum(lst) % 9 == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
a = list(map(int,input().split()))

count = 0
c = collections.Counter(a)
c_value = c.values()
c_key = c.keys()


i = 1
flag = True
count = 0
while flag:
  if i in list(c_key):
    print(c[i])
    if count == n-1:
      flag = False
  else:
    print(0)
    if count == n-1:
      flag = False
  i += 1
  count += 1

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

ans = [0] * n

for i in range(n-1):
  rem = a[i] - 1
  ans[rem] += 1

for i in range(n):
  print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
tot = n
count = 0

while tot > 0:
  tot -= a
  if tot > 0:
    count += a
  else:
    count += a+tot
  tot -= b
print(count)

Fixed submission:
import math
n,a,b = map(int,input().split())
hako = a+b
hako_include = math.floor(n/hako)

nokori = n-hako_include*hako
if nokori >= a:
  print(hako_include*a + a)
else:
  print(hako_include*a + nokori)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = list(map(int,input().split()))

for i in range(k):
  if a >0:
    a -=1
  else:
    b -=1
    
print(str(a) + " " +str(b))



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

newk = k-a
if newk >= 0:
  a = 0
  b = b-newk
  if b <= 0:
    print(str(0) + " " +str(0))
  else:
    print(str(0) + " " + str(b))
else:
  a = a-k
  print(str(a) + " " +str(b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))

res = []
count = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    count += 1
    if i == (n-2):
      res.append(count)
  else:
    res.append(count)
    count = 0

      
print(max(res))

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

res = []
count = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    count += 1
    if i == (n-2):
      res.append(count)
  else:
    if count != 0: 
      res.append(count)
    count = 0

if len(res) == 0:
  print(0)
else:
  print(max(res))

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))

res = []
count = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    count += 1
  else:
    if h[n-2] >= h[n-1]:
      count += 1
    res.append(count)
    count = 0
      
print(max(res))

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

res = []
count = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    count += 1
    if i == (n-2):
      res.append(count)
  else:
    if count != 0: 
      res.append(count)
    count = 0

if len(res) == 0:
  print(0)
else:
  print(max(res))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int,input().split()))

res = []
for i in range(n):
  count = 0
  flag = True
  for j in range(i,n-1):
    if h[j] >= h[j+1]:
      if flag:
      	count += 1
    else:
      flag = False
      break
  res.append(count)
      
print(max(res))

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

res = []
count = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    count += 1
    if i == (n-2):
      res.append(count)
  else:
    if count != 0: 
      res.append(count)
    count = 0

if len(res) == 0:
  print(0)
else:
  print(max(res))
Buggy python submission (verdict: Runtime Error):
s,t = list(input()),list(input())
s.sort()
t.sort(reverse=True)
count = 0
while count < len(s):
  if t[count] > s[count]:
    print("Yes")
    exit()
  else:
    count += 1
print("No")

Fixed submission:
s = list(input())
s.sort()
s = "".join(s)

t = list(input())
t.sort(reverse=True)
t = "".join(t)

if s < t:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s,t = list(input()),list(input())
s.sort()
t.sort(reverse=True)
count = 0
while count < len(s):
  if t[count] > s[0]:
    print("Yes")
    exit()
  else:
    count += 1
print("No")

Fixed submission:
s = list(input())
s.sort()
s = "".join(s)

t = list(input())
t.sort(reverse=True)
t = "".join(t)

if s < t:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())

count1 = 0

for i in range(1,n):
  a = i%2
  b = i/2
  count = 1
  while a ==0:
    a = b%2
    b = b/2
    count += 1
  if count > count1:
    count1 = count
    max_num = i
print(max_num)

Fixed submission:
n = int(input())

count1 = 0

for i in range(1,n+1):
  a = i%2
  b = i/2
  count = 1
  while a ==0:
    a = b%2
    b = b/2
    count += 1
  if count > count1:
    count1 = count
    max_num = i
print(max_num)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())

count = 0
for i in range(k+1):
  for j in range(k+1):
    for l in range(k+1):
      tot = i+j+l
      if s == tot:
        count += 1
print(count)

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

count = 0
for i in range(k+1):
  for j in range(k+1):
    l = s-i-j
    if l>=0 and l<=k:
      count +=1
print(count)

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

count = 0
for i in range(k+1):
  for j in range(k+1):
    for k in range(k+1):
      tot = i+j+k
      if s == tot:
        count += 1
print(count)

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

count = 0
for i in range(k+1):
  for j in range(k+1):
    l = s-i-j
    if l>=0 and l<=k:
      count +=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
A = list(map(int, input().split()))

c = 0
hoge = []

for i in range(len(A)):
  hoge.append(max(A[0:i+1]))

print(sum(hoge)-sum(A))

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

c = 0
mae = A[0]

for i in A:
  if i < mae:
    c += mae - i
  else:
    mae = i

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
N = input()
A = list(map(int, input().split()))

c = 0
for i in range(1, len(A)):
  ki = max(A[0:i])
  if A[i] < ki:
    c += abs(A[i]-ki)

print(c)

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

c = 0
mae = A[0]

for i in A:
  if i < mae:
    c += mae - i
  else:
    mae = i

print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if 7 in n:
  print('Yes')
else:print('No')

Fixed submission:
n = list(input())
if "7" in n:print('Yes')
else:print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
z = range(1, 1+int(input()))
y = 0
for a in z:
  for b in z:
    for c in z:
      y += math.gcd(math.gcd(a,b),c)
print(y)

Fixed submission:
from math import gcd
z = range(1, 1+int(input()))
y = 0
for a in z:
  for b in z:
    for c in z:
      y += gcd(gcd(a,b),c)
print(y)
Buggy python submission (verdict: Runtime Error):
L = int(input())
if L%3 == 0:
  a == L/3
  print(a**3)
elif L%3 == 1:
  b = L/3 + 2/3
  c = (L - b)/2
  print(b*c**2)
else:
  pass

Fixed submission:
L = int(input())
clue = L/3
ans = (L/3)**3
print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
  list_s = [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]
  list_s.sort()
  
  k = int(input())
  
  print(list_s[k+1])
  
main()

Fixed submission:
K = int(input())
k = [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]
print(k[K-1])

Buggy python submission (verdict: Runtime Error):
def main():
  list_s = [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(list_s[k+1])
  
main()

Fixed submission:
K = int(input())
k = [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]
print(k[K-1])
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

a = int(N - B)

pritn(a)

Fixed submission:
N, A, B = map(int, input().split())
ans = N //(A + B)*A
rem = N % (A +B)
ans += min(rem, A)

print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A == B == C and A !==B !== C:
  print('No')
else:
  print('Yes') 

Fixed submission:
A, B, C = map(int, input().split())
if A == B == C:
  print('No')
elif A != B and A != C and B != C:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())
for i in range(K):
  if A >= 1:
    A -= 1
  elif A < 1 and B >= 1:
    B -= 1
  else:
    pass
print(A, B)

Fixed submission:
a, b, k = map(int, input().split())
d = max(0, k-a)
ans_a = max(0, a-k)
ans_b = max(0, b-d)
print(ans_a, ans_b)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())
def func():
  pass
for i in range(K):
  if A >= 1:
    A -= 1
  elif A < 1 and B >= 1:
    B -= 1
  else:
    func()
print(A, B)

Fixed submission:
a, b, k = map(int, input().split())
d = max(0, k-a)
ans_a = max(0, a-k)
ans_b = max(0, b-d)
print(ans_a, ans_b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = {i*j for i in range(1,10) for j in range(1,10)}
if n in ans:
  print("Yes")
else:print("No")

Fixed submission:
a, b = map(int, input().split())
if 1 <= a <=9 and 1 <= b <= 9:print(a*b)
else:print('-1')
Buggy python submission (verdict: Runtime Error):
import math
import itertools as p
l = int(input())
r = int(input())
d = int(input())
count = 0
for i in range(l,r+1):
	if i%d == 0:
		count+=1
print(count)

Fixed submission:
import math
import itertools as p
l,r,d = map(int,input().split())
count = 0
for i in range(l,r+1):
	if i%d == 0:
		count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
x = int(input())
c = [i for i in range(1,x+1)]
l = map(int,input().split())
count = 0
for i,j in zip(c,l):
	if i% 2== 1 and j%2 == 1:
		count+=1a
print(count)

Fixed submission:
x = int(input())
c = [i for i in range(1,x+1)]
l = map(int,input().split())
count = 0
for i,j in zip(c,l):
	if i% 2== 1 and j%2 == 1:
		count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
s = int(input())
print(s[:3].lower())

Fixed submission:
s = input()
print(s[:3].lower())
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from fractions import gcd
def lcm(x,y):return x*y//gcd(x,y)
def lcmm(l):return reduce(lcm,l)
a = int(input())
List=list(map(int,input().split()))
b = lcmm(List)
c = 0
for i in range(a):
  c = c + b // List[i] % 1000000007
print(c%1000000007)

Fixed submission:
from functools import reduce
from fractions import gcd
def lcm(x,y):return x*y//gcd(x,y)
def lcmm(l):return reduce(lcm,l)
a = int(input())
List=list(map(int,input().split()))
b = lcmm(List)
c = 0
for i in range(a):
  c = c + b // List[i]
print(c%1000000007)
Buggy python submission (verdict: Runtime Error):
a,b=input()
print(a*b if a<10 and b<10 else -1)

Fixed submission:
a,b=map(int,input().split())
print(a*b if a<10 and b<10 else -1)
Buggy python submission (verdict: Runtime Error):
a=input()
for i in range(9):
 if a%(9-i)==0 and a/(9-i)<10:
  print("yes")
  break
else:
 print("no")

Fixed submission:
a=int(input())
for i in range(9):
 if a%(9-i)==0 and a/(9-i)<10:
  print("Yes")
  break
else:
 print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
y=int(a ** (1/2))
z=y
while y*z != a:
 if y*z > a:
  z=z-1
 if y*z < a:
  y=y+1
print(y+z-2)

Fixed submission:
import math

a=int(input())
x=(math.ceil(a**(1/2)))
for i in range(x+1):
 if a%(x-i+1)==0:
  print(int(x-i-1+(a/(x-i+1))))
  break
Buggy python submission (verdict: Runtime Error):
import math
a,b,c=map(int,input().split())
if a*a*b/2<c:
 print(90-math.degrees(math.atan(a/(b*2-c/a/a*2))))
else:
 print(math.degrees(math.atan(b/(2*c/a/b))))

Fixed submission:
import math
a,b,c=map(int,input().split())
if b-c/a/a==0:
 print(0)
elif a*a*b/2<c:
 print(90-math.degrees(math.atan(a/(b*2-c/a/a*2))))
else:
 print(math.degrees(math.atan(b/(2*c/a/b))))
Buggy python submission (verdict: Time Limit Exceeded):
nums = [int(e) for e in input().split()]
abcs = [nums[0],nums[0]+nums[1],nums[0]+nums[1]+nums[2]]
max = 0
for k in range(nums[3]):
    if k<abcs[0]:
        max+=1
    elif k<abcs[1]:
        continue
    elif k<abcs[2]:
        max-=1
print(max)


Fixed submission:
nums = [int(e) for e in input().split()]

if nums[0]<nums[3]:
    max=nums[0]
    if nums[0]+nums[1]<nums[3]:
        max -= (nums[3]- (nums[0]+nums[1]))
else:
    max=nums[3]

print(max)