qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a, b = input().rstrip().split()

if int(a) > 0 and int(a) < 10:
  if int(b) > 0 and int(b) < 10:
    print(int(a)*int(b))
else:
  print(-1)

Fixed code:
a, b = input().rstrip().split()

if int(a) > 0 and int(a) < 10:
  if int(b) > 0 and int(b) < 10:
    print(int(a)*int(b))
  else:
    print('-1')
else:
  print('-1')
Buggy code:
a,b=map(int,input().split())

if 9>=a>=1and9>=b>=1:
  print(a*b)
else:
  print(-1)

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

if 9 >= a >= 1 and 9 >= b >= 1:
  print(a*b)
else:
  print(-1)
Buggy code:
A,B=map(int,input().split())

if 9>=A,B>=1:
  print(A*B)
else:
  print(-1)

Fixed code:
A,B = map(int,input().split())
if A > 9 or B > 9 :
    print(-1)
else :
    print(A*B)
Buggy code:
a = list(map(int,input().split()))

if a[0] < 10 && a[1] < 10:
  print(a[0] * a[1])
else:
  print(-1)

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

if a[0] < 10 and a[1] < 10:
  print(a[0] * a[1])
else:
  print(-1)
Buggy code:
numz = input()
count = 0
numz_pair = numz.split(" ")
numz_pair = list(map(int, numz_pair))

for i in range(len(numz_pair)):
    if numz_pair[i] <= 9:
        count = count + 1
        print("True")
    else:
        print(-1)
        break

if count == len(numz_pair)+1:
    print(numz_pair[0]*numz_pair[1])


Fixed code:
numz = input()
count = 0
numz_pair = numz.split(" ")
numz_pair = list(map(int, numz_pair))

for i in range(len(numz_pair)):
    if numz_pair[i] <= 9:
        count = count + 1
    else:
        print(-1)
        break

if count == len(numz_pair):
    print(numz_pair[0]*numz_pair[1])
Buggy code:
a,b=map(int, input().split())
if (0<a<10　and 0<b<10):
  print(a*b)
else:
  print(-1)

Fixed code:
a,b=map(int, input().split())
if 0<a<10 and 0<b<10:
	print(a*b)
else:
	print('-1')
Buggy code:
A, B = map(int, input().split())
if (1 <= A <= 9) and (1 <= B <= 9):
    print(a * b)
else:
    print(-1)

Fixed code:
A,B = map(int,input().split())
if A<=9 and B<=9:
    print(A*B)
else:
    print(-1)
Buggy code:
a, b = map(int, input().split())
ans = -1 if 0 < a < 10 or 0 < b < 10 else a*b
print(ans)

Fixed code:
a, b = map(int, input().split())
ans = a*b if 0  < a < 10 and 0  < b < 10 else -1
print(ans)
Buggy code:
data = input(split())
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(A * B)
else:
  print('-1')

Fixed code:
data = input().split()
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(str(A * B))
else:
  print('-1')
Buggy code:
A,B = map(int,input().split())
if A > 9 and B > 9:
  print(-1)
else:
  print(A*B)
  

Fixed code:
A, B = map(int,input().split())
if A>9 or B>9:
  print(-1)
else:
  print(A*B)
Buggy code:
a, b = map(int, input().split())
if a < 10 and b < 10:
  print('a * b')
else:
  print('-1')

Fixed code:
a, b = map(int, input().split())
if a < 10 and b < 10:
  print(a * b)
else:
  print('-1')
Buggy code:
a, b = map(int, (input().split()))
print(a * b if a <= 9 and b <= 9 else -1).

Fixed code:
a, b = map(int, (input().split()))
print(a * b if a <= 9 and b <= 9 else -1)
Buggy code:
A,B = map(int,input().split())
print(A*B) if  A <= 9 and B <= 9 else '-1'

Fixed code:
A,B=map(int,input().split())

if A<=9 and B<=9:
    print(A*B)
else:
    print(-1)
Buggy code:
i = list(map(int, input().split()))

if i[0] >= 10 or i[0] >= 10:
    ans = -1
else:
    ans = i[0] * i[1]

print(ans)

Fixed code:
i = list(map(int, input().split()))

if i[0] >= 10 or i[1] >= 10:
    ans = -1
else:
    ans = i[0] * i[1]

