Problem:


Score : 200 points

Problem Statement

Takahashi's house has only one socket.

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

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

Find the minimum number of power strips required.

Constraints

All values in input are integers.

2 \leq A \leq 20

1 \leq B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the minimum number of power strips required.

Sample Input 1

4 10

Sample Output 1

3

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

Sample Input 2

8 9

Sample Output 2

2

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

Sample Input 3

8 8

Sample Output 3

1



Sample input:
4 10


Sample output:
3

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a, b = map(int, input().split())
c = 0
s = 1

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

while True:
    for e in range(s):
        c += 1
        s = s - 1 + a
        if s >= b:
            print(c)
            break
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
        exit()

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


solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Power Socket
A,B = input().split()
A = int(A)
B = int(B)

count = 0
total_plug = 1
for i in range(1,B):
    count += 1
    total_plug += (A - 1)
    if B <= total_plug:
        break
        
print(count)

Submission status: Accepted

Solution code:
#B - Power Socket
A,B = map(int,input().split())

count = 0
total_plug = 1
for i in range(1,B):
    count += 1
    total_plug += (A - 1)
    if B <= total_plug:
        break
        
print(count)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

num = 1
res = 0

while num < B:
    res += 1
    num += A-1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
MM = input().split()
A = int(MM[0])
B = int(MM[1])
total = 1
count = 0
while total < B:
  total += A-1
  count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

num = 1
res = 0
while num < B:
  res += 1
  num += A-1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list1 = list( map(int, input().split()) ) 
A,B = list1[0], list1[1] #A個口の電源タップを使って差し込み口をB個作りたい。

x = 1 #現在の差込口の数
count = 0 #電源タップを差し込んだ回数

while x < B:
    x += (A - 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 math

A, B = input().split(' ')

A = int(A)
B = int(B)

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

Submission status: Accepted

Solution code:
import numpy as np
A, B = input().split(' ')
A = int(A)
B = int(B)
print(int(np.ceil((B - 1) / (A - 1))))

Submission status: Accepted

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

count = 0
nums = 1
while nums < B:
    nums += A - 1
    count += 1

print(count)

Submission status: Accepted

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

ans = 0
start = 1
for i in range(21):
    if start >= b:
        ans = i
        break
    start -= 1
    start += a

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
A,B=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,input().split())
import math
print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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

if (b == 1):
    print(0)
    exit()
ans = 0
for i in range(1,1000000000):
    if (i == 1):
        b -= a
    else:
        b -= (a-1)
    ans += 1
    if (b <= 0):
        break
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-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())
N = 1
i = 0
while N < B:
  N += A-1
  i += 1  
print(i)

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:
# -*- coding: utf-8 -*-

def main():

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

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ref = 1

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

print(ans)

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq
t = 1
def max(a,b):
	if a > b:
		return a
	return b
def min(a,b):
	if a < b:
		return a
	return b

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

Submission status: Accepted

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

sasikomi = 1
tap = 0

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

print(tap)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# b -= a
# counter = 1
# while b > 0:
#     b -= a - 1
#     counter += 1

# print(counter)

sum_tap = 1

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

Submission status: Accepted

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

    print(counter)

# sum_tap = 1

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

Submission status: Accepted

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

# b -= a
# counter = 1
# while b > 0:
#     b -= a - 1
#     counter += 1

# print(counter)

sum_tap = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

# B - Power Socket /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 高橋くんの家には電源プラグの差込口が 1口しかありません。
# そこで、高橋くんは A個口の電源タップをいくつか使って未使用の差込口を B口以上に拡張したいと考えています。
# A個口の電源タップ 1 つと未使用の差込口 1 口を使って、新たに差込口を A口増やすことができます。
# 最小でいくつの電源タップが必要でしょうか。

# 制約
#     入力は全て整数である。
#     2≤A≤20
#     1≤B≤20

# 入力
# 入力は以下の形式で標準入力から与えられる。
# A B

# 出力
# 必要な電源タップの個数の最小値を出力せよ。

# 入力例 1
# 4 10

# 出力例 1
# 3

# 4個口の電源タップを 3 つ使うと、未使用の差込口は 10口になります。

# 入力例 2
# 8 9

# 出力例 2
# 2

# 8個口の電源タップを 2 つ使うと、未使用の差込口は 15口になります。

# 入力例 3
# 8 8

