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:
import sys
a,b = map(int,input().split())
c = 2
if b == 1:
    print(0)
    sys.exit()
if a >= b:
    print(1)
    sys.exit()
R = False
x = 2*a - 1
while R == False:
    if x >= b:
        R = True
    else:
        x += a-1
        c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=(int(x) for x in input().split())
i=0
while i*(A-1)<B-1:
  i+=1
print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

if (b-1)%(a-1) == 0:
  sum += (b-1)//(a-1)
else:
  sum += (b-1)//(a-1) +1
  
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    C = 1
    ans = 0

    while C < B:
        C -= 1
        C += A
        ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

a, b = map(int, input().split())
ans = 0
cnt = 1
while True:
    if cnt >= b:
        print(ans)
        sys.exit()
    cnt = cnt + a - 1
    ans += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = (B-1) // (A-1)
if (B-1)%(A-1) > 0:
  ans +=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#入力 A:使う1個当たりのタップの口数 B:最終的にここまで増やす差し込み口の数
A, B = list(map(int,input().split()))
#タップの必要数をans, 差し込み口の数をsocとする
ans = 0
soc = 1
#差し込み口はタップを使うと増えるが一つ使うと必ず1つ差し込み口を消費する。
while soc < B:
  soc -= 1
  ans += 1
  soc += A
#結果  
print(ans)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B == 1:
    print(0)
    exit()
    
ans = 1
B -= A

while True:
    if B <= 0:
        print(ans)
        exit()
    B -= (A-1)
    ans += 1

Submission status: Accepted

Solution code:
import sys
a, b = map(int, sys.stdin.readline().split())
print(-((a-b) // (a-1)) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
args = input().split()
a = int(args[0])
b = int(args[1])
 
tap = 0
socket = 1
while socket < b:
  socket -= 1
  tap += 1
  socket += a
  
print(tap)

Submission status: Accepted

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

Submission status: Accepted

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

n = 0
while (a*n-(n-1)) < b:
  n+=1
print(n)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
i = 0
f = True
if b == 1:
    print('0')
    f = False

while f:
    i += 1
    #print(a*i-i+1)
    if a*i-i+1 >= b:
        print(i)
        break

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input().split(" ")
a = int(s[0])
b = int(s[1])
ans = 0
tap = 1

for i in range(20):
    if tap < b:
        ans += 1
        tap += a-1

    else:
        print(ans)
        break

Submission status: Accepted

Solution code:
import math

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

print((B+A-3)//(A-1))

Submission status: Accepted

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

Submission status: Accepted

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

if b == 1:
    print(0)
else:
    count = 1
    b += -a
    while b > 0:
        b += -(a - 1)
        count += 1
    print(count)

Submission status: Accepted

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

ans = a
cnt = 1
while b>ans:
    ans += a-1
    cnt+=1

if b == 1:
    print(0)
else:
    print(cnt)

Submission status: Accepted

Solution code:
import math
data = input().split(' ')
a = int(data[0])
b = int(data[1])
# 1 + n * (a-1) <= b
print(math.ceil((b - 1) / (a - 1)))

Submission status: Accepted

Solution code:

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

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

print(ans)

Submission status: Accepted

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

t = b - 1
s = a - 1
ans = (t + s - 1) // s
print(ans)

Submission status: Accepted

Solution code:
# 初期入力
A,B = (int(x) for x in input().split())

#
import math
tapp_num = math.ceil( (B-1)//(A-1) )
#print(tapp_num)


sasikomiguti_misiyou=0
if B==1:
    print(0)
elif B<=A:
    print(1)
else:        
    sasikomiguti_misiyou =(tapp_num -1)*(A) +A
    if B <= sasikomiguti_misiyou-1:
        print(tapp_num)
    else:
        print(tapp_num +1)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

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:
a, b = map(int, input().split())

if b == 1:
    print(0)
elif b == 2:
    print(1)
else:
    print((b-2) // (a-1) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A, B = [int(s) for s in input().split()]
if B == 1:
    print(0)
    sys.exit()

if A >= B:
    print(1)
    sys.exit()

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

print(tap)

Submission status: Accepted

Solution code:
import math
a, b = list(map(int, input().split(' ')))
hoge = 1
if b == 1:
    print(0)
else:
    ct = 0
    while hoge < b:
        hoge += a - 1
        ct += 1
        # print(hoge)
    print(ct)

Submission status: Accepted

Solution code:
A, B = [int(s) for s in input().split(' ')]
count = 0
sockets = 1
while sockets < B:
    sockets = sockets - 1 + A
    count += 1
print(count)

Submission status: Accepted

Solution code:
import os, sys, re, math

(A, B) = [int(n) for n in input().split()]

print((B - 1 - 1) // (A - 1) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while 1:
    if plug>=b:
        print(t)
        exit()
    
    plug-=1
    plug+=a
    t+=1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
a, b = [int(x) for x in input().split()]
ans = ceil((b - 1) / (a - 1))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=list(map(int,input().split()))
plug=((l[1]-l[0])//(l[0]-1))+1
if (l[1]-l[0])%(l[0]-1)!=0:
    plug=plug+1
print(plug)

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split())
plug = 1
socket = 0
while True:
  if plug >= B:
    print(socket)
    sys.exit(0)
  plug += A
  socket += 1
  plug -= 1

Submission status: Accepted

Solution code:
line = input().split(" ")
a = int(line[0])
b = int(line[1])

# a + (n - 1) * (a - 1) >= b
# n * (a - 1) + 1 >= b
# n >= (b - 1)/(a - 1)

n = (b - 1)/(a - 1)

if n == int(n):
  print(int(n))
elif n >= int(n):
  print(int(n) + 1)

Submission status: Accepted

Solution code:
#--power socket

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

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

print(j)

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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:
a, b = map(int, input().split())

ans = (a + b - 3) // (a - 1)
print(ans)

Submission status: Accepted

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

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

print(ans)
'''

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC 139: B – Power Socket
A, B = [int(s) for s in input().split()]

taps = 0

while (A - 1) * taps + 1 < B:
    taps += 1

print(taps)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=-1
for i in range(21):
  ans+=1
  if b<=(a-1)*i+1:
    print(ans)
    exit()

Submission status: Accepted

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

ans = 0
outlet = 1

while outlet < y:
    outlet -= 1
    outlet += x
    ans += 1

print(ans)

Submission status: Accepted

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

print(k)

Submission status: Accepted

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

tap = 0
count = 1

while True:
    if count >= B:
        break
    tap += 1
    count += A-1

print(tap)

Submission status: Accepted

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

inf = 10**7
if (B == 1):
    print(0)
    sys.exit()
for i in range(1, inf):
    if B <= ((A - 1) * (i - 1) + A):
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = input().split(' ')
if int(B) >1:
    num = 1
    while (int(A)-1)*(num -1) + int(A) < int(B):
        num += 1
    print(num)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = 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())
emp = 1
cnt = 0
while emp < b:
    #print("emp",emp)
    emp = emp-1+a
    #print("emp",emp,cnt)
    cnt += 1

    

print(cnt)

Submission status: Accepted

Solution code:
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

A, B = MAP()

print(-(-(B-1)//(A-1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    A, B = LI()
    if B == 1:
        print(0)
        return
    tap = A
    cnt = 1
    while tap < B:
        tap += (A - 1)
        cnt += 1
    print(cnt)
        


main()

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:
A,B=map(int,input().split())
print(-(-(B-1)//(A-1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a,b = list(map(int,input().split()))

from math import ceil

if b==1:
    print(0)
else:
    print(1+max(0,ceil((b-a)/(a-1))))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    A,B=pin()
    ans=0
    plug=1
    while(1):
        if plug>=B:
            print(ans)
            break
        ans+=1
        plug=plug-1+A
        
resolve()

Submission status: Accepted

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

if B ==1:
  print(0)

else:
  for i in range(19):
    if B <= A + (A-1)*i:
      print(i + 1)
      break

Submission status: Accepted

Solution code:

A,B=[int(x) for x in input().rstrip().split()]

if B==1:
  print(0)
else:
  ans=A
  cnt=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
    A, B = map(int, input().split())
    i = 0
    if B == 1:
        print(0)
    else:
        if B <= A:
            print(1)
        else:
            con = B
            while True:
                con -= A - 1
                i += 1
                if con <= A:
                    i += 1
                    break
            print(i)
main()

Submission status: Accepted

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

while num < b:
    num += a-1
    count += 1

print(count)

Submission status: Accepted

Solution code:
import math


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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_line=input().split(" ")
A,B=int(input_line[0]),int(input_line[1])
ans,port=0,1
while port<B:
    port=port+A-1
    ans=ans+1
print(ans)

Submission status: Accepted

Solution code:
#A 2A-1 3A-2 のように未使用の差し込み口が増える
A, B = map(int, input().split())

i = 1
while i * A - i + 1 < B:
    i += 1

if B == 1:
    i = 0

print(i)

Submission status: Accepted

Solution code:
# 2:50
a, b = map(int, input().split())
if b == 1:
    print(0)
    exit()

if a >= b:
    print(1)
else:
    b -= a
    cnt = 1
    while (b > 0):
        b -= (a - 1)
        cnt += 1
    print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import copy
from collections import deque


def main():

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

main()

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
t = x
c = 1
if y == 1:
    print(0)
    exit()
for i in range(100):
    if t>=y:
        print(c)
        break
    t += x-1
    c += 1
    #print(t)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc139/tasks/abc139_b
a, b = map(int, input().split())

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

Submission status: Accepted

Solution code:
'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''


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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

B -= A
ans = 1

while B > 0:
  B -= (A - 1)
  ans += 1
  
print(ans)
exit()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(a, b):
    n = 0
    c = 0
    while (True):
        c = a + (n - 1) * (a - 1)
        if c >= b:
            break
        else:
            n = n + 1
    return n

a, b = [int(x) for x in input().split()]
answer = solve(a, b)
print(answer)

Submission status: Accepted

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
outlet = 1

while outlet < B:
    outlet -= 1
    outlet += A
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
A,B = map(int,input().split())
cnt = 0
tmp = A
while True:
    cnt += 1
    if tmp >= B:
        break
    else:
        tmp += (A - 1) 

if B ==1:
    print(0)
else:
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

n=0
while A*n-n+1 < B:
    n += 1
print(n)

Submission status: Accepted

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

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:
def main():
    A, B = map(int, input().split())
    plug, tap = 1, 0
    while plug < B:
        plug += A - 1
        tap += 1
    print(tap)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

n=int((b-1)/(a-1))
if (b-1)%(a-1)==0:
    print(n)
else:
    print(n+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
B - Power Socket
"""


import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

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

total = 1
number = 0

while total < B:
    number += 1
    total = (total - 1) + A

print(number)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N = int(input())
A = list(map(int, input().split()))
D = [int(input()) for _ in range(N)]
"""

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

total = 1
number = 0

while True:
    if total >= B:
        break

    number += 1
    total = (total - 1) + A

print(number)

# while True:
#     if total >= B:
#         break
#     index += 1
#     if index == 1:
#         total += A
#     else:
#         total += A - 1
#
#
# print(index)

# def main():


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

Submission status: Accepted

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

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 = input().split()

a = int(a)
b = int(b)

count = 0

if b == 1:
    print('0')
else:
    while True:
        if b <= a:
            count += 1
            break
        elif b <= 0:
            break
        else:
            b = b - a + 1
            count = count + 1

    print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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)
elif a<b:
    x=(b-1)//(a-1)
    if (b-1)%(a-1)==0:
        print(x)
    else:
        print(x+1)
else:
    print(1)

Submission status: Accepted

Solution code:
from sys import stdin
import queue
import sys
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())
print(((b-1)+(a-2))//(a-1))

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 = list(map(int, input().split()))
n = 0
outlet = 1
while outlet < b:
    n += 1
    outlet += a - 1
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

a, b = inpl()
c = a-1
d = b-1
print((d+c-1)//c)

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())
print((B-2)//(A-1)+1)

Submission status: Accepted

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

print(A_num)

Submission status: Accepted

Solution code:
import math

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

#(A-1)(x-1)+A >= B
print(math.ceil(1 + (b-a) / (a-1)))

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())
x = 0
outlet = 1
while outlet < b:
  outlet -= 1
  outlet += a
  x+=1
print(x)

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())
c = 1 
ans = 0
while c < b:
  c += a-1
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
# B - Power Socket

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

print(((b-1)+(a-1-1))//(a-1))

Submission status: Accepted

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