print(ans)
Buggy code:
a,b=map(int,input())
if max(a,b)<=9 and min(a,b)>=1:
    print(a*b)
else:print(-1)
    

Fixed code:
a,b=map(int,input().split())
if max(a,b)<=9 and min(a,b)>=1:
    print(a*b)
else:print(-1)
Buggy code:
a, b = map(int, input().split())

if a <= 10 or b <= 10:
    print(-1)
    exit()
print(a * b)


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

if a >= 10 or b >= 10:
    print(-1)
    exit()
print(a * b)
Buggy code:
a.b=map(int,input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)

Fixed code:
a, b = map(int, input().split())
if(a > 9 or b > 9):print(-1)
else:print(a*b)
Buggy code:
A, B = map(input().split())
if A<10 and B<10:
  print(A*B)
else:
  print(-1)

Fixed code:
A, B = map(int, input().split())
if A<10 and B<10:
  print(A*B)
else:
  print(-1)
Buggy code:
a, b = map(int, input())
if a > 9 or b > 9:
  print("-1")
else:
  print(a * b)

Fixed code:
a, b = map(int, input().split())
if a > 9 or b > 9:
  print("-1")
else:
  print(a * b)
Buggy code:
A,B = list(map(int,inpput().split()))
if A > 9 or B > 9:
  print('-1')
  exit()
print(A*B)

Fixed code:
A,B = list(map(int,input().split()))
if A > 9 or B > 9:
  print('-1')
  exit()
print(A*B)
Buggy code:
a,b=map(int,input().split())
if (1,1) <= (a,b) <= (9,9):
	print(a*b)
else:
	print('-1')

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

if a>=1 and a <= 9 and b>=1 and b<=9:
  print(a*b)
else:
  print("-1")
Buggy code:
a,b=map(int(input().split()))

print(a*b if 1<=a<=9 and 1<=b<=9 else -1)

Fixed code:
a,b = list(map(int,input().split()))
print(a*b if 1<=a<=9 and 1<=b<=9 else -1)
Buggy code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    A,B=mis
    print(A*b if 0<A<10 and 0<B<10 else '-1')


if __name__ == "__main__":
    main()

Fixed code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    A,B=mis()
    print(A*B if 0<A<10 and 0<B<10 else '-1')


if __name__ == "__main__":
    main()
Buggy code:
data=input().split()
ans=1
count=0

for i in data:
  if int(i)<=9:
    ans*=int(i)
  if int(i)>9:
    count+=1
    
if count>=1:
  print("-1")
elif cuont==0:
  print(ans)

Fixed code:
data=input().split()

ans=1
count=0
 
for i in data:
  if int(i)<=9:
    ans*=int(i)
  if int(i)>9:
    count+=1
    
if count>=1:
  print("-1")
elif count==0:
  print(ans)
Buggy code:
a,b = map(int, input().split())
if a<=9 & b<=9:
    print(a*b)
else:
    print(-1)

Fixed code:
a,b = map(int, input().split())
if a<=9 and b<=9:
    print(a*b)
else:
    print(-1)
Buggy code:
a, b = map(int, input())
if a >= 10 or a >= 10:
    print(a * b)

else:
    print(-1)

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

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a * b)
Buggy code:
a, b = map(int, input().split())
 
if a<=9 and b<=9:
  print(a*b)
  else:
    print(-1)

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

if max(a, b) <= 9:
  print(a * b)
else:
  print(-1)
Buggy code:
a, b = list(map(int, input().split()))

if a<=9 and b<=9:
  print(a*b)
  else:
    print(-1)
    

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

if  a >= 1 and a <= 9 and b >= 1 and b <= 9  :
   print(a*b)
else:
     print(-1)
Buggy code:

number = input().split(" ")
    


if int(number[0]) <= 9 & int(number[1]) <= 9:
    print(int(number[0]) * int(number[1]))
else:
    print(-1)

Fixed code:

number = input().split(" ")

if (int(number[0]) <= 9) & (int(number[1]) <= 9):
    print(int(number[0]) * int(number[1]))
else:
    print(-1)
Buggy code:
a, b = map (int, input().split())

if a < 10 and b < 10
  print (a*b)

else:
  print (-1)

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

if a < 10 and b < 10:
  print (a*b)

else:
  print (-1)
Buggy code:
A, B = input().split
A = int(A)
B = int(B)

