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

Solution (Python):

import sys
from math import ceil


def solve(A: int, B: int):
    n = 1
    c = 0
    while(n < B):
        n += (A-1)
        c += 1

    print(c)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)

if __name__ == '__main__':
    main()

Solution (Python):


tap, target = map(int, input().split(" "))

for x in range(0,target):
    y = (tap-1)*x + 1
    if y >= target:
        print(x)
        break

Solution (Python):
import sys


def main():
    ab = sys.stdin.readline().strip()
    a, b = [int(s) for s in ab.split(' ')]

    need = b - 1
    inc = a - 1

    if need % inc:
        plus_one = 1
    else:
        plus_one = 0

    ans = need // inc + plus_one
    print(ans)


main()

Solution (Python):
A, B = map(int, input().split())
count = 0
x = 1
while B > x:
    x -= 1
    x += A
    count += 1
print(count)

Solution (Python):
def solve():
    a, b = map(int, input().split())
    k = 0
    while True:
        plugs = k * a - (k - 1)
        if plugs >= b:
            return k
        else:
            k += 1


def resolve():
    print(solve())


if __name__ == "__main__":
    resolve()

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

Solution (Python):
A, B = map(int, input().split())
hole = 1
ans = 0
for i in range(20):
    if B <= hole:
        break
    else:
        ans += 1
        hole += A-1

print(ans)

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

temp=0
count=0
for i in range(100):
    if B>temp+1:
        temp +=(A-1)
        count+=1
print(count)

Solution (Python):
def main():
    A, B = list(map(int, input().strip().split()))
    
    n_taps = 0
    n_output = 1
    while n_output < B:
        n_output += (A - 1)
        n_taps += 1
    print(n_taps)


if __name__ == "__main__":
    main()

Solution (Python):
from sys import stdin,stdout
I = lambda : map(int,stdin.readline().split())
import math

a,b = I()
x = math.ceil((float(b)-1.0)/(a-1))
print int(x)

Solution (Python):

y1,y2 = map(int,input().split())
ans = (y2-2) // (y1-1) + 1
print(ans)

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

cons=1
count=0

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

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

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

    cnt += 1

print(cnt)

Solution (Python):
a,b = list(map(int, input().split()))
ans=0
h=1
while(True):
	if(h>=b):
		print(ans)
		break
	h += a-1
	ans += 1

Solution (Python):
AB = input().split(" ")
A = int(AB[0])
B = int(AB[1])

kuti = 1
count = 0 

while kuti < B:
  kuti -= 1
  kuti += A
  count += 1

print(count)

Solution (Python):
a, b = map(int, input().split())
o = a
if b == 1:
    print(0)
else:
    s = 1
    while o < b:
        o-=1
        o+=a
        s+=1
    print(s)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

a, b = getList()

for i in range(b):
    if (a-1)*i + 1 >= b:
        print(i)
        sys.exit()

Solution (Python):
import math
 
A, B = map(int, input().split())
cnt = 0
if B > 1:
    tap = 1
    while tap < B:
        tap -= 1
        cnt += 1
        tap += A
    print(cnt)
else:
    print(0)

Solution (Python):

from math import ceil


def main():
    A, B = tuple(map(int, input().split()))
    ans = ceil((B - 1) / (A - 1))
    print(ans)


if __name__ == "__main__":
    main()

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

Solution (Python):
a,b = map(int,input().split())
s = 1
ans = 0
if b == 1:
  print(0)
  exit()
while s < b:
  s += a-1
  ans += 1
print(ans)

Solution (Python):
a,b=map(int,input().split())
prag=1
ans=0
while b>prag:
	prag += a-1
	ans+=1
print(ans)

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

if B==1:
  print(0)
  exit()
cnt = A
cnt_A = 1
while True:
  if cnt >= B:
    break
  cnt += A-1
  cnt_A += 1
print(cnt_A)

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


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

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

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

    print(ans)

