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
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

A,B=LI()

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

Submission status: Accepted

Solution code:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

A,B=LI()

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

Submission status: Accepted

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

for i in range(21):
  if d <= c*i-(i-1):
    print(str(i))
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a, b = [int(i) for i in input().split()]

if b == 1:
    ans = 0
else:
    ans = 1
    count = a
    while True:
        if count >= b:
            break
        else:
            #count = count - 1 + a
            count += (a - 1)
            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:
from math import ceil


def main():
    A, B = map(int, input().split(" "))
    A += 1
    print(ceil((1 + B - A) / (A - 2)) + 1)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s=a-1
t=b-1
ans=(t+s-1)//s
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	a,b = map(int,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())
a, b = a-1, b-1
b_, rslt = 0, 0
while b_ < b:
    b_ += a
    rslt += 1
print(rslt)

Submission status: Accepted

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

while True:
    if a[1] == 1:
        print(0)
        break
    
    if a[0] + (a[0]-1)*i >= a[1]:
        print(i+1)
        break
    else:
        i += 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())

tap = 1
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:

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

plag = 1
count = 0
while True:
    if B <= plag:
        break

    plag += A - 1
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Power Socket

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

# solve
if B == 1:
    res = 0
else:
    res = 1
    tap = A
    while tap < B:
        tap += A - 1
        res += 1

# output
print(res)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(A: int, B: int):
    from math import ceil
    print(ceil((B-A)/(A-1))+1)
    # n = A
    # i = 1
    # while n < B:
    #     n += (A-1)
    #     i += 1

    # print(i)

    return



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

if (B-1)%(A-1)!=0:
    result+=1

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

outlet = 1
tap = 0
while outlet < b:
    tap += 1
    outlet += a - 1

print(tap)

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
ans = 0
if B == 1:
    print(0)
    exit()
for i in range(10**100):
    if A+(A-1)*i < B:
        ans += 1
    else:
        ans += 1
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
# calc
if b == 1:
    print(0)
elif b-a <= 0:
    print(1)
