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())
tmp = 1
count = 0
 
if B == 1:
    print(0)
else:
    while tmp < B:
        tmp += A-1
        count += 1
    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=input().split()
tap=0
plug=1


for i in range(int(B)*3):
    if plug >= int(B):
       break
    plug+=int(A)-1
    tap+=1
#if int(B)%int(A) != 0:
#    tap=int(B)/int(A)+1
#else:
#    tap=int(B)/int(A)

print(int(tap))

Submission status: Accepted

Solution code:
def solve():
    A,B = map(int, input().split())
    num = 1
    tap = A
    if B == 1:
        print(0)
        return
    
    while tap < B:
        num += 1
        tap += (A-1)
    print(num)
    
solve()

Submission status: Accepted

Solution code:
import math

inputs = list(map(lambda i: float(i), input().split()))
A, B = inputs[0], inputs[1]

if B == 1:
    taps = 0
elif A > B:
    taps = 1
else:
    taps = math.ceil((B-A)/(A-1)) + 1

print(taps)

Submission status: Accepted

Solution code:
import math

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

i = 0
if B<=1:
    N = 0
    all_hole = B+1
else:
    N = 0
    hole = [1]
    all_hole = sum(hole)

while all_hole < B:
    hole[i] = A
    all_hole = sum(hole)
    if hole[-1] == A:
        i = 0
        hole = [1]*all_hole
    else:
        i += 1
    N += 1

print(N)

Submission status: Accepted

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

ans = 0

if B == 1 :
	print(0)

elif B <= A :
	print(1)

elif (B-A)%(A-1) <= 0 :
	ans = (B-A)//(A-1)+1
	print(ans)
elif (B-A)%(A-1) >= 1 :
	ans = (B-A)//(A-1)+2
	print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


def main():

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

   if B ==1:
      print(0)
      exit()
   
   if A >= B:
      print(1)
      exit()
   
   increase = A -1
   count = A
   ans = 1

   while(count < B):
      count += increase
      ans += 1

   print(ans)
      

if __name__== "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

while True:
    try:
        A, B = map(int, input().split())
        print(math.ceil((B-A) / (A-1)) + 1)
    except:
        break

Submission status: Accepted

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

# 最後の一個 + 追加の分
# a + (a-1) * ans >= b

sub = b - a

if sub % (a-1) == 0:
    ans = sub // (a-1)
else:
    ans = sub // (a-1) + 1

print(ans + 1)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

# if a==b:
#     print(1)
# if b==1:
#     print(1)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

slot = 1
count = 0

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

Submission status: Accepted

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

if b==1:
    print(0)
elif a>=b:
    print(1)
else:
    while 1:
        an+=(a-1)
        t+=1
        if an>=b:
            print(t)
            exit()

Submission status: Accepted

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

if A<2 or A>20 or B<1 or B>20:
	exit()

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

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

Submission status: Accepted

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

if tap[1] <= 1:
    print(0)
elif tap[0] >= tap[1]:
    print(1)
else:
    num = tap[0]
    inc = tap[0] - 1
    cnt = 1

    while True:
        num += inc
        cnt += 1

        if num >= tap[1]:
            break

    print(cnt)

Submission status: Accepted

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

print(n)

Submission status: Accepted

