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:
def main():
    a, b = scan()
    plag = 1
    cnt = 0
    while plag < b:
        plag -= 1
        plag += a
        cnt += 1
    print(cnt)

def iread():
    return int(input())


def sread():
    return input()


def aread(t="int"):
    if t == "int":
        ret = [int(i) for i in input().split()]
    elif t == "str":
        ret = list(input())
    return ret


def scan():
    return list(map(int, input().split()))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
while True:
    try:
        A, B = map(int, input().split())
        if B == 1:
            print(0)
        elif A >= B:
            print(1)
        else:
            A -= 1
            B -= 1
            print(-(-B//A))
    except EOFError:
        break

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations
import sys
import bisect
import string
sys.setrecursionlimit(10**6)
def SI():
    return input().split()
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
mo=10**9+7

a,b=MI()
ans=1
c=a
while c<b:
    c+=a-1
    ans+=1
print(ans if b!=1 else 0)

Submission status: Accepted

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

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())
res = 1
if b == 1:
    print(0)
    exit(0)
while a *res - (res -1 ) < b  :
 res = res + 1
 #print(a,"個口を",res,"つ使うと未使用は、",a *res - (res -1 ))
print(res)

Submission status: Accepted

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

kuti = a
ans = 1


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

print(ans)

Submission status: Accepted

Solution code:
import sys

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: [int(x) for x in ns().split()]
nall = lambda: [int(x) for x in sys.stdin.readlines()]


def main():
    a, b = na()

    #a * i - (i-1) >= b
    c = ((b - 1) + (a - 2)) /(a - 1)
    print(int(c))


        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    # 1 + R * (A - 1) >= B
    print((b - 1 + a - 2) // (a - 1))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
count=0
b -=1
while b>0:
    b -=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:
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 = 1
ac = a

while ac < b:
  ac += a - 1
  n += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
# sum_a = a[0]+(a[0]-1)+(a[0]-1)
b=0
for i in range(100000000):
   if(a[1]==1):
      break
   if(i==0):
      if(b>=a[1]): 
         break
      b=a[0]
   else:
      if(b>=a[1]):
         break
      b=b+(a[0]-1)

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = (int(n) for n in input().split())
if B == 1:
    cnt = 0
else:
    B-=A
    cnt = 1
    while(B>0):
        B-=(A-1)
        cnt+=1
print(str(cnt))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(int,input().split()))
n = 0
m = 0

for i in range(20):
    n = s[0]*i - (i - 1)
    if n >= s[1]:
        m = i
        break

print(m)

Submission status: Accepted

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

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

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

a = 1
num = 0

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

print(num)

Submission status: Accepted

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

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

count = 1
remain = B - A
while remain > 0:
    count += 1
    remain -= (A - 1)

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

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

Submission status: Accepted

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

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

count = 1
remain = B - A
while True:
    if remain <= 0:
        print(count)
        break
    count += 1
    remain -= (A - 1)

Submission status: Accepted

Solution code:
def test2(a, b):
  cnt = 1
  if(b == 1):
    return 0
  if(a >= b):
    return cnt
  limit = 10**10
  for i in range(1, limit):
    cnt += 1
    if((a + ((a-1) * i)) >= b):
      return cnt
a,b=map(int,input().split())
print(test2(a,b))

Submission status: Accepted

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

b -= 1
if b%(a-1) == 0:
    print(b//(a-1))
else:
    print(b//(a-1)+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:
P = [int(_) for _ in input().split()]
A = P[0]
B = P[1]

T = 1
N = 0

while T < B:
    N += 1
    T += A - 1

print(N)

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve
ans = 0
plug = 1
while True:
    if plug >= B:
        break
    plug += A - 1
    ans += 1

# output
print(ans)

Submission status: Accepted

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

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

for i in range(10 ** 9):
    ans += 1
    tmp += a
    if b <= tmp:
        break
    else:
        tmp -= 1
print(ans)

Submission status: Accepted

Solution code:
def solve():
    a, b = read()
    result = think(a, b)
    write(result)


def read():
    return read_int(2)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b):
    if b == 1:
        return 0
    accum = [a + (a - 1) * r for r in range(100)]
    for i in range(len(accum)):
        if accum[i] >= b:
            return i + 1


def write(result):
    print(result)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
from copy import deepcopy
from math import ceil
if __name__ == "__main__":

    a = list(map(int, input().split()))
    n = deepcopy(a[0])
    i = 1
    if a[0] == a[1]: print(i)
    elif a[1] == 1: print(0)
    elif a[0] >= a[1]: print(i)
    else:
        while True:
            i += 1
            n += a[0] - 1
            if n >= a[1]:
                print(i)
                break

Submission status: Accepted

Solution code:
import sys
A,B = map(int, input().split())
akikuti =A
ans =1

if(B ==1):
    ans = 0
    print(ans)
elif (akikuti >= B ):
    print(ans)
    
else:
    
    for i in range(1000):
        akikuti += A-1
        ans +=1
        if(akikuti >=B):
            print(ans)
            sys.exit()
        else:
            continue

Submission status: Accepted

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

tmp = 0

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

print(tmp)

Submission status: Accepted

Solution code:
a,b = [int(x) for x in input().split()]
def extend(x,a,b,n):
  assert x>=1
  if x >= b:
    return n
  else:
    n += 1
    extended =  x - 1 + a
    return extend(extended, a, b, n)
print(extend(1, a, b, 0))

Submission status: Accepted

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

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


print(c)

Submission status: Accepted

Solution code:
A,B = [int(x) for x in input().split()]
if(B==1):
    print(0)
elif(B<A):
    print(1)
else:
    if((B-A)%(A-1)==0):
        print((B-A)//(A-1)+1)
    else:
        print((B-A)//(A-1)+2)

Submission status: Accepted

Solution code:
a, b = (int(_) for _ in input().split())
total = 1
ans = 0
while total < b:
  total -= 1
  total += a
  ans += 1    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

cnt = 0
while b > 0:
    if cnt == 0:
        b -= a
    else:
        b -= a - 1
    cnt += 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

while True:
  result += a
  if result >= b:
    tap += 1
    break
  else:
    result -= 1
    tap += 1
print(str(tap))

Submission status: Accepted

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

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

for i in range(10 ** 9):
    ans += 1
    tmp += a
    if b <= tmp:
        break
    else:
        tmp -= 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 電源タップが1つ増えるごとに差込口はa-1ずつ増える
count = 0
while a+(a-1)*(count-1) < b:
    count += 1
print(count)

Submission status: Accepted

Solution code:
n = list(map(int, input().split(' ')))
sum = n[1]
cnt = 1
if n[1]==1:
    cnt = 0
else:
    for i in range(1,40):
        sum = sum - n[0]
        if sum <= 0 :
            break
        else:
            sum += 1
        cnt += 1
print(cnt)

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
t = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_AB = input()
AB = input_AB.split(" ")
A = int(AB[0])
B = int(AB[1])
ans = 0
outlet = 1
while outlet < B:
  outlet = outlet - 1
  outlet = outlet + A
  ans = ans + 1
print(ans)

Submission status: Accepted

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

ans = 0
out = 1

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

print(ans)

Submission status: Accepted

Solution code:
A = input().split()
count = 1
a = int(A[0])
b = int(A[1])
c = a

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# A = int(input())

A, B = [int(i) for i in input().split(" ")]
total = A
ans = 1
while True:
   if B <= total: break
   ans += 1
   total += A  -1
if B == 1:  print(0)
else: print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

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

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
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 input(): return sys.stdin.readline().strip()
def INT(): return int(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()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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


while(1):

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

    

# n = INT()
# a, b, c = MAP()
# ans = 1
# # count = 0
# count = a
# flag = False
# # for i in range(30):
# while flag == False:
#     if count >= b:
#         flag = True    
#     else:
#         count += a-1
#         ans += 1
# print(ans)





# k = 1
# count = 0
# ans = 0
# A = []


# count += a
# ans += 1


# while(1):
#     if count >= b:
#         print(ans)
#         exit()
#     else:
#         count += a-1
#         ans += 1
#         # print()




# count += a
# ans += 1

# for i in range(100):
#     if b <= count:
#         print(ans)
#         exit()

#     else:
#         count += a-1
#         ans += 1 
#         # print(ans)

# for i in range(30):
# while(1):
#     count += a
#     ans += 1
#     print(count)

#     if b <= count:
#         print(ans)
#         exit()
#     else:   
#         count = count-1
#     # print(ans)
    
    # # A.append(a)
    # # if sum(A)
    # if count == 0:
    #     count += a
    #     ans += 1
    # else:
    #     count += a-1
    #     ans += 1
    # print(count)
    # print(ans)
    # if b<=count:
    #     # print(count)
    #     print(ans)
    #     exit()

Submission status: Accepted

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

ans = 0
out = 1

while(out < B):
  out -= 1
  out += 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:
import math
def A():
    a = input()
    b = input()
    ans = 0
    for i in range(3):
        if a[i] == b[i]:
            ans += 1
    print(ans)

def B():
    temp = [int(i) for i in input().split()]
    a = int(temp[0])
    b = int(temp[1])
    ans = 0
    t = 1
    while (t<b):
        ans += 1
        t += (a-1)
    print(ans)

def C():
    n = int(input())
    nums = [int(i) for i in input().split()]
    start_index = 0
    end_index = 1
    max_len = 0
    le = 0
    while (end_index < len(nums)):
        if nums[end_index] <= nums[end_index-1]:
            le += 1
        else:
            max_len = max(le, max_len)
            start_index = end_index
            le = 0
        end_index += 1
    max_len = max(le, max_len)
    print(max_len)

def D():
    n = int(input())
    # for i in range(1, n+1):
    #     m = 0
    #     s = [i for i in range(1, n+1)]
    #     for j in range(len(s)):
    #         m = max(m, s[0]%i)
    #         del s[0]

    #     print(i, m)
    #     ans += m
    ans = n*(n-1)//2
    print(ans)

B()

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
tmp = 1
count = 0
while tmp < b:
    tmp -= 1
    tmp += a
    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:
import sys

stdin = sys.stdin
na = lambda: map(int, stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())

def main():
  a, b = na()
  
  tmp = 1
  cnt = 0
  while tmp < b:
    tmp += a-1
    cnt += 1
  print(cnt)

main()

Submission status: Accepted

Solution code:


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

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

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

if A >= B:
    print(1)
    exit()

count = 2
B -= (A-1)
while True:
    if A >= B:
        print(count)
        exit()

    count += 1
    B -= (A-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])
#print(a,b)
out = 1
n = 0
while b > out:
  out += a-1
  n +=1
print(n)

Submission status: Accepted

Solution code:
import copy
A, B = list(map(int, input().split()))
C = copy.copy(A)
if B == 1:
    print(0)
    exit()
count = 1
while A < B:
    A += C - 1
    count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


l,r = map(int, raw_input().split())
if r == 1 :
	print 0
	exit()
ans = 0
count = 0
while count < r:
	count += l - (1 if ans >0 else 0)
	ans +=1
print ans

Submission status: Accepted

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

Submission status: Accepted

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

for n in range(0,21):
    if n * X[0] - (n-1) >= X[1]:
        print(n)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=a
n=1
m=0
if b==1:
    print(m)
else:
    for i in range(2100):
        if b<=s:
            print(n)
            break
        s=s+(a-1)
        n=n+1

Submission status: Accepted

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


v = 1
count = 0

a = A - 1

if v == B:
    print("0")
    exit()

count = (B - 1) // a
amari = (B - 1) % a
if amari > 0:
    count += 1

print(count)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

un = A
ans = 1

while True:
    if B <= un:
        break

    un = (un - 1) + A
    ans += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a,b=map(int, input().split())
hole = a
if b==1:
	print(0)
	sys.exit()
for i in range(1,30):
    if hole<b:
        hole = hole + a -1
    elif hole>=b:
        print(int(i))
        break

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
ans=0
num=0

while True:
    if a[1]==1:
        break
    if (a[0]-1)*num+a[0] >= a[1]:
        ans = num+1
        break
    num += 1
print(ans)

Submission status: Accepted

Solution code:
a, b = (int(x) for x in input().split())
plus_a = a - 1

ans = 1

if b == 1:
  ans = 0
else:
  while a < b:
    ans += 1
    # print(a)
    a += plus_a

# print(a)
print(ans)

Submission status: Accepted

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

checker = True

if b==1:
    print(0)
    checker = False

if checker and a >= b:
    print(1)
    checker = False

    
counter = 1
tmp = a

while checker:
    tmp += a-1
    if tmp >= b:
        checker = False
        counter += 1
        print(counter)
    else:
        counter += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#El Patron
P, Q = map(int, input().split())
if Q == 1:
    print(0)
    exit(0)

count = 1
a = P
while a < Q:
    a += P - 1
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if B == 1:
    ans = 0
else:
    ans = 1
    while x < B:
        x -= 1
        x += A
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
if B == 1:
    print(0)
    exit()
if 2 <= A and A <= 20:
    if 1 <= B and B <= 20:

        power = 1
        count = 0

        while True:
            count += 1
            power = power - 1 + A
            # print(power)
            if power >= B:
                print(count)
                break

Submission status: Accepted

Solution code:
cnt=0
m,n=map(int,input().split())
if(n==1):
    print(0)
else:
    n-=m
    cnt+=1
    while(n>0):
        n-=(m-1)
        cnt+=1  
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

if A[1] == 1:
  print(0)
  exit()
elif A[1] <= A[0]:
  print(1)
  exit()

import math  
N = math.ceil((A[1]-1) / (A[0]-1))
print(N)

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = True
if(b==1):
    print(0)
    flag=False

sasi = a;
answer = 1;

if(flag==True):
    while(sasi < b):
        sasi = sasi + a - 1;
        answer += 1;
    print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

S = list(input().split())

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

C = (B-A)/(A-1)+1

print(math.ceil(C))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a , b = map(int, input().split(" "))
c = 0
ans = 0
if(b == 1):
    print(0)
else:
    for i in range(0, 50):
        if(i == 0):
            c = c + a
            ans = ans + 1
        else:
            c = c + a - 1
            ans = ans + 1
        if(c >= b):
            break
    print(ans)

Submission status: Accepted

Solution code:
import math

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

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

print(int(count + 1))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if B==1:
    ans=0
elif 1<B and B<=A:
    ans=1
else :
    for k in range(2,100):
        if (k-1)*A-(k-2)<B and B<=k*A-(k-1):
            ans=k
        else:
            k=k+1
print(ans)

Submission status: Accepted

Solution code:
import sys
num = list(input().split(" "))
a = int(num[0])
b = int(num[1])
if b == 1:
  print(0)
  sys.exit()

count = 1

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

print(count)

Submission status: Accepted

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

if B == 1:
    print(0)
    exit(0)
n = 0
x = 1
while(1):
    if x >= B:
        print(n)
        exit(0)
    else:
        x += A - 1
        n += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = input().split()
A = int(A)
B = int(B)
out = int((B-1)/(A-1))
if B > out*(A-1)+1:
  out += 1
print(out)

Submission status: Accepted

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

if b == 1:
    print(0)
    exit()
while tmp < b:
    cnt += 1
    tmp += a - 1

print(cnt)

Submission status: Accepted

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