if(A > 10 or B > 10):
  print(-1)
else:
  print(A*B)

Fixed code:
A, B = input().split()
A = int(A)
B = int(B)
 
if(A > 9 or B > 9):
  print(-1)
else:
  print(A*B)
Buggy code:
nums = [int(e) for e in input().split()]

if nums[0] <= 9 & nums[1] <= 9:
  print(nums[0]*nums[1])
else:
  print(-1)

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

if (nums[0] <= 9) & (nums[1] <= 9):
  print(nums[0]*nums[1])
else:
  print(-1)
Buggy code:
string=input

string=string.split(' ')
A= int(A[0])
B= int(A[1])

if A>9 or b>9:
    print(-1)
    else:
        print(A*B)



Fixed code:

string=input()
string=string.split(' ')
A= int(string[0])
B= int(string[1])

if A>9 or B>9:
    print(-1)
else:
        print(A*B)
Buggy code:
A,B=int(input().split())
if 1<=A<=9 and 1<=B<=9:
    print(A*B)
else:
    print(-1)

Fixed code:
A,B=map(int,input().split())
if A<=9 and A>=1 and B<=9 and B>=1:
  print(A*B)
else:
  print(-1)
Buggy code:
a, b = map(int, input().split())

if (a > 0 and a <= 9) or (b > 0 and b <=9):
	print(a*b)
else:
	print("-1")

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

if (a > 0 and a <= 9) and (b > 0 and b <=9):
	print(a*b)
else:
	print("-1")
Buggy code:
a, b = map(int, input().split())
if a<=9 and b<=:
    print(a*b)
else:
    print("-1")

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

if a < 10 and b < 10:
    print(a * b)
else:
    print('-1')
Buggy code:
def main():
	# a,b,k = map(int,input().split())
	n,k = map(int,input().split())
	# s = int(input())
	# a = list(map(int,input().split()))
	# rsp = list(str(input()))
	# l = [list(map(int, input().split())) for _ in range(n-1)]
	# s = list(s)

	if n < 10 or k < 10:
		print(int(n*k))	
 	else:
 		print(-1)

 
if __name__ == '__main__':
	main()

Fixed code:
def main():
	# a,b,k = map(int,input().split())
	n,k = map(int,input().split())
	# s = int(input())
	# a = list(map(int,input().split()))
	# rsp = list(str(input()))
	# l = [list(map(int, input().split())) for _ in range(n-1)]
	# s = list(s)
 
	if n < 10 and k < 10:
		print(int(n*k))
	else:
 		print(-1)
 
 
if __name__ == '__main__':
	main()
Buggy code:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
if a<10:
  if b<10:
    print(a*b)
    else:
      print(-1)
  else:
    print(-1)
     


Fixed code:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
if a<10 and b<10:
  print(a*b)
else:
  print(0-1)
Buggy code:
a, b = map(int, input().split())

if 1 <= a and a <= 9 and <= b and b <= 9:
  print(a*b)
else:
  print(-1

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

if 1 <= a and a <= 9 and 1<= b and b <= 9:
  print(a*b)
else:
  print(-1)
Buggy code:
a,b = map(int,input().split())
if a <= 9 and b < = 9:
    print(a*b)
else:
    print(-1)

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

if 1<= a <=9 and 1<= b <= 9:
    print(a*b)
else:
    print(-1)
Buggy code:
A, B) = map(int, input().split(' '))
if A < 10 and B < 10:
    print(A * B)
else:
    print('-1')


Fixed code:
(A, B) = map(int, input().split(' '))
if A < 10 and B < 10:
    print(str(A * B))
else:
    print('-1')
Buggy code:
x,y = map(int,input().split())
import sys

if x>10 or y>10:
    print(-1)
else:
    print(x*y)

Fixed code:
x,y = map(int,input().split())
import sys

if x>9 or y>9:
    print(-1)
else:
    print(x*y)
Buggy code:
n=list(map(int,input().split()))
a=[i for i in range(1,10)]
ans=0
if n[0] in a and n[1] in a:
  ans=n[0]*n[1]
else:
  ans=-1
  print(a)
print(ans)

Fixed code:
n=list(map(int,input().split()))
a=[i for i in range(1,10)]
ans=0
if n[0] in a and n[1] in a:
  ans=n[0]*n[1]
else:
  ans=-1