Solution code:
a,b = list(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 math
A,B = map(float,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
sum = 1
if ((b > 1) and (b < a)):
    print(1)
elif b == 1:
    print(0)
else:
    b = b - a
    while 0 < b:
        b = b - (a-1)
        sum=sum+1
    print(sum)

Submission status: Accepted

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

s = A
ans = 1
if B == 1:
  ans -= 1
elif A >= B:
  """
  None
  """
else:
  while s < B:
    s += A - 1
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

current = a
counter = 1
remain = a
if b == 1:
    print(0)
else:
    while current < b:
        current -= 1
        current += a
        counter += 1
    print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
I = input().split()
A = int(I[0])
B = int(I[1])
ana = 0
i = 0
while(True):
  if B == 1:
    break
  if i == 0:
  	ana += A
  else:
    ana += (A-1)
  i += 1
  if ana >= B:
    break
print(i)

Submission status: Accepted

Solution code:
import math
A,B=(int(x) for x in input().split())
if B is 1:
  print(0)
else:
  print(math.ceil((B-A)/(A-1)+1))

Submission status: Accepted

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

socket = A
sum_socket = A
tap = 1
while sum_socket < B:
    sum_socket = sum_socket - 1 + socket
    tap += 1
if B == 1:
    tap = 0
print(tap)

Submission status: Accepted

Solution code:
#double underscore makes a class variable or a class method private
mod = 1000000007
ii = lambda :  int(input())
si = lambda :  input()
dgl = lambda : list(map(int, input()))
f = lambda :   map(int, input().split())
il = lambda :  list(map(int, input().split()))
it = lambda :  tuple(map(int, input().split()))
ls = lambda :  list(input())
a, b=f()
c=1
if b==1:
    print(0)
    exit()
while a*c-c+1 < b:
    c += 1
print(c)

Submission status: Accepted

Solution code:
A,B=[int(n) for n in input().split()]
i=0
if B!=1:
    while B > 0:
        if i==0:
            B -= A
        else:
            B -= (A-1)
        i += 1
print(i)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

    if total >= b:
        print(i)
        exit()

Submission status: Accepted

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

a = input_data[0]
b = input_data[1]

ans = 0

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

print(ans)

Submission status: Accepted

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

while(1):
    if unused_tap >= b:
        print(count)
        break
    
    unused_tap = unused_tap-1 + a 
    count += 1

Submission status: Accepted

Solution code:
import sys
s = input().split()
tapp_in= int(s[0])
nouse_tapp= int(s[1])
i=0
while nouse_tapp > (tapp_in-1)*i+1:
    i+=1
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A, B = [int(x) for x in input().split()]
 
cnt = 1
N = A
 
if B==1:
  print(0)
  sys.exit()
 
for i in range(0, B):
  if N >= B:
    print(cnt)
    break
  else:
    cnt+=1
    N+=(A-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = []
a = input().split()

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

tap = 1

while (A - 1)*(tap - 1) + A < B :
  tap = tap + 1

if B == 1 :
  tap = 0

print(tap)

Submission status: Accepted

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

count = 1

if(B>1):
    a = A
    while(A<B):
        A -= 1
        A += a
        count += 1
        pass
else:
    count = 0
    pass


print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a, b = map(int,input().split())
sum = a
count = 1
if b == 1:
        print(0)
else:
        for i in range(10000):
                if sum < b:
                        sum += (a-1)
                        count += 1
                else:
                        break
        print(count)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=[int(i) for i in input().split()]
a=n[0]
b=n[1]
if(a==b):
  print("1")
elif(b==1):
  print("0")
else:
  count=0
  i=0
  while(count!=b):
    i+=1
    if((count+a)>=b):
      count+=a
      print(i)
      break
    else:
      count+=a-1

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
in_data = input()
 
data = in_data.split(' ')
A = int(data[0])
B = int(data[1])
if B == 1:
  print("0")
else:
  c = (B - 1) // (A - 1)
  d = (B - 1) / (A - 1)
  if c < d:
    c = c + 1
  print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(st) for st in input().split()]
def count_tap(a, b):
    taps = 0
    if b == 1:
        return taps
    else:
        taps = 1
        if a >= b:
            return taps
        else:
            taps = 1 + (b-a) // (a-1)
        if (b - a)%(a-1) != 0:
            taps += 1
    return taps
  
  
print(count_tap(A, B))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if C % (A-1) == 0:
  print(C//(A-1)+1)
elif C % (A-1) != 0 :
  print(C//(A-1)+2)

Submission status: Accepted

Solution code:
import math
a,b=(int(c) for c in input().split())
y=[]
for i in range(b):
  if i*(a-1)+1>=b:
    y.append(i)
print(y[0])

Submission status: Accepted

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

Submission status: Accepted

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

from sys import stdin
import math

# 標準入力をスペースで区切って、intに変換 listに収納
int_list  = [int(x) for x in stdin.readline().rstrip().split()]

A = int_list[0]
B = int_list[1]

plug=1
cnt=0
while True:
    if plug>=B:
        break
    plug+= A - 1
    cnt+=1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

c = 0
tmp = 1
while tmp < B:
    c += 1
    tmp = (A - 1) * (c - 1) + A

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

amari = (B-1)%(A-1)

if amari == 0:
    ans = (B-1)/(A-1)
else:
    ans = (B-1)//(A-1) + 1

ans2 = int(ans)

print(ans2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, 30):
    if cnt * A - cnt + 1 >= B :
        break
    else :
        cnt +=1

if B == 1:
    cnt = 0

print(cnt)

Submission status: Accepted

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

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

    elif r >= b:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

i=0
all_in=1
while(all_in<b):
    all_in=all_in+a-1
    i+=1

print(i)

Submission status: Accepted

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

ct = 1
asum = a
while True:
    if asum<b:
        asum = asum+a-1
        ct+=1
    else:
        break
if b >=2:
    print(ct)
else:
    print(0)

Submission status: Accepted

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

deff=1
i=0

while deff+(a-1)*i<b:
  i=i+1
print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

#print( ans if ans != 0 else 1 )
print( ans if ans != 0 else 1 )

Submission status: Accepted

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

count = 0
if B != 1:
    count += 1
    tap = A
    while tap < B:
        count += 1
        tap = count * (A - 1) + 1

print(count)

Submission status: Accepted

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

import math
if B < 2:
    print(0)
    exit()
c = 0


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

Submission status: Accepted

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

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

if a >= b:
    print(1)
    exit()
b -=a
print(1 + -(-b//(a-1)))

Submission status: Accepted

Solution code:
import math

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

# c = 0
# taps = 1
# while(True) :
#     # 1犠牲にしてAを得る
#     # jack = A * (taps-1) + A
#     jack = (A-1) * (taps-1) + A
#     if (jack >= B) :
#         break
    
#     taps += 1


# print(taps)

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
tap = 0

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

print(tap)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

m=1
ans=0

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

print(ans)

Submission status: Accepted

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

result = 0
count = 1
while(True):
    if nums[1] <= 1:
        break
    count -= 1
    count += nums[0]
    result += 1
    if nums[1] <= count:
        break
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum

def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList

def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList

# ===CODE===

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

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

print(n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B=(int(x) for x in input().split())
k=(B-1)/(A-1)
if B==1:
    print(0)
else:
    print(math.ceil(k))

Submission status: Accepted

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

c = b[0]
d = b[1]
amari = 0
if c/d == 1:
  print("1")
else:
  f = math.ceil((d-c)/(c-1))
  print(f+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

a, b = list(map(int, input().split()))
tap, free = 0, 1

while free < b:
    tap += 1
    free += a - 1

print(tap)

Submission status: Accepted

Solution code:
# question 2
A, B = input().split()

# question 2
a_org = int(A)
a = int(A)
b = int(B)
i = 1

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

Submission status: Accepted

Solution code:
import math
lines = input().split(" ")
 
A = int(lines[0])
B = int(lines[1])
C = A - 1
result = 0
 
if B == 1:
  print(0)
elif B == 2:
    print(1)
elif A == 20:
    print(1)
elif A >= B:
    print(1)
else:
    result += A
    count = 1
    while result < B:
        result += C
        count += 1
    print(count)

Submission status: Accepted

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

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

print(tap)

Submission status: Accepted

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

socket = 0
count  = 0
#最初についている1口で足りるとき
if B == 1:
	print(0)
	sys.exit()

#電源タップを追加する時
while True:
	count  += 1
	socket += A-1
	if B - socket <= 1:
		print(count)
		sys.exit()

Submission status: Accepted

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

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

tap = 0
plug = 0

while(True):
  plug = (A-1) * (tap-1) + A
  if plug >= B:
    print(tap)
    break
  tap += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans-1)

Submission status: Accepted

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

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

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().strip().split())
import math
print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

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

no_used = A

res = 1
while True:
    if no_used >= B:
        break
    else:
        res += 1
        no_used += A-1

print(res if B >= 2 else 0)

Submission status: Accepted

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

count = A
ans = 1

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

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

Submission status: Accepted

Solution code:
a, b = [int(x) for x in input().split()]
if b == 1:
	print(0)
else:
	i    = 1
	while a * i - (i - 1) < b:
		i += 1
	print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = input().split(" ")
A = int(line[0])
B = int(line[1])
kuchi = 1
kuchinum = 0
for i in range(19):
  if kuchi < B:
    kuchi += (A - 1)
    kuchinum += 1
  else:
    i = 13
print(kuchinum)

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
tmp = 0
if B < 2:
    print(cnt)
    exit()
tmp += A
cnt += 1
while True:
    if tmp >= B:
        break
    tmp += A -1
    cnt += 1
    
print(cnt)

Submission status: Accepted

Solution code:
import math
arr = list(map(float, input().split()))
A,B=arr[0],arr[1]

ans = (B-1.0)/(A-1.0)
print(math.ceil(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

p = 0
total = 1

while total < B:
    p += 1
    total = total + A - 1

print(p)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil
a,b=[int(i) for i in input().split()]
if a-1==1:
    print(b//(a-1)-1)
elif b%(a-1)==1:
    print(b//(a-1))
else:
    print(ceil(b/(a-1)))

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
C = A-1
n = 0
m = 1

if B == 1:
    print('0')
else:
    while C*n + A*m < B:
        n += 1
    print(n + m)

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:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b = readmi()

cnt = a
count = 1
if b == 1:
    print(0)
    exit()
while(1):
    if cnt >= b:
        break
    cnt -= 1
    cnt += a
    count += 1
print(count)

Submission status: Accepted

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

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

c = A
count = 1
for i in range(1, 1000):
    if c >= B:
        break
    c = c + A - 1
    count = count + 1
    
if B == 1:
    print(0)
else:
    print(count)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
# 1,A,2A-1,3A-2

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