406361: GYM102388 G Snails

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

Description

G. Snailstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

On Planet E, snails are born in infinitely deep wells!

Initially a snail is at $$$n$$$ meters below the ground. During the daytime the snail try very hard to climb up, and goes up by $$$a$$$ meters. It can escape the well once it touches the ground. However during the night the snail has to sleep and falls back by $$$b$$$ meters. Hence it may happens that an unfortunate snail stucks in the well forever.

Can you help the snails on Planet E to determine the number of days they need to escape the well?

Input

The first line contains a positive integer $$$T$$$ ($$$T \le 10$$$), the number of testcases.

Each testcase contains three integers $$$n, a, b$$$ ($$$1 \le n \le 1000$$$, $$$0 \le a \le 1000$$$, $$$0 \le b \le 1000$$$), the initial position of the snail, the length it climbs up during the daytime, and the length it falls during the night.

Output

For each testcase, output a single line consisting of the number of days the snail need to escape the well. Output "-1" (without quotes) if it is impossible.

ExampleInput
3
10 5 2
10 5 5
5 5 6
Output
3
-1
1

加入题单

上一题 下一题 算法标签: