Problem:


Score : 200 points

Problem Statement

Takahashi's house has only one socket.

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

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

Find the minimum number of power strips required.

Constraints

All values in input are integers.

2 \leq A \leq 20

1 \leq B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the minimum number of power strips required.

Sample Input 1

4 10

Sample Output 1

3

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

Sample Input 2

8 9

Sample Output 2

2

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

Sample Input 3

8 8

Sample Output 3

1



Sample input:
4 10


Sample output:
3

Submission status: Accepted

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

Submission status: Accepted

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

tmp = B // (A - 1)

if B == 1:
    print(0)
elif A == 2:
    print(B - 1)
elif tmp * (A - 1) + 1 >= B:
    print(tmp)
else:
    print(tmp + 1)

Submission status: Accepted

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

con_c = 1
ans = 0

while True:
    if con_c >= B:
        break
    ans += 1
    con_c += (A-1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

# 整数複数個
A, B = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

c = 0
s = 0
if b == 1:
	print (0)
	exit()
while s < b:
	c += 1
	if c == 1:
		s += a
	else:
		s += a-1
print (c)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if B == 1:
    print(0)
    exit()
elif B <= A:
    print(1)
    exit()
else:
    for i in range(20):
       if B <= A+i*(A-1):
           print(1+i)
           exit()

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
while B > 1:
    B -= A - 1
    count += 1

print(count)

Submission status: Accepted

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

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=[int(x) for x in input().split()]
 
c=1
ans=0
while True:
  if c>=b:
    break
  else:
    c+=a-1
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import fractions
A,B=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())

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(A: int, B: int):
    ans = 0
    outlet = 1
    while B > outlet:
        outlet += (A - 1)
        ans += 1
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = il()
    tap = 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
il = [int(k) for k in input().split()]
A = il[0]
B = il[1]
for i in range(B):
    if i * A - i + 1 >= B:
        print(i)
        break

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())
tap = 1

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

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

Submission status: Accepted

Solution code:
A, B = [int(A) for A in input().split()] 
socket = 0
count = 0
if B==1 :
    count=0
elif B != 0 :
    while socket < B :
        if socket + A < B :
            socket = socket + A - 1
            count += 1
        elif socket+A >= B :
            socket = socket + A
            count += 1
print(count)

Submission status: Accepted

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

count = 1
if b == 1:
    print("0")
    exit()
while True:
    if count ==1:
        temp = a * count 
    else:
        temp = a + ((a-1) * (count -1))
    if temp >= b:
        print(count)
        exit()
    else:
        count += 1

Submission status: Accepted

Solution code:
def power_socket(a, b):

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

    return ans

def main():
    a, b = map(int, input().split())
    print(power_socket(a, b))

if __name__ == '__main__':
    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:
import math
A, B  = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# ex) 3->5->7(5-1+3)
# a-x+ax>=b
# (a-1)x>=b-a
# x>=(b-a)/(a-1)

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
ana = 1

for i in range(b*2):
    if ana >= b:
        break
    else:
        ans +=1
        ana = ana + a -1

print(ans)

Submission status: Accepted

Solution code:
def sum(A, B):
  n = 0
  while True:
    if n >= (B-1)/(A-1):
      return n
    else:
      n += 1

num = input().split(' ')
A = int(num[0])
B = int(num[1])

n = sum(A,B)
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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:
# -*- coding: <encoding name> -*-

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

Submission status: Accepted

Solution code:
# -*- coding: <encoding name> -*-

