Problem:


Score : 200 points

Problem Statement

Takahashi's house has only one socket.

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

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

Find the minimum number of power strips required.

Constraints

All values in input are integers.

2 \leq A \leq 20

1 \leq B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the minimum number of power strips required.

Sample Input 1

4 10

Sample Output 1

3

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

Sample Input 2

8 9

Sample Output 2

2

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

Sample Input 3

8 8

Sample Output 3

1



Sample input:
4 10


Sample output:
3

Submission status: Accepted

Solution code:
import 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())
for i in range(100):
    if 1+(a-1)*i>=b:
        print(i)
        break

Submission status: Accepted

Solution code:
from math import ceil
A,B = map(int,input().split())
count = 0 
num = 1
while num < B:
    num -= 1
    num += A
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
s = input().split()
s_i = [int(d) for d in s]
c = 1
cnt = 0
while s_i[1] > c:
    c = c - 1 + s_i[0]
    cnt = cnt + 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

tap = int(i[0])
need = int(i[1])
count = 1
needed_tap = 0
while count < need:
  count = count + (tap - 1)
  needed_tap = needed_tap +1
 
print(str(needed_tap))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B == 1:
    print(0)
else:
    q, mod = divmod(B, A-1)
    if mod <= 1 and A == 2:
        print(q-1)
    elif mod <= 1:
        print(q)
    else:
        print(q+1)

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split(" ")]
if B == 1:
  print(0)
elif B <= A:
  print(1)
