P26963 [AtCoder] Kaiden
普及
题目描述

Problem Description

ButCoder Inc. operates a programming contest site called "ButCoder". On this site, users are given an integer value called a rating that represents their skill level, and this value fluctuates with each contest they participate in. The initial rating for new users is $0$, and users whose rating reaches or exceeds $K$ are called Kaiden. Note that the rating can also become negative.

A user named Kojiharu has newly registered on ButCoder. According to predictions, his rating will increase by $A$ every time he participates in a contest on odd-numbered attempts (1st, 3rd, 5th, ...) and decrease by $B$ every time he participates in a contest on even-numbered attempts (2nd, 4th, 6th, ...).

According to this prediction, after how many contests will he first become Kaiden, or will he never become Kaiden?

Input Format

The input is given from the standard input in the following format:

$ K $ $ A $ $ B $

Output Format

If it is predicted that Kojiharu will never become Kaiden, output -1. Otherwise, output the predicted number of contests he will need to participate in to first become Kaiden.

Sample Input and Output

Sample Input #1

4000 2000 500

Sample Output #1

5

Sample Input #2

4000 500 2000

Sample Output #2

-1

Sample Input #3

1000000000000000000 2 1

Sample Output #3

1999999999999999997

Notes/Hints

Constraints

  • $1 \leq K, A, B \leq 10^{18}$
  • All input values are integers.

Sample Explanation 1

It is predicted that Kojiharu's rating will fluctuate as follows with each contest participation: $0$ → $2000$ → $1500$ → $3500$ → $3000$ → $5000$ → ... His rating will reach or exceed $4000$ after his 5th participation.

Sample Explanation 2

It is predicted that Kojiharu's rating will fluctuate as follows with each contest participation: $0$ → $500$ → $-1500$ → $-1000$ → $-3000$ → $-2500$ → ... He will never become Kaiden.

Sample Explanation 3

The input values and the output value may not fit within a 32-bit integer.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4000 2000 500
样例输出
5