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 = tuple([int(i) for i in input().split(' ')])

ans = 0
outlet = 1
while True:
    if outlet >= b:
        break
    outlet += 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:
import itertools
a, b = [int(el) for el in input().split(' ')]

def f(n, x):
    if n == 0:
        return(1)
    else:
        return(n*x - (n-1))

for i in itertools.count(0):
    if f(i, a) >= b:
        print(i)
        break

Submission status: Accepted

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

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

Submission status: Accepted

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

#A + (A-1)*(X-1) >= B 
# 8 + (A-1)*(X-1) >= 9
#(A-1)*(X-1) >= B-A
X = (B-A)/(A-1) +1
if (B-A)%(A-1) > 0:
    X+=1
print X

Submission status: Accepted

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

Submission status: Accepted

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

if b == 1 :
    print(0)
else :
    count = 1

    kuchi = a

    while kuchi < b :
        count+=1

        kuchi = (a - 1) * count + 1
    else :
        print(count)

Submission status: Accepted

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

count = 0
powerSocket = 1

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

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
A, B = list(int(num) for num in input().split(' '))

num_tap=0
num_source=1

while True:
  if num_source>=B: break
  num_tap += 1
  num_source += A-1
    
print(num_tap)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = input("")
a, b = a.split()
a, b = int(a), int(b)
c, d = 0, 0
while d < b:
    if a == 0:
        break
    c += 1
    d = a * c - (c - 1)
if b == 1:
  c = 0
print(c)

Submission status: Accepted

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

ans = 0
outlet = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

tap=1
count=0

if b==1:
  count==0

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
cnt = 1
ans = 0
# 口の増え方　1,1+(A-1),1+(A-1)+(A-1),・・
# B-1個に増やしたい。1は壁にある口
# ポイントは切り上げ
while cnt<B:
    cnt+=A-1
    ans+=1
else:
    print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split(" "))
c = 0
count = 0
if b <= 1:
    print(count)
    exit()
