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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if B == 1:
  print(0)
else:
  tap_num = 0
  available_socket_num = 0
  while B > available_socket_num:
    tap_num += 1
    available_socket_num = (A - 1) * tap_num + 1

  print(tap_num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
now = 0
ans = 0
f = True
while now < B:
    if f:
        now += A
        ans += 1
        f = False
    else:
        now += A-1
        ans += 1

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

Submission status: Accepted

Solution code:
A = list(map(int,input().split()))
totalTap = 1
useTap = 0
while totalTap < A[1]:
  totalTap = totalTap + A[0] - 1
  useTap = useTap + 1
print(useTap)

Submission status: Accepted

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

A = get[0]
B = get[1]


count = 0
plug = 1

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

Submission status: Accepted

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

ans = 1
tmp = a

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

while True:
    if tmp >= b:
        print(ans)
        quit()
    else:
        tmp += (a - 1)
        ans += 1

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

#print(A,B)
if B==1:
    n=0
else:
    n=1
    while True:
        if n*A-n+1>=B:
            break
        else:
            n+=1

print(n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().rstrip().split(' ')
A = int(s[0])
B = int(s[1])
 
sum = A
cnt = 1
flg = True
 
while flg:
  if B ==0 or B == 1:
    cnt = 0
    break
  if sum >= B:
    break
  sum += A -1
  cnt += 1
 
print(cnt)

Submission status: Accepted

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

m = 1
c = 0

while True:
	#print(m,c)
	if B <= m:
		break
	
	m = m - 1 + A
	c += 1
		
print(c)

Submission status: Accepted

Solution code:
def acinput():
    return list(map(int, input().split(" ")))

a,b=acinput()

dp={}
dp[1]=a
dp[0]=1
for i in range(1,100):
    dp[i]=dp[i-1]+a-1

res=0
for i in range(0,100):
    if dp[i]>=b:
        res=i
        break
print(res)

Submission status: Accepted

Solution code:
from math import ceil

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

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

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
s = 0
i = 0
while s < l[1]:
  s = l[0]*i - i +1
  i += 1

print(i-1)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
from sys import stdin

a,b = list(map(int,stdin.readline().rstrip().split()))

i = 1

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

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

Submission status: Accepted

Solution code:
a, b = [int(c) for c in input().split(' ')]
num = 0
bdash = b
if b == 1:
    num = 0
    bdash = -1
while bdash > 0:
    if bdash == a:
        num = num+1
        break
    elif bdash > a:
        num = num+1
        bdash = bdash - (a - 1)
    elif bdash < a:
        num = num + 1
        break
print(num)

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:

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

tap = 1
ans = 0

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

Submission status: Accepted

Solution code:
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())

# 電源の数
dengen = 1

# タップの数
tappu = 0

while dengen < B:
  tappu += 1
  dengen = dengen  + A - 1
  
print(tappu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b =[int(_) for _ in input().split()]
ans = 1
c = a
if b<=1:
    print(0)
    exit()
while 1:
    if c >=b:
        break
    ans+=1
    c += a-1
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

a,b = input().split()
a = int(a)
b = int(b)
num_tap = int(0)

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

if ((b-a)%(a-1))==0:
  print(num_tap+1)
else:
  print(num_tap+2)

Submission status: Accepted

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

count = 1
tap = a
while True:
    if tap >= b and b != 1:
        print(count)
        break
    elif b == 1:
        print(0)
        break
    else:
        count += 1
        tap = a*count - (count - 1)

Submission status: Accepted

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

a=0
plug=1
num=list(map(int,input().split()))
while plug<num[1]:
    plug=plug-1+num[0]
    a=a+1

print(a)

Submission status: Accepted

Solution code:
import math

a, b = input().strip().split(' ')
a, b = [int(a), int(b)]

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

n = 1
while True:
    if b == 1:
        print(0)
        break
    elif (a-1) * (n-1) + a >= b:
        print(n)
        break
    else:
        n+=1

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
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:
elc_tap = input().split(" ")
for i in range(2):
    elc_tap[i] = int(elc_tap[i])

count = 0
now_tap = 1
while elc_tap[1]>now_tap:
    now_tap += (elc_tap[0]-1)
    count += 1

    
print(count)

Submission status: Accepted

Solution code:
import sys
a, b = map(int, input().split())
num = 0
flg = True
while flg:
  if (a-1)*num + 1 >= b:
    flg = False
  else:
    num += 1
print(num)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c = 1
for i in range(30):
  if b <= c:
    break
  c += a-1
print(i)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
import math

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(numa)

Submission status: Accepted

Solution code:
import math

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

if b!=1:
  num = math.ceil((b-1)/(a-1))
else:
  num = 0

print(num)

Submission status: Accepted

Solution code:
#import math

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

#if A >= B: # B-A <=0 
#    print(1)
#else:
#    out = math.ceil((B-A) / (A-1)) + 1
#    print(out)

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

print(count)

Submission status: Accepted

Solution code:
import math

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

mytarget = (B-A)

print(1 + math.ceil(mytarget/(A-1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    ans = A
    sum_ = 1

    while True:
        if B == 1:
            sum_ = 0
            break

        if ans >= B:
            break

        sum_ += 1

        ans = ans - 1 + A

    print(sum_)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**9)
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a,b = na()

import math

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

Submission status: Accepted

Solution code:
#(A-1)n+1　とB

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
count = 0

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

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

A, B = ISI()
for i in range(1, 10000):
    if B == 1:
        print(0)
        break
    else:
        sum = A*i-(i-1)
        if sum >= B:
            print(i)
            break

Submission status: Accepted

Solution code:
import math
inputData = input().split()
A, B = [int(x) for x in inputData]

ans = math.ceil((B-1) / (A -1))
# if amari > 0:
#     ans += 1
print(ans)

Submission status: Accepted

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

ele = 1
ans = 0

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

print(ans)

Submission status: Accepted

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

c = 0
tmp = 1

while tmp < B:
    c += 1
    if c == 1:
        tmp = A
    else:
        tmp = (A - 1) * (c - 1) + A
    # print(c, tmp)

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

temp = B - A

if B == 1:
    print(0)
elif temp <= 0:
    print(1)
else:
    total = temp/(A-1)
    if temp%(A-1)==0:
        print(int(total)+1)
    else:
        print(int(total)+2)

Submission status: Accepted

Solution code:
import numpy as np
A,B=np.array(list(map(int, input().split())))

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

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
if B == 1:
  print(0)
  exit()
c = 1
a = A
while True:
  if a >= B:
    break
  else:
    a += A-1
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor

A_B = str(sys.stdin.readline()).strip().split()
A, B = int(A_B[0]), int(A_B[1])

def max_num_outlets(num_outlets_each, num_sockets):
    max_num_outlets = 1 + (num_outlets_each - 1) * num_sockets
    return max_num_outlets

for i in range(B):
    if B <= max_num_outlets(A, i):
        print(i)
        break

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
add = A - 1
ans = 0
total = 1

while total < B :
  total += add
  ans += 1
  
print(ans)

Submission status: Accepted

Solution code:
n1 = list(map(int, input().split()))
n2 = (n1[1] - 1)//(n1[0] - 1)
n3 = (n1[1] - 1)%(n1[0] - 1)
if n3 > 0:
    a1 = n2 + 1
else:
    a1 = n2
print(a1)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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)]
"""

list_tap =  list(map(int, sys.stdin.readline().split()))

A = list_tap[0]
B = list_tap[1]

cnt = 1
cnt2 = 0

for i in range (20):
    if(cnt >= B):
        break
    cnt = cnt + A - 1
    cnt2 += 1
    #if(cnt >= B):
    #    break

print(cnt2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
h = 1
i = 1
if B == 1:
  print(0)
  sys.exit()
else:
  for _ in range(100):
    h += A - 1
    if h >= B:
      print(i)
      sys.exit()
    i += 1

Submission status: Accepted

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

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

Submission status: Accepted

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

count=0
C=1

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

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:
kuchi, needed_kuchi_num= map(int,input().split())
if needed_kuchi_num != 1:
    socket_num = 1

    con_flg = 1
    available_kuchi_num = 0

    while con_flg == 1:
        available_kuchi_num = (kuchi - 1)*(socket_num - 1) + kuchi
        if needed_kuchi_num <= available_kuchi_num:
            con_flg = 0
        else:
            socket_num += 1
else:
    socket_num = 0

print(socket_num)

Submission status: Accepted

Solution code:
import sys

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

count= 1
expandA= A

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

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


print(count)

Submission status: Accepted

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

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

tmp = a
c = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit


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

for n in range(0, 20):
    if n == 0:
        num = 1
    elif n == 1:
        num = A
    else:
        num = n*A - n + 1

    if num >= B:
        print(n)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

cover = lambda n: 1+(A-1)*n

n = 0
while True:
    if B <= cover(n):
        print(n)
        break
    n+=1

Submission status: Accepted

Solution code:
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""
from collections import defaultdict
import sys
import math
from datetime import datetime
import re
import math
def sol(a, b):
    c = 1
    ans = 0
    if c >= b: return ans

    while c < b:
        c += a - 1
        ans += 1
    return ans



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    # n = int(parsed_lines[0][0])
    # k = int(parsed_lines[0][1])
    S = parsed_lines[0][0]
    return S


if not do_submit:
    S = input_parse("""
    1905
    """)
    print(sol(S))

    S = input_parse("""
    0112
    """)
    print(sol(S))

    S = input_parse("""
    1700
    """)
    print(sol(S))

    S = input_parse("""
    0000
    """)
    print(sol(S))

    S = input_parse("""
    1001
    """)
    print(sol(S))



else:
    A, B = list(map(int, input().split()))
    #S = input()
    print(sol(A, B))

    # S = input().strip()
    # print(sol(S))

Submission status: Accepted

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

res = b - a
rez = -(-res//(a - 1))

rez = rez + 1

print(rez)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
tap = 0
num = 1
if b == 1:
    print(tap)
    exit()
tap += 1

while True:
    num = num + a - 1
    if b <= num:
        break
    else:
        tap += 1

print(tap)

Submission status: Accepted

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

Submission status: Accepted

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

add = 0
if (b-1)%(a-1)>0:
    add = 1

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

Submission status: Accepted

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

tmp = A
if B ==1:
    print(0)
else:
    for i in range(1,21):
        if tmp>= B:
            print(i)
            break
        tmp = A + (A-1)*i

Submission status: Accepted

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

while 1==1:
    if sum < B:
        sum = sum - 1 + A
        ans += 1
    else:
        print(ans)
        break

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(math.ceil(ans))

Submission status: Accepted

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

Submission status: Accepted

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

if B==1:
    print(0)

elif A >= B:
    print(1)
elif(2*A-1) >=B:
    print(2)
elif(3*A-2)>=B:
    print(3)
elif(4*A-3)>=B:
    print(4)
elif(5*A-4)>=B:
    print(5)
elif(6*A-5)>=B:
    print(6)
elif(7*A-6)>=B:
    print(7)
elif(8*A-7)>=B:
    print(8)
elif(9*A-8)>=B:
    print(9)
elif(10*A-9)>=B:
    print(10)
elif(11*A-10)>=B:
    print(11)
elif(12*A-11)>=B:
    print(12)
elif(13*A-12)>=B:
    print(13)
elif(14*A-13)>=B:
    print(14)
elif(15*A-14)>=B:
    print(15)
elif(16*A-15)>=B:
    print(16)
elif(17*A-16)>=B:
    print(17)
elif(18*A-17)>=B:
    print(18)
elif(19*A-18)>=B:
    print(19)
elif(20*A-19)>=B:
    print(20)

Submission status: Accepted

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

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

B -= A  
A -= 1
 
Cnt = 1
Flag = 0
while Flag == 0:
  B -= A
  Cnt += 1
  if B > 0:
    continue
  else:
    Flag = 1
    break
 
 
print(Cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
x = 1
ans = 0
while x < b:
    x += a - 1
    ans += 1
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(math.ceil((B-A)/(A-1))+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

def addConcent(concent, all):
    return all - 1 + concent

all = 1
count = 0
while B > all:
    all = addConcent(A, all)
    count += 1

print(count)

Submission status: Accepted

Solution code:
import sys

#+++++
		
def main():
	b , c = map(int, input().split())
	if c==1:
		return 0
		
	kuti=b
	kosuu=1
	while kuti < c:
		kosuu+=1
		kuti += b - 1
		
	print(kosuu)
	
	
#+++++


if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter

def main():
	a, b = map(int, input().strip().split())
	if b == 1:
		print(0)
		return
	ans = 1
	kuchi = a
	while kuchi < b:
		ans += 1
		kuchi += a-1
	print(ans)

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

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


print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力


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

    if b == 1:
        print(0)
        return

    count = 0
    sum = a
    count += 1
    if sum >= b:
        print(1)
        return

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(20):
    if b==1:
        break
    b=b-a
    count+=1
    if b<=0:
        break
    b=b+1
    
print(count)

Submission status: Accepted

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

def main():
    a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
    ans = 1
    if b == 1:
        print(0)
    else:
        while(True):
            if a < b:
                b = b - a + 1
                ans += 1
            else:
                print(ans)
                break     

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

for _ in range(1,100):
    if(B==1):
        print(0)
        break
        
    if( (A-1)*(_-1)+A >= B):
        print(_)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(n)

Submission status: Accepted

Solution code:
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

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

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