# 出力例 3
# 1


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    A, B = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

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

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['4 10']
        lines_export = [3]
    if pattern == 2:
        lines_input = ['8 9']
        lines_export = [2]
    if pattern == 3:
        lines_input = ['8 8']
        lines_export = [1]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve(a,b):
  def needTaps(a,b,holes=1,res=0):
    if holes >= b:
      return res
    else:
      return needTaps(a,b,holes+a-1,res+1)
    
  return needTaps(a,b)

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC139 B - Power Socket

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

Submission status: Accepted

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

num = 1
res = 0
while num < B:
  res += 1
  num += A-1

print(res)

Submission status: Accepted

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

ans = 0
taps = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def resolve():
    import sys
    input = sys.stdin.readline
    row = [int(x) for x in input().rstrip().split(" ")]
    a = row[0]
    b = row[1]

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




if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = list(input().split()) 
a = int(num[0])
b = int(num[1])
ans = 0
tap = 1
while b > tap:
    tap += a-1
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
"""ワット数に気を付けましょう"""
A,B=map(int,input().split())
ans=0
now=1
while now<B:
  ans+=1
  now+=A-1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

  print(i)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
q, r = divmod(B - 1, A - 1)
print(q + (r > 0))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

ans = 0
kazu = 1
while B > kazu:
    ans += 1
    kazu = kazu - 1 + A

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A,B = [int(x) for x in input().split()]
    ans = 0
    p = 1
    while p<B:
        p += A-1
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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,b = map(int,input().split())
ans = 0
cnt = 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())
x = math.ceil((b-a)/(a-1))+1
print(x)

Submission status: Accepted

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

cnt = 1
ans = 0

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

Submission status: Accepted

Solution code:
import sys
import math

A,B = map(int,input().split())
if not ( 2 <= A <= 20 and 1 <= B <= 20 ): sys.exit()

if B == 1: print(0);sys.exit()
for I in range(math.ceil(B/A),21):
    if I*A-(I-1) >= B:
        print(I)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

if B == 1:
    print(0)
else:
    socks = 1
    taps = 0
    while socks < B:
        socks -= 1
        socks += A
        taps += 1
    print(taps)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque


def input():
    return sys.stdin.readline().rstrip()


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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

socket = 1 
number = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

socket = 1
tap_cnt = 0

while socket < b:
    socket -= 1
    socket += a

    tap_cnt += 1

print(tap_cnt)

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

socket = 1
cnt_A = 0
while socket < B:
    socket += A-1
    cnt_A += 1

print(cnt_A)

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 = [int(i) for i in input().split()]
result = 1
require_socket = B - A

result += require_socket // (A - 1)
if (require_socket / (A - 1)).is_integer() is False:
    result += 1

print(result)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
import math
c = math.ceil((B - A) / (A - 1))
print(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:
A,B = map(int, input().split())
if B == 1:
  print(0)
  exit(0)
  
sumA = A
if sumA >= B:
  print(1)
  exit(0)

sumA = sumA + A - 1
for i in range(2,100):
  if sumA >= B:
    print(i)
    break
  else:
    sumA = sumA + A - 1

Submission status: Accepted

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

Submission status: Accepted

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

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(1-(A-B)//~-A)

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
socket_count = A
result = 1

if B == 1:
    print(0)
else:
    while socket_count <= B:
        if socket_count == B:
            break
        else:
            socket_count += (A - 1)
            result += 1
    print(result)

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)
    quit()
else:
    i = 1
    while (A - 1) * i + 1 < B:
        i += 1
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

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

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
def main():
    a, b = map(int, input().split())
    k = 1
    cnt = 0

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

    while True:
        k += a-1
        cnt += 1
        if k >= b:
            break

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main() -> None:
    A, B = map(int, input().split())
    now, cnt = 1, 0
    while True:
        if now >= B:
            break
        now += A - 1
        cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import sys
import re
from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor
sys.setrecursionlimit(1000000)


def main():
    input = sys.stdin.readline
    #N, M = map(int, input().split())
    #N, K = map(int, input().split())
    #ps = list(map(int, input().split()))

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

    num = 1
    cnt = 0
    while B > num:
        num -= 1
        num += A
        cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
print((B+A-3)//(A-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 = map(int, input().split())

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

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

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

count = 0
avail = 1

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

N = 0

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

print(N)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    A, B = list(map(int, input().split()))
    if B == 1:
        ans = 0
        print(ans)
        return
    cnt = A
    ans = 1
    while cnt < B:
        cnt += A-1
        ans += 1

    print(ans)

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
def calc(m,B, i):
    if (i*(m-1) >= B-1):
        return i
    return calc(m,B, i+1)
print(calc(a,b,i=0))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

count = 0
tap = 1

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