else:
    if (b-a) % (a-1) == 0:
        print(int(((b-a)//(a-1))+1))
    else:
        print(int(((b-a)//(a-1))+2))

Submission status: Accepted

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

outlet = 1
n = 0

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

Submission status: Accepted

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


print(count)

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

if b==1:
    tmp = 0

else:
    tmp = 1

    while tmp*a-tmp+1 < b:
        tmp += 1

print(tmp)

Submission status: Accepted

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

while True:
	if total<b:
		ans+=1
		total+=a-1
	else:
		break

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    a,b=map(int,input().split())
    now=1
    ans=0
    while(now<b):
        now+=a-1
        ans+=1
    print(ans)
resolve()

Submission status: Accepted

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

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())
cnt=0
ans=1
while ans<B:
    ans+=A-1
    cnt+=1
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())
import math
print(int(math.ceil((B-1)/(A-1))) )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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), = [list(map(int, s.split())) for s in open(0)]

if B == 1:
    print(0)
elif A >= B:
    print(1)
else:
    cnt = 1
    while True:
        if B <= A + (A - 1)*(cnt - 1):
            break
        cnt += 1
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

def main():
    a,b  = map(int, input().split())
    
    tmp = 1
    ans = 0
    while tmp < b:
        ans += 1
        tmp = ans*a-ans+1

    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
        return None

    total = 1
    for i in range(1, 20):
        total += a - 1
        if total >= b:
            print(i)
            return None

if __name__ == '__main__':
    main()

Submission status: Accepted

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

count = 0; socket = 0
while True:
    if B <= 1:
        break
    socket += A
    count += 1
    if socket >= B:
        break
    socket -= 1

print(count)

Submission status: Accepted

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

cnt = 1
k = a

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

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

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
ret = 0
outlet = 1
while outlet < B:
    outlet -= 1
    outlet += A
    ret += 1
print(ret)

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
tap = 1

if tap >= B:
    print(cnt)
    exit()

tap -= 1

while True:
    tap += A
    cnt += 1
    if tap >= B:
        break
    else:
        tap -= 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

k = 1
for i in range(10**6) :
  if k >= b :
    print(i)
    sys.exit()
  k = k - 1 + a

Submission status: Accepted

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

i = 1

while True:
    s = A*i - (i - 1)
    
    if s >= B:
        break
    i += 1

if B == 1:
    print(0)
else:
    print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

i = 1

while True:
    if i == 1:
        s = A*i
    else:
        s = A*i - (i - 1)
    
    if s >= B:
        break
    i += 1

if B == 1:
    print(0)
else:
    print(i)

Submission status: Accepted

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

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


print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
r = 1
while r<b:
    r += a-1
    count += 1

print(count)

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())
#a個口
#増やしたい差し込み口

wk = a -1
ans = ((b-1) *-1 // wk) * -1  #b/wkの切り上げ

print(ans)

Submission status: Accepted

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

lest_taps = B - A


q, r = divmod(lest_taps, A-1)

if r == 0:
    output = q + 1
else :
    output = q + 2
    
print(output)

Submission status: Accepted

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

t = 0
p = 1
while True:
    if p >= B:
        break
    t += 1
    p -= 1
    p += A

print(t)

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())
cnt=0
Plag=1
while True:
    if Plag>=B:
        print(cnt)
        break
    cnt+=1
    Plag+=A-1

Submission status: Accepted

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

Submission status: Accepted

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

N = 0

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

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def MAP(): return [int(s) for s in input().split()]

A, B = MAP()

def tap(n, a):
	return n+a-1

n = 1
count = 0
while n<B:
	n = tap(n,A)
	count += 1

print(count)

Submission status: Accepted

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

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())
for i in range(21) :
    if b <= 1 + a*i-i :
        print(i)
        break

Submission status: Accepted

Solution code:
n=list(map(int,input().split()))
g=1
result=0
while g<n[1]:
    g=g+n[0]-1
    result+=1

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

q, m = divmod(b-a, a-1)
print(q+1 if m == 0 else q+2)

Submission status: Accepted

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

    taps = 1
    sock = 1

    if B == 1:
        print(0)

    else:
        sock = A
        while (sock) < B:
            taps = taps + 1
            sock = sock + A - 1

        print(taps)

ABC139B_PowerSocket()

Submission status: Accepted

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

N = 0

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

Submission status: Accepted

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

ans = 1
s = a


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

Submission status: Accepted

Solution code:
import sys

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

if(B==1):
    print('0')
    sys.exit()

while True:
    if(A+(A-1)*x>=B):
        print(x+1)
        sys.exit()
    x+=1

Submission status: Accepted

Solution code:
l=list(map(int,input().split()))
a=l[0]
b=l[1]
c=a-1
cnt=1
if(a>b and b==1):
  print(0)
else:
  while a<b:
    a=a+c
    cnt+=1
  print (cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

total = 1
tap = 0

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

print(tap)

Submission status: Accepted

Solution code:
import math

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

print(int(math.ceil((B - 1.0) / (A - 1.0))))

Submission status: Accepted

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

count_p = 0
count = 0

if b == 1:
    print(count)

else:
    while True:
        if count == 0:
            count_p += a
    
        else:
            count_p += a-1
    
        count += 1
    
        if count_p >= b:
            break

    print(count)

Submission status: Accepted

Solution code:
def ceil(x, y):
    return (x + y - 1) // y

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

need = 0
now = 1
while True:
    if now >= b :
        break
    now += a -1
    need += 1
    if now >= b :
        break


print(need)

Submission status: Accepted

Solution code:
A=list(map(int,input().split()))
count=0
A[1]=A[1]-1
A[0]=A[0]-1
print(A[1]//A[0] + (A[1]%A[0]!=0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A, B = [int(i) for i in input().split()]
ans = 0
outlet = 1
while (outlet < B):
  outlet -= 1
  outlet += A
  ans += 1
print(ans)

Submission status: Accepted

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

now = 1
ans = 0
for i in range(30):
  if now >= B:
    break
  now += A-1
  ans += 1
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(z)

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

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

Submission status: Accepted

Solution code:
import math
import heapq
import sys
from collections import Counter
import numpy as np

#N,K=map(int, input[0].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

A,B=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

needs=B-A
cnt=1

cnt+= math.ceil(needs/(A-1))

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
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())

x = 1
counter = 0

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

print(counter)

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

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

print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC 139: B – Power Socket
from math import ceil

a, b = [int(s) for s in input().split()]
print(ceil((b - 1) / (a - 1)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s = a-1
t = b-1
ans = int((s+t-1)/s)
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B =map(int,input().split())
plug_count=0
ext_count=0 
if B ==1:
    print(0)
else:
    plug_count+=A
    ext_count+=1
    while True:
        if plug_count>=B:
            break
        plug_count+=A-1
        ext_count+=1
    print(ext_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=map(int, input().split())
k=math.ceil((B-1)/(A-1))
print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019-11-17 20:44:23(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# import re
# import heapq
# import array
# from scipy.misc import comb # (default: exact=False)
# import numpy as np 


def main():
    a, b = [int(x) for x in sys.stdin.readline().split()]
    extend = a - 1
    
    total_sockets = 1
    strips_count = 0
    if b >= 2:
        more_needed = True
    else:
        more_needed = False
    
    while more_needed:
        strips_count += 1
        total_sockets += extend
        if total_sockets >= b:
            more_needed = False
    
    print(strips_count)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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