409995: GYM103895 E Feed Worm
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
E. Feed Wormtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
After spending years as a nematologist, you've finally acquired yourself a pet worm. Unfortunately, since it's your first pet worm, you're unsure of your ability to maintain its welfare.
Your worm begins with $$$F$$$ fullness. Every day, you feed it, increasing its fullness by $$$A$$$. Every night, it consumes energy, losing $$$B$$$ fullness.
Your worm will finally be happy as soon as it reaches or exceeds $$$1000$$$ fullness.
Given the worm's initial fullness and your feeding regimen, determine how many days it will take before the worm gets full (or that it will never become full).
InputA single line with values $$$0 \leq F \leq 999$$$, $$$1 \leq A, B \leq 100$$$.
OutputThe day on which the worm becomes full, or $$$-1$$$ if this never occurs.
ExamplesInput900 50 25Output
3Input
500 10 10Output
-1