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



answer = n // (a+b) * a + min((n % (a+b)), a)

print(answer)

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

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

print(ans)

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

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

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