Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(N: int):

    res = 0
    for i in range(1,N):
        a = (N-i) % i 
        b = (N-i) // i 

        if a == 0:
            if b > i:
                res += b
            else:
                break

    print(res)


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys

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

def solve(N: int):
    divisors =  make_divisors(N)
    res = 0
    for i in divisors:
        t = i-1
        if t > 0 and N // t == N % t:
            res += t
    print(res)


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(N: int):

    res = 0
    for i in range(1,N):
        a = (N-i) % i 
        b = (N-i) // i 

        if a == 0:
            if b > i:
                res += b
            else:
                break

    print(res)


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys

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

def solve(N: int):
    divisors =  make_divisors(N)
    res = 0
    for i in divisors:
        t = i-1
        if t > 0 and N // t == N % t:
            res += t
    print(res)


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()