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:
# template by 3xC and starkizard.
# contributors: 

#####################################################################################
from __future__ import division, print_function 

import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io


"""Uncomment modules according to your need"""


# from bisect import bisect_left, bisect_right, insort
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from copy import deepcopy
# from decimal import *
# import re
# import operator

#####################################################################################
# this enables you to write python3 code with PyPy2 (Python 2)
if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

#####################################################################################

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""Uncomment next 4 lines if doing huge recursion"""
# import threading
# threading.stack_size(1<<27)
# sys.setrecursionlimit(10000

def prepare_factorial(mod=mod):
    """ returns two lists, factorial and inverse factorial modulo argument by default 10**9 +7 """
    # Comment code out when you don't need inverse factorial or vice versa
    fact = [1]
    for i in range(1, 200005):
        fact.append((fact[-1] * i) % mod)

    ifact = [0] * 200005
    ifact[200004] = pow(fact[200004], mod - 2, mod)
    for i in range(200004, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod
 
    return fact, ifact

def modinv(n, p):
    """ returns N inverse modulo p """
    return pow(n, p - 2, p)
 
def ncr(n, r,  fact, ifact):
    """ takes 4 arguments: n , r and factorial and inverse factorial lists"""
    t = (fact[n] * (ifact[r]*ifact[n-r]) % MOD)% MOD
    return t


def get_n(Sum):    
    """this function returns the maximum n for which Summation(n) <= Sum"""
    ans = (-1 + sqrt(1 + 8*Sum))//2
    return ans

def sieve(n):
    """ returns a list of prime numbers till n """
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r



def divs(n, start=1):
    """ returns a list of all divisors till n """
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors



def divn(n, primes):
    """ returns the number of divisors, two arguments n and the sieve till n """
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t



def lrfind(d, x, default=-1):
    """ Takes 2 arguments an iterable and an element. returns a tuple (firstoccurence,lastoccurence) -1 if not found """
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return default, default
    else:
        return left, right

def gcd(x, y): # math.gcd is slower
    """ returns greatest common divisor of x and y """
    while y:
        x, y = y, x % y
    return x

def ceil(n, k): return n // k + (n % k != 0) #returns math.ceil but protecting against floating inconsistencies
def input(): return sys.stdin.readline().strip()
def ii(): return int(input()) #inputs integer
def mi(): return map(int, input().split()) # inputting space seperated variables for example x,y,z
def li(): return list(map(int, input().split())) #inputting a space seperated list of integers
def lw(): return input().split() #inputting a space seperated list of strings
def lcm(a, b): return abs(a * b) // gcd(a, b) #returns LCM of two arguments
def prr(a, sep=' ', end='\n'): print(sep.join(map(str, a)), end=end) #For printing an iterable with seperator sep as optional second argument (default : " "), ending character (default: "\n") as optional third
def dd(): return defaultdict(int) #returns a dictionary with values defaulted to 0
def ddl(): return defaultdict(list) #returns a dictionary with values defaulted to []
def write(s): return sys.stdout.write(s)

###################################################################
def main():
    #CODE GOES HERE:
    a,b=mi()
    b-=a
    c=ceil(b,a-1)
    print(c+1)
""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""
 
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange
 
import os, sys
from io import IOBase, BytesIO
 
BUFSIZE = 8192
 
class FastIO(BytesIO):
    newlines = 0
 
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None
 
    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s
 
    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()
 
    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)
 
 
class IOWrapper(IOBase):
 
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')
 
""" main function"""
 
if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
def resolve():
    A, B = [int(i) for i in input().split()]
    ans = 0
    now = 1
    while now < B:
        now += A - 1
        ans += 1
    print(ans)


resolve()

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    a, b = geta(int)

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
unused = 1
tap_num = 0
while not unused >= b:
  unused += a-1
  tap_num += 1
print(tap_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:
A, B = map(int, input().split())
ans = 0
sum_of_tap = 1
while sum_of_tap < B:
  sum_of_tap += A - 1
  ans += 1
print(ans)

Submission status: Accepted

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

ans = -(-(B-1)//(A-1)) #切り上げしたいから
print(ans)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
N,K = [int(x) for x in input().split()]
N = N-1
kosuu = 1
for i in range(1000):
    if kosuu >= K:
        print(i)
        break
    kosuu += N

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
port = 1

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

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


a, b = LI()
guchi = 1
ans = 0
while guchi < b:
    guchi += a - 1
    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:
import math
a,b = list(map(int,input().split()))
ans = 0
num = 1
while (num < b):
    num -= 1
    num += a
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

A, B = [int(x) for x in input().split(' ')]
plug = 1
table_tap = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

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

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

Submission status: Accepted

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

for n in range(0, 500):
    if 1 + n * A - n >= B:
        break

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sockets = 1
goal = b

ans = 0
while sockets < goal:
    ans += 1
    sockets += a - 1

print(ans)

Submission status: Accepted

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

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())
c = 0
total = 1
while total<B:
  total += (A-1)
  c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    a, b = geta(int)

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

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

    print(n)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math


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

def actual(a, b):
    return math.ceil((b - 1) / (a - 1))

print(actual(a, b))

Submission status: Accepted

Solution code:
import math

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

B -= A
A -= 1

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

Submission status: Accepted

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

Submission status: Accepted

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

# 初期状態（1口）
n=1

# タップの数
ans=0

# タップを1つずつ差していく
# 差すことでa口増えるが、差した口も1つ減る
while True:
  # b口以上になったら終了
  if n>=b:
    print(ans)
    exit()
    
  n+=a
  n-=1
  ans+=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:
# coding: utf-8
import math
a, b = map(int,input().split())

if a >= b:
    ans = 1
else:
    ans = 1
    ans += math.ceil((b-a)/(a-1))
if b == 1:
    ans = 0
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
count = 0
while a * count - (count - 1) < b:
  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:
import math
a,b=map(int,input().split())
n=math.ceil((b-a)/(a-1))
print(n+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
#入力
a, b = map(int, input().split())
#関数の定義
def abc139B(a, b):
    return math.ceil((b-1)/(a-1))
print(abc139B(a, b))

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    A, B = map(int, input().split())

    c = 1
    ans = 0

    while True:
        if c < B:
            c += (A - 1)
            ans += 1
        else:
            break

    print(ans)


if __name__ == '__main__':
    solve()

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 += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()

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

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())

t = 1
cnt = 0

while  t<b:
    t += (a-1)
    cnt += 1
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(n)

Submission status: Accepted

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

x = 1
n = 0
while x < b:
  x += a - 1
  n += 1

print(n)

Submission status: Accepted

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

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L, R = map(int, input().split())
s = (R - 1) // (L - 1)
r = (R - 1) % (L - 1)
if r == 0:
  ans = s
else:
  ans = s + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
import math
ans = math.ceil( (b-1)/(a-1) )

print(ans)

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
A,B = map(int,input().split())

from math import ceil
print(ceil((B-1)/(A-1)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    a, b = map(int, input().split())

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

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

cnt = 0
total = 0

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

for i in range(30):
    if i == 0:
        total = a
        cnt += 1
    else:
        total += a-1
        cnt += 1
    
    if b <= total:
        break

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import math
A, B = map(int,input().split())

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

print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
outlet = 1

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

print(ans)

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:
def solve(a, b):
    return (a+b-3) // (a-1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, raw_input().split(' '))
q = 1
u = 0
while(q < b):
	q -= 1
	q += a
	u += 1
print u

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())
print((b-1)//(a-1) + ((b-1)%(a-1) != 0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
print(-((-b+1)//(a-1)))

Submission status: Accepted

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

Submission status: Accepted

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

x = 1
num = 0
while True:
    if b == 1:
        num = 0
        break
    x += (a - 1)
    num += 1
    if x >= b:
        break
        
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

plug=1
tap=0
while plug < b:
    tap+=1
    plug+=a-1
print(tap)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 1
ans = 0

for i in range(20):
    if count >= b:
        break
    else:
        count += a - 1
        ans += 1

print(ans)

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:
	cnt = 0
else: cnt = 1

B -= A


while B > 0:
	B -= (A-1)
	cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
    a, b = MI()

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



if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
#!/usr/bin/env python3
import sys
import math

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    A, B = map(int, readline().split())
    # 1 + (A - 1) * n >= B
    # n >= (B - 1) / (A - 1)
    ans = math.ceil((B - 1) / (A - 1))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

def main(a,b):
    if b<=a:
        return 1
    x=b-a
    q=x//(a-1)
    r=x%(a-1)
    if(r==0):
        return q+1
    else:
        return q+2

def main2(a,b):
    nc=1
    ntap=0
    while(nc<b):
        ntap+=1
        nc+=a-1
    return ntap

if __name__=='__main__':
    a,b=readinput()
    ans=main2(a,b)
    print(ans,end='')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[16]:


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


# In[18]:


ans = 0
plug = 1
while 1:
    if plug >= B:
        break
    else:
        ans += 1
        plug = plug - 1 + A
#         print(plug)
print(ans)


# In[ ]:

Submission status: Accepted

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

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

Submission status: Accepted

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


answer = i

print(answer)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if b==1:
    print(0)
elif a>=b:
    print(1)
elif (a-b)%(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())

i=0

while True:

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

Submission status: Accepted

Solution code:
import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
  a, b = map(int, input().split())
  if b <= 1:
    print(0)
  elif a >= b:
    print(1)
  else:
    print(math.ceil((b-a)/(a-1))+1)
  return 0
 
if __name__ == "__main__":
  solve()