Robbing Balloons composition's problem-set contains $N$ problems.
The cat "Kitty" with her friend, the dog "Lucy" want to participate as a team in the competition.
If Kitty needs $X$ minutes to solve a single problem and Lucy needs $Y$ minutes to do so, what is the minimum time required by their team to solve all problems?
Please note that each one of them has a laptop and can solve the problems separately. If one of them solved a certain problem, no need to solve it again by the other one, as they are a team!
The first and only line contains three integers $N$, $X$ and $Y$ ($1 \le N, X, Y \le 10^9$), the number of problems, the number of minuets Kitty needs to solve a single problem and the number of minuets Lucy needs to solve a single problem.
Print a single integer, the minimum number of minutes Kitty and Lucy team needs to solve all problems.
In the first sample, we have 10 problems. Kitty and Lucy will start to solve the problems when the competition starts. Kitty can solve a problem in each 2 minutes, while Lucy can solve a problem in each 3 minutes. In 12 minutes, Kitty will solve 6 problems and Lucy will solve 4. So, their team can solve 10 problems in 12 minutes and this is the minimum time they need to solve all 10 problems.
Input | Output |
---|---|
10 2 3 Copy
|
12 Copy
|
We have 2 solutions for this problem: