Problem:


Score : 100 points

Problem Statement

ButCoder Inc. runs a programming competition site called ButCoder. In this site, a user is given an integer value called rating that represents his/her skill, which changes each time he/she participates in a contest. The initial value of a new user's rating is 0, and a user whose rating reaches K or higher is called Kaiden ("total transmission"). Note that a user's rating may become negative.

Hikuhashi is a new user in ButCoder. It is estimated that, his rating increases by A in each of his odd-numbered contests (first, third, fifth, ...), and decreases by B in each of his even-numbered contests (second, fourth, sixth, ...).

According to this estimate, after how many contests will he become Kaiden for the first time, or will he never become Kaiden?

Constraints

1 ≤ K, A, B ≤ 10^{18}

All input values are integers.

Input

Input is given from Standard Input in the following format:

K A B

Output

If it is estimated that Hikuhashi will never become Kaiden, print -1. Otherwise, print the estimated number of contests before he become Kaiden for the first time.

Sample Input 1

4000 2000 500

Sample Output 1

5

Each time Hikuhashi participates in a contest, his rating is estimated to change as 0 → 2000 → 1500 → 3500 → 3000 → 5000 → … After his fifth contest, his rating will reach 4000 or higher for the first time.

Sample Input 2

4000 500 2000

Sample Output 2

-1

Each time Hikuhashi participates in a contest, his rating is estimated to change as 0 → 500 → -1500 → -1000 → -3000 → -2500 → … He will never become Kaiden.

Sample Input 3

1000000000000000000 2 1

Sample Output 3

1999999999999999997

The input and output values may not fit into 32-bit integers.



Sample input:
4000 2000 500


Sample output:
5

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, input().split())
if a < b:
  print(-1)
elif a == b:
  if k <= a:
    print(1)
  else:
    print(-1)