Solution (Python):
a, b = map(int, input().split())
num = 1
cnt = 0
while b > num:
  num = num + a - 1
  cnt += 1
print(cnt)

Solution (Python):
a,r = map(int,input().split())

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

count = 0
sum = 1
while True:
  count += 1
  sum += a - 1
  if sum >= r:
    break

print(count)

Solution (Python):

I0 = lambda :map(int,input().split())
I1 = lambda :int(input())
I2 = lambda :list(map(int,input().split()))

from math import ceil
A,B = I0()
A-=1
res=1
c=0
while res < B:
    res+=A
    c+=1
print(c)

Solution (Python):
A, B = map(int, input().split())
ans = 0
t = 1

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

print(ans)

Solution (Python):
N = list(map(int, input().split()))

if N[1]==1:
    print(0)
else:
    i=1
    while N[0]*i-i+1 < N[1]:
        i+=1
    print(i)

Solution (Python):
AB = input().split()

A = int(AB[0])
B = int(AB[1])
r = 1
c = 0
while r < B:
  r = r - 1 + A
  c += 1
print(c)

Solution (Python):
a, b = map(int, input().split())
count = 1
left = b - a
temp = 0
while temp < left:
    temp += (a-1)
    count += 1
if b == 1:
    print(0)
else:
    print(count)

Solution (Python):

"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect
import heapq


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    

"""
N, X = map(int, input().split())

x = list(map(int, input().split()))

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())


dp = np.zeros((N+1, 4,4,4))
    
all(nstr.count(c) for c in '753')


ABT = zip(A, B, totAB)
result = 0

sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)


(x >> i) & 1


dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

add = 1 
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)


li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    


org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)




    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""


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

    
def main(): 
    if B == 1:
        return print(0)
    if A >= B:
        return print(1)
    else:
        for n in range(100):
            if n >= (B-1)/float(A-1):
                return print(n)
                
                
            
            
                

    
if __name__ == '__main__':
    main()

Solution (Python):
m = list(map(int,input().split()))
print(-(-(m[1]-1)//(m[0]-1)))

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

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

Solution (Python):
a,b = map(int, input().split())
import numpy as np
print(int(np.ceil((b-1)/(a-1))))

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






taps = 1
num = 0
while True:
    if taps >= B:
        break
    taps -= 1
    taps += A
    num += 1
print(num)

Solution (Python):


import math

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

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

Solution (Python):
a, b = [int(x) for x in input().split()]
n = 1
p = a
if b == 1:
    print(0)
else:
    while p < b:
        p += a-1
        n += 1
    print(n)

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

cnt=0
ana=1

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

print(cnt)

Solution (Python):


a,b=map(int, input().split())
c = 0
while a < b:
    t = (a-1) * c + a
    if t >= b: break
    c += 1
    
if b == 1: print(0)
else :print(c+1)

Solution (Python):
A,B =map(int,input().split())
for i in range(100):
    if (A*i-i+1)<B:
        continue
    else:
        break
print(i)

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

Solution (Python):
import sys
def main():
    input = sys.stdin.readline
    AB = list(map(int, input().split()))
    A = AB[0]
    B = AB[1]

    ans = 0
    cnt = 1
    while cnt < B:
        ans += 1
        cnt = A * ans - ans + 1
        
        
    print(ans)
if __name__ == '__main__':
    main()

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

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

Solution (Python):
a,b = map(int, input().split())
ans = 0
if b == 1:
    print(ans)
elif b<=a:
    ans = 1  
    print(ans)
else:
    for i in range(20):
        if a*i-i+1>=b:
            ans = i
            break
    print(ans)

Solution (Python):

a = input().split()

tap = int(a[0])
last = int(a[1])

start = 1
num = 0

if start == last:
    print(0)
else:
    while start < last:
        start += tap - 1
        num += 1
        
    print(num)

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

if B == 1:
    print("0")
if B != 1:
    if (B-1) % (A-1) ==0:
        print((B-1)//(A-1))
    if (B-1) % (A-1) != 0:
        print(-(-(B-1)//(A-1)))

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

ans=0
total=1
while True:
  if total<b:
    total+=a-1
  else:
    break
  ans+=1
print(ans)

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

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

Solution (Python):
A,B=(int(x) for x in input().split())
  
result = 0
s_count = 1
while(1):
  if s_count >= B:
    break;
  s_count += A - 1
  result += 1

print(result)

Solution (Python):



import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a,b = LI()
n = 1
if b == 1:
    print(0)
    quit()
while 1:
    if a + (n-1)*(a-1) >= b:
        print(n)
        quit()
    n += 1

Solution (Python):
import sys

A, B = map(int, input().split())
if B == 1:
	print(0)
	sys.exit()

cond = True
tmp = 0
cnt = 0
while cond:
	cnt += 1
	tmp += A
	if tmp >= B:
		cond = False
	else:
		tmp -= 1
print(cnt)

Solution (Python):
import sys
a, b = map(int, input().split())
i = 1
if b == 1:
    print(0)
    sys.exit()

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

Solution (Python):
A,B = map(int,input().split())
ans = 0

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

print(ans)

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

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

Solution (Python):
a, target = map(int, input().split())

available, used = 1, 0
while available < target:
  available = available + a - 1
  used = used + 1
print(used)

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

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

print(ans)

Solution (Python):
a,b=map(int,input().split())
c=[]
for i in range(20):
  if (a-1)*i>=b-1 :
    c.append(i)
print(c[0])

Solution (Python):
i = input()
a = int(i.split(' ')[0])
b = int(i.split(' ')[1])
r = (b - 1) // (a - 1)
if (b - 1) % (a - 1) != 0:
    r += 1
print(r)

Solution (Python):
import math
i = input().split()
a = int(i[0])
b = int(i[1])
c = math.ceil((b-a)/(a-1))
print(c+1)

Solution (Python):
import sys
INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
sys.setrecursionlimit(10 ** 9)


def main():
    A, B = MAP()

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


if __name__ == '__main__':
    main()

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

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

n = 1
kuchi = a

while kuchi < b:
    n += 1
    kuchi += a - 1

print(n)

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

res = (b - 1) // (a - 1)
if (b - 1) % (a - 1) != 0:
    res = res + 1
print(res)

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

Solution (Python):
a, b = map(int, input().split())
count = 1
ll = a
if b == 1:
    print(0)
else:
    while b > ll:
        count += 1
        ll += a-1
    print(count)

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

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

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

num = 1

for i in range(1000):
    num += (A-1)
    if num >= B:
        print(i+1)
        sys.exit()

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

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

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

Solution (Python):
A, B = list(map(int, input().split()))
c = -1
x = 1

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

c = max(0, c)
print(c)

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

Solution (Python):
import math

A, B = map(int, input().split())
ans = int(0)
count =int(1)
plug = int(A)
if B==1:
    ans = 0
else:
    while plug < B:
        plug += A - 1
        count += 1

    ans = count

print(ans)

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

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

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

n=0
if B==1:
    print(0)
elif B<=A :
    print(1)
else:
    n=A
    counter =1
    while n <B:
        n+=(A-1)
        counter += 1
    print(counter)

Solution (Python):

import sys

def main():
    a,b = map(int, input().split())
    count = 1
    cosuu = 0

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

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

if __name__ == '__main__' :
    main()

Solution (Python):
A, b = map(int, input().split())

if b == 1:
	print(0)
elif b <= A:
	print(1)
elif b <= 2*A - 1:
	print(2)
elif b <= 3*A - 2:
	print(3)
elif b <= 4*A - 3:
	print(4)
elif b <= 5*A - 4:
	print(5)
elif b <= 6*A - 5:
	print(6)
elif b <= 7*A - 6:
	print(7)
elif b <= 8*A - 7:
	print(8)
elif b <= 9*A - 8:
	print(9)
elif b <= 10*A - 9:
	print(10)
elif b <= 11*A - 10:
	print(11)
elif b <= 12*A - 11:
	print(12)
elif b <= 13*A - 12:
	print(13)
elif b <= 14*A - 13:
	print(14)
elif b <= 15*A - 14:
	print(15)
elif b <= 16*A - 15:
	print(16)
elif b <= 17*A - 16:
	print(17)
elif b <= 18*A - 17:
	print(18)
else:
	print(19)

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

Solution (Python):
ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

if b == 1:
	ans = 0
else:
	ans = 1
	n = a
	while n < b:
		n += a-1
		ans += 1

print(ans)

Solution (Python):
import math

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

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

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

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

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

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

print(math.ceil(c))

Solution (Python):
a,b=(int(i) for i in input().split())
a=a-1
b=b-1
if b//a==b/a:
  print(b//a)
else:
  print((b//a)+1)

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

Solution (Python):
import math

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

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

Solution (Python):

def main():
    A,B = map(int,input().split())
    if B == 1:
        print(0)
        return
    tap = A
    ans = 1
    while True:
        if tap >= B:
            print(ans)
            return
        tap+=A-1
        ans+=1


if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
c = 1

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

        if b <= 0:
            break
        
print(c)

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

n = 1
ans = 0

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

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

Solution (Python):
def main():
    a, b = [int(x) for x in input().split()]
    if b == 1:
        print(0)
        return
    n = 1
    b -= a
    while b > 0:
        b -= a-1
        n += 1
    print(n)
    return


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    [A, B] = [int(number) for number in input().split()]

    raw = (B - 1) / (A - 1)
    ans = int((B - 1) / (A - 1))
    if raw == ans:
        print(ans)
    else:
        print(ans + 1)

if __name__ == '__main__':
    main()

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

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

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

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

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

print(N)

Solution (Python):
A, B = map(int, input().split())
a = A-1
b = B-1
c = b//a
if b == 0:
  print(0)

elif b%a ==0:
  print(c)
else:
  print(c+1)

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

Solution (Python):
import math

def main():
    line = input().split(" ")
    a = int(line[0])
    b = int(line[1])
    result = math.ceil((b-1)/(a-1))
    print(result)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import  math

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

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

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

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

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

result=1
sum_=a

if b==1:
  print(0)
  exit()
while(sum_<b):
  result+=1
  sum_+=(a-1)
print(result)

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

ans = 0

out = 1

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

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

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

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

ans=1
c=a
z=0
if b==1:
    print(0)
else:
    while z==0:
        if c>=b:
            print(ans)
            z=1
        else:
            ans+=1
            c+=a-1

Solution (Python):
import math

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

Solution (Python):
n1, n2 = [int(i) for i in input().split()]

t1 = (((n2 - n1) - 1) // (n1 - 1)) + 2

print(t1)

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


def count(n_i, i):
    if n_i >= b:
        return i
    return count(n_i - 1 + a, i + 1)


print(count(1, 0))

Solution (Python):
import math

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

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

print(N)

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

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

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

R = 1
i = 0
while R < B :
    R = (R - 1) + A
    i = i + 1

print(i)

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

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

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

plug = 0

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

print(plug)

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

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

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

Solution (Python):

import sys


def solve(A: int, B: int):
    count_plug = 0
    count_available = 1
    if B==1:
        print(0)
        return
    while True:
        count_available += A
        count_plug += 1
        count_available -= 1

        if count_available >= B:
            break
    print(count_plug)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)

if __name__ == '__main__':
    main()

Solution (Python):
a,b = map(int,input().split())
from math import ceil,floor

ans = ceil((b-1)/(a-1))

print(int(ans))

Solution (Python):
line = input()
line = line.split()
A = int(line[0])
B = int(line[1])

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

print(count)

Solution (Python):
a,b=map(int,input().split())
s=(b-1)//(a-1)
t=(b-1)%(a-1)

if b==1:
    print(0)
elif t!=0:
    print(s+1)
else:
    print(s)

Solution (Python):
a,b=map(int,input().split())
ans=0
if a>=b and b>1:
  ans=1
  b=0
while b>a:
  b-=(a-1)
  ans+=1
  if b<=a and b>0:
    ans+=1
    b=0
print(ans)

Solution (Python):
A, B = map(int, input().split())
cnt = 0
plug = 1

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

Solution (Python):
a, b = map(int, input().split())
c = 0
while 1 == 1:
    if c == 0:
        if b == 1:
            break
        b = b - a
    else:
        b = b - a + 1
    c = c + 1
    if b <= 0:
        break
print(c)

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


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

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

count = 1
remain = B - A
while True:
    if remain <= 0:
        print(count)
        break
    count += 1
    remain -= (A - 1)

Solution (Python):


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

ans = 0
u = 1
while 1:
    if u >= b:
        break
    ans += 1
    u -= 1
    u += a

print(ans)

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

outlet=1
cnt=0
while outlet<B:
  cnt+=1
  outlet=outlet+A-1

print (cnt)

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    a, b = rli()
    start = 1
    print(((b-1)+a-2)//(a-1))


if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
import sys
a,b=map(int,input().split())

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

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

Solution (Python):
a,b=[int(_) for _ in input().split()]
print((b+a-3)//(a-1))

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

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

Solution (Python):
A_B_list = [int(i) for i in input().split()]
A = A_B_list[0]
B = A_B_list[1]

count = 0
counter = 1
for i in range(20):
    if counter < B:
        counter += (A - 1)
        count += 1
    else:
        break

print(count)

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

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

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

Solution (Python):
import math
a, b = map(int, input().split())
if b == 1:
    res = 0
else:
    res = math.ceil((b - 1) / (a - 1))
print(res)

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

Solution (Python):
A, B = map(int, input().split())
b = B
n = 0
for i in range(B):
  if A*i+1 >= b:
    n = i
    break
  else:
    b += 1
print(n)

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

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

Solution (Python):
def solve():
  import sys
  import math

  sys.setrecursionlimit(10**7)

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


if __name__ == '__main__':
  solve()

Solution (Python):
import math


A, B = map(int, input().split())
ans = 0
while True:
    if ans == 0:
        tap = 1
    elif ans == 1:
        tap = A
    else:
        tap = A + (A-1) * (ans - 1)
    if tap >= B:
        break
    ans += 1
print(ans)

Solution (Python):
A, B = map(int, input().split())
n_ = (B-1)/(A-1)
n = (B-1)//(A-1)
if n_ > n:
  print(n+1)
else:
  print(n)

Solution (Python):
A, B = map(int, input().split())
i = 1
sum = A
while sum < B:
  sum += (A-1)
  i += 1
if B == 1:
  print(0)
else:
  print(i)

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

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

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

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

count = 1
ans = 1

for i in range(b):
        
        count += a-1
        if count >= b:
                print(ans)
                exit() 
        ans += 1

Solution (Python):
a, b = map(int, input().split())
x = a
ans = 1
while x < b:
    x += a - 1
    ans += 1
if b < 2:
    ans = 0
print(ans)

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

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

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

Solution (Python):
input = raw_input

x,y = map(int, input().split(" "))
ans = 0
t = 1
while t < y:
    t += (x-1)
    ans += 1
print(ans)

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

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

Solution (Python):





from sys import stdin,setrecursionlimit


setrecursionlimit(10**6)
input=stdin.readline

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

Solution (Python):

import sys


def solve(A: int, B: int):
    count_plug = 0
    count_available = 1
    if B==1:
        print(0)
        return
    while True:
        count_plug += 1
        count_available -= 1
        count_available += A
        if count_available >= B:
            break
    print(count_plug)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)

if __name__ == '__main__':
    main()