Problem:


Score : 200 points

Problem Statement

Takahashi's house has only one socket.

Takahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.

One power strip with A sockets can extend one empty socket into A empty sockets.

Find the minimum number of power strips required.

Constraints

All values in input are integers.

2 \leq A \leq 20

1 \leq B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the minimum number of power strips required.

Sample Input 1

4 10

Sample Output 1

3

3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.

Sample Input 2

8 9

Sample Output 2

2

2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.

Sample Input 3

8 8

Sample Output 3

1



Sample input:
4 10


Sample output:
3

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
num = B / A
i = 0
if B == 1:
  print(int(0))
else:
  while True:
    if B == 1:
        print(0)
        break
    if A * i - (i - 1) >= B:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B == 1:
    print(0)
    exit()
socket = A
t = 1
while socket < B:
    t += 1
    socket = socket + A - 1
print(t)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
p = 1
ans = 0

while p < b:
    p += (a - 1)
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
cnt = 1
ans = 0
while cnt < b:
  cnt = cnt - 1 + a
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
#<B>
A, B = map(int,input().split())
i = 1
while True:
    if B == 1:
        print(0)
        break
    if A * i - (i - 1) >= B:
        print(i)
        break
    i += 1

Submission status: Accepted

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

consent = 1
ans = 0

while consent < b:
  consent += (a - 1)
  ans += 1
  
print(ans)

Submission status: Accepted

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

for i in range(20):
  d = (a-1)*i +1
  if d >= b:
    print(i)
    break

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
x,y = 0,0

if B == 1:
    print(0)