print(ans)
Buggy code:

a,b = list(map(int, input().split()))
  
if(1<=a<=9 & 1<=b<=9):
    print(a*b)

else:
    print(-1)
  
  
  

Fixed code:
a, b = list(map(int, input().split()))
if (1 <= a <= 9 and 1 <= b <= 9):
  print(a * b)
else:
  print(-1)
Buggy code:
a, b = map(int, input())

print(a*b if 1 <= a <= 9 and 1 <= b <= 9 else '-1')

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

print(a*b if (1 <= a <= 9 and 1 <= b <= 9) else '-1')
Buggy code:
ab = input()
a, b = ab.split(" ")
A = int(a)
B = int(b)

if "0" in a or "0" in b or a > 9 or b > 9:
    print(-1)
else:
    print(A * B)

Fixed code:
ab = input()
a, b = ab.split(" ")
A = int(a)
B = int(b)

if "0" in a or "0" in b or A > 9 or B > 9:
    print(-1)
else:
    print(A * B)
Buggy code:
a,b = map(int,input().split())

if a>9 and b>9:
  print(-1)
  else
  print(a*b)
  
  

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

if a>9:
  print(-1)

elif b>9:
  print(-1)
  
else:
  print(a*b)
Buggy code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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


if (b > 9 or a > 9):
    print(-1)

print(a*b)


Fixed code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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


if (b > 9 or a > 9):
    print(-1)
else:
    print(a*b)
Buggy code:
a,b = map(int,input().split())
if a<10 nad b<10:
  print(a*b)
else:
  print("-1")

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

if a<10 and b<10:
  print(a*b)
  
else:
  print('-1')
Buggy code:
a , b = list(map(int, input().split()))
if a or b >= 10:
  print("-1")
else:
  print(a*b)

Fixed code:
a , b = list(map(int, input().split()))
if a >= 10 or b >= 10:
  print("-1")
else:
  print(a*b)
Buggy code:
n, m = map(int, input())
 
if n <= 9 and m <= 9:
  print(n * m)
else:
  print(-1)

Fixed code:
n, m = map(int, input().split())
 
if n <= 9 and m <= 9:
  print(n * m)
else:
  print(-1)
Buggy code:
A, B = map(int,input().split())
if A < 10 & B < 10:
  print(A * B)
else:
  print(-1)

Fixed code:
A, B = map(int,input().split())
if (A < 10) & (B < 10):
  print(A * B)
else:
  print(-1)
Buggy code:
a, b = map(int, input().split())
if a > 10 or b > 10:
 	print (-1)
else:
  	print(a * b)

Fixed code:
a, b = map(int, input().split())
if a > 9 or b > 9:
 	print (-1)
else:
  	print(a * b)
Buggy code:
a,b = map(int, input().split())
if a < 10 and b < 10:
  return a * b
else:
  return -1

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

if a < 10 and b<10:
    print(a*b)
else:
    print(-1)
Buggy code:
A,B = map(int.input().split)

if A > 9 or B > 9:
	print(-1)
else:
	print(A*B)

Fixed code:
A,B = map(int,input().split())

if A > 9 or B > 9:
	print(-1)
else:
	print(A*B)
Buggy code:
a,b = map(int,input().split())
if a<0 or a>10 or b<0 or b>10:
  print(-1)
else:
  print(a*b)

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

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a * b)
Buggy code:
a,b = map(int.input(),split())
if a <= 9 and b <= 9 :
    print(a*b)
else :
    print(-1)

Fixed code:
a,b = map(int,input().split())
if a <= 9 and b <= 9 :
    print(a*b)
else :
    print(-1)
Buggy code:
a, b = list(map(int, input().split()))
if a > 10 and b < 10:
    print(a*b)
else:
    print(-1)


Fixed code:
a, b = list(map(int, input().split()))
if a < 10 and b < 10:
    print(a*b)
else:
    print(-1)
Buggy code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a, b = inpm()
ans = -1
if(a < 10 or b < 10):
    ans = a * b
print(ans)




Fixed code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a, b = inpm()
ans = -1
if(a < 10 and b < 10):
    ans = a * b
print(ans)
Buggy code:
a,b=[i for i in input().split()]
if a<10 and b<10:
    print(a*b)
else:
    print(-1)

Fixed code:
a,b=[int(i) for i in input().split()]
if 0<a<10 and 0<b<10:
    print(a*b)
