Buggy python submission (verdict: Runtime Error):
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    absum=(a+b)*s
    m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Buggy python submission (verdict: Runtime Error):
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    absum=(a+b)*s
    n=n%(absum)#余り
    if n<a:
        print(s*a+n)
    else:
        print((s+1)*a)

Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Buggy python submission (verdict: Runtime Error):
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    n=n%((a+b)*s)#余り
    if n<a:
        print(s*a+n)
    else:
        print(s*a+a)


Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Buggy python submission (verdict: Runtime Error):
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
aa=0
s=n//(a+b)
n=n%((a+b)*s)#余り
if n<a:
    print(s*a+n)
else:
    print(s*a+a)

Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Buggy python submission (verdict: Runtime Error):
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(-1)
    sys.exit()
aa=0
s=n//(a+b)
n=n%((a+b)*s)#余り
if n<a:
    print(s*a+n)
else:
    print(s*a+a)


Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Buggy python submission (verdict: Time Limit Exceeded):
#B
n,a,b=map(int,input().split())
aa=0
for i in range(n//(a+b)+1):
    if n<a:
        aa+=n
        break
    else:
        aa+=a
    n-=a+b
print(aa)

Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
i=0
aa=0
while n>0:
    if n<a:
        aa+=n
        break
    else:
        aa+=a
    n-=a+b
print(aa)

Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

Buggy python submission (verdict: Time Limit Exceeded):
#B
n,a,b=map(int,input().split())
i=0
aa=[]
bb=[]
while n>0:
    if n<a:
        aa.append(n)
        break
    else:
        aa.append(a)
    n-=a
    if n<b:
        bb.append(n)
        break
    else:
        bb.append(b)
    n-=b
print(sum(aa))

Fixed submission:
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)