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:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b = Is()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B =map(int,input().split())
soc= 1
tap=0
while(soc<B):
  soc-=1
  soc+=A
  tap+=1
#print(tap)
print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

Solution code:
import math
A,B =map(int,input().split())
soc= 1
tap=0
while(soc<B):
  soc-=1
  soc+=A
  tap+=1
print(tap)
#print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
def main():
    s, t = list(map(int, input().split()))
    tap = 1
    count = 0
    while tap < t:
        tap += s - 1
        count += 1
    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c = input()
c = tuple(map(int, c.split()))
a, b = c
if a == 2:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 2
	elif b == 4:
		ans = 3
	elif b == 5:
		ans = 4
	elif b == 6:
		ans = 5
	elif b == 7:
		ans = 6
	elif b == 8:
		ans = 7
	elif b == 9:
		ans = 8
	elif b == 10:
		ans = 9
	elif b == 11:
		ans = 10
	elif b == 12:
		ans = 11
	elif b == 13:
		ans = 12
	elif b == 14:
		ans = 13
	elif b == 15:
		ans = 14
	elif b == 16:
		ans = 15
	elif b == 17:
		ans = 16
	elif b == 18:
		ans = 17
	elif b == 19:
		ans = 18
	elif b == 20:
		ans = 19
elif a == 3:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 2
	elif b == 5:
		ans = 2
	elif b == 6:
		ans = 3
	elif b == 7:
		ans = 3
	elif b == 8:
		ans = 4
	elif b == 9:
		ans = 4
	elif b == 10:
		ans = 5
	elif b == 11:
		ans = 5
	elif b == 12:
		ans = 6
	elif b == 13:
		ans = 6
	elif b == 14:
		ans = 7
	elif b == 15:
		ans = 7
	elif b == 16:
		ans = 8
	elif b == 17:
		ans = 8
	elif b == 18:
		ans = 9
	elif b == 19:
		ans = 9
	elif b == 20:
		ans = 10
elif a == 4:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 2
	elif b == 6:
		ans = 2
	elif b == 7:
		ans = 2
	elif b == 8:
		ans = 3
	elif b == 9:
		ans = 3
	elif b == 10:
		ans = 3
	elif b == 11:
		ans = 4
	elif b == 12:
		ans = 4
	elif b == 13:
		ans = 4
	elif b == 14:
		ans = 5
	elif b == 15:
		ans = 5
	elif b == 16:
		ans = 5
	elif b == 17:
		ans = 6
	elif b == 18:
		ans = 6
	elif b == 19:
		ans = 6
	elif b == 20:
		ans = 7
elif a == 5:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 2
	elif b == 7:
		ans = 2
	elif b == 8:
		ans = 2
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 3
	elif b == 11:
		ans = 3
	elif b == 12:
		ans = 3
	elif b == 13:
		ans = 3
	elif b == 14:
		ans = 4
	elif b == 15:
		ans = 4
	elif b == 16:
		ans = 4
	elif b == 17:
		ans = 4
	elif b == 18:
		ans = 5
	elif b == 19:
		ans = 5
	elif b == 20:
		ans = 5
elif a == 6:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 2
	elif b == 8:
		ans = 2
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 3
	elif b == 13:
		ans = 3
	elif b == 14:
		ans = 3
	elif b == 15:
		ans = 3
	elif b == 16:
		ans = 3
	elif b == 17:
		ans = 4
	elif b == 18:
		ans = 4
	elif b == 19:
		ans = 4
	elif b == 20:
		ans = 4
elif a == 7:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 2
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 3
	elif b == 15:
		ans = 3
	elif b == 16:
		ans = 3
	elif b == 17:
		ans = 3
	elif b == 18:
		ans = 3
	elif b == 19:
		ans = 3
	elif b == 20:
		ans = 4
elif a == 8:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 2
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 3
	elif b == 17:
		ans = 3
	elif b == 18:
		ans = 3
	elif b == 19:
		ans = 3
	elif b == 20:
		ans = 3
elif a == 9:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 2
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 3
	elif b == 19:
		ans = 3
	elif b == 20:
		ans = 3
elif a == 10:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 2
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 3
elif a == 11:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 2
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 12:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 2
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 13:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 2
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 14:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 2
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 15:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 2
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 16:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 2
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 17:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 2
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 18:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 1
	elif b == 19:
		ans = 2
	elif b == 20:
		ans = 2
elif a == 19:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 1
	elif b == 19:
		ans = 1
	elif b == 20:
		ans = 2
elif a == 20:
	if b == 1:
		ans = 0
	elif b == 2:
		ans = 1
	elif b == 3:
		ans = 1
	elif b == 4:
		ans = 1
	elif b == 5:
		ans = 1
	elif b == 6:
		ans = 1
	elif b == 7:
		ans = 1
	elif b == 8:
		ans = 1
	elif b == 9:
		ans = 1
	elif b == 10:
		ans = 1
	elif b == 11:
		ans = 1
	elif b == 12:
		ans = 1
	elif b == 13:
		ans = 1
	elif b == 14:
		ans = 1
	elif b == 15:
		ans = 1
	elif b == 16:
		ans = 1
	elif b == 17:
		ans = 1
	elif b == 18:
		ans = 1
	elif b == 19:
		ans = 1
	elif b == 20:
		ans = 1
print(ans)

Submission status: Accepted

Solution code:
# B - Power Socket

A, B = map(int, input().split())
i = 0
while (A - 1) * i + 1 < B:
    i += 1
print(i)

Submission status: Accepted

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

while True:
    if b == 1:
        t = 0
        break
    else:
        if b <= s:
            break
        else:
            s = s + a - 1
            t = t + 1

print(t)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

c = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    a,b=map(int, readline().rstrip().split())
    #arr=list(map(int, readline().rstrip().split()))
    #n=int(readline())
    #ss=readline().rstrip()
    #yn(1)
    n=1
    tap=0

    if b==1:
        print(0)
        return

    while 1:
        n-=1
        n+=a
        tap+=1
        if n>=b:
            print(tap)
            break


    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


ans = 0

i = 1


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

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

Submission status: Accepted

Solution code:
import sys, heapq
def LI(): return list(map(int, sys.stdin.readline().split()))
def LS(): return list(sys.stdin.readline())

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

res = 0
tmp = 1
while tmp < B:
    res += 1
    tmp = tmp - 1 + A

print(res)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 1
cnt = 0

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

Submission status: Accepted

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


resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

n = 1

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math

if __name__ == "__main__":
  A, B = [int(i) for i in input().split()]
  
  print(math.ceil((B-1)/(A-1)))

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if b == 1:
    print(0)
elif a >= b:
    print(1)
else:
    dum = b - a
    ans = 1
    syo,amari = divmod(dum,a-1)
    if amari != 0:
        ans += 1
    ans = ans + syo
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

a, b = map(int, input().split())
counter = 0
kuchi = 1

while not (kuchi >= b):
    counter = counter + 1
    kuchi = (kuchi -1) + a

print (counter)

Submission status: Accepted

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

Submission status: Accepted

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

while True:
  if b <= current:
    print(nums)
    exit(0)
  current += (a - 1)
  nums += 1

Submission status: Accepted

Solution code:
# coding: utf-8
import math
A, B = map(int, input().split())
if B == 1:
    print(0)
elif B - A > 0:
    num = 1
    B = B - A
    print(num + math.ceil(B/(A-1)))
else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split()) #OK! 次に進もうぜ

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

Submission status: Accepted

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

import math

def calc_num_of_sockets(plug, tap):
    return math.ceil((tap-1)/(plug-1))

def main():
    plug, tap = map(int, input().split())
    print(calc_num_of_sockets(plug, tap))

if __name__ == "__main__":
    try:
        assert calc_num_of_sockets(4, 10) == 3
        assert calc_num_of_sockets(8, 9) == 2
        assert calc_num_of_sockets(8, 8) == 1
    except:
        import traceback
        traceback.print_exc()
        exit()
    main()

Submission status: Accepted

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

if b==1:
  print(0)
else:
  t = a
  ans = 1
  for i in range(20):
    if t>=b:
      print(ans)
      break
    ans+=1
    t += a-1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a,b=map(int,input().split())
kosuu=0
sum=0
if b==1:
    print(kosuu)
    sys.exit()
while sum<b:
    sum=a+(a-1)*kosuu
    kosuu+=1
print(kosuu)

Submission status: Accepted

Solution code:

def main():
    A,B = map(int, input().split())
    aki = 1
    cnt = 0

    while aki < B:
        aki -=1
        aki += A
        cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split()) ; i=0
for q in range(1,364187,n-1):
    if q>=k:
        print(i)
        exit()
    i+=1

Submission status: Accepted

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

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())
d, q = divmod(b-1,a-1)
if q == 0:
  print(d)
else:
  print(d+1)

Submission status: Accepted

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

if B==1:
  print(0)
else:
  if math.ceil(B/A)==1:
    print(1)
  else:
    if (B-A)%(A-1)==0:
      print((B-A)//(A-1)+1)
    else:
      print((B-A)//(A-1)+2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

ans = 0
cnt = 1

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

print(ans)

Submission status: Accepted

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

ans = 0
X = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math


def solve():
    a, b = map(int, input().split())
    ans = 0
    if b == 1:
        print(0)
        sys.exit(0)
    ans = math.ceil((b-1)/(a-1))
    print(ans)


solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
x, y = map(int, input().split())
tap = 1
ans = 0
while True:
  if tap >= y:
    break
  tap += x-1
  ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math



def main(a, b):
    if a == b:
        return 1
    n = math.ceil((b - 1) / (a - 1))
    return n

a,b = list(map(int, input().split()))
print(main(a,b))

Submission status: Accepted

Solution code:
def II(): return int(input())
def MI(): return map(int,input().split())
def LMI(): return list(map(int,input().split()))
def LIIN(n): return list(int(input()) for _ in range(n))
def LMIN(n): return [list(map(int, input().split())) for _ in range(n)]
def IS(): return input()
def MS(): return map(str,input().split())
def LMS(): return list(map(str,input().split()))
def LISN(n): return list(input() for _ in range(n))
def LMSN(n): return [input().split() for _ in range(n)]
MOD = 10**9+7
INF = 10**18

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

else:
  print(int(c)+1)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
args = input().split()
a,b = int(args[0]),int(args[1])
if b==1:
  print("0")
elif b<=a:
  print("1")
else:
  print(int((b-a)/(a-1))+1+((b-a)%(a-1)!=0))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

print(math.ceil(x))

Submission status: Accepted

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

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

Submission status: Accepted

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

def main():
    A, B = map(int, open(0).read().split())

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


main()

Submission status: Accepted

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

num = 1
count = 0

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

aki = a - 1
n = 0
while aki * n < b - 1:
    n += 1

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 1
ans = 0
while tmp < i[1]:
    ans+=1
    tmp+=i[0]-1
print(ans)

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# B - Power Socket
a, b = map(int, input().split())

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

	print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
# 1個プラグが増えると未使用の差込口がA-1個増える
n = 0
b = 1
while b < B:
    n += 1 
    b += A-1
print(n)

Submission status: Accepted

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

i = 0
while True:
  if a + (i-1)*(a-1) >= b:
    ans = i
    break
  i += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

for x in range(B):
  if A+(A-1)*x < B:
    cnt+=1
  else:
    break
    
print(cnt+1)