else:
  if (B-1)%(A-1) == 0:
    print((B - 1) // (A - 1))
  else:
    print((B - 1) // (A-1) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if A == 2:
    ans = B-1

elif B == 1:
    ans = 0
    
else:
    ans = 1 + (B-2)//(A-1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# 1つだけaであとはa-1個
# a, b = map(int, input().split())
# if b <= a:
#     print(1)
# else:
#     cur = a
#     c = 1
#     while cur < b:
#         c += 1
#         cur += a - 1
#     if cur -
#     print(c)
# なぜかダメなので愚直
a, b = map(int, input().split())
c = 0
cur = 1
while True:
    if cur >= b:
        break
    cur += a - 1
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
def main():
    A, B = [int(i) for i in input().split()]
    one = A
    many = 0
    for N in range(20):
        if A * 1 + (A-1) * N >= B:
            many = N + 1
            break
    if B == 1:
        print(0)
        exit()
    if A >= B:
        print(1)
    else:
        print(many)
main()

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
a=0
b=s[0]-1
if s[1]==1:
  print(a)
else:
  a=a+1
  while s[1]>s[0]:
    a=a+1
    s[0]=s[0]+b
  print(a)

Submission status: Accepted

Solution code:
A, B = [int(s) for s in input().split()]
count = 1
while True:
  if B == 1:
    print(0)
    break
  elif count*(A-1)+1 >= B:
    print(count)
    break
  count = count+1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import sys
 
debug = False
 
def log(text):
    if debug:
        print(text)
 
def parse_input(lines_as_string = None):
 
    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
 
    token = lines[0].split()
    a = int(token[0])
    b = int(token[1])
 
    return (a, b)
 
 
def solve(a, b):
  
    if b == 1:
        return 0

    result = -1
    for n in range(1, 20):
        if a + (n-1)*(a-1) >= b:
            result = n
            break
        
 
    return result
 
 
def main():
    # 出力
 
    print("%s" % solve(*parse_input()))
 
if __name__ == '__main__':
 
    main()

Submission status: Accepted

Solution code:
S = input().split()
cnt = 1
num = int(S[0])

if int(S[1]) == 1:
  print(0)
else:
  while(num < int(S[1])):
    num += (int(S[0]) - 1)
    cnt += 1
  print(cnt)

Submission status: Accepted

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

if B ==1:
  k=0
else:
  k=1

t = B-A

if t > 0:
  q, mod = divmod(t, A-1)
#  print("q="+str(q),mod)
  k=k+q
  if mod != 0:
    k = k+1

  

print(k)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if (B-1) % (A-1) != 0:
	num += 1

print(int(num))

Submission status: Accepted

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

while True:
    if A < B:
        A += tmp - 1
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

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

for i in range(50):
	if B<=A*i-(i-1):
		print i
		quit()

Submission status: Accepted

Solution code:
List = list(map(int, input().split()))
A = List[0]
B = List[1]
if B==1:
    print(0)
else:
    i=1
    K=0
    while True:
        if B<=(A*i-K):
            print(i)
            break
        i+=1
        K+=1

Submission status: Accepted

Solution code:
import sys

input_str = input().split(" ")
A = int(input_str[0])-1
B = int(input_str[1])
rem = (B-1)%A
ans = int((B-1)/A)
if rem!=0:
    ans += 1
if B==1:
  ans = 0
print(ans)

Submission status: Accepted

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

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

x = a

for i in range(1, 100000):
    if x >= b:
        print(i)
        exit()
    x = x + a - 1

Submission status: Accepted

Solution code:
A, B = (int(i) for i in input().split())
a = A - 1
ans = 1
c = A
if B == 1:
    print(0)
else:
    while c < B:
        c = c + a
        ans += 1
    print(ans)

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

A, B =  map(int, sys.stdin.readline().split())

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


now = A
cnt = 1
while True:
    if now >= B:
        break
    now += (A - 1)
    cnt += 1

print(cnt)

Submission status: Accepted

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

for n in range(1, 20):
    if B == 1:
        print(0)
        break

    if (A - 1) * (n-1) + A >= B:
        print(n)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
T = A
if B == 1:
	print(0)
elif T >= B:
	print(1)
else:
	for i in range(2,50):
		if T < B:
			T += A-1
			continue
		else:
			print(i-1)
			break

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
A_B = input()
A_B_list = A_B.split(" ")

A = int(A_B_list[0])
B = int(A_B_list[1])

socket = 1
result = 0


# if A == 2:
#     print(B-1)
# else:
#     result = (B // (A - 1)) + 1
#     if (A-1) * (result-1) + 1 == B:
#         result -= 1
# 
#     print(result)
    
while True:
    if socket >= B:
        print(result)
        break
    socket += (A-1)
    result += 1

Submission status: Accepted

Solution code:
# 2019 9.1
# Power Socket

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

kuti = 1
cnt = 0

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

print(cnt)

Submission status: Accepted

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

ans = 1 + ((B-A) + (A-1) - 1)//(A-1)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a, b = map(int, input().split())

result = 1
socket = a
if b == 1:
    result = 0
else:
    result = 1

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

Submission status: Accepted

Solution code:
import math
N,M=list(map(int,input().split()))
if M==1:
    print(0)
    exit()
M-=N

if M<1:
    print(1)
    #exit()
else:
    print(1+math.ceil(M/(N-1)))

Submission status: Accepted

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

Submission status: Accepted

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k = A

if B == 1:
    i = 0
else:
    i = 1

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s,t = map(int,(input().split()))
x = 0
sum = 1
while 1:
  if sum >= t:
    print(x);exit()
  sum += s - 1
  x += 1

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

if AB[1] == 1:
    print(0)
    sys.exit(0)

b = AB[1] - AB[0]

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

c = b // (AB[0]-1)

if b % (AB[0]-1) != 0:
    print(c+2)
else:
    print(c+1)

Submission status: Accepted

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

def main():
    A, B = map(int,input().split())
    tap = 0
    s = 1
    while s < B:
        tap += 1
        s += A - 1
    print(tap)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

a, b = na()
if b ==1:
        print(0)
elif (b-1)%(a-1)==0:
        print((b-1)//(a-1))
else:
        print((b-1)//(a-1)+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
# cook your dish here
a,b=list(map(int,input().split()))
l=[1]*a
f=1
s=0
if(b<2):
    print(0)
    exit()
else:
    s=1
while(f==1):
    for i in range(0,a):
        if(sum(l)>=b):
            f=0
            break
        else:
            l[i]=l[i]-1+a
            s=s+1
        #print(l,s)
print(s)

Submission status: Accepted

Solution code:
import math
n,m=input().split()
n=int(n)
m=int(m)
cnt=0
cnt=math.ceil((m-n)/(n-1))
print(cnt+1)

Submission status: Accepted

Solution code:
A , B = list(map(int, input().split()))
q =0
for i in range(20):
    if i*A-(i-1) < B:
        q += 1
    else:
        break

print(q)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tako = 0
outlet = 1
while outlet < b:
    outlet += a - 1
    tako += 1
print(tako)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def inq(x, n):
    if B == 1:
        return 0
    if B <= x:
        return n
    return inq(x + A-1, n+1)

print(inq(A, 1))

Submission status: Accepted

Solution code:
S = str(input())
vals = S.split(' ')
A = int(vals[0])
B = int(vals[1])
total = A
n = 0
while (A + (A - 1) * (n - 1)) < B:
    n += 1
    
print("%d"% n)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B == 1:
  print(0)
elif A >= B:
  print(1)
else:
  rest = B-A
  cnt = 1
  while rest > 0:
    rest -= A-1
    cnt += 1
  print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

l = 0
if(b == 1):
    print(0)
else:
    c = a + 1
    l += 1
    while(c < b):
        c += a
        l+=1
    print(l)

Submission status: Accepted

Solution code:
a=input().split(" ")
A=int(a[0])
B=int(a[1])
b=(B-1)//(A-1)
if (B-1)%(A-1)!=0:
    b+=1
print(b)

Submission status: Accepted

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

mod = (b - 1) % (a - 1)
rslt = int((b - 1) / (a - 1))

if mod ==  0 :
  print(rslt)
else:
  print(rslt + 1)

Submission status: Accepted

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

print(taps)

Submission status: Accepted

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

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


print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
 
A, B = map(int,input().split())
tmp = A
ctr = 1
if B == 1:
    print(0)
else:
    while True:
        if tmp >= B:
            print(ctr)
            break
        else:
            tmp += A - 1
            ctr += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
# import collections

# import bisect
# import math
# import numpy as np
# from fractions import gcd

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    a, b = ip.IL()
    count = 0
    ans = 0
    if b == 1:
        print(0)
    else:
        while count < b:
            # print(count)
            if count == 0:
                count += a
            else:
                count += a-1
            ans += 1
        print(ans)



main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(int(1e6))

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

# n(A-1) + 1 >= B
# n >= (B-1)/(A-1)
a = A-1
b = B-1
ans = b//a + bool(b%a)
print(ans)

Submission status: Accepted

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

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

count = 0
plug = 1
for i in range(0, 21):
  count = plug + (A - 1) * i
  if count >= B:
    print(i)
    exit()

Submission status: Accepted

Solution code:
from math import ceil

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math


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

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

Submission status: Accepted

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

print (result)

Submission status: Accepted

Solution code:
"""
https://atcoder.jp/contests/abc139/tasks/abc139_b
"""

import numpy as np


def calc(A: int, B: int) -> int:
    return int(np.ceil((B - 1) / (A - 1)))


def load_input_as_int_array() -> np.ndarray:
    return np.array([int(v) for v in input().split(" ")])


def main() -> None:
    A, B = load_input_as_int_array()
    result = calc(A, B)
    print(result)


main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if b ==1:
    n =0

elif b <=a:
    n =1
else:
    n = (b-a)/(a-1) +1
    n = math.ceil(n)
    
print(n)

Submission status: Accepted

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

ans=1
c=a
if b==1:
    print(0)
    exit()
while c<b:
    c-=1
    c+=a
    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:
import sys
inputs = sys.stdin.readlines()

A, B = map(int, inputs[0].split())
if B == 1:
  print(0)
else:
  ok = A
  use = 1
  while ok < B:
      use += 1
      ok += A-1

  print(use)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if b == 1:
    print(0)

else:
    while all < b:
        ans += 1
        if ans > 0:
            all = a * ans - (ans - 1)
        else:
            all = a * ans

    print(ans)

Submission status: Accepted

Solution code:
input_ = input()
input_ = input_.split(' ')
a = int(input_[0])
b = int(input_[1])
cnt = 1
mouth = 0
for idx in range(20):
  if cnt >= b:
    break
  cnt += a -1
  mouth +=1
  
print(mouth)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""
a,b=  map(int, sys.stdin.readline().split())

# c=1
# t=a
# while True:
#     if t>=b:
#         break
#     else:
#         t+=a-1 
#         c+=1
# print(c)

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

Submission status: Accepted

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

Submission status: Accepted

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

    cnt = 1

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

    print(cnt)
        

main()

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:
inp = input() 
inp_lis = inp.split(" ")
A = int(inp_lis[0])
B = int(inp_lis[1])

add_times = 0
number_of_tap = 1

while number_of_tap < B:
    number_of_tap = number_of_tap + A - 1
    add_times = add_times + 1

print(add_times)

Submission status: Accepted

Solution code:
import math

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

# 1 + (A-1)*n >= B
# n >= (B-1)/(A-1)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# n個さしたら口はn*a-(n-1) = a*n-n+1個
if b == 1:
  print(0)
else:
  for i in range(1,21):
    if a*i - i + 1 >= b:
      n = i
      break	
  print(n)

Submission status: Accepted

Solution code:
def main():

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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