Vasiliy has a car and he wants to get from home to the post office. The distance which he needs to pass equals to d kilometers.
Vasiliy's car is not new − it breaks after driven every k kilometers and Vasiliy needs t seconds to repair it. After repairing his car Vasiliy can drive again (but after k kilometers it will break again, and so on). In the beginning of the trip the car is just from repair station.
To drive one kilometer on car Vasiliy spends a seconds, to walk one kilometer on foot he needs b seconds (a<b).
Your task is to find minimal time after which Vasiliy will be able to reach the post office. Consider that in every moment of time Vasiliy can left his car and start to go on foot.
Output
Print the minimal time after which Vasiliy will be able to reach the post office.
Note
In the first example Vasiliy needs to drive the first 2 kilometers on the car (in 2 seconds) and then to walk on foot 3 kilometers (in 12 seconds). So the answer equals to 14 seconds.
In the second example Vasiliy needs to drive the first 2 kilometers on the car (in 2 seconds), then repair his car (in 5 seconds) and drive 2 kilometers more on the car (in 2 seconds). After that he needs to walk on foot 1 kilometer (in 4 seconds). So the answer equals to 13 seconds.
瓦西里有一辆车,他想从家里去邮局。他需要经过的距离等于d公里。
瓦西里的车不是新的——每行驶k公里就坏一次,瓦西里需要t秒来修理它。修理完他的车后,瓦西里伊可以再次驾驶(但在行驶k公里后,它会再次坏,依此类推)。在旅程的开始,这辆车刚从修理站出来。
瓦西里开车一公里需要一秒,步行一公里需要b秒(a<b)。
你的任务是找到最短的时间,之后瓦西里就能到达邮局。想想瓦西里在每一个时刻都可以离开他的车,开始步行。