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 sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

A,B=nm()

print(((B-1)//(A-1)+((B-1)%(A-1)>0) if B>1 else 0))

Submission status: Accepted

Solution code:
import math

inputted = input().split()
A = int(inputted[0])
B = int(inputted[1])

answer = (B - 1) / (A - 1)
answer = math.ceil(answer)

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#print(int((B-A)/(A-1)+1))

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
count = 0
n,m = map(int, input().split())
m -= 1
n -= 1
print(ceil(m/n))

Submission status: Accepted

Solution code:
import math
p,q= input().split()
a,b =(int(p), int(q))
count = 1

for i in range(math.floor((b/a)**2 + 4)):
    if count < b:
        count += a -1
    else:
        print(i)
        ans = i
        break

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

A,B  = nm()

s = A - 1
print(((B-1)+s -1)//s )

Submission status: Accepted

Solution code:
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
#template
A,B = inputlist()
ans = 0
count = 1
while True:
    if count >= B:
        break
    count += A-1
    ans +=1
print(ans)

Submission status: Accepted

Solution code:
A,B = list(map(int,input().split()))
C = B - A
if C % (A-1) == 0:
  print(C//(A-1)+1)
else:
  print(C//(A-1)+2)

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  a,b = map(int,input().split())
  ans = 0
  outlet = 1
  while outlet < b:
    outlet -=1
    outlet += a
    ans += 1
    
    
  print(ans)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = 0
#最初は電源口１こ
n = 1
while n < b:
    n = n + a - 1
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b = iim()
print((b+a-3)//(a-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    for i in range(1,100):
        count = 0
        
        if a[1] ==1:
            print(0)
            break
            
        if i > 1:
            count = a[0] + (a[0]-1)*(i-1)
        else:
            count = a[0]

        if count >= a[1]:
            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:
a,b=map(int,input().split())
import math
print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

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

Submission status: Accepted

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

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

if amari == 0:
    print(count + 1)
else:
    print(count + 2)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b=INTM()
    print(int((b-1+a-1.1)//(a-1)))
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

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

x = 1
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

result = 0

while puragu < B:
  puragu += A-1
  result += 1

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
answer = ((B-1) + (A-2)) // (A-1)
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
print(math.ceil(((b-1)/(a-1))))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 1
ans = 0

while x < B:
    x += A
    x -= 1
    ans += 1
    if x >= B:
        break
print(ans)

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
#どっちで出すか注意, rstrip注意
#提出前に見返すこと！
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    # N = int(input())
    # H = list(map(int, input().split()))
    # a = 0
    # res = 0
    # while a < N-1:
    #     c = 0
    #     for i in range(a, N-1):
    #         if H[i]-H[i+1] >= 0:
    #             c += 1
    #         else:
    #             break
    #     a += c + 1
    #     res = max(res, c)
    # print(res)

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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#どっちで出すか注意, rstrip注意
#提出前に見返すこと！
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = map(int, input().split())
    if not (b-a)%(a-1):
        print((b-a)//(a-1) + 1)
    else:
        print((b-a)//(a-1) + 2)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

a,b=map(int,input().split())
ans=0
ans+=a
count=1

if b==1:
  print(0)
  sys.exit()
  
while ans<b:
  ans+=a-1
  count+=1

print(count)

Submission status: Accepted

Solution code:
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

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

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


# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc139","b",main)

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
x = 0
X = B%(A-1)
Y = B//(A-1)

if B == 1:
  print(0)
elif A ==2:
  print(B-1)
elif A >= B:
  print(1)
elif X <= 1:
  print(Y)
else:
  print(Y + 1)

Submission status: Accepted

Solution code:

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

n = 1
c = 0

while n < B:
	n = n + A -1
#	print(n)
	c = c+1

print(c)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Power Socket
https://atcoder.jp/contests/abc139/tasks/abc139_b

"""
import sys


def solve(A, B):
    total = 1
    used = 0
    while total < B:
        total += (A - 1)
        used += 1
    return used


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

if B != 1:
	count, sum = 1, A
	while sum < B:
		sum += A - 1
		count += 1
else:
	count = 0

print(count)

Submission status: Accepted

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

res = 0
cnt = 1
while True:
  if cnt >= B:
    break
  else:
    cnt += (A-1)
    res += 1

print(res)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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())
amount = 1 
c = b-a
d = a-1
amount += -(-c//d)
print(amount)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter

# import numpy as np
# import scipy as scp

# 入力の受け取り
a,b = map(int,input().split())

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

print(ans)
# print("{:.10f}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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


print(count)

Submission status: Accepted

Solution code:
#B Power Socket
import math
a,b=map(int,input().split())
out=1
ans=0
while out<b:
    out-=1
    out+=a
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
#sys.setrecursionlimit(150000)


def solve(A: int, B: int):
    print(-(-(B-1)//(A-1)))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.readline().split()))
    print(math.ceil((B - A) / (A - 1)) + 1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

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

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())
ans = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
def solve():
    N, M = map(int, input().split())
    return math.ceil((M-1)/(N-1))

print(solve())

Submission status: Accepted

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

n = 1
cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

[A, B] = [int(x) for x in sys.stdin.readline().strip().split(" ")]

current = 1
result = 0
while current < B:
    result += 1
    current += A - 1

print(result)

Submission status: Accepted

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

now = 1
cnt = 0
while now < B:
    now -= 1
    now += A
    cnt += 1

print(cnt)

Submission status: Accepted

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

div, mod = divmod(B - A, A - 1)
div += 1
if mod > 0:
    div += 1
print(div)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

a,b = map(int,input().split())
ans = 0
socket = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
syou,amari = divmod((B - 1),(A - 1))
if amari != 0:
  syou = syou + 1

print(syou)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


tap = 1
num = 0
while 1:
    if tap >= B:
        print(num)
        break
    tap += A - 1
    num += 1

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

a -= 1
c = 1

count = 0

while c < b:
    count += 1
    c += a

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
number = input().split(" ")
A = int(number[0])
B = int(number[1])
if B == 1:
    print(0)
elif A >= B:
    print(1)
else:
    x = (B-A)//(A-1)
    y = (B-A)%(A-1)
    if y == 0:
        print(x+1)
    else:
        print(x+2)

Submission status: Accepted

Solution code:
N , M = (map(int , input().split()))
ana = 1
count = 0
while ana < M:
    ana = ana + N-1
    count += 1
print(count)

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

Submission status: Accepted

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

cnt = 0
p = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, H = map(int, input().split())
import math

print(math.ceil((H-1)/(N-1)))

Submission status: Accepted

Solution code:
import sys
import math
a,b= map(int,input().split())
#N=int(input())
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
i=0
print(math.ceil((b-1)/(a-1)))

Submission status: Accepted

Solution code:
import math

input_1,input_2=map(int,input().split())
print (math.ceil((input_2-1)/(input_1-1)))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]

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())
tap=0
x=1
while x<b:
    x+=a-1
    tap+=1
print(tap)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i = -1
while 1:
  i += 1
  if (A-1)*i + 1 >= B:
    print(i)
    quit()

Submission status: Accepted

Solution code:

a, b = map(int, input().split())
cnt = 0
power = 1

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

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

while(power < b):
    cnt += 1
    power = power - 1 + a 

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
#import bisect
#import numpy as np
#import itertools
#import copy
import sys

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    a, b = list(map(int,ipti().split()))
    print(math.ceil(((b-1)/(a-1))))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = 0
flag = True
while flag:
  ans += 1
  if b <= (ans-1)*(a-1) + a:
    flag = False

print(ans)

Submission status: Accepted

Solution code:
kuchi,total=map(int,input().split())

tap=0
while tap*kuchi-(tap-1)<total:
  tap+=1

print(tap)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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