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

L = []
i = 0
k = 0
j = 0
 
for k in range(10**9):
    for i in range(A):
        L.append('b')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()
        elif A == 0:
            print(A)
            exit()
        elif A == 1:
            print(N // B)
            exit()
    
    for j in range(B):
        L.append('r')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()
        elif B == 0:
            print(N)
            exit()

Fixed submission:
N, A, B = map(int , input().split())
 
L = []
i = 0
k = 0
j = 0
P = N // (A + B)
Q = N % (A + B)

if A > Q:
    print((P * A) + Q)
else:
    print((P * A) + A)

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

L = []
i = 0
k = 0
j = 0
 
for k in range(10**100):
    for i in range(A):
        L.append('b')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()
        elif A == 0:
            print(A)
            exit()
        elif A == 1:
            print(N // B)
            exit()
    
    for j in range(B):
        L.append('r')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()
        elif B == 0:
            print(N)
            exit()

Fixed submission:
N, A, B = map(int , input().split())
 
L = []
i = 0
k = 0
j = 0
P = N // (A + B)
Q = N % (A + B)

if A > Q:
    print((P * A) + Q)
else:
    print((P * A) + A)

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

L = []
i = 0
k = 0
j = 0

for k in range(10**18):
    for i in range(A):
        L.append('b')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()
    
    for j in range(B):
        L.append('r')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()

Fixed submission:
N, A, B = map(int , input().split())
 
L = []
i = 0
k = 0
j = 0
P = N // (A + B)
Q = N % (A + B)

if A > Q:
    print((P * A) + Q)
else:
    print((P * A) + A)

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

L = []
i = 0
k = 0
j = 0

for k in range(10**100):
    for i in range(A):
        L.append('b')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()
    
    for j in range(B):
        L.append('r')
        if len(L) >= N:
            L = L[0:N]
            print(L.count('b'))
            exit()

Fixed submission:
N, A, B = map(int , input().split())
 
L = []
i = 0
k = 0
j = 0
P = N // (A + B)
Q = N % (A + B)

if A > Q:
    print((P * A) + Q)
else:
    print((P * A) + A)

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

L = []
i = 0
k = 0
j = 0

for k in range(10**100):
    for i in range(A):
        L.append('b')
        if len(L) >= N:
        L = L[0:N]
        print(L.count('b'))
        break
    
    for j in range(B):
        L.append('r')
    if len(L) >= N:
        L = L[0:N]
        print(L.count('b'))
        break

Fixed submission:
N, A, B = map(int , input().split())
 
L = []
i = 0
k = 0
j = 0
P = N // (A + B)
Q = N % (A + B)

if A > Q:
    print((P * A) + Q)
else:
    print((P * A) + A)

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

L = []
i = 0
k = 0
j = 0

for k in range(10**100):
    for i in range(A):
        L.append('b')
    for j in range(B):
        L.append('r')

    if len(L) >= N:
        L = L[0:N]
        print(L.count('b'))
        break

Fixed submission:
N, A, B = map(int , input().split())
 
L = []
i = 0
k = 0
j = 0
P = N // (A + B)
Q = N % (A + B)

if A > Q:
    print((P * A) + Q)
else:
    print((P * A) + A)