Jumping Frogs

5

1 votes
Easy
Problem

Problem Statement

This is a classic problem we all know. Once upon a time a frog unfortunately jumps into a well of height 'h'. It tries to come out of the well. Frog covers 'p' feet up but slips 'q' feet down due to wetness on the wall in it's every jump.

You will be provided with the required inputs. Output the number of jumps that the frog requires to come out of the well.

Input:
Input consists of three space separated integers h, p, q denoting height of the well, feet that frog covers in one jump and feet slipped by the frog in every jump.

Output:
Print the number of jumps required by the frog to come out of the well.
If it never reaches out of the well print -1.


Constraints:
1≤ h ≤ 10^9
0≤ p,q ≤ 10^9

Sample Input1:
24 5 2
Sample Output1:
8

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?