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

import numpy as np
blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*N)
print(np.count_nonzero(ball[0:N]==1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

import numpy as np
blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*int(N/(A+B)+1))
print(np.count_nonzero(ball[0:N]==1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
blue=[1]*A
red=[-1]*B
ball=(blue+red)*N
X=ball[0:N]
print(X)
print(X.count(1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N,A,B=map(int,input().split())

blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*N)
print(np.count_nonzero(ball[0:N]==1))


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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

import numpy as np
blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*N)
ball=list(ball[0:N])
print(ball.count(1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N,A,B=map(int,input().split())

blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*N)
print(np.count_nonzero(ball[0:N]==1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

import numpy as np
blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*N)
print(np.count_nonzero(ball[0:N]==1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

import numpy as np
blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*N)
print(ball)
print(np.count_nonzero(ball[0:N]==1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

import numpy as np
blue=np.array([1]*A)
red=np.array([-1]*B)

ball=np.concatenate(([blue, red]*N))

print(np.count_nonzero(ball[0:N]==1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

import numpy as np
ball=np.array([])
blue=np.array([1]*A)
red=np.array([-1]*B)
while len(ball)<N:
    ball=np.concatenate([ball, blue, red])
print(np.count_nonzero(ball==1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

ball=[]

while len(ball)<=N:
    for x in range(A):
        ball.append(1)
        if len(ball)>=N:
            break
    for x in range(B):
        ball.append(-1)
        if len(ball)>=N:
            break

print(ball[0:N].count(1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

ball=[]

while len(ball)<=N:
    for x in range(A):
        ball.append(1)
    for x in range(B):
        ball.append(-1)

print(ball[0:N].count(1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)

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

ball=[]

for i in range(N):
    for x in range(A):
        ball.append(1)
    for x in range(B):
        ball.append(-1)

print(ball[0:N].count(1))

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)