else:
  cnt = 1
  k -= a
  d = a - b
  if k % d == 0:
    cnt += 2*(k // d)
  else:
    cnt += 2*((k // d) + 1)
  print(cnt)

Submission status: Wrong Answer

Solution code:
import math
K,A,B=map(int,input().split())
if A>=K:
  print(1)
elif A-B>0:
  print(1+math.ceil((K-A)/(A-B))*2)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
K,A,B = map(int,input().split())
if K<=A:
  print(1)
else:
  if A<=B:
    print(-1)
  else:
    S = (K-A)/(A-B)
    print(2*S+1)

Submission status: Wrong Answer

Solution code:
K,A,B = map(int,input().split())
if K<=A:
  print(1)
else:
  if A<=B:
    print(-1)
  else:
    S = (K-A)//(A-B)
    print(2*S+1)

Submission status: Wrong Answer

Solution code:
k,a,b = map(int, input().split())
inc_two = a - b
if inc_two > 0:
    k -= a
    print(1 +2*(k + inc_two - 1) // inc_two)
else:
    if a >= k:
        print(1)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil
k,a,b=map(int,input().split())
if a-b<0 or (a-b==0 and a<k):
  print(-1)
  exit()
if a>=k:
  print(1)
  exit()
if (k-a)%(a-b)==0:
  print(1+2*(k-a)//(a-b))
else:
  print(1+2*(1+(k-a)//(a-b)))

Submission status: Wrong Answer

Solution code:
from math import ceil
k,a,b=map(int,input().split())
if a-b<0 or (a-b==0 and a<k):
  print(-1)
  exit()
if a-b==0 and a>=k:
  print(1)
  exit()
if (k-a)%(a-b)==0:
  print(1+2*(k-a)//(a-b))
else:
  print(1+2*(1+(k-a)//(a-b)))

Submission status: Wrong Answer

Solution code:
from math import ceil
k,a,b=map(int,input().split())
if a-b<0 or (a-b==0 and a<k):
  print(-1)
  exit()
if a-b==0 and a>=k:
  print(1)
  exit()
print(1+2*ceil((k-a)/(a-b)))

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split())
if a-b<0 or (a-b==0 and a<k):
  print(-1)
  exit()
if a-b==0 and a>=k:
  print(1)
  exit()
print(1+(2*(k-a))//(a-b))

Submission status: Wrong Answer

Solution code:
import math
k, a, b = map(int, input().split())

if a <= b:
    if a < k:
        print(-1)
    else:
        print(1)
else:
    if a > k:
        print(1)
    else:
        answer = math.ceil((k - a) / (a - b)) * 2 + 1
        print(answer)

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, input().split())

if a <= b:
    if a < k:
        print(-1)
    else:
        print(1)
else:
    if a > k:
        print(1)
    else:
        answer = ((k - a) // (a - b)) * 2 + 1
        print(answer)

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, input().split())
if a >= k:
  print(1)
else:
  if a <= b:
    print(-1)
  else:
    r = (k-a) // (a-b)
    print(2*r+1)

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, input().split())
if a < b:
  print(-1)
elif a == b:
  if k <= a:
    print(1)
  else:
    print(-1)
else:
  if k <= a:
    print(1)
  else: 
    r = -(-(k-a) // (a-b))
    print(2*r+1)

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
l = -1
r = 10**18+1
while r - l > 1 :
	c = (r + l) // 2
	sum = (a - b) * c + a
	if sum >= x : r = c
	else : l = c
if x > a and r == 10**18+1 : print(-1)
else : print(2 * r + 1)

Submission status: Wrong Answer

Solution code:
x,a,b = map(int,input().split())
l = -1
r = 10**18+1
while r - l > 1 :
	c = (r + l) // 2
	sum = (a - b) * c + a
	if sum >= x : r = c
	else : l = c
if r == 10**18+1 : print(-1)
else : print(2 * r + 1)

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split())
ans=0
k-=a
if a-b<=0:
  print(-1)
elif k<=0:
  print(1)
else:
  print(2*((k-1)//(a-b)+1)+1)

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split())
ans=0
k-=a
if a-b<=0:
  print(-1)
elif k<=0:
  print(1)
else:
  print((k-1)//(a-b)+2)

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, input().split())

if a <= b:
    if a < k:
        print(-1)
    elif a == b:
        print(-1)
    else:
        print(1)
else:
    if a > k:
        print(1)
    else:
        diff = a - b
        print(2 * ((k - a) // diff) + 1)

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, input().split())

if a <= b:
    if a < k:
        print(-1)
    else:
        print(1)
else:
    if a > k:
        print(1)
    else:
        diff = a - b
        print(2 * ((k - a) // diff) + 1)

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split())
z=a-b
if z<=0 and a<k:
    print(-1)
    exit()
elif z<=0:
    print(1)
    exit()
print(-(a-k)//z*2+1)

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split())
z=a-b
if z<=0 and a<k:
    print(-1)
    exit()
elif z<=0:
    print(1)
    exit()
print(-(k-a)//z*2+1)

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())
    if B >= A: return -1
    if K <= A: return 1

    d = A-B
    K -= A
    if(K % d == 0): return 2 * (K//d) + 1
    return (K // d + 1) * 2 + 1

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())
    if B >= A: return -1

    d = A-B
    K -= A
    if(K % d == 0): return 2 * (K//d) + 1
    return (K // d + 1) * 2 + 1

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007



k, a, b = LI()
if k < a:
    print(0)
else:
    if b >= a:
        print(-1)
    else:
        print(1 + ((k - a - 1) // (a - b) + 1) * 2)

Submission status: Wrong Answer

Solution code:
k,a,b = map(int, input().split())
if b >= a:
  print(-1)
elif k <= a:
  print(1)
else:
  print(((k-a-1)//(a-b)+1)*2+1)

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())
    if K <= A:
        print(1)
    if A <= B:
        print(-1)
        return
    ans = max(0, -(-(K-A)//(A-B))) * 2 + 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())
    if A <= B:
        print(-1)
        return
    ans = max(0, -(-(K-A)//(A-B))) * 2 + 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

g,a,b=map(int,input().split())
if g<=a:
  print(1)
else:
  if a<=b:
    print(-1)
  else:
    print(2*math.ceil((g-a)/(a-b))+1)

Submission status: Wrong Answer

Solution code:
import math

g,a,b=map(int,input().split())
if g<=a:
  print(1)
else:
  if a<=b:
    print(-1)
  else:
    print(2*math.ceil((g-a)//(a-b))+1)

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split());print(1+2*((k-b-1)//(a-b)+1)if a-b>0 else(1 if k<=a else -1))

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split());print(1+2*((k-b-1)//(a-b)+1)if a-b>0 else(1 if k>=a else -1))

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split());print(1+2*((k-a-1)//(a-b)+1)if a-b>0 else(1 if k>=a else 0))

Submission status: Wrong Answer

Solution code:
k,a,b=map(int,input().split());print((-1 if k<a else 1)if a<=b else 2*((k-1)//(a-b))+1)

Submission status: Wrong Answer

Solution code:
K,A,B = map(int,input().split())
if A <= B:
  print(-1)
else:
  n = (K-A)//(A-B)
  if n <= 0:
    print(1)
  else:
    if (A-B)*n+A >= K:
      print(2*n+1)
    elif (A-B)*(n+1)+A >= K:
      print(2*n+3)
    else:
      print(2*n+5)

Submission status: Wrong Answer

Solution code:
K,A,B = map(int,input().split())
if A <= B:
  print(-1)
else:
  n = (K-A)//(A-B)
  if n <= 0:
    print(1)
  else:
    if (A-B)*n+A >= K:
      print(2*n+1)
    else:
      print(2*n+3)

Submission status: Wrong Answer

Solution code:
p,a,b = map(int,input().split())
if(a<=b):
  print(-1)
else:
  p-=a
  up=a-b
  if(p<=0):
    print(1)
  else:
  	num=p//up+(p%up!=0)
  	print(num*2+1)

Submission status: Wrong Answer

Solution code:
p,a,b = map(int,input().split())
if(a<=b):
  print(-1)
else:
  p-=a
  up=a-b
  num=p//up+(p%up!=0)
  print(num*2+1)

Submission status: Wrong Answer

Solution code:
p,a,b = map(int,input().split())
if(a<=b):
  print(-1)
else:
  p-=a
  up=a-b
  num=int(p/up+0.5)
  print(num*2+1)

Submission status: Wrong Answer

Solution code:
p,a,b = map(int,input().split())
if(a<=b):
  print(-1)
else:
  p-=a
  up=a-b
  num=int(p/up+0.5)
  print(num+1)

Submission status: Wrong Answer

Solution code:
s =input().split()
a=0
b=0
if int(s[1])<int(s[2]) :
    print(-1)
else :
    while a<int(s[0]) :
        b+=2
        a+=int(s[1])-int(s[2])
        if a>int(s[0]) :
            print(b)
            break

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, raw_input().split())
if k <= a or a <= b:
    print [1, -1][a <= b]
else:
    print (k - b - 1) / (a - b) * 2 + 1

Submission status: Wrong Answer

Solution code:
from math import ceil
k,a,b=map(int,input().split())
k-=a
if k<=0:
  print(1)
elif a>b:
  print(1+k//(a-b)*2)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil
k,a,b=map(int,input().split())
k-=a
if k<=0:
  print(1)
elif a>b:
  print(1+ceil(k/(a-b))*2)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil
k,a,b=map(int,input().split())
k-=a
if k<=0:
  print(1)
elif a>b:
  print(1+ceil(k/(a-b)))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

k = int(arr_data[0][0])
a = int(arr_data[0][1])
b = int(arr_data[0][2])

print(k, a, b)

rate = 0

chkflg = True

cnt = 0

while rate < k:
    
    if chkflg:
        
        rate += a
        chkflg = False
        cnt += 1
    else:
        
        if a < b:
            
            cnt = -1
            break
            
        else:

            rate -= b
            chkflg = True

            cnt += 1

#    print(rate)
        
print(cnt)

Submission status: Wrong Answer

Solution code:
k,a,b = (int(i) for i in input().split())
num = k-a
if num<0: print(1)
elif a<=b: print(-1)
else: print(((num-num%(a-b))//(a-b))*2+2*(min(1,num%(a-b)))+1)

Submission status: Wrong Answer

Solution code:
k, a, b = map(int, input().split())
if a < k and b >= a:
  print('-1')
elif a >= k:
  print('1')
else:
  ans = k // (a - b) * 2 - 2
  while ans // 2 * a - ans // 2 * b + b < k:
    ans += 2
  print(ans - 1)

Submission status: Wrong Answer

Solution code:
K,A,B=map(int,input().split())
if A <= B:
    print(-1)
else:
    ans=(K-A)//(A-B)

    if (K-A)%(A-B)==0:
        ans *= 2
        ans += 1
    else:
        ans *= 2
        ans += 3
    print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil


def solve(k, a, b):
    if k <= a:
        return 1
    if a <= b:
        return -1
    return ceil((k - a) / (a - b)) * 2 + 1


print(solve(*map(int, input().split())))

Submission status: Wrong Answer

Solution code:
from math import ceil


def solve(k, a, b):
    if k <= a:
        return 1
    if a <= b:
        return -1
    return ceil((k - a) // (a - b)) * 2 + 1


print(solve(*map(int, input().split())))

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
import math
k,a,b = map(int, input().split())
if a >= k:
    print(1)
else:
    if a <= b:
        print(-1)
    else:
        print((2*math.ceil((k-a)/(a-b)))+1)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
import math
k,a,b = map(int, input().split())
if a >= k:
    print(1)
else:
    if a <= b:
        print(-1)
    else:
        print((2*math.floor((k-a)/(a-b)))+1)

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))
 
if (A >= K):
    print('1')
    sys.exit()
elif (A - B) <= 0:
    print('-1')
    sys.exit()
d = A-B
p = K-A
q = int(p/d)
if ((p % d) != 0):
    q += 1
print(str(2*q + 1))

Submission status: Wrong Answer

Solution code:
K, A, B = map(int, input().split())
if A <= B :
   print ('-1')
elif K <= A:
   print ('1')
else :
   delta = A - B
   ans = (K - A + delta - 1) // delta * 2 + 1
   print ('%ld' % ans)

Submission status: Wrong Answer

Solution code:
K, A, B = map(int, input().split())
if A <= B :
   print ('-1')
elif K < A:
   print ('1')
else :
   delta = A - B
   ans = (K - A + delta - 1) // delta * 2 + 1
   print ('%ld' % ans)

Submission status: Wrong Answer

Solution code:
K, A, B = map(int, input().split())
if A <= B :
   print ('-1')
elif K < B:
   print ('1')
else :
   delta = A - B
   ans = (K - A + delta - 1) // delta * 2 + 1
   print ('%ld' % ans)

Submission status: Wrong Answer

Solution code:
K, A, B = map(int, input().split())
if A <= B :
   print ('-1')
elif K < B:
   print ('1')
else :
   delta = A - B
   ans = (K - A) // delta * 2 + 1
   print ('%ld' % ans)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *

numbers = [int(i) for i in input().split()]

diff = numbers[1] - numbers[2]

if diff <= 0:
    print("-1")
elif numbers[0] <= numbers[1]:
    print("1")
else:
    rating = 0
    count = 0
    print(math.ceil(Decimal(numbers[0] - numbers[1]) / diff) * 2 + 1)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *

numbers = [int(i) for i in input().split()]

max_number = math.pow(10,18)

diff = numbers[1] - numbers[2]

if numbers[0] > diff * max_number:
    print("-1")
elif numbers[0] <= numbers[1]:
    print("1")
else:
    rating = 0
    count = 0
    print(math.ceil(Decimal(numbers[0] - numbers[1]) / diff) * 2 + 1)

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if (A >= K):
    print('1')
    sys.exit()
elif (A - B) <= 0:
    print('-1')
    sys.exit()
d = A-B
p = K-A
q = int(p/d)
if ((p % d) != 0):
    q += 1
print(int(2*q + 1))

Submission status: Wrong Answer

Solution code:
import math
from decimal import *

k, a, b = map(int, input().split())
inc = a - b
if inc < 0:
    if k <= a:
        print(1)
    else:
        print(-1)
    exit()
elif inc == 0:
    print(-1)
    exit()

getcontext().prec = 500
print(math.ceil(Decimal(k-a) / Decimal(inc))*2+1)

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if (A >= K):
    print('1')
    sys.exit()
elif (A - B) <= 0:
    print('-1')
    sys.exit()
d = A - B

p = K-A
q = p/d
if ((p % d) != 0):
    q += 1
print(int(2*q + 1))

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if (A >= K):
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = p/d
if ((p % d) != 0):
    q += 1
print(int(2*q + 1))

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if (A >= K):
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = p/d
if ((p % d) != 0):
    q += 1
print(2*q + 1)

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = p/d
if (p % d) != 0:
    q += 1
print(2*q + 1)

Submission status: Wrong Answer

Solution code:
import math

numbers = [int(i) for i in input().split()]

max_number = math.pow(10,18)

diff = numbers[1] - numbers[2]

if numbers[0] > diff * max_number:
    print("-1")
else:
    rating = 0
    count = 0
    print(math.ceil(numbers[0] / diff) * 2 - 1)

Submission status: Wrong Answer

Solution code:
# coding:utf-8

K, A, B = map(int, raw_input().split())
if K <=A:
    print '1'

elif A <= B:
    print '-1'
else:
    x = (K-B-1)/(A-B)+1
    print '2*x-1'

Submission status: Wrong Answer

Solution code:
# coding:utf-8

K, A, B = map(int, raw_input().split())
if K <=A:
    print 1

if A <= B:
    print -1
else:
    x = (K-B-1)/(A-B)+1
    print 2*x-1

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = p/d
if p % d != 0:
    q += 1
print(int(2*q + 1))

Submission status: Wrong Answer

Solution code:
# coding:utf-8

K, A, B = map(int, raw_input().split())
if K <=A:
    print '1'

if A <= B:
    print '-1'
else:
    x = (K-B-1)/(A-B)+1
    print 2*x-1

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = math.ceil(float(p)/d)
print(int(2*q + 1))

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = math.ceil(float(p)/d)

Submission status: Wrong Answer

Solution code:
import math

numbers = [int(i) for i in input().split()]

max_number = math.pow(10,18)

diff = numbers[1] - numbers[2]

if numbers[0] > diff * max_number:
    print("-1")
else:
    rating = 0
    count = 0
    while rating < numbers[0]:
        rating = rating + diff
        count = count + 2
    print(count-1)

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = math.ceil(float(p)/d)
print(2*q + 1)

Submission status: Wrong Answer

Solution code:
import sys
import math
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-A
q = math.ceil(p/d)
print(2*q + 1)

Submission status: Wrong Answer

Solution code:
import sys
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = K-d
q = int(p/d)
r = p%d
if (r == 0):
    print(2*q+1)
else:
    print(2*q+3)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    K,A,B = map(int, input().split())
    left = 0
    right = 2 ** 100
    if B >= A:
        print (-1)
        exit()
    while (right - left > 1):
        med = (right + left) // 2
        res = (A - B) * med
        if res >= K:
            right = med
        else:
            left = med
    # print ((A - B) * right)
    res = 2 * right
    for x in range(max(1, res - 100), res+10):
        a1 = x // 2
        a2 = x - a1
        tmp = A * a2 - B * a1
        if tmp >= K:
            print (x)
            exit()

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    K,A,B = map(int, input().split())
    left = 0
    right = 2 ** 100
    if B >= A:
        print (-1)
        exit()
    while (right - left > 1):
        med = (right + left) // 2
        res = (A - B) * med
        if res >= K:
            right = med
        else:
            left = med
    # print ((A - B) * right)
    res = 2 * right
    for x in range(res - 100, res+10):
        a1 = x // 2
        a2 = x - a1
        tmp = A * a2 - B * a1
        if tmp >= K:
            print (x)
            exit()

Submission status: Wrong Answer

Solution code:
import sys
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = int((K-d) / d)
if (p % d == 0):
    print(2*p+1)
else:
    print(2*p+2)

Submission status: Wrong Answer

Solution code:
import sys
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = int(K/d)
if ((K-d) % d == 0):
    print(2*p+1)
else:
    print(2*p+2)

Submission status: Wrong Answer

Solution code:
import math
k, a, b = map(int, input().split())

if (a <= b):
    print(-1)
else:
    x = (k-a)/(a-b)
    print(2*int(math.ceil(x)) + 1)

Submission status: Wrong Answer

Solution code:
import sys
K, A, B = list(map(int, input().split()))

if A >= K:
    print(1)
    sys.exit()
elif (A - B) <= 0:
    print(-1)
    sys.exit()
d = A - B

p = int(K/d)
if K % d == 0:
    print(2*p-1)
else:
    print(2*p+1)

Submission status: Wrong Answer

Solution code:
K,A,B=map(int,input().split())
if A-B<=0: print(-1)
elif A>=K: print(1)
else: 
  n = (K-A-1) // (A-B) + 1
  print(2*n +1)

Submission status: Wrong Answer

Solution code:
K,A,B = map(int,input().split())
if A > B:
    #n = math.ceil((K-A) / (A-B))
    n = (K-A-1) // (A-B) + 1
    print(2*n + 1)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
k,a,b=map(int,input().split())
if a<=b:
    print(-1)
else:
    print(((k-a+(a-b-1))//(a-b))*2+1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
k,a,b=map(int,input().split())
if a<=b:
    print(-1)
else:
    print('%d'%((k-b-b)//(a-b)*2+1))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
k,a,b=map(int,input().split())
if a<=b:
    print(-1)
else:
    print('%d'%((k-b-1)//(a-b)*2+1))

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())

    if A <= B:
        print(-1)
        exit()
    elif A >= K:
        print(1)
        exit()

    n, m = divmod(K - A, A - B)
    ans = n * 2 + 1
    a = -A
    b = B
    while m > 0:
        m += b
        a, b = b, a
        ans += 1
    print(ans)

main()

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())

    if A <= B:
        print(-1)
        exit()

    n, m = divmod(K - A, A - B)
    ans = n * 2 + 1
    a = -A
    b = B
    while m > 0:
        m += b
        a, b = b, a
        ans += 1
    print(ans)

main()

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())

    if A <= B:
        print(-1)
        exit()
    elif A >= K:
        print(1)
        exit()

    div_, mod_ = divmod(K - A, A - B)
    if mod_:
        ans = div_ * 2 + 3
    else:
        ans = div_ * 2 + 1
    print(ans)

main()

Submission status: Wrong Answer

Solution code:
def main():
    K, A, B = map(int, input().split())

    if A <= B:
        print(-1)
        exit()

    div_, mod_ = divmod(K - A, A - B)
    if mod_:
        ans = div_ * 2 + 3
    else:
        ans = div_ * 2 + 1
    print(ans)

main()

Submission status: Time Limit Exceeded

Solution code:
s =input().split()
a=0
b=0
while a<int(s[0]) :
    b+=1
    a+=int(s[1])
    if a>int(s[0]) :
        print(b)
        break
    b+=1
    a=a-int(s[2])
    if a<0 :
        print(-1)
        break

Submission status: Time Limit Exceeded

Solution code:
s =input().split()
a=0
b=0
while a<int(s[0]) :
    b+=1
    a+=int(s[1])
    if a>int(s[0]) :
        break
    b+=1
    a=a-int(s[2])
    if a<0 :
        break
if a<0 :
    print(-1)
if a>int(s[0]) :
    print(int(b))

Submission status: Time Limit Exceeded

Solution code:
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

k = int(arr_data[0][0])
a = int(arr_data[0][1])
b = int(arr_data[0][2])

#print(k, a, b)

rate = 0

chkflg = True

cnt = 0

while rate < k:
    
    if chkflg:
        
        rate += a
        chkflg = False
        cnt += 1
    else:
        
        if a < b:
            
            cnt = -1
            break
            
        else:

            rate -= b
            chkflg = True

            cnt += 1

#    print(rate)
        
print(cnt)

Submission status: Accepted

Solution code:
K, A, B = map(int, input().split())

if A >= K:
    print(1)
    exit()

if A - B <= 0:
    print(-1)
    exit()

up = A - B
cnt = (K - A + up - 1) // up
print(1 + 2 * cnt)

Submission status: Accepted

Solution code:
from decimal import *
import math
K,A,B=map(int,input().split())
if A>=K:
  print(1)
elif A-B>0:
  print(1+math.ceil(Decimal(K-A)/Decimal(A-B))*2)
else:
  print(-1)

Submission status: Accepted

Solution code:
K, A, B = map(int, input().split())

if A >= K:
  print(1)
else:
  if A-B <= 0:
    print(-1)
  else:
    S = -(-(K-A)//(A-B))
    print(S*2+1)

Submission status: Accepted

Solution code:
ceil = lambda a, b: -(-a // b)

K, A, B = map(int, input().split())
if A >= K:
    print(1)
    exit()
p = A - B
if p <= 0:
    print(-1)
    exit()

ans = 1
ans += ceil(K - A, A - B) * 2
print(ans)

Submission status: Accepted

Solution code:
k,a,b = map(int, input().split())
inc_two = a - b
if inc_two > 0:
    k -= a
    print(1 + 2 * ((k + inc_two - 1) // inc_two))
else:
    if a >= k:
        print(1)
    else:
        print(-1)

Submission status: Accepted

Solution code:
k, a, b = map(int, input().split())
if a >= k:
    print(1)
elif a <= b:
    print(-1)
else:
    print(((k - a - 1) // (a - b) + 1 ) * 2 + 1)

Submission status: Accepted

Solution code:
k,a,b=map(int,input().split())
if a>=k:
    print(1)
elif a<=b:
    print(-1)
else:
    print(-(-(k-a)//(a-b))*2+1)

Submission status: Accepted

Solution code:
k, a, b = map(int, input().split())
if a >= k:
  print(1)
else:
  if a <= b:
    print(-1)
  else:
    r = -(-(k-a) // (a-b))
    print(2*r+1)

Submission status: Accepted

Solution code:
import math
K,A,B=map(int,input().split())
if A>=K:
    print(1)
else:
    if A<=B:
        print(-1)
    else:
        if (K-A)%(A-B)==0:
            print((K-A)//(A-B)*2+1)
        else:
            print((K-A)//(A-B)*2+3)

Submission status: Accepted

Solution code:
k, a, b = map(int, input().split())

if a <= b:
    if a < k:
        print(-1)
    else:
        print(1)
else:
    if a > k:
        print(1)
    else:
        answer = ((k - b - 1) // (a - b) * 2) + 1
        print(answer)

Submission status: Accepted

Solution code:
k, a, b = map(int, input().split())
if a >= k:
  print(1)
else:
  if a <= b:
    print(-1)
  else:
    r = -(-(k-a) // (a-b))
    print(2*r+1)

Submission status: Accepted

Solution code:
def main():
    k,a,b=map(int,input().split())
    if a<=b:
        if a>=k:
            print(1)
        else:
            print(-1)
        return
    print(((k-b-1)//(a-b)+1)*2-1)
    
    
main()

Submission status: Accepted

Solution code:
x,a,b = map(int,input().split())
l = -1
r = 10**18+1
while r - l > 1 :
	c = (r + l) // 2
	sum = (a - b) * c + a
	if sum >= x : r = c
	else : l = c
if x <= a : print(1)
elif r != 10**18+1 : print(2 * r + 1)
else : print(-1)

Submission status: Accepted

Solution code:
k,a,b=map(int,input().split())
ans=0
k-=a
if k<=0:
  print(1)
elif a-b<=0:
  print(-1)
else:
  print(2*((k-1)//(a-b)+1)+1)

Submission status: Accepted

Solution code:
K, A, B = map(int, input().split())
if A >= K:
  r = 1
elif B >= A:
  r = -1
else:
  r = (K-A +A-B-1)//(A-B)*2+1
print(r)

Submission status: Accepted

Solution code:
K,A,B=map(int,input().split())
if A>=K:
  print(1)
elif A<=B:
  print(-1)
else:
  bef=((K-A)//(A-B))+((K-A)%(A-B)!=0)
  print(2*bef+1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7

K, A, B = MAP()

# 上がっていかない場合
if B >= A:
    # 初回で行ければOK、そうでなければNG
    if A >= K:
        print(1)
    else:
        print(-1)
else:
    # A + (A-B)*x >= K → x >= (K-A) / (A-B)
    x = ceil((K-A), (A-B))
    # 2回に1回しか上がらないので、その調整
    print(x*2+1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

k, a, b = [int(item) for item in input().split()]
if a >= k:
    print(1)
    exit()
if abs(a) - abs(b) <= 0:
    print(-1)
    exit()
diff = abs(a) - abs(b)
print(1 + (k - a + diff - 1) // diff * 2)