Buggy python submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split(' ')))
ab = ''

for i in range(n):
    ab = ab + ('a' * a) + ('b' * b)
    if len(ab) == 0:
        break

print(ab[:n].count('a'))


Fixed submission:
n, a, b = list(map(int, input().split(' ')))
blueBall = 0
answer = []

if a == 0:
    print(a)
else:
    if n / (a + b):
        answer = divmod(n, (a + b))
        blueBall = answer[0] * a
        if answer[1] > a:
            blueBall = blueBall + a
        else:
            blueBall = blueBall + answer[1]

        print(blueBall)
    else:
        if n <= a:
            print(n)
        elif n <= b:
            print(a)

Buggy python submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split(' ')))
ab = ''

while len(ab) <= n:
    ab = ab + ('a' * a) + ('b' * b)
    if len(ab) == 0:
        break

print(ab[:n].count('a'))


Fixed submission:
n, a, b = list(map(int, input().split(' ')))
blueBall = 0
answer = []

if a == 0:
    print(a)
else:
    if n / (a + b):
        answer = divmod(n, (a + b))
        blueBall = answer[0] * a
        if answer[1] > a:
            blueBall = blueBall + a
        else:
            blueBall = blueBall + answer[1]

        print(blueBall)
    else:
        if n <= a:
            print(n)
        elif n <= b:
            print(a)

Buggy python submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split(' ')))
ab = ''

while len(ab) < n:
    ab = ab + ('a' * a) + ('b' * b)
    if len(ab) == 0:
        break

print(ab[:n].count('a'))


Fixed submission:
n, a, b = list(map(int, input().split(' ')))
blueBall = 0
answer = []

if a == 0:
    print(a)
else:
    if n / (a + b):
        answer = divmod(n, (a + b))
        blueBall = answer[0] * a
        if answer[1] > a:
            blueBall = blueBall + a
        else:
            blueBall = blueBall + answer[1]

        print(blueBall)
    else:
        if n <= a:
            print(n)
        elif n <= b:
            print(a)

Buggy python submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split(' ')))
ab = ''

while len(ab) < n and a + b != 0:
    ab = ab + ('a' * a) + ('b' * b)

print(ab[:n].count('a'))


Fixed submission:
n, a, b = list(map(int, input().split(' ')))
blueBall = 0
answer = []

if a == 0:
    print(a)
else:
    if n / (a + b):
        answer = divmod(n, (a + b))
        blueBall = answer[0] * a
        if answer[1] > a:
            blueBall = blueBall + a
        else:
            blueBall = blueBall + answer[1]

        print(blueBall)
    else:
        if n <= a:
            print(n)
        elif n <= b:
            print(a)

Buggy python submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split(' ')))
ab = ''

while len(ab) < n and a + b != 0 :
    ab = ab + ('a' * a) + ('b' * b)

print(ab[:n].count('a'))


Fixed submission:
n, a, b = list(map(int, input().split(' ')))
blueBall = 0
answer = []

if a == 0:
    print(a)
else:
    if n / (a + b):
        answer = divmod(n, (a + b))
        blueBall = answer[0] * a
        if answer[1] > a:
            blueBall = blueBall + a
        else:
            blueBall = blueBall + answer[1]

        print(blueBall)
    else:
        if n <= a:
            print(n)
        elif n <= b:
            print(a)

Buggy python submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split(' ')))
ab = ''

while len(ab) < n:
    ab = ab + ('a' * a) + ('b' * b)

print(ab[:n].count('a'))


Fixed submission:
n, a, b = list(map(int, input().split(' ')))
blueBall = 0
answer = []

if a == 0:
    print(a)
else:
    if n / (a + b):
        answer = divmod(n, (a + b))
        blueBall = answer[0] * a
        if answer[1] > a:
            blueBall = blueBall + a
        else:
            blueBall = blueBall + answer[1]

        print(blueBall)
    else:
        if n <= a:
            print(n)
        elif n <= b:
            print(a)