while True:
  c += a
  count += 1
  if c >= b:
    print(count)
    exit()
  c -= 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:
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())
print(-(-(b-a)//(a-1))+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if (N[1]-1)%(N[0]-1)==0:
    print(int((N[1]-1)/(N[0]-1)))
else:
    print(int((N[1]-1)/(N[0]-1))+1)

Submission status: Accepted

Solution code:
#coding:utf-8
a, b = map(int, input().split())

#1つタップを増やすとa-1口増えるので、b-1口増やすことを考える
tap = -(-(b-1)//(a-1))
print(tap)

Submission status: Accepted

Solution code:
s = input()
k = s.split(" ")
a = (int)(k[0])-1
b = (int)(k[1])
count = 0
n = 1
while(n<b):
  n+=a
  count+=1
print(count)

Submission status: Accepted

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

print(answer)

Submission status: Accepted

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def _input():
    array  = input().split()
    return int(array[0]), int(array[1])

def result(actual, need):
    port = 1
    count = 0
    while  port < need:
        port -= 1
        port += actual
        count += 1
    return count

if __name__ == "__main__":
    actual, need = _input()
    print(result(actual, need))

Submission status: Accepted

Solution code:

a,b=map(int,input().split())
n=0
sum=0
if b==1:
    print(0)
else:
    while sum<b:
        n +=1
        if n==1:
            sum = n * a
        else:
            sum=n*a -(n-1)
       # print("n:",n,"s:",sum)
    print(n)

Submission status: Accepted

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

temp = 1
res = 0

while b > temp:
    temp += a - 1
    res += 1

print(res)

Submission status: Accepted

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

print(k)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
i=input();print(0--~-int(i[2:])//~-int(i[:2]))

Submission status: Accepted

Solution code:
i=input();print(-(~-int(i[2:])//-~-int(i[:2])))

Submission status: Accepted

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

if B == 1:
    print(0)

else:
    ans = 1
    while 1:
        if A + (A-1) * (ans - 1) >= B:
            break
        ans += 1

    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

socket = 1
ans = 0

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

Submission status: Accepted

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools





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

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

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





if __name__ == '__main__':
    main()

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:
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    N, D = map(int,input().split())
    if (D==1):
        print(0)
        exit()
    D-=N
    ans = 1
    while(D>0):
        ans +=1
        D -= N-1
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

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

print(add_value)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

a, b = map(int, input().split())
ans = 1
still = 1
while still < b:
    ans += 1
    still += a - 1
print(ans - 1)

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    count = 1
    nes = 0
    if b == 1:
        print("0")
    elif a >= b:
        print("1")
    else:   
        while count < b:
            count += a - 1
            nes += 1
        print(nes)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

import math
#x * (a - 1) + 1 >= b

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
ans = """
a,b = (int(i) for i in input().split())
"""
for a in range(2,21):
    if a == 2:
        ans += "if a == " + str(a) + ":\n"
    else:
        ans += "elif a == " + str(a) + ":\n"
    for b in range(1,21):
        if b == 1:
            ans += "\tif b == " + str(b) + ":\n"
        else:
            ans += "\telif b == " + str(b) + ":\n"
        ans += "\t\tans = "+str(ceil(((b-1)/(a-1)))) + "\n"
ans += "print(ans)"
exec(ans)

Submission status: Accepted

Solution code:
a,b = (int(i) for i in input().split())
if a == 2:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 2
	elif b == 4:
		ans = 3
	elif b == 5:
		ans = 4
	elif b == 6:
		ans = 5
	elif b == 7:
		ans = 6
	elif b == 8:
		ans = 7
	elif b == 9:
		ans = 8
	elif b == 10:
		ans = 9
	elif b == 11:
		ans = 10
	elif b == 12:
		ans = 11
	elif b == 13:
		ans = 12
	elif b == 14:
		ans = 13
	elif b == 15:
		ans = 14
	elif b == 16:
		ans = 15
	elif b == 17:
		ans = 16
	elif b == 18:
		ans = 17
	elif b == 19:
		ans = 18
	elif b == 20:
		ans = 19
elif a == 3:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 2
	elif b == 5:
		ans = 2
	elif b == 6:
		ans = 3
	elif b == 7:
		ans = 3
	elif b == 8:
		ans = 4
	elif b == 9:
		ans = 4
	elif b == 10:
		ans = 5
	elif b == 11:
		ans = 5
	elif b == 12:
		ans = 6
	elif b == 13:
		ans = 6
	elif b == 14:
		ans = 7
	elif b == 15:
		ans = 7
	elif b == 16:
		ans = 8
	elif b == 17:
		ans = 8
	elif b == 18:
		ans = 9
	elif b == 19:
		ans = 9
	elif b == 20:
		ans = 10
elif a == 4:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 2
	elif b == 6:
		ans = 2
	elif b == 7:
		ans = 2
	elif b == 8:
		ans = 3
	elif b == 9:
		ans = 3
	elif b == 10:
		ans = 3
	elif b == 11:
		ans = 4
	elif b == 12:
		ans = 4
	elif b == 13:
		ans = 4
	elif b == 14:
		ans = 5
	elif b == 15:
		ans = 5
	elif b == 16:
		ans = 5
	elif b == 17:
		ans = 6
	elif b == 18:
		ans = 6
	elif b == 19:
		ans = 6
	elif b == 20:
		ans = 7
elif a == 5:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 2
	elif b == 7:
		ans = 2
	elif b == 8:
		ans = 2
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 3
	elif b == 11:
		ans = 3
	elif b == 12:
		ans = 3
	elif b == 13:
		ans = 3
	elif b == 14:
		ans = 4
	elif b == 15:
		ans = 4
	elif b == 16:
		ans = 4
	elif b == 17:
		ans = 4
	elif b == 18:
		ans = 5
	elif b == 19:
		ans = 5
	elif b == 20:
		ans = 5
elif a == 6:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 2
	elif b == 8:
		ans = 2
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 3
	elif b == 13:
		ans = 3
	elif b == 14:
		ans = 3
	elif b == 15:
		ans = 3
	elif b == 16:
		ans = 3
	elif b == 17:
		ans = 4
	elif b == 18:
		ans = 4
	elif b == 19:
		ans = 4
	elif b == 20:
		ans = 4
elif a == 7:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 2
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 3
	elif b == 15:
		ans = 3
	elif b == 16:
		ans = 3
	elif b == 17:
		ans = 3
	elif b == 18:
		ans = 3
	elif b == 19:
		ans = 3
	elif b == 20:
		ans = 4
elif a == 8:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 3
	elif b == 17:
		ans = 3
	elif b == 18:
		ans = 3
	elif b == 19:
		ans = 3
	elif b == 20:
		ans = 3
elif a == 9:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 3
	elif b == 19:
		ans = 3
	elif b == 20:
		ans = 3
elif a == 10:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 3
elif a == 11:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 12:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 13:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 14:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 15:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 16:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 17:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 18:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 1
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 19:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 1
	elif b == 19:
		ans = 1
	elif b == 20:
		ans = 2
elif a == 20:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 1
	elif b == 19:
		ans = 1
	elif b == 20:
		ans = 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input().split()
a = int(x[0])
b = int(x[1])
total = 1
count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 実装例のPythonコード
a, b = map(int, input().split())
ans = 0
outlet = 1
while outlet < b:
    outlet = outlet - 1
    outlet = outlet + a
    ans = ans + 1
print(ans)

Submission status: Accepted

Solution code:
def power():
    A, B = map(int, input().split())
    socket = 1
    numberOfStrips = 0

    while socket < B:
        socket = socket + A - 1
        numberOfStrips = numberOfStrips + 1

    return numberOfStrips


print(power())

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import copy
import math

sys.setrecursionlimit(1000000)

# input = sys.stdin.readline

# ~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~

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

S = A - 1
T = B - 1

print((S + T - 1) // S)

Submission status: Accepted

Solution code:

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

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

print(ans)

Submission status: Accepted

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

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:
A,B=map(int,input().split())
c=0
B-=1
while B>0:
    c+=1
    B-=A-1
print(c)

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
A,B=map(int,input().split())
cnt=0
outlet=1
while outlet<B:
  cnt=cnt+1
  outlet=outlet+(A-1)
print(cnt)

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:
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().strip().split())
print(max(0, (b-2)//(a-1)+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())
n=0
k=(a-1)*n+1
while b>(a-1)*n+1:
  n+=1
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=[int(e) for e in input().split()]
a=x[0]
b=x[1]
c=1
k=0
while c<b:
  c+=a-1
  k+=1
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(Socket)

Submission status: Accepted

Solution code:
def solve(A, B):
    ans = 0
    outlet = 1
    while outlet < B:
        outlet -= 1
        outlet += A
        ans += 1
    return ans


if __name__ == '__main__':
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(i) for i in 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())
print((b-1)//(a-1) if (b-1)%(a-1)==0 else (b-1)//(a-1)+1)

Submission status: Accepted

Solution code:
mondai = input().split(" ")
kuchi = int(mondai[0])
want = int(mondai[1])

ans = 0
num = 1
while int(num) < want:
    
    ans += 1
    num = ans * kuchi
    num = num - (ans -1)

print(ans)

Submission status: Accepted

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

while B > con:
  ans += 1
  con -= 1
  con += A

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = [int(i) for i in input().split()]
ct = 0
num = 0

while num < b-1:
    ct += 1
    num += a -1
    
print(ct)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def check():
    A,B = [int(i) for i in input().split(' ')]
    count = 0
    count_plug = 1
    while count_plug<B:
        count_plug += A - 1
        count += 1
    print(count)
check()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = b%(a-1)

if a!=2:
  if x<=1:
    print(b//(a-1))
  else:
    print(b//(a-1)+1)
else:
  print(b-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    A,B = map(int,input().split())
    ans = 1
    temp = A

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
kuti = 1
k = 0
for i in range(100):
    if kuti>=B:
        print(k)
        break
    elif B == 1:
        print(0)
    else:
        kuti += A-1
        k += 1

Submission status: Accepted

Solution code:
A,B = map(int, open(0).read().split())
MAX = 20
plug = 1
if(B <= 1):
  print(0)
  exit()
for i in range(MAX):
  plug -= 1
  plug += A
  if(plug >= B):
    print(i+1)
    break
    exit()

Submission status: Accepted

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