|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||512 MB||1||1||1||100.000%|
Your workplace recently announced a staircase cup with some fabulous prizes to win. The rules of participation are simple: Each day, it is possible to gain one point, and at the end of the month, whoever has the most points wins. In order to get a point for a specific day, you need to first walk n steps (either upwards or downwards) in the staircase — thereafter you must register your achievement in the registration book at the registration desk.
While you would like to participate in the cup (the prizes are quite nice) you also don’t like walking on stairs that much, and would like to know the minimal number of steps you need to walk each day in order to get a point. You also plan to spend most of your day in your office, and you will enter and leave the building through the only entrance on the ground floor. There are no elevators and no underground floors in the building.
One line with three numbers n (1 ≤ n ≤ 1 000), r (0 ≤ r ≤ 1 000) and k (0 ≤ k ≤ 1 000), respectively indicating the number of steps required before you can register, the number of steps from the ground floor to the registration desk, and the number of steps from the ground floor to the floor of your office.
The minimal number of staircase steps needed to participate in the staircase cup each day.
20 10 5