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, itertools, fractions, math, collections, heapq
sys.setrecursionlimit(10**7)
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
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())

a, b = LI()
ans = 0
total = 1
while total < b:
    total += a-1
    ans+=1
print(ans)

Submission status: Accepted

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

ent = 1
cnt = 0
for _ in range(20+1):
  if ent<b:
    ent += a
    ent -= 1
    cnt +=1
  else:
    print(cnt)
    exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
def function(A, B):
  if B == 1:
    return 0
  elif B <= A:
    return 1
  else:
    return (B-1+A-2)//(A-1)
  
print(function(A,B))

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:

a, b = input().strip().split()

a, b = int(a), int(b)

ans= 0
outlet = 1

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

print(ans)

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
print(-((1 - B) // (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())
#a*n -n +1 = b
#a(n-1)= b -1

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

Submission status: Accepted

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

resolve()

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())
n = 0
while b > n*(a-1) + 1:
  n = n + 1
else:
  print(n)

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

while True:
    if tap >= b:
        break
    tap += a - 1
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(taps)

Submission status: Accepted

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

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

  
for i in range(10000):
  if ans >= b:
    print(i+1)
    exit()

  else:
    ans += a -1

Submission status: Accepted

Solution code:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



a,b=MI()
x=a

if b == 1:
    print(0)
    exit()
if x >= b:
    print(1)
    exit()
for i in range(2,21):
    x+=(a-1)
    if x >= b:
        print(i)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import io

nim, mike = map(int, input().split())
    
print(math.ceil((mike - 1)/(nim - 1)))

Submission status: Accepted

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

if B == 1 :
    ans = 0
else:
    ans=math.ceil((B-1)/(A-1))

print(ans)

Submission status: Accepted

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

x = a[0]
y = a[1]

n = 2
if y == 1:
    print(0)
elif x >= y:
    print(1)
else:
    while ((x * n) - (n - 1)) < y:
        n += 1
    print(n)

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

Submission status: Accepted

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

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

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 = 1
ans = 0
if count >= b:
    print(ans)
else:
    while True:
        count -= 1
        count += a
        ans += 1
        if count >= b:
            break
    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)
else:
	print(-(-(B-1)//(A-1)))

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
consent = 1

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

Submission status: Accepted

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

ans = 0
consent = 1

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

Submission status: Accepted

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

K = 1
ans = 0

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


print(ans)

Submission status: Accepted

Solution code:
# abc139_b.py
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())
if (b-a)%(a-1)==0:
    print((b-a)//(a-1)+1)
else:
    print((b-a)//(a-1)+2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
 
a,b=list(map(int,input().split()))
 
mouse_tot = 1
mouse_cnt = 0
add_mouse = a-1
 
while mouse_tot <  b:
    mouse_tot += add_mouse
    mouse_cnt += 1
 
if b==0:
    mouse_cnt = 0
 
print(mouse_cnt)

Submission status: Accepted

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

Submission status: Accepted

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

i = 1
tmp = 1
ans = 1

while b > tmp:
  tmp = a * i - (i-1)
  ans += 1
  i += 1

print(ans-1)

Submission status: Accepted

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

for i in range(0, 21):
    ans = i * ( A - 1 ) + 1
    if ans >= B:
        print(i)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import *
from heapq import *
from itertools import *
from fractions import gcd

from decimal import *
import copy
from bisect import *
import time
import sys
import math
sys.setrecursionlimit(10**7)
A,B=map(int,input().split())
B-=1
count=0
while B>0:
    B-=A-1
    count+=1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = 1

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Sum=1
Count=0
while Sum < B:
    Sum=Sum+A-1
    Count+=1

print(Count)

Submission status: Accepted

Solution code:
A,B = list(map(int, input().split()))
C = B-A
D = A-1
n = -(-C // D) + 1
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')
#import numpy as np


def main():
	a,b=MI()
	for i in range(100):
		if (a-1)*i+1>=b:
			print(i)
			exit(0)
			
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
A, B = (int(x) for x in input().split())
C, count = 1, 0
while C < B:
    C += (A - 1)
    count += 1
print(count)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
def ceil(n): # ceiling関数
    if n > int(n):
        return(int(n)+1)
    else:
        return(int(n))
print(ceil((B-1)/(A-1)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print((s+t-1)//s)

Submission status: Accepted

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

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

number = 0

if B == 1:
    count = 0

else:
    number = A
    count = 1

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

print(count)

Submission status: Accepted

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

def main():
    A,B = map(int, input().split())
    sasikomi = 1
    tap = 0
    while(True):
        if sasikomi >= B:
            break
        sasikomi += (A-1)
        tap += 1
    print(tap)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split())
C=A
ans = 1
if(B == 1):
    print(0)
    sys.exit()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	a,b = MI()
	if b == 1:
		print(0)
	else:
		ans = 0
		tap = 1
		while True:
			tap += a - 1
			ans += 1
			if b <= tap:
				print(ans)
				break


if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
if B == 1:
    print(0)
elif A >= B:
    print(1)
else:
    print(math.ceil((B - A) / (A - 1)) + 1)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
a,s=map(int,input().split())
print(1-(-s+a)//(a-1))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

ans = int((B - 1) / (A - 1)) + 1

if (B - 1) % (A - 1) == 0:
    ans -= 1

print(ans)

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math
import collections
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

a,b=MI()
if b==1:
    print(0)
    sys.exit()
for i in range(1,100):
    num=a+(a-1)*(i-1)
    if num>=b:
        print(i)
        sys.exit()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
import sys

def solve():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    currentOpen = 1
    usedA = 0
    while currentOpen < B:
        currentOpen += A - 1
        usedA += 1
    print(usedA)
    

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

for i in range(101):
    socket=1+i*(a-1)
    if socket>=b:
        print(i)
        exit(0)

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())
ans = 1
if b == 1:
    print(0)
    exit()
for i in range(100):
    ans += (a-1)
    if ans >= b:
        break
print(i+1)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem B - Power Socket

import math

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

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

# output
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())
k=1
for i in range(1000):
    if k>=b:
        print(i)
        break
    k = k - 1 + a

Submission status: Accepted

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

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:
from math import ceil


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

a, b = MAP()
ans = ceil((b - a) / (a - 1) + 1)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = (int(i) for i in input().split())
    print(0--(B-1)//(A-1))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

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())
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
c=1
while c<b:
    c-=1
    c+=a
    ans+=1
print(ans)

Submission status: Accepted

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

ans = 1
temp = A

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if b == 1:
    print(0)
elif a == b:
    print(1)
else:
    print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
c = 1
n = 0
while c < B:
  n += 1  # 電源タップを1つ用意
  c -= 1  # 差込口を1個使って
  c += A  # 差込口をA個得る
print(n)  # 必要な電源タップの個数

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

num = (b - 1) // (a - 1)
amari = (b - 1) % (a - 1)

if amari == 0:
    print(num)
else:
    print(num + 1)

Submission status: Accepted

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