n,a,b=list(map(int,input().split()))

m=n//(a+b)

n-=m*(a+b)

print((m*a+min(a,n)))
n,a,b=list(map(int,input().split()))

ans=a*(n//(a+b))

ans+=min(a,n%(a+b))

print(ans)

n, a, b = list(map(int, input().split()))
m = n // (a + b)
n -= m * (a + b)
print((m * a + min(a, n)))

n, a, b = list(map(int, input().split()))
ans = a * (n // (a + b))
ans += min(a, n % (a + b))
print(ans)

-m = n // (a + b) -n -= m * (a + b) -print((m * a + min(a, n))) +ans = a * (n // (a + b)) +ans += min(a, n % (a + b)) +print(ans)