403752: GYM101257 D !Hasan

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. !Hasantime limit per test0.25 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Mixed Dimensions Onsite Round will host N contestants this year.

Moath and Saif have been preparing the contest hall, Moath needs X minutes to set up a computer for the contest, while Saif needs Y minutes to set up a computer. Each one of them works separately on one computer at a time.

Hasan is concerned they won't finish setting up the PCs in time, can you help Hasan figure out the minimum time required by Moath and Saif to set up all N PCs for the contest?

Input

The input contains 3 integers, N, X, and Y (1 ≤ N, X, Y ≤ 109), the number of PCs to set up, the amount of minutes Moath needs to set up a computer, and the amount of minutes Saif needs to set up a computer, respectively.

Output

On a single line, print one integer, the minimum number of minutes required by Moath and Saif to set up all the PCs for the contest.

ExamplesInput
5 3 4
Output
9
Input
100 10 1
Output
91

加入题单

算法标签: