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

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

Submission status: Accepted

Solution code:
import sys
MAX_INT = int(10e9)
MIN_NUM = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B = IL()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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

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


if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
A,B=map(int,input().split())

for i in range(B):
	N=A*i-(i-2)
	if N>B:
		print(i)
		break

Submission status: Accepted

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

q, mod = divmod(B-1, A-1)

if mod > 0:
  print(q+1)
else:
  print(q)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math; from collections import deque; readline=sys.stdin.readline;

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

a = (B - 1 + A - 2) // (A - 1)

print(a)

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 = (int(i) for i in input().split())
ans = 0
C = 1

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

Submission status: Accepted

Solution code:
s = input().split(" ");
a = int(s[0]);
b = int(s[1]);

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

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

c = (b - 1) // (a - 1)
d = (b - 1) % (a - 1)

if d == 0:
    print(c)
else:
    print(c + 1)

Submission status: Accepted

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

tap = 0

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

print(tap)

Submission status: Accepted

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

ans=0
nowkuchi=1
if kazu==1:
    print(0)
    exit()

while nowkuchi<kazu:
    nowkuchi+=kuchi-1
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
nums = list(map(int, input().split()))
A, B = nums[0], nums[1]
import math
if B == 1:
    print(0)
else:
    print(math.ceil(((B-A)/(A-1)) + 1))

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(count)


if __name__ == '__main__':
    func()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#ABC139B
import sys
#sys.setrecursionlimit(100000)


#n=int(input())
tmp = input().split()
a,b = list(map(lambda a: int(a), tmp))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():    
    a,b = map(int,input().split())
    x = 1
    c = 0
    while True:
        if x < b:
            x = x-1+a
            c += 1
        else:
            break
    print(c)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


a,b = li()
print(max(0, -(-(b-1) // (a-1))))

Submission status: Accepted

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

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

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

n = (B - 1) // (A - 1)
if (B - 1) % (A - 1):
    n += 1

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
socket = 1

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

print(count)

Submission status: Accepted

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

m, n = divmod(b-1, a-1)

if n == 0:
  print(m)
  
else:
  print(m+1)

Submission status: Accepted

Solution code:
hoge = input().split()
A = int(hoge[0])
B = int(hoge[1])

n = 0
count = 0
while 1 == 1:
  if B == 1:
    break
  if n == 0:
    n += A
    count += 1
  else:
    n += A - 1
    count += 1
  if n >= B:
    break

print(count)

Submission status: Accepted

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

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

c = 1
n = 0
while c<B:
    c = c - 1 + A
    n += 1

print(n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
out = 1
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
a=[]
for x in input().split(" "):
    a.append(int(x))

n=1
i=0
while n<a[1]:
    n+=(a[0]-1)
    i+=1
print(i)

Submission status: Accepted

Solution code:
#n=int(input())
#L=list(map(int,input().split()))
a,b=map(int,input().split())
#A=[[0 for i in range()] for j in range()]
#l = [int(input()) for i in range(N)]
b-=1
a-=1
if b%a!=0:
  print(b//a+1)
else:
  print(b//a)

Submission status: Accepted

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


def solve(A: int, B: int):
    ret = 0
    if B == 1:
        ret = 0
    else:
        for i in range(100):
            if A + (A - 1) * i >= B:
                ret = i + 1
                break
    print(ret)
    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:
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    cnt = 0
    tap = 1
    while tap < B:
        tap += A - 1
        cnt += 1

    return cnt


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

Submission status: Accepted

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

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

if ans%1 > 0:
    ans += 1
print(int(ans))

Submission status: Accepted

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

left = b - a
cnt = 1
while left > 0:
    left -= a - 1
    cnt += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(math.ceil(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep  1 20:21:49 2019

@author: Yamazaki Kenichi
"""

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import collections
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    a, b = map(int, input().split())
    ans = 0
    k = 1
    while True:
        if k >= b:
            break
        k += a - 1
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

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


def solve(A, B):
    one = A - 1
    total = B - 1
    return (total+one-1) // one


if __name__ == '__main__':
    A, B = map(int, input().split())

    ans = solve(A, B)

    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
# S=numpp.assaray(S)=="#"
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LLS(): return [list(sys.stdin.readline().rstrip()) for _ in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()



def main():
    A,B=LI()
    out=1
    num=A
    if B<=1:
        print("0")
        exit()
    while num<B:
        num+=(A-1)
        out+=1
    print(out)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A, B = map(int,input().split()) # 複数の数字を変数に格納

count = 0
result = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

A -= 1
B -= 1

ans = B/A

print(math.ceil(ans))

Submission status: Accepted

Solution code:
import sys
import collections
import copy
q = 1
A,B = map(int,input().split())
ans = 0
while B > q:
    q += A-1
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
ans = 0

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

Submission status: Accepted

Solution code:
import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

# input = sys.stdin.readline


def main():
    n, m = map(int, input().split())

    concent = 1
    count = 0
    while concent < m:
        concent += n - 1
        count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
def main():
    A, B = map( int, input().split())
    ans = 0
    if B == 1:
        print(0)
        return
    for i in range(30):
        if A*i - (i-1) >= B:
            print(i)
            break
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

outlet = 1
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# ABC139b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Accepted

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

import sys
import math

a,b= [ int(x)-1 for x in sys.stdin.readline().split() ]
print( math.ceil(b/a) )

Submission status: Accepted

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

n = 1
i = 0
while n < B:
    i += 1
    n += A-1

print(i)

Submission status: Accepted

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

result = 0
plug = 1

while(1):
  if plug >= B: break
  plug += (A-1)
  result += 1

print(result)

Submission status: Accepted

Solution code:
a, b = [int(elem) for elem in input().split()]

if (b - 1) / (a - 1) == (b - 1) // (a - 1):
    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()


now = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False


n,m = m()
k = 1
co = 0
while k < m:
    k = k-1 + n
    co += 1 
print(co)

Submission status: Accepted

Solution code:
# coding: utf-8

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

output = 1
now = A
while now < B:
    output += 1
    now += A - 1

if B == 1:
    output = 0

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

now = 1

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

print(ans)

Submission status: Accepted

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

count = 1
num = 0

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

print(num)

Submission status: Accepted

Solution code:
import sys
import math
a,b = [int(i) for i in sys.stdin.readline().split()]
if b == 1:
    print(0)
else:
    print(math.ceil((b-1) / (a-1)))

Submission status: Accepted

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

Submission status: Accepted

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

while B > out:
    out += A - 1
    ans += 1

print(ans)

Submission status: Accepted

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

plug = 1
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
A, B = inpl()
print((B-1)//(A-1) + int((B-1)%(A-1) > 0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
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())
count = 0

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

Submission status: Accepted

Solution code:
#B問題
import math
A,B = map(int,input().split())
now = 1
for i in range(50):
    if now < B:
        now+=(A-1)
    else:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/09/01
# AtCoder Beginner Contest 139 - B

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

# Calc
sum_s = 1
cnt = 0
while(sum_s < b):
    sum_s = sum_s + (a - 1)
    cnt = cnt + 1

ans = cnt

# Output
print(ans)

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B = MAP()

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())
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:
a, b = map(int, input().split())
cnt = 0
tap = 1
while tap < b:
    tap += (a-1)
    cnt +=1
print(cnt)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

hole = 1
ans = 0
for i in range(500):
    if hole >= B:
        print(i)
        break

    hole +=(A -1)

Submission status: Accepted

Solution code:
import math
import queue

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b):
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a):
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

A, B = map(int, input().split())
plug = 1
ans = 0
while plug < B:
    ans += 1
    plug += A - 1

print(ans)

Submission status: Accepted

Solution code:
import math
a, b = [int(item) for item in input().split()]
if b == 1:
    print(0)
    exit()

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

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math


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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

current = 1
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(output)

Submission status: Accepted

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

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

Submission status: Accepted

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

# 1 + (a - 1) * x >= b
print((b - 2) // (a - 1) + 1)

Submission status: Accepted

Solution code:
A,B=(int(x) for x in input().split())
c=0
kuti=1
for n in range(30):
    if n==0:
        if B==1:
            break
    else:
        kuti+=A-1
        c+=1
        if kuti>=B:
            break
print(c)

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

while True:
    if current >= b:
        break

    current += a - 1
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A, B = map(int, input().split())
ans = 0
plug = 1
while plug < B:
	plug -= 1
	plug += A
	ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

hole = 1
c = 0
for i in range(10000):
  if hole >= B:
    break
  
  hole += A - 1
  c += 1

print(c)

Submission status: Accepted

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