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())
#初期tapsは0から
taps = 0
#現在の穴数（最初のコンセントの穴があるので１）
A = 1

#A(現在の穴の数)がb(ほしい穴数)より小さい間繰り返す
while A < b:
    #タップの数を一つづつ足していく
    taps += 1
    #タップにタップを接続するとひとつ穴を使ってa個の穴を拡張できるのでa-1を足す
    A += a-1

print(str(taps))

Submission status: Accepted

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

cnt = 1
num = A

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

Submission status: Accepted

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

Submission status: Accepted

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

#print(A,B)

count=0
tap=1
if B==1:
  print(0)
else:
  for j in range(100):
   count=count+1
   tap=tap+(A-1)
   if tap >= B:
    print(count)
    break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

cnt = 0
p = 0

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

while p < B:
    if p + A >= B:
        cnt += 1
        break

    p += A - 1
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import math
Input = input().split(" ")
A = int(Input[0])
B = int(Input[1])
n = (B-1)/(A-1)
print(math.ceil(n))

Submission status: Accepted

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

Submission status: Accepted

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

if (b - 1) % (a - 1) != 0:
    ans = (b - 1) // (a - 1) + 1
else:
    ans = (b - 1) // (a - 1)
# if b == 1:
#     ans = 0
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

        print(tap_num)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
AA = A-1
ans = 0
p = 1
for i in range(10**6):
    if p>=B:
        break
    p += AA
    ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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

    sum_receptor = 1
    ans = 0
    while sum_receptor < b:
        sum_receptor += a - 1
        ans += 1

    print(ans)