else:    
    for i in range(21):
        x = (A-1)*i+A
        if x >= B:
            print(i+1)
            break

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=1
ans=0
while c<b:
    c+=a-1
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
x=-(-(B-1)//(A-1))
print(x)

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
count = 1
ans = 0

while count < b:
    count += (a-1)
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
cnt = 1
c = b-a
if c >0:
    cnt += (c//(a-1))
    d = c%(a-1)
    if d != 0:
        cnt += 1
if b == 1:
    cnt = 0
print(cnt)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

Solution code:
n = [int(i) for i in input().split()]
m = 1
ans = 0
while m < n[1]:
  ans += 1
  m += n[0]-1
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
res = 1
cnt = 0
while res < B:
    res += A - 1
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
A,B = [int(i) for i in input().split()]
if B == 1:
    print(0)
    exit()
c = 0
while True:
    B -= A
    c += 1
    if B <= 0:
        print(c)
        break
    B += 1

Submission status: Accepted

Solution code:
a,b = input().split(" ")
count = 0
sum = 1
while sum < int(b):
    sum = sum + int(a) -1
    count += 1
print(count)

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
a = 1
cnt = 0
while a < B:
    a -= 1
    a += A
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys
import math
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    a,b = IL()
    print(math.ceil((b-1)/(a-1)))
    return

if __name__=='__main__':
    Main()

Submission status: Accepted

Solution code:
import sys
import math

def main():

    input = sys.stdin.readline

    a,b = map(int, input().split())
    a_total = 1 
    ans = 0
    while (a_total < b):
        a_total += a-1
        ans +=1
    print(ans)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
c=1
while(c<b):
    c+=a-1
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
a,b=input().split(" ")
count=0
sum=1
while sum<int(b):
  sum=sum+int(a)-1
  count+=1
print(count)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans =0
cnt=1
while cnt<B:
    cnt = cnt+A-1
    ans+=1
print(ans)

Submission status: Accepted

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

tap_num = 1
count = 0
while tap_num < B:

  # 追加
  tap_num -= 1
  tap_num += A
  count += 1

print(count)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(20):
    if (A*i-(i-1) >= B ):
        print(i)
        exit(0)

Submission status: Accepted

Solution code:
[A,B] = list(map(int,input().split()))

s=A
i=1
while True:
    if B==1:
        print(0)
        break
    elif A==B:
        print(1)
        break

    elif s>=B:
        print(i)
        break
    s+=A-1
    i+=1

Submission status: Accepted

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

i = 0
c = 1
while c < b :
    c += (a-1)
    i += 1

print(i)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
un = 1
tap_num = 0
while not un >= b:
  un += a-1
  tap_num += 1
print(tap_num)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
print(1-(A-B)//(A-1))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
sum = 1 
count = 0
while sum < b:
  sum += a - 1
  count += 1
print(count)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
sum = 1
count = 0
while sum < b :
  sum += a - 1
  count += 1
print (count)

Submission status: Accepted

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

ans = 1
i = 0
while ans < B:
    ans += A - 1
    i += 1

print(i)

Submission status: Accepted

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

now = 1
for i in range(100):
    if now >= B:
        print(i)
        break
    now -= 1
    now += A

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
count = 1
a_count = 0
while True:
    if count >= B:
        print(a_count)
        break
    else:
        count += (A - 1)
        a_count += 1

Submission status: Accepted

Solution code:
import math
a,b=list(map(int,input().split()))
""" if (b-1)%(a-1)==0:
    print(int((b-1)/(a-1)))
else:
    print(int((b-1)/(a-1))+1)
 """

print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

Solution code:
a,b=list(map(int,input().split()))
if (b-1)%(a-1)==0:
    print(int((b-1)/(a-1)))
else:
    print(int((b-1)/(a-1))+1)

Submission status: Accepted

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

count = 1
num = 0
while count < B:
  count += (A-1)
  num += 1
print(num)

Submission status: Accepted

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

print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    A, B = list(map(int, input().split()))
    num_of_tap = 0
    num_of_hole = 1
    while(num_of_hole < B):
        num_of_tap += 1
        num_of_hole = (A-1)*(num_of_tap-1) + A

    print(num_of_tap)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
print(((B-1)+(A-2))//(A-1))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a -= 1
b -= 1
print((a+b-1)//a)

Submission status: Accepted

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

total = 1
ans = 0
while total < b:
    ans += 1
    total -= 1
    total += a

print(ans)

Submission status: Accepted

Solution code:
import sys
a,b = map(int,input().split())
if b==1:
  print(0)
  sys.exit()
for i in range(1,20):
    if a+(a-1)*(i-1) >= b:
        print(i)
        break

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
for i in range(0,20):
    if a*(i-1) -(i-2)  < b <= a*i -(i-1):
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

tap = 1
cnt = 0
while tap < B:
    tap += A - 1
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cnt = 1
ans = 0
while cnt < B:
  cnt += A-1
  ans += 1
  
print(ans)

Submission status: Accepted

Solution code:
A, B = map(lambda x: int(x) - 1, input().split())

if B == 0:
  ans = 0
elif B % A == 0:
  ans = B // A
else:
  ans = B // A + 1
  
print(ans)

Submission status: Accepted

Solution code:
import sys
a,b=list(map(int,input().split()))
if b==1:
  print(0)
  sys.exit()
for i in range(100):
  if a+(a-1)*i >=b:
    print(i+1)
    sys.exit()

Submission status: Accepted

Solution code:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a,b=mp()
if b==1:
    print(0)
    exit()
for i in range(1,100):
    if 1+(a-1)*i>=b:
        print(i)
        exit()

Submission status: Accepted

Solution code:
import math
A,B = (int(x) for x in input().split())
print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

Solution code:
from math import ceil

A, B = map(int, input().split())
result = ceil((B-1)/(A-1))
print(result)

Submission status: Accepted

Solution code:
from math import ceil

A, B = map(int, input().split())
result = ceil((B-1)/(A-1))
print(result)

Submission status: Accepted

Solution code:
import sys
A,B=map(int,input().split())
num=A
cnt=1
if B==1:
    print(0)
    sys.exit()
while num<B:
    cnt+=1
    num+=A-1

print(cnt)

Submission status: Accepted

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

if B == 1:
    print(0)
    exit()

ans = A
for i in range(1000):
    if ans >= B:
        break
    else:
        ans += A-1
        
print(i+1)

Submission status: Accepted

Solution code:
import sys
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    a, b = map(int, input().split())
    print(math.ceil((b-1)/(a-1)))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

t=1
for i in range(21):
    t=1+(a-1)*i
    if t>=b:
        mini=i
        break
print(i)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
plg=1
cnt=0
while plg<b:
  plg+=a-1
  cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if b == 1:
    print(0)
    exit(0)
num = a
c = 1
while True:
    if num >= b:
        break
    else:
        num += a-1
        c += 1
print(c)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
num = 1 #差し込み口数
c = 0
while True:
    if (num >= b):
        break
    else:
        num += a-1
        c += 1
print(c)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if(B==1):
    print(0)
    exit()
for i in range(1,21):
    if(B<=A*i-(i-1)):
        print(i)
        exit()

Submission status: Accepted

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

if b == 1:
    print(0)
    exit()

kuti = a
cnt = 1
while kuti < b:
    kuti += a-1
    cnt += 1
print(cnt)

Submission status: Accepted

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

i = 1
while True:
    if (a-1) * i + 1 >= b:
        break
    i += 1
print(0 if b == 1 else i)

Submission status: Accepted

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

i = 1
while True:
    if a+(a-1)*(i-1) >= b:
        break
    i += 1
print(0 if b == 1 else i)

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    kuchi = 1
    ans = 0

    while kuchi < b:
        kuchi = kuchi - 1 + a
        #print(kuchi, a, b)
        ans += 1
    print(ans)
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a,b = MAP()
if(b==1):
    ans = 0
else:
    
    if(a>=b):
        ans = 1
    else:
        left = b - a
        ans = ceil(left/(a-1)) + 1
print(ans)

Submission status: Accepted

Solution code:
#n , m , l = map(int , input().split())

# list_n = list(map(int , inpuut().split()))<Paste>

#n = input()
# list = [input() for i in range(N)

#list = [[i for i in range(N)] for _ in range(M)]


import math

A, B = map(int, input().split())
print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

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


i=1
while True:
    if A+(A-1)*(i-1)>=B:
        break
    i+=1
if B==1:
    print(0)
else:
    print(i)

Submission status: Accepted

Solution code:
import math

A,B = map(int,input().split())
print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

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

ans=0
while cur<B:
    cur-=1
    cur+=A
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
print(1+math.ceil((b-a)/(a-1)))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
tap=1
while tap<b:
    ans+=1
    tap+=a-1
print(ans)

Submission status: Accepted

Solution code:
def resolve():
    a, b = map(int, input().split())
    from math import ceil
    print(ceil((b - 1) / (a - 1)))


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
def resolve():
    a, b = map(int, input().split())
    ret = 0
    if b > 1:
        from math import ceil
        ret = ceil((b - 1) / (a - 1))
    print(ret)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())
x = ((1-b)//(a-1))
# 出力
print("{}".format(-x))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if b==1:
  print(0)
  exit()
b -= a
if b%(a-1) == 0:
  print(b//(a-1) + 1)
else:
  print(b//(a-1) + 2)

Submission status: Accepted

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

tap = 1
ans = 0
for i in range(0, 100):
    if tap >= b:
        ans = i
        break
    tap -= 1
    tap += a
    

print(ans)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = map(int, readline().split())
    print((B - 1 + A - 1 - 1) // (A - 1))

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

A, B = list(map(int, input().split()))

result = math.ceil((B - 1) / (A - 1))

print(result)

Submission status: Accepted

Solution code:
import math
a, b = [int(w) for w in input().split()]

print(math.ceil((b - 1) / (a - 1)))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cnt = 0
tap = 0
outlet = 1
while outlet < B:
    tap += 1
    outlet -= 1
    outlet += A

print(tap)

Submission status: Accepted

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

count_A = 0
while True:
    outlet = 1
    outlet += A * count_A - count_A
    if outlet >= B:
        break
    count_A += 1
print(count_A)

Submission status: Accepted

Solution code:
# B - Power Socket
def main():
    a, b = map(int, input().split())
    cnt = 1
    ans = 0
    for i in range(20):
        if cnt >= b:
            print(ans)
            exit()
        else:
            cnt = a + (a-1) * i
            ans += 1

if __name__ ==  "__main__":
    main()

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

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

if b==1:
    print(0)
    exit()

i=1
tappu=a

while tappu<b:
    tappu+=(a-1)
    i+=1

print(i)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    A, B = [int(x) for x in input().split()]
    a = 1

    ans = 0
    while a < B:
        ans += 1
        a -= 1
        a += A

    print(ans)
    
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
A,B= list(map(int,input().split()))
#for i in range(1,22):
#    if (A-1)*(i-1)+A >=B:
#        print(i)
#        break
print(math.ceil((B-A)/(A-1))+1)

Submission status: Accepted

Solution code:
import math
A,B= list(map(int,input().split()))
#for i in range(1,22):
#    if (A-1)*(i-1)+A >=B:
#        print(i)
#        break
print(math.ceil((B-A)/(A-1))+1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print((a + b - 3)//(a - 1))

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
C = 1
val = 0
 
while C < B:
    C -= 1
    C += A
    val += 1
 
print(val)

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
print(math.ceil((b - 1) / (a - 1)))

Submission status: Accepted

Solution code:
input = list(map(int,input().split()))
A = input[0]
B = input[1]

for iter in range(21):
    if A+(A-1)*(iter-1) >= B:
        print(iter)
        break

Submission status: Accepted

Solution code:
# 139 B  # nxt try

a, b = map(int, input().split())
ans = 0

temp = 1
while temp < b:
    temp -= 1
    temp += a
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
t = 1
while t < B:
  ans += 1
  t += A-1
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
import math
print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

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

d, m = divmod(b-1, a-1)

print(d + bool(m))

Submission status: Accepted

Solution code:
a,socks = map(int, input().split())
count = 1
ans = 0
while count < socks:
  count += a-1
  ans +=1 
  
print(ans)

Submission status: Accepted

Solution code:
A, B = list(map(int,input().split(" ")))
if B == 1:
  print(0)
elif A >= B:
  print(1)
else:
  if (B-A)%(A-1) == 0:
    print((B-A)//(A-1)+1)
  else:
    print((B-A)//(A-1)+2)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
count, outlet = 0, 1
while outlet < B:
    outlet = outlet-1
    outlet = outlet+A
    count = count+1
print(count)

Submission status: Accepted

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

def sum_tap_num(tap_num, A, B):
	tap_sum = (tap_num-1)*(A-1)+A
	if tap_sum >= B:
		return tap_num
  	
	return sum_tap_num(tap_num+1, A, B)
if B==1:
	print(0)
else:
	print(sum_tap_num(1, A, B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    outlet = 1
    ans = 0
    while outlet < b:
        outlet += a - 1
        ans += 1

    print(ans)
    
        


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()

a,b=mi()
print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
outlet_num = 1
answer = 0
for i in range(B):
    if outlet_num >= B:
        print(answer)
        break
    outlet_num += (A - 1)
    answer += 1

Submission status: Accepted

Solution code:
A, B=input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))

Submission status: Accepted

Solution code:
A, B =input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))

Submission status: Accepted

Solution code:
A,B=input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
# i*(A-1)+1>=B
ans=0
while ans*(A-1)+1<B:
    ans=ans+1
print(ans)

Submission status: Accepted

Solution code:
inp1, inp2 = map(int, input().split())
if inp2 == 1:
    print(0)
elif inp1 >= inp2:
    print(1)
else:
    print((inp2-2)//(inp1-1)+1)

Submission status: Accepted

Solution code:
from math import ceil
a, b = list(map(int , input().split()))
print(ceil((b-1)/(a-1)))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
current = 1
ans = 0

while current < b:
    current -= 1
    current += a
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
num=1
ans=0
while(1):
    if num>=b:
        print(ans)
        exit()
    num-=1
    num+=a
    ans+=1

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math

a, b = map(int, input().split())

print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

Solution code:
import math

a, b = list(map(int, input().split()))

temp = math.ceil((b-1)/(a-1))

print(temp)

Submission status: Accepted

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

Submission status: Accepted

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

if (B-1)%(A-1)==0:
  print(int((B-1)/(A-1)))
else:
  print(int((B-1)//(A-1)+1))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
count = 0
while (a-1)*count+1 < b:
    count += 1
print(count)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
i = 1
r = a
if b == 1:
  print(0)
  exit()
while True:
  if r >= b:
    print(i)
    break
  else:
    r = (a - i) + a * i
    i += 1

Submission status: Accepted

Solution code:
import math
a=input()
res=[i for i in a.split()]
x,y=[res[i] for i in (0,1)]
A,B=int(x),int(y)
if 2<=A<=20 and 1<=B<=20:
    w=(B-1)/(A-1)
    z=math.ceil(w)
    print(z)

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    elif b - a <= 0:
        print(1)
    else:
        if (b-1) % (a-1) == 0:
            print((b-1)//(a-1))
        else:
            print((b-1)//(a-1) + 1)
            
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
if b == 1:
    print(0)
    exit()
n = int((b-2) / (a-1))
print(n+1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
result = 0
while result * (a - 1) + 1 < b:
  result = result + 1
print(str(result))

Submission status: Accepted

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

calc = (B-1)/(A-1)

if calc % 1 == 0:
    print(int(calc))
else:
    print(int(calc) + 1)

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())
count = 0
result = 0

while result < b:
    
    result = count * (a - 1) + 1 
    count += 1

print(count-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
n = 1
cnt = 0
while n < b:
  n += a-1
  cnt += 1
  
print(cnt)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if (B-1) % (A-1) == 0:
    print((B-1)//(A-1))
else:
    print((B-1)//(A-1)+1)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
for i in range(B):
  if A*i-i+1 >= B:
    print(i)
    break

Submission status: Accepted

Solution code:
import math
A,B=[int(i) for i in input().split()]
print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]

for n in range(21):
    socket = A*n-n+1
    if(socket >= B):
        print(n)
        break

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split())
if B == 1:
  print(0)
  sys.exit()
  
for i in range(1,20):
  if (1+(A-1)*i) >= B:
    print(i)
    sys.exit()

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if b <= 1:
    print(0)
    exit(0)
p = 1
c = a
a -= 1
while c < b:
    c += a
    p += 1
print(p)

Submission status: Accepted

Solution code:
import math


a, b = map(int, input().split())
n = math.ceil((b - 1)/(a - 1))
print(n)

Submission status: Accepted

Solution code:
import sys

a, b = map(int, input().split())
ans = -(-(b-a)//(a-1)) + 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
A, B= [int(x) for x in stdin.readline().rstrip().split()]
#print(A)
#print(B)
i=0
while True:
  num = i*A - (i-1) 
  if num >= B:
    print(i)
    exit()
  i+=1

Submission status: Accepted

Solution code:
def solve():
    a, b = map(int, input().split())
    print(1 + -(-(b - a) // (a-1)))


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

ans = 0
consent = 1

while consent < B:
    ans += 1
    consent -= 1
    consent += A
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
cnt=1
res=0
while 1:
  if cnt >= b:
    break
  cnt += a - 1
  res+=1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
A,B = input().split()
A,B = int(A), int(B)
A -= 1
B -= 1
print(ceil(B/A))

Submission status: Accepted

Solution code:
m,n=map(int,input().split())
x=(n-1)/(m-1)
if x%1==0:
    print(int(x))
else:
    print(int(x)+1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
x = 0
while True:
    if (a - 1) * (x -  1) + a < b:
        x += 1
    else:
        print(x)
        break

Submission status: Accepted

Solution code:
A,B=input().split()
A=int(A)
B=int(B)
for i in range(100):
  if 1+(A-1)*i>=B:
    print(i)
    break

Submission status: Accepted

Solution code:
import math as mp
A,B=map(int,input().split())

if B==1:
    print(0)
else:
    B = max(B-A,0)
    print(mp.ceil(B/(A-1))+1)

Submission status: Accepted

Solution code:
def main():
    import copy
    a, b = map(int, input().split())
    
    ans = 0
    outlet = 1
    while outlet < b:
        outlet = outlet - 1
        outlet = outlet + a
        ans = ans + 1
    
    print(ans)
    

main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


import math

def main():
    a,b = map(int, input().split())
    print(math.ceil((b-1)/(a-1)))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
c=0
x=1
while x<b:
    x+=a-1
    c+=1

print(c)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if b == 1:
    print(0)
    exit(0)
for i in range(10000):
    if a + i * a - i >= b:
        print(1 + i)
        break

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
n = 0
while (a - 1) * n + 1 < b:
    n = n + 1

print(n)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if (B-1)%(A-1)==0:
  print((B-1)//(A-1))
else:
  print((B-1)//(A-1)+1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().strip().split())
ans=0
sockets=1
while sockets<b:
  sockets-=1
  sockets+=a
  ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

A, B = map(int, input().split())

answer = 0
x = 1

while B > x:
    x += (A-1)
    answer += 1
print(answer)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

A, B = map(int, input().split())

answer = 0
x = 1
while B > x:
    x += (A-1)
    answer += 1
print(answer)

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
if ((K-1) % (N-1)) == 0:
  print((K-1)//(N-1))
else:
  print((K-1)//(N-1)+1)

Submission status: Accepted

Solution code:
def main(A, B):
    if B == 1:
        return 0
    N = 1
    while A + (A-1)*(N-1) < B:
        N += 1
    return N


if __name__ == "__main__":
    A, B = map(int, input().split())
    ans = main(A, B)
    print(ans)

Submission status: Accepted

Solution code:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

A, B = rl()

print(math.ceil((B-1)/(A-1)))