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: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

if b % a > 0:
    c += 1

c += (b // a)

print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
import numpy as np
print(int(np.ceil(b/a)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
while A*ans < B:
  ans += 1


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

print(math.ceil(B / A))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

print(output)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# m = map(int, raw_input().split())
a, b = map(int, raw_input().split())
print (b+a-1)/a
# s = raw_input()
# t = raw_input()
# ans = 0
# for i in xrange(3):
#   if s[i] == t[i]:
#     ans += 1
# print ans
# l = raw_input().split()
# n = int(raw_input())

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
i = 1
while True:
  if i*A - i + 1 >= B:
    print(i)
    exit()
  i += 1

Submission status: Wrong Answer

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

import math
print(math.ceil(B/A))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ans = 1
for i in range(1, 200):
    if i * A >= B:
        break

    ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if mod != 0:
  div += 1

print(div)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	A,B = inputMap()

	ans = B // A
	if B % A != 0:
		ans += 1

	print(ans)

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
#B問題
import math
A,B = map(int,input().split())
if B != 1:
    print(math.ceil(B/A))
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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-a<=0:
        cnt+=1
        break
    elif b-c >=0:
        cnt+= 1
        b-=c
    if b<=0:
        break

print(cnt)

Submission status: Wrong Answer

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()
if m == 1:
    print(0)
else:
    print(-(-m//n))

Submission status: Wrong Answer

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

ans = 0
ko = 0

while ko < B:
    ans += 1
    ko += A

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = 1

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    a, b = rli()
    print((b+a-1)//a)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

Solution code:
a, b = (int(i) for i in input().split())
from math import ceil
print(int(ceil(b/a)))

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

Solution code:
import collections as c
ip = lambda : map(int, input().split())
# ##############
mod = 1e9+7
a,b = ip()
ans = (b+a-1)//a
print(ans)

Submission status: Wrong Answer

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

c = B//A
d = B%A
if d>0:
    print(c+1)
else:
    print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
print(math.ceil(B/A))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 2019/09/01

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import ceil
A, B = map(int, input().split())
print(ceil(B/A))

Submission status: Wrong Answer

Solution code:
from math import ceil

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

print(ceil(b/a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
while A*ans <= B:
  ans += 1


print(ans)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(b//(a-1))

Submission status: Wrong Answer

Solution code:

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

import math
ans = math.ceil(B/A)
print(ans)

Submission status: Wrong Answer

Solution code:



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

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

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

Submission status: Wrong Answer

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def solve(A: int, B: int):
    ret = 0
    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: Wrong Answer

Solution code:
import math

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

print(math.ceil(b/a))

Submission status: Wrong Answer

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

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

print(-(-B//A))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from collections import *
import math
from bisect import *
import functools
INF = float('inf')
mod = 10**9+7

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

Submission status: Time Limit Exceeded

Solution code:
MM = input().split()
A = int(MM[0])
B = int(MM[1])
total = 1
count = 0
while total != B:
  total += A-1
  count += 1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

cnt = 1
while True:
  if b<= 1:
    cnt = 0
  elif b <= (a-1)*cnt+1:
    break
  cnt += 1
  
print(cnt)

Submission status: Time Limit Exceeded

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

if B == 1:
    print(0)

else:
    ans = 1
    while 1:
        if A + (A-1) * (ans - 1) >= B:
            break
            ans += 1

    print(ans)

Submission status: Time Limit Exceeded

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

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

x = 0
i = 0
while True:
    x = a + (a-1)*i
    if x<b:
        i+=1

print(i)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
c = N
ans = 1
if K == 1:
    print(0)
else:
    while c < K:
        ans += 1
        c += N-1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7
import math
a, b = LI()

# a は電源タップの口数
# b　は欲しい口数>
# 何個電源タップが必要ですか？
# ただしもとから一つの差し込み口がある。

kuchi = 1
ans = 0

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

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

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

Submission status: Accepted

Solution code:
n = 0
a, b = map(int, input().split())
while n*(a-1)+1 < b:
  n += 1
 
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())
num = 1
ans = 0
while num < B:
    num += A - 1
    ans += 1
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:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a,b=nii()

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

print(ans)

Submission status: Accepted

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

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())
if B == 1:
    print(0)
elif B <= A:
    print(1)
else:
    ans = 1+int((B-A)/(A-1))
    if (B-A)%(A-1):
        ans += 1
    print(ans)

Submission status: Accepted

Solution code:
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())


A,B = MI()
print((B+A-3)//(A-1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
plug = 1

if b > 1:
    while plug < b:
        plug = plug - 1 + a
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


A,B = MI()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
def main():
    # n = int(input())
    n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()

    ans = 0
    while True:
        if (n - 1) * ans + 1 >= k:
            print(ans)
            break
        ans += 1


if __name__ == '__main__':
    main()

Submission status: Accepted

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

g = a - 1
d, r = divmod(b - 1, g)
if r == 0:
    print(d)
else:
    print(d + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(tap)

Submission status: Accepted

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

Submission status: Accepted

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


def solve(A: int, B: int):
    if B == 1:
        print(0)
        return
    t = A
    ans = 1
    while True:
        if t >= B:
            print(ans)
            break
        t += A-1
        ans += 1
    return


# Generated by 1.1.7.1 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:
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    t = 1
    ans = 0
    while True:
        if t >= B:
            print(ans)
            break
        t += A-1
        ans += 1
    return


# Generated by 1.1.7.1 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:
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    p = 1
    ans = 0
    while True:
        if p >= B:
            print(ans)
            break
        p -= 1
        p += A
        ans += 1
    return


# Generated by 1.1.7.1 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())

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

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,b=map(int,input().split())
if b==1: print(0); exit();
for i in range(1,1000):
  if b<=a*i-(i-1):
    print(i)
    exit(0)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
 
# 答えは、ceil((B-1)/(A-1))
A -= 1
B -= 1
print(-(-B//A))

Submission status: Accepted

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

# シミュレーションで解く場合：
# 電源タップの個数をa, 差込口の個数をnumとおく 
a = 0
num = 1
while num < B:
  num -= 1
  num += A
  a += 1

print(a)

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())
 
# A*x-(x-1) >= B
# (A-1)*x >= B-1
# x >= ceil((B-1)/(A-1))
print(-(-(B-1)//(A-1)))

Submission status: Accepted

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

Submission status: Accepted

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

N = 0
sum = 1

while (sum < B):
     N += 1
     sum = A + (A-1)*(N-1)

     if sum >= B:
         break

ans = N

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

def main():
    a, b = map(int, input().split())
    quo = (b - 1) // (a - 1)
    rem = (b - 1) % (a - 1)
    if rem == 0:
        print(quo)
    else:
        print(quo+1)

if __name__ == "__main__":
    main()

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 = (int(i) for i in input().split())
count = 0
if b == 1:
    print("0")
    exit()
while True:
    b -= a
    count += 1
    if b <= 0: break
    b += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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:
A, B = map(int, input().split())
if B == 1:
  print(0)
  exit()
x = 1
while x * (A - 1) < B - 1:
  x += 1
print(x)

Submission status: Accepted

Solution code:
import sys
d = list(map(int,input().split()))
A = d[0]
B = d[1]
cnt = 0
while True:
    #A口がcnt個ある。cntが1のときA*1口
    #cntが2以上のとき、
    if A*cnt - cnt +1 >= B:
        print(cnt)
        sys.exit(0)
    cnt +=1

Submission status: Accepted

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

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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