import math
a, b = map(int, input().split())
# range = d * 2 + 1
# c == 1 + a * n - n >= b
print(math.ceil((b - 1) / (a - 1)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
def invr():
    return(map(int, input().split()))


a, b = invr()
c = 0
outlet = 1
while outlet < b:
    outlet -= 1
    outlet += a
    c += 1
print(c)

Submission status: Accepted

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

def f(k):
  return k*A - k +1

l = 0
r = 20

while l<r:
  m = (l+r)//2
  if f(m) >= B:
    r = m
  else:
    l = m+1
print(r)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if y == 1:
    print(0)
elif y <= x:
    print(1)
else:
    cnt = 1
    total = x
    while True:
        total += (x - 1)
        cnt += 1
        if total >= y:
            break
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

A, B = LI()

concent = 1
ans = 0
while True:
    if concent >= B:
        break
    else:
        concent = concent - 1 + A
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
A, B = [int(_) for _ in input().split()]
x = A
ans = 1
if B == 1:
    print(0)
else:
    while(x < B):
        ans += 1
        x += (A - 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())

i = a
c = 1
while int(i) < int(b):
  i += int(a) - 1
  c += 1
if int(b) == 1:
  print(0)
else:
  print(c)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

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

print(math.ceil(ans))

Submission status: Accepted

Solution code:
tap_socket_num, required_socket = map(int, input().split())

if required_socket <= 1:
    print(0)
elif required_socket <= tap_socket_num:
    print(1)
else:
    n = (required_socket-tap_socket_num)%(tap_socket_num - 1)
    if n == 0:
        print((required_socket - tap_socket_num)//(tap_socket_num - 1) + 1)
    else:
        print((required_socket - tap_socket_num)//(tap_socket_num - 1) + 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2問目
A, B = map(int, input().split())
plug = 1 #最初のプラグの個数
count = 0
while(plug < B):
    plug -= 1
    plug += A
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(1,23):
  if i*(A-1)+1 >= B:
    print(i)
    sys.exit()

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
socket = 1
while socket < B:
    cnt += 1
    if cnt == 1:
        socket = A
    else:
        socket += A - 1

print(cnt)

Submission status: Accepted

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

print(num)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a,b=map(int,stdin.readline().split())
print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

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

for n in range(1000):
    if n*a-n+1 >= b:
        print(n)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

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

count = 0

if not A == B:
    while ((count*A)-(count-1)) < B:
        count += 1

else:
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#if count == 0:
#    count += a
#    ans += 1

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

print(ans)

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

print(ans)

Submission status: Accepted

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

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())
count=1
A_sample=A

if B==1:
  print(0)
else:
  while A<B:
    count+=1
    A=(A-1)+A_sample
  print(count)

Submission status: Accepted

Solution code:
def resolve():
    x,y = map(int,input().split())
    ans = (y-2) // (x-1) + 1
    print(ans)
resolve()

Submission status: Accepted

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

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 sys
from io import StringIO
import unittest


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

    ans = 0
    tmp = 1

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

    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4 10"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """8 9"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """8 8"""
        output = """1"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:





inp = input().split()
for a in inp:
    out = int(a)
inp.pop(1)
for a in inp:
    i = int(a)
    
n = 1
while (i*n-(n-1)) < out:
    n += 1

else:
    if out == 1:
        print(0)
    else:
        print(n)

Submission status: Accepted

Solution code:
A, B = (int(x) for x in input().split())

S = A
num  = 1
i = 1

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

Submission status: Accepted

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

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:
import math
a, b = list(map(int,input().split()))
x = math.ceil((b-1)/(a-1))
print(x)

Submission status: Accepted

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

tmp = 1
ans = 0

while tmp < b:
    tmp += (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())
print(- (-(B - 1) // (A - 1)))

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3
# coding: utf-8


hairu = input()
sockets = 0
plugs = 1
ab = hairu.split()

while True:
    if int(ab[1]) == 1:
        print(0)
        break

    sockets += 1
    plugs -= 1
    plugs += int(ab[0])
    if int(ab[1]) <= plugs:
        print(sockets)
        break

Submission status: Accepted

Solution code:
A,B = [int(hoge) for hoge in input().split()]
print((B-2)//(A-1)+1)

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B = inputIL()

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

Submission status: Accepted

Solution code:
x = input().split()

a = int(x[0])
b = int(x[1])

c = 1
outlet = a
if(b==1):
  print(0)
  exit()

while True:
  if(outlet >= b):
    print(c)
    break
  elif(outlet < b):
    c = c + 1
    outlet = outlet + a - 1

Submission status: Accepted

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

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

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 sys
import math
import bisect

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
#190901B
A, B = map(int, input().split())
ans=0
if B == 1:
    ans = 0
else:
    if A == 2:
        ans = B -1
    else:
        if B%(A-1)==1:
            ans = (B-1)//(A-1)
        else:
            ans = (B-1)//(A-1)+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(result)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    num_socket = 1
    num_tap = 0 
    while num_socket < B:
        num_tap += 1
        num_socket += A - 1
    print(num_tap)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
s = input().split()
A = int(s[0])
B = int(s[1])
y = (B - 1) / (A - 1)
x = math.ceil(y)
print(x)

Submission status: Accepted

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

sockets = 1
taps = 0
while sockets < b:
  sockets += a - 1
  taps += 1
  
print(taps)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = (int(i)for i in input().split())
ans =0
d = 1
while d<b:
  ans+=1
  d = d-1+a
print(ans)

Submission status: Accepted

Solution code:
a,b = (int(i)for i in input().split())
ans = 0
d = 1
while d<b:
  ans+=1
  d = d-1+a
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# a>=bなら1
# 2a-1(=a+a-1)>=bのとき2
# a+2(a-1)>=bのとき3
#電源タップC個使用するとして
#a+(a-1)(c-1)=a+ac-a-c+1=(a-1)c+1個のコンセントがりようできるので、b=<(a-1)c+1<b+aとなるcを求めれば良い
#(b-1)/(a-1)<=c & c<b/(a-1)+1 を満たすC
#b/(a-1)+1=(b-1)/(a-1)+1/(a-1)+1=(b-1)/(a-1)+a/(a-1)
#(b-1)/(a-1)<=c & c<(b-1)/(a-1)+a/(a-1) を満たすC
#(b-1)/(a-1)の切り上げ
print((b+a-3)//(a-1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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