else:
    print(-1)
Buggy code:
import sys

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

input = sys.stdin.readline
n = int(input())

yaku_list = make_divisors(n)
print(yaku_list)
index = int(len(yaku_list)/2)

result = yaku_list[index-1] - 1 + yaku_list[index] - 1 
print(result)


Fixed code:
import sys

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

input = sys.stdin.readline
n = int(input())

yaku_list = make_divisors(n)
index = int(len(yaku_list)/2)


if len(yaku_list) % 2 == 0:
    result = yaku_list[index-1] - 1 + yaku_list[index] - 1 
else:
    result = yaku_list[index] - 1 + yaku_list[index] - 1 

print(result)
Buggy code:
import math
int_n = int(input())
i = (math.sqrt(int_n))
i = math.floor(i)
while i > 1:
    if int_n % i == 0:
        j = int_n/i
        print((i - 1) + (j -1))
        break
    i = i - 1

Fixed code:
import math
int_n = int(input())
i = (math.sqrt(int_n))
i = math.floor(i)
while i >= 1:
    if int_n % i == 0:
        j = int_n/i
        print(math.floor((i - 1) + (j - 1)))
        break
    i = i - 1
Buggy code:
# C
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
divisors = make_divisors(N)
memo = 0
maX = divisors[0] + divisors[len(divisors) - 1]
for (i, r) in zip(make_divisors, reversed(make_divisors)):
    maX = min(i + r, maX)
    memo = i
    if memo == r:
        break
print(maX)


Fixed code:
# C
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
divisors = make_divisors(N)
memo = 0
maX = divisors[0] + divisors[len(divisors) - 1]
for (i, r) in zip(divisors, reversed(divisors)):
    maX = min(i + r, maX)
    memo = i
    if memo == r:
        break
print(maX - 2)
Buggy code:
import numpy as np
import math

n = int(input())
x = []
for i in range(1,math.ceil(math.sqrt(n))):
    if(n%i == 0):
        x.append(i+n/i-2)
print(min(x))

Fixed code:
import numpy as np
import math

n = int(input())
x = []
for i in range(1,math.floor(math.sqrt(n))+1):
    if(n%i == 0):
        x.append(i+n/i-2-0)
print(round(min(x)))
Buggy code:
#!/usr/bin/env python

