Buggy python submission (verdict: Runtime Error):
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())

n = []
n = make_divisors(N)

cnt = 999999999999999
if len(n) >= 2:
    for i in range(0,len(n),2):
        t = int(n[i])-1 + int(n[i+1])-1
        if cnt > t:
            cnt = t
print(cnt)



Fixed submission:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    #table = list(set(table))
    table = list(table)
    table.sort()
    return table

N = int(input())

#for N in range(1000000000000):
n = []
n = divisor(N)
#print(n)

cnt = 999999999999999
for i in range(0,len(n)//2,1):
    t = int(n[i])-1 + int(n[len(n)-i-1])-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy python submission (verdict: Runtime Error):
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())

n = []
n = make_divisors(N)

cnt = 999999999999999
for i in range(0,len(n),2):
    t = int(n[i])-1 + int(n[i+1])-1
    if cnt > t:
        cnt = t
print(cnt)



Fixed submission:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    #table = list(set(table))
    table = list(table)
    table.sort()
    return table

N = int(input())

#for N in range(1000000000000):
n = []
n = divisor(N)
#print(n)

cnt = 999999999999999
for i in range(0,len(n)//2,1):
    t = int(n[i])-1 + int(n[len(n)-i-1])-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy python submission (verdict: Runtime Error):
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())

n = []
n = make_divisors(N)

cnt = 999999999999999
for i in range(0,len(n),2):
    t = int(n[i])-1 + int(n[i+1])-1
    if cnt > t:
        cnt = t
print(cnt)



Fixed submission:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    #table = list(set(table))
    table = list(table)
    table.sort()
    return table

N = int(input())

#for N in range(1000000000000):
n = []
n = divisor(N)
#print(n)

cnt = 999999999999999
for i in range(0,len(n)//2,1):
    t = int(n[i])-1 + int(n[len(n)-i-1])-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy python submission (verdict: Runtime Error):
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())

n = make_divisors(N)

cnt = 999999999999999
for i in range(0,len(n),2):
    t = n[i]-1 + n[i+1]-1
    if cnt > t:
        cnt = t
print(cnt)



Fixed submission:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    #table = list(set(table))
    table = list(table)
    table.sort()
    return table

N = int(input())

#for N in range(1000000000000):
n = []
n = divisor(N)
#print(n)

cnt = 999999999999999
for i in range(0,len(n)//2,1):
    t = int(n[i])-1 + int(n[len(n)-i-1])-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy python submission (verdict: Runtime Error):
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())

n = make_divisors(N)

cnt = 999999999999
for i in range(0,len(n),2):
    t = n[i]-1 + n[i+1]-1
    if cnt > t:
        cnt = t
print(cnt)



Fixed submission:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    #table = list(set(table))
    table = list(table)
    table.sort()
    return table

N = int(input())

#for N in range(1000000000000):
n = []
n = divisor(N)
#print(n)

cnt = 999999999999999
for i in range(0,len(n)//2,1):
    t = int(n[i])-1 + int(n[len(n)-i-1])-1
    if cnt > t:
        cnt = t
print(cnt)