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

if x[1]==1:
	print(0)
else:
	for i in range(1,20):
		if x[0]*max((i-1),0)+x[0]>=x[1]:
			print(i)
			break

Submission status: Wrong Answer

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

print(i+k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A , B = map(int,input().split())
if A == B:
        print(str(1))
        exit()
cnt = 0
result = 0
while True:
        cnt += 1
        result += A
        if result > B:
                break
new_result = A * cnt - (1) * (cnt-1)
if new_result < B:
        print(cnt+1)
else:
        print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""
from collections import defaultdict
import sys
import math
from datetime import datetime
import re
import math
def sol(a, b):
    return math.ceil(b/a)



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    # n = int(parsed_lines[0][0])
    # k = int(parsed_lines[0][1])
    S = parsed_lines[0][0]
    return S


if not do_submit:
    S = input_parse("""
    1905
    """)
    print(sol(S))

    S = input_parse("""
    0112
    """)
    print(sol(S))

    S = input_parse("""
    1700
    """)
    print(sol(S))

    S = input_parse("""
    0000
    """)
    print(sol(S))

    S = input_parse("""
    1001
    """)
    print(sol(S))



else:
    A, B = list(map(int, input().split()))
    #S = input()
    print(sol(A, B))

    # S = input().strip()
    # print(sol(S))

Submission status: Wrong Answer

Solution code:
import sys

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

for _ in range(1,10000):
    if( (A-1)*(_-1)+A >= B):
        print(_)
        break

Submission status: Wrong Answer

Solution code:

a,b = [int(i) for i in input().split()]
counter = 1
while (a-1)*(counter-1) + a < b:
    counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
I = input().split()
A = int(I[0])
B = int(I[1])
i = 0
ana = 0
while(True):
  if i == 0:
  	ana += A
  else:
    ana += (A-1)
  i += 1
  if ana >= B:
    break
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

num = list(input().split(" "))
a = int(num[0])
b = int(num[1])

print(math.ceil(b / a))

Submission status: Wrong Answer

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

while True:
    if b <= a*tap:
        break
    else:
        tap += 1

print(tap)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

a, b = input().strip().split(' ')
a, b = [int(a), int(b)]
if b - a < 0:
    ans = 1
else:
    ans = 1 + math.ceil((b - a)/(a-1)) 
print(ans)

Submission status: Wrong Answer

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

if c >=b:
  print(c%b+1)
else:
  print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if B<=A:
	print 1
	quit()

for i in range(2,50):
	if B<=A*i-(i-1):
		pass
		print i
		quit()

Submission status: Wrong Answer

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

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

div = b // (a-1)
mod = b % (a-1)

if mod <= 1:
    print(div)
else:
    print(div+1)

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    sum_ = 1

    while True:
        if A >= B:
            break

        sum_ += 1

        A = A - 1 + A

    print(sum_)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a == b:
    print(1)
elif (b//a+1)*a-2 >= b:
    print(b//a+1)
else:
    print(b//1+2)

Submission status: Wrong Answer

Solution code:
import math

elc_tap = input().split(" ")
for i in range(2):
    elc_tap[i] = int(elc_tap[i])

tap_num = 0

num = int(math.ceil(elc_tap[1]/elc_tap[0]))
for i in range(num):
    tap_num += 1

print(tap_num)

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 = list(map(int,input().split()))
c = 0
for i in range(1,a+1):
    c = c+a
    if c>=b:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# B - Power Socket
A, B = map(int, input().split())
A_new = A
count = 1
while A_new <= B:
    if A_new == B:
        break
    else:
        A_new += A-1
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

answer = 0
number = 1

if A < B:
  while number < B:
    number += A-1
    answer += 1
elif A == B:
  answer = 1
else:
  answer = 0

print(answer)

Submission status: Wrong Answer

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

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

i = 1
while i<=100000000:
    if int(B) <= (int(A)-1)*(i-1)+int(A):
        print(i)
        break
    i +=1

Submission status: Wrong Answer

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

def main():
    a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
    ans = 1
    while(True):
        if b == 1:
            print(0)
            break
        elif a < b:
            b = b - a
            ans += 1
        else:
            print(ans)
            break     

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
def main():

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

    
    c = int(b / (a - 1))
    if((a-1)*c+1 == b):
        print(c)
    else:
        print(c+1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

# 電源タップの初期値は1
socket_num = 1

con_flg = 1
available_kuchi = 0
while con_flg == 1:
    available_kuchi_num = (kuchi - 1)*(socket_num - 1) + kuchi
    if needed_kuchi_num <= available_kuchi_num:
        con_flg = 0
    else:
        socket_num += 1

print(socket_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
inputs = sys.stdin.readlines()

import math
A, B = map(int, inputs[0].split())
if A >= B:
    print(1)
else:
    print(1+int(math.ceil((B-A) / (A-1))))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
A,B=np.array(list(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: Wrong Answer

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

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

if B == 0:
    ans = 0
elif A > B:
    ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
import math
print(math.ceil(i[1]/ i[0]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

tap = 0
num = 0

while num < B:
  if tap >= 1:
    num -= 1
  tap += 1
  num += A

print(tap)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

#+++++
		
def main():
	b , c = map(int, input().split())
	kuti=b
	kosuu=1
	while kuti < c:
		kosuu+=1
		kuti += b - 1
		
	print(kosuu)
	
	
#+++++


if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

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

Submission status: Wrong Answer

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

Am1 = A - 1
if A >= B:
    print(1)
else:
    Result = (B // Am1) + 1
    print(Result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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()
# n = INT()
# a, b, c = MAP()

k = 1
count = 0
ans = 0

# for i in range()
while(1):
    if b<=count:
        # print(count)
        print(ans)
        exit()
    if count == 0:
        count += a
        ans += 1
    else:
        count += a-1
        ans += 1

Submission status: Wrong Answer

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

if a >= b:
    print(1)
    exit()

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

print(cnt)

Submission status: Wrong Answer

Solution code:


def main():

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

   C = B-A
   if C <= 0: print(1);exit()
   
   count = 1
   decline = A -1
   
   while(C > 0):
      C -= decline
      count += 1
   print(count)

   


      

if __name__== "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

k = A
i = 1

while k < B:
    k = k + A - 1
    i += 1

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
A , B = map(int,input().split())
if abs(int(B/(A-1))*(A-1) - B) > 1:
	ans = int(B/(A-1))+1
	print(ans)
	sys.exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = [int(x) for x in input().split()]
c = 1
a = A
while True:
  if a >= B:
    break
  else:
    a += A-1
    c += 1
print(c)

Submission status: Wrong Answer

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

if B%A==0:
    C=B//A
else:
    C=-(~B//A)
print(C)

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

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


def solve(A: int, B: int):
    n = A
    c = 1
    while(n < B):
        n -= 1
        n += A
        c += 1

    print(c)
    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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#S = input()
#X_list = list(map(int,input().split()))
#X1_list = [int(input()) for i in range(N)]
#X2_list = [list(map(int,input().split())) for i in range(N)]

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

ans = 1
kuchi = ans * A
while kuchi < B:
    ans += 1
    kuchi += A-1
    #print(kuchi)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

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

for _ in range(1,100):
    if( (A-1)*(_-1)+A >= B):
        print(_)
        break

Submission status: Wrong Answer

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

for i in range(1,10000000000):
    if (a*i -i + 1) >=b:
        print(i)
        exit()

Submission status: Wrong Answer

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

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


print(count)

Submission status: Wrong Answer

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

print (result)

Submission status: Wrong Answer

Solution code:
import math

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

i = 0
unused = 0
while 1:
    unused = A * (i + 1) - i
    if unused >= B:
        break
    i += 1
#print(unused)
if B != 0:
    print(i + 1)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = list(map(lambda x: int(x), 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 A == B:
  print(1)
elif A == 1:
    print(B)
else:
  print(B//A +1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

result = 0
for i in range(1, 100):
    if (B <= A * i - (i - 1)):
        result = i
        break

print(result)

Submission status: Wrong Answer

Solution code:
A , B = map(int,input().split())
if A == B:
        print(str(1))
cnt = 0
result = 0
while True:
        cnt += 1
        result += A
        if result > B:
                break
new_result = A * cnt - (1) * (cnt-1)
if new_result < B:
        print(cnt)
else:
        print(cnt-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

answer = 0
number = 1
i = 0

if A < B:
  while number < B:
    number += A-1
    answer += 1

print(answer)

Submission status: Wrong Answer

Solution code:
import numpy as np

a,b = input().split()
a = int(a)
b = int(b)
num_plug = a
num_tap = int(0)

while 1:
  if num_plug >= b:
    print(num_tap)
    exit()
  num_plug += (a-1)
  num_tap += 1

Submission status: Wrong Answer

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

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

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 = 0
	to = 0
	flg = False
	while True:
		ans += 1
		if flg == False:
			to = (to-1) + A
			flg = True
		else:
			to = (to-1) + A

		if to >= B:
			break

	print(ans)

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
'''

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

'''

from math import ceil

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

if b == 1:
    print(0)
else:
    ans = int(ceil(b / a))
    
    print(ans)

Submission status: Wrong Answer

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

print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
    try:
        A, B = map(int, input().split())
        
        if A >= B:
            print(1)
            continue
        
        strip = 1
        socket = A
        while (socket < B):
            strip += 1
            socket += (A-1)
            
        print(strip)
    
    except:
        break

Submission status: Wrong Answer

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

a_ = a - 1

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

Submission status: Wrong Answer

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

A, B = ISI()
for i in range(1, 101):
    if i == 1:
        sum = A*i
    else:
        sum = (A-1)*i+1
    if sum >= B:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
count=0
for i in range(21):
    if a*i>=b:
        count=i
        break
    elif i == 0 and b==1:
        count=0
        break
print(count)

Submission status: Wrong Answer

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

ans = -(-float(B) // float(A))
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split(" "))
n = 1
N = A
while True:
    if(B <= N):
        break
    N = N + (A - 1)
    n = n + 1

print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = b // (a - 1)

if c * (a - 1) + 1 == b:
    print(c)
else:
    print(c + 1)

Submission status: Wrong Answer

Solution code:
get = list(map(int, input().split()))
A = get[0]
B = get[1]
ans = 0
i = 1
while True:
    if A * i >= B:
        print(i)
        break
    else:
        i += 1

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

Submission status: Wrong Answer

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

for i in range(1,100000000):
    if (a*i -i + 1) >=b:
        print(i)
        exit()

Submission status: Wrong Answer

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

plug, sumPlug = 1, A
while sumPlug < B:
    sumPlug += A-1
    plug += 1

print(plug)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""
from collections import defaultdict
import sys
import math
from datetime import datetime
import re
import math
def sol(a, b):
    if b <= 1: return 0
    return math.ceil(b/a)



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    # n = int(parsed_lines[0][0])
    # k = int(parsed_lines[0][1])
    S = parsed_lines[0][0]
    return S


if not do_submit:
    S = input_parse("""
    1905
    """)
    print(sol(S))

    S = input_parse("""
    0112
    """)
    print(sol(S))

    S = input_parse("""
    1700
    """)
    print(sol(S))

    S = input_parse("""
    0000
    """)
    print(sol(S))

    S = input_parse("""
    1001
    """)
    print(sol(S))



else:
    A, B = list(map(int, input().split()))
    #S = input()
    print(sol(A, B))

    # S = input().strip()
    # print(sol(S))

Submission status: Wrong Answer

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

ret = 0
kuti = 0
for i in range(1, 1000):
  ret += 1
  if i == 1:
    kuti += A
  else:
    kuti += A-1
  
  if kuti >= B:
    break

print(ret)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
ans=1
x=A
if x>=B:
    print(ans)
    exit()

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

Submission status: Wrong Answer

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

count= 1
expandA= A

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = [int(c) for c in input().split(' ')]
num = 0
bdash = b
while bdash > 0:
    if bdash == a:
        num = num+1
        break
    else:
        num = num+1
        bdash = bdash - (a - 1)
print(num)

Submission status: Wrong Answer

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

tap = 0
count = 0

while True:
	count += A
	tap += 1
	
	if count < B:
		count -= 1
	else:
		break

print(tap)

Submission status: Wrong Answer

Solution code:


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

c=a

ans=1

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

print(ans)

Submission status: Wrong Answer

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

tako = 0
outlet = 1
while outlet < b:
    outlet += 3
    tako += 1
print(tako)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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