def main():
    N = int(input())
    ans = float('inf')
    for i in range(2, 10 ** 6 + 1):
        if N % i == 0:
            tmp = (i-1) + (N // i -1)
            ans = min(ans, tmp)
    print(ans)

if __name__ == '__main__':
    main()

Fixed code:
#!/usr/bin/env python

def main():
    N = int(input())
    ans = N-1
    for i in range(2, 10 ** 6 + 1):
        if N % i == 0:
            tmp = (i-1) + (N // i -1)
            ans = min(ans, tmp)
    print(ans)

if __name__ == '__main__':
    main()
Buggy code:
n=int(input())
import math
a=math.floor(math.sqrt(n))
while a>0:
  if n%a==0:break
  a-=1

print(a+n//a)


Fixed code:
n=int(input())
import math
a=math.floor(math.sqrt(n))
while a>0:
  if n%a==0:break
  a-=1

print(a-2+n//a)
Buggy code:
import math

N = int(input())

ans = 10**13


for i in range(1,10**6+1:
    if N % i == 0:
        j = N / i
        ans = min(ans,j + i - 2)
        
print(int(ans))

Fixed code:
import math

N = int(input())

ans = 10**13


for i in range(1,10**6+1):
    if N % i == 0:
        j = N / i
        ans = min(ans,j + i - 2)
        
print(int(ans))
Buggy code:
n = int(input())

for i in range(1, int(n**(1/2))+2 , 1):
    if n%i == 0:
        j = n//i
i = n//j

print(i, j)
ans = i-1 + j-1
print(ans)

Fixed code:
n = int(input())

for i in range(1, int(n**(1/2))+2 , 1):
    if n%i == 0:
        j = n//i
i = n//j

ans = i-1 + j-1
print(ans)
Buggy code:
N = int(input())
 
mi = 10**10
 
for a in range(int(math.sqrt(N)), N+1, 1):
  N % a == 0:
    b = N//a
    if mi > a+b-2:
      mi = a+b-2
print(mi)

Fixed code:
import math

N = int(input())
 
mi = 10**100

for a in range(1, int(math.sqrt(N))+1, 1):
  if N % a == 0:  
    b = N//a
    if mi > a+b-2:
      mi = a+b -2
print(mi)
Buggy code:
n = int(input())
save = 1
for i in range(2, int(n**(1/2)), -1):
    print(i)
    if n % i == 0:
        save = i
        break
print(int(save+n/save - 2))


Fixed code:
n = int(input())
save = 1
for i in range(int(n**(1/2)), 1, -1):
    if n % i == 0:
        save = i
        break
print(int(save+n/save - 2))
Buggy code:
N = int(input())

# print(N)

ans = N
i = 1
while i < N:
    # print(i)
    
    div, mod = divmod(N, i)
    
    if mod == 0:
        # print(i)
        # print(div)
        # print(mod)
        
        ans = min(ans, ((i - 1) + (div - 1)))
    
    i += 1
    
print(ans)

Fixed code:
N = int(input())

# print(N)

ans = N
i = 1
while i * i <= N:
    # print(i)
    
    div, mod = divmod(N, i)
    
    if mod == 0:
        # print(i)
        # print(div)
        # print(mod)
        
        ans = min(ans, ((i - 1) + (div - 1)))
    
    i += 1
    
print(ans)
Buggy code:
N = int(input())
min = N
max_i = 0
max_j = 0
for i in range(1,N):
    if N % i == 0:
        j = N // i
        if abs(i - j) < min:
            min = abs(i - j)
            max_i = i
            max_j = j

print(max_i + max_j - 2)

Fixed code:
N = int(input())
min = N
max_i = 0
max_j = 0
for i in range(1,1000000):
    if N % i == 0:
        j = N // i
        if abs(i - j) < min:
            min = abs(i - j)
            max_i = i
            max_j = j
for i in range(1000000,N // 1000000 + 1):
    if N % i == 0:
        j = N // i
        if abs(i - j) < min:
            min = abs(i - j)
            max_i = i
            max_j = j

print(max_i + max_j - 2)
Buggy code:
import math
n = int(input())
for i in range(math.floor(math.sqrt(n)), 0, -1):
    if n % i==0:
        print(i + n/i - 2)
        exit()

Fixed code:
import math
n = int(input())
for i in range(math.floor(math.sqrt(n)), 0, -1):
    if n % i==0:
        print(i + n//i - 2)
        exit()
Buggy code:
n = int(input())

res = float('inf')
for x in range(1, int(n**0.5) + 1):
    if n % x == 0:
        res = min(res, x-1 + n/x -1)
print(res)

Fixed code:
n = int(input())

res = float('inf')
for x in range(1, int(n**0.5) + 1):
    if n % x == 0:
        res = min(res, x-1 + n//x -1)
print(res)
Buggy code:
from sys import stdin
import math
N = int(input())

a,b = 0,0
for i in range(1,int(math.sqrt(N))):
    if N % i == 0:
        a = i
        b = N // i
        break
print(a+b-2)

Fixed code:
from sys import stdin
import math
N = int(input())
a,b = 0,0
for i in range(int(math.sqrt(N)),0,-1):
    if N % i == 0:
        a = i
        b = N // a
        break
print(a+b-2)
Buggy code:
N = int(input())
check = []
k = int()
for i in range(int( N ** (1/2) ) + 1 , 2 , -1 ):
    if N % i == 0:
        k = int( N / i )
        check.append(i + k - 2)
        
print(min(check))

Fixed code:
N = int ( input() )
check_list = []
for i in range( 1, int( N**( 1/2 )+1 ) ):
    check = 0
    if N % i == 0:
        check = i + int( N / i ) - 2
        check_list.append(check)

print( min(check_list) )
Buggy code:
import math
 
N = int(input())
 
min_cand = 10**9
 
for i in range(1,(int(math.sqrt(N))+1)):
  if N % i == 0 and min_cand > (i + (N // i)):
    min_cand = (i + (N // i))
    
print(min_cand - 2)

Fixed code:
import math
 
N = int(input())
 
min_cand = 10**12
 
for i in range(1,(int(math.sqrt(N))+1)):
  if N % i == 0 and min_cand > (i + (N // i)):
    min_cand = (i + (N // i))
    
print(min_cand - 2)