main()

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:
num = list(map(int, input().split()))
if((num[1]-1)%(num[0]-1)==0):
    print((num[1]-1)//(num[0]-1))
else:
    print((num[1]-1)//(num[0]-1)+1)

Submission status: Accepted

Solution code:
# B - Power Socket

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

if tgt == 0:
    print(1)
else:
    div = tgt // (a - 1)
    mod = tgt % (a - 1)
    print(div + 2 if mod > 0 else div + 1)

Submission status: Accepted

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

print(result)

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
c = 1
count = 0
while b > c:
  count += 1
  c += (a - 1)
print(count)

Submission status: Accepted

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

ans = 0
sum = 1
while sum < b:
  sum -= 1
  sum += a
  ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

plug = 1
ans = 0

while plug < int(B):
    plug = plug + int(A) - 1
    ans += 1

print(ans)

Submission status: Accepted

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

while unused < B:
    ans += 1
    unused = unused - 1 + A

print(ans)

Submission status: Accepted

Solution code:
import math

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

x = math.ceil((i[1] - 1) / (i[0] - 1))
print(x)

Submission status: Accepted

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

plug = 1
cnt = 0
while plug < b:
    plug = plug + a - 1
    cnt += 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

count = 0
flag = True
if B <= 1:
    flag = False
elif A >= B:
    flag = False
    count +=1
else:
    count +=1
while flag:
    if (A-1) * count + A >= B:
        count +=1
        break
    count +=1

print(count)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
tap_count = 1
a_count = 0
while tap_count < b:
  tap_count = tap_count + a - 1
  a_count = a_count + 1
print("{}".format(a_count))

Submission status: Accepted

Solution code:
from sys import exit, stdin
A, B = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
socket = 1
while B > socket:
    socket += A - 1
    ans += 1
print(ans)

Submission status: Accepted

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

ans = 0
outlet = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = 1
ans = 0

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

print(ans)

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
s = list(map(int, input().split()))
print(math.ceil((s[1] - 1) / (s[0] - 1)))

Submission status: Accepted

Solution code:
from math import ceil

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

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

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

Submission status: Accepted

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

t = 1
count = 0

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

print(count)

Submission status: Accepted

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

x = 1
c = 0
while x < B:
    c += 1
    x += A - 1

print(c)

Submission status: Accepted

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

consent = 1
tap = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

first = 1

ans = 0
count = 1

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

print(ans)

Submission status: Accepted

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

import math

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

# タップ1個で a-1個の口が増える
need_tap_num = math.ceil((b-1)/(a-1))
print(need_tap_num)

Submission status: Accepted

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

tap = 1
a_num = 0

while tap < b:
    tap = (tap - 1) + a
    a_num += 1

print(a_num)

Submission status: Accepted

Solution code:
a, b =  map(int, input().split())
# 総口数は n(a-1)+1
# 求めたいのは n(a-1)+1 >= b を満たす最小の自然数n
# n >= (b-1)/(a-1)
# n = ((b-1)+(a-1)-1)/(a-1)
# 	= (a+b-3)//(a-1)
print((a+b-3)//(a-1))

Submission status: Accepted

Solution code:
#abc139b

a,b=map(int,raw_input().split())
n=0
while n*a-n+1<b:
 n+=1
print n

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

a,b = inpl()
if b == 1:
    print(0)
    quit()
b -= a
if b <= 0:
    print(1)
else:
    print(math.ceil(b/(a-1))+1)

Submission status: Accepted

Solution code:
line = list(map(int, input().split()))
A = line[0]
B = line[1]

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

Submission status: Accepted

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

print(num)

Submission status: Accepted

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

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

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB = list(map(int,input().split()))
count = 1
A = AB[0]
B = AB[1]
M = A
while(M<B):
    M += A-1
    count += 1
if B == 1:
    print(0)
else:
    print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

if (b-1) % (a-1) > 0 :
   c = c+1
print(c)

Submission status: Accepted

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

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

Submission status: Accepted

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

tap = 1
ans = 0
while tap < B:
    tap += A-1
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B == 1:
    print(0)
    exit(0)
ans = 1
while((ans*A)-(ans-1)) < B:
    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:
    ans = a
    c = 1
    while True:
        ans += a-1
        c += 1
        if ans >= b:
            print(c)
            break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
outlet = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

plus = A-1

B = B-1
ans = B // plus

if B%plus != 0:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(X)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
print(0--(b-1)//(a-1))

Submission status: Accepted

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

Submission status: Accepted

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


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

if amari==0:
  print(ans)

else:
  print(ans+1)

Submission status: Accepted

Solution code:
AB=list(map(int,input().split()))
A=AB[0]
B=AB[1]

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

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:
a,b=map(int,input().split());print((b+a-3)//(a-1))

Submission status: Accepted

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

count = 0
total = 1

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

print(count)

Submission status: Accepted

Solution code:
def power_sockets(A, B):
    s=0
    if B == 1:
        s = 0
    elif B <= A:
        s=1
    else:
        s=(B-A) // (A-1) + 1
        if (B-A) % (A-1) > 0:
            s = s + 1
    return s

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

Submission status: Accepted

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

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

Submission status: Accepted

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

print(b//a + 1)

Submission status: Accepted

Solution code:
A, B = input().split()
count = 0
sum = 1

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

print(count)

Submission status: Accepted

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

counter = 1
tap = 0

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

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
print(min([num for num in range(0, 20) if (a - 1) * (num - 1) + a >= b]))

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    a, b = map(int, input().split())
    ans = 0
    empty = 1

    for i in range(20 + 1):
        if empty >= b:
            print(max(0, ans - 1))
            exit()
        else:
            ans += 1
            empty = i * a - ((i - 1))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if B == 1:
    print(0)
else:
    ans = 1
    C = A
    while B > C:
        C = C + A - 1
        ans += 1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(a, b):
    return (a + b - 3) // (a-1)

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

Submission status: Accepted

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

print(n)

Submission status: Accepted

Solution code:
from sys import stdin
 
s,t =input().split()
count=int(s)
goal=int(t)
total=count
cnt=1

while total<goal :
	total=total+count-1
	cnt+=1

if goal==1:
  cnt=0
    
print(cnt)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

def solve():
    A, B = list(map(int, input().split()))
    if B == 1:
        print(0)
    else:
        total = 1
        ans = 0
        while True:
            ans += 1
            total += (A-1)
            if total >= B:
                break
        print(ans)


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

A -= 1
unused = 1
counter = 0
while unused < B:
    unused += A
    counter += 1
print(counter)

Submission status: Accepted

Solution code:
A, B = (int(i) for i in input().split(' '))
total = 1
count = 0
while True:
    if total >= B:
        print(count)
        break
    count += 1
    total = total + A - 1

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for x in range(20):
  s = (A-1)*(x-1) + A
  if B<=s:
    print(x)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int, input().split())
count = 1
num = 0

while count < y:
    count -= 1
    count += x
    num +=1
    
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a,b = map(int,input().split())
if b == 1:
  print(0)
  exit()
count = 1
tap = a
while tap < b:
  tap += a-1
  count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

import random


def main():
    n_finger,n_required = map(int, input().split())
    n_finger = n_finger-1
    # 1 + n_finger * n_hub_prepare = n_required
    n_hub_prepare = ( n_required - 1 ) // n_finger
    
    if 1 + n_finger * n_hub_prepare < n_required :
        n_hub_prepare += 1

    print(n_hub_prepare)
    
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

A,B = II()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding: utf-8

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

ans=0
socket=1

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a, b = (int(i) for i in input().split())
count = 0
plug = 1
while plug < b:
  plug = plug + a - 1
  count += 1
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
print(ans)

Submission status: Accepted

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

tap = 0

if b != 1:
    while(tap*(a-1) +1) < b:
        tap += 1

print(tap)

Submission status: Accepted

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

n = 1
if B == 1: n = 0
while A+(A-1)*(n-1) < B: n += 1

print(n)

Submission status: Accepted

Solution code:
# coding: utf-8
a, b = map(int, input().split())
for i in range(100000):
    tmp = 1 + (a - 1) * i
    if tmp >= b:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

res=(b-1)//(a-1)
if((b-1)%(a-1)>0):
  res+=1
  
print(res)

Submission status: Accepted

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

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:
def solve(string):
    a, b = map(int, string.split())
    return str((b - 2) // (a - 1) + 1)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

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

Submission status: Accepted

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

print(time)

Submission status: Accepted

Solution code:
from math import ceil

A,B = [int(zz) for zz in input().split()]

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

if B == 1:
    ans = 0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(map(int,input().split()))
print(-(-(a[1]-1)//(a[0]-1)))

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
cnt = A
num = 1
i = 1
if B == 1:
    print("0")
    exit()
while 1:
    if cnt >= B:
        print(num)
        exit() 
    cnt += (A-1)
    num += 1
i += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ana,bnb = map(int, input().split())
bbb,i = 1,0
while bbb < bnb:
    bbb = bbb -1 + ana
    i += 1

print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
A, B = list(map(int,input().split(' ')))
#print(A,B)
for n in range(100):
  if n*A-(n-1) >= B:
    print(n)
    break

Submission status: Accepted

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

cnt=1
kuti=a

while kuti<b:
    cnt+=1
    kuti += a-1
   
if b==1:
    cnt=0

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = tuple([int(i) for i in input().split(' ')])
 
ans = 0
while True:
    if (a - 1) * (ans - 1) + a >= b:
        break
    if a == b:
        ans += 1
        break
    ans += 1
 
print(ans)