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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())
if a >= 2 and B>= 1:
    x = (B-1) / (A-1)

    print(math.ceil(x))

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())
if a >= 2 and B>= 1
    x = (B-1) / (A-1)

    print(math.ceil(x))

Submission status: Runtime Error

Solution code:
import math

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

ans = 0

if a >= b:
    ans = 1
else:
    if (b / a) + 1

print(ans)

Submission status: Runtime Error

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


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

import math

def func(B, C, D):
    if D >= B:
        print(C)
    else:
        C += 1
        func(B, C, D)
        
if B == 1:
    print(0)

else:
    C = math.ceil(B/A)
    D = (A-1)*(C-1) + A
    func(B, C, D)

Submission status: Runtime Error

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

if a[1]%a[0]==0:
    print(int(a[1]/b[0]))

else :
    print(int(a[1]/a[0]+1))

Submission status: Runtime Error

Solution code:

A=int(input())
B=int(input())

if B<=A:
    ans=1
else:
    for k in range(2,100):
        if (k-1)*A-(k-2)<B and B<=k*A-(k-1):
            ans=k
        else:
            k=k+1
print(ans)

Submission status: Runtime Error

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

ans = 0

if B = 1
print(0)

elif B <= A :
	print(1)

elif (B-A)%(A-1) <= 0 :
	ans = (B-A)//(A-1)+1
	print(ans)
elif (B-A)%(A-1) >= 1 :
	ans = (B-A)//(A-1)+2
	print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())

b = int(input())

ans = int(0)

for i in range(1,21):
    if b > a*i-i+1:
            ans += 1
    else:
            ans += 1
            print(ans)
            break

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

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

if ans_tmp > 1 and ans_tmp < 2:
    print(int(ans_tmp) + 1)
elif ans_tmp < 1:
    print(1)
else:
    print(int(ans_tmp))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

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

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())

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

print(math.ceil(x))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define INF INT_MAX
#define ll  long long
#define ull unsigned long long
#define rep(i,n) for(ll i=0; i<n; ++i)
#define FOR(i, s, e) for(ll i=s; i<e; ++i)
#define MOD 1000000007
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if(a>b) {a=b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) { if(a<b) {a=b; return true;} return false;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int A, B; cin >> A >> B;
  int n;
  for(n=0; ;++n) {
    if(A+(A-1)*n >= B) break;
  }
  if(A==B) cout << 1 << endl;
  else cout << n+1 << endl;
}

Submission status: Runtime Error

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

import math

def func(B, C, D):
    if D >= B:
        print(C)
    else:
        C += 1
        func(B, C, D)
        
if B == 1:
    print(0)

else:
    C = math.ceil(B/A)
    D = (A-1)*(C-1) + A
    func(B, C, D)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())

if B<=A:
    ans=1
else:
    for k in range(2,31):
        if (k-1)*A-(k-2)<B and B<=k*A-(k-1):
            ans=k
        else:
            k=k+1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
if (2 <= A <=20) and (1 <= B <=20):
    MAX = A
    for i in range(1,A+1):
        outlet =  i*A + (MAX -i)
        if (B <= outlet):
            print(i+1)
            break
        elif (outlet == A*A):
            MAX = A*A
            continue
else:
    print("error")

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
MAX = A
for i in range(1,A+1):
    outlet =  i*A + (MAX -i)
    if (B <= outlet):
        print(i+1)
        break
    elif (outlet == A*A):
        MAX = A*A
        continue

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

a = int(input())
b = int(input())

x = (b)/(a-1)

print(math.ceil(x))

Submission status: Runtime Error

Solution code:
a = int(input())

b = int(input())

ans = int(0)

for i in range(1,21):
    if b > a*i-i+1:
            ans += 1
    else:
            ans += 1
            break

print(ans)

Submission status: Runtime Error

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

if A<2 or A>20 or B<1 or B>20:
	sys.exit()

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
ans=(A+B-1)//A
print(ans)

Submission status: Runtime Error

Solution code:
import math

a = int(input())
b = int(input())

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

print(math.ceil(x))

Submission status: Runtime Error

Solution code:
a = int(input())

b = int(input())

ans = int(0)

for i in range(21):
    if b > a*i-i+1:
            ans += 1
    else:
            break

print(ans)

Submission status: Runtime Error

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

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

    for i in range(21):
        a = i * A - i * 1
        if a >= B and ans != 0:
            ans = a
    
    print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = int(input())

b = int(input())

ans = int(0)

for i in range(21):
    if b > a*i-i:
            ans += 1
    else:
            break

print(ans)

Submission status: Runtime Error

Solution code:
a,b = [int(x) for x in input().split()]                                                                  
                                                                                                         
if(b == 1) :                                                                                             
    print("0")                                                                                           
elif a == b:                                                                                             
    print("2")                                                                                           
    exit()                                                                                               
else:                                                                                                    
    ans = 1                                                                                              
    hole = a                                                                                             
    while hole < b:                                                                                      
        hole = hole + a - 1                                                                              
        ans += 1                                                                                         
print(ans)

Submission status: Runtime Error

Solution code:
import math
a,  b = map(int, input().split())
count = 0
r= b/(a-1)
q = b%(a-1)
s = math.floor(r)
if a >= b:
    count = 1
elif b - (s * (a-1)) <=1:
    count = s
    
elif b - (s * (a-1)) >1:
    count = s+1
elif q = 0:
    count = s
print(count)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
num = 1
s = 0
if a >= b:
  num == 1
  print(num)
else:
  while s > b:
  s = a*num
  num = num +1
print(num)

Submission status: Runtime Error

Solution code:
a,b = [int(x) for x in input().split()]                                                                  
                                                                                                         
if(b == 1) :                                                                                             
    print("0")                                                                                           
else:                                                                                                    
    ans = 1                                                                                              
    hole = a                                                                                             
    while hole < b:                                                                                      
        hole = hole + a - 1                                                                              
        ans += 1                                                                                         
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
def is_integer(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

a,b = map(int, raw_input().split())
sub = b - a

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
if a>= b:
  ans=1
else:
  c = b-a
  d=c//a+1
  ans=d+1
print(ans)

Submission status: Runtime Error

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


gap = B - A


if gap == 1:
  print(1)
elif gap > 1:
  print(int(mathy.ceil(B / A)))
else:
  print(0)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

x = b//(a-1)

print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
x=((B-1)//A+1)
all=A*x
use=x
notuse=all-use
if notuse<B:
    add=(B-notuse-1)//A+1
print(x+add)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
count = 1

while A < B:
    A += A
    count += 1
    if A > B:
        break

print(count)

Submission status: Runtime Error

Solution code:
t=int(input())
d=int(input())
c=d//t
f=c/t
if f!=c:
  c+=1
print(c)

Submission status: Runtime Error

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

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
B = input()
count = 1


while A < B:
    A += A
    count += 1
    if A > B:
        break

print(count)

Submission status: Runtime Error

Solution code:
in_data = input()
 
data = in_data.split(' ')
A = int(data[0])
B = int(data[1])
if B == 1:
  print("0")
else
  c = (B - 1) // A + 1
  print(c)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
def is_integer(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

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

if a >= b:
	print 1
else:
	sub = b - a
if sub < a-1:
	print 2
else:
	div = sub/float(a-1)
  	print 1 + int(div)

Submission status: Runtime Error

Solution code:
line = input().split(" ")
 
n = 0
 
while n >= 0:
	if n*(int(line[0])-1) >= int(line[1])-int(line[0]):
		break
	else:
		n += 1
 
input(str(n+1))

Submission status: Runtime Error

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

space = 0
ans = 0

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

print(ans)

Submission status: Runtime Error

Solution code:
a = [input().split() for l in range(1)]
tap = a[0]
need = a[1]
count = 1
needed_tap = 0
while count < need:
  count = count + (tap - 1)
  needed_tap = needed_tap +1

print(str(needed_tap))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
A, B = map(int, input().split())
tmp = A
ans = 1
if B == 1:
    print(0)
    sys.exit()

while True:
    if A < B:
        A += tmp - 1
        ans += 1
    else:
        break

print(ans)w

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())  
res = 1
while 1:
  if a *res - (res -1 ) =< b:
    res = res + 1
    #print(a,"個口を",res,"つ使うと未使用は、",a *res - (res -1 ))
  else:
    break
print(res)

Submission status: Runtime Error

Solution code:
in_data = input()
def test_fun(in_data):
    data = in_data.split(' ')
    A = int(data[0])
    B = int(data[1])
    c = (B - 1) // A + 1
 
    print(c)
  
test_func(in_data)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input().split()
cnt = 1
num = int(S[0])

if int(S[1]) == 1:
  print("0")
else:
	while(num < int(S[1])):
    	num += int(S[0]) - 1
    	cnt += 1
    
	print(cnt)

Submission status: Runtime Error

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

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

print(Count)4

Submission status: Runtime Error

Solution code:
ab = input().split(" ")

n = 0

while n >= 0:
	if n*(ab[0]-1) >= ab[1]-ab[0]:
		break
	else:
		n += 1

input(n+1)

Submission status: Runtime Error

Solution code:
# 2019 9.1
# A Tenki

S = list(input())
T = list(input())

cnt = 0

for i in range(3):
    if S[i] == T[i]:
        cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
y=0

if(A>=B):
   y=1
elif(A<B):
   y=(int(B/A))+1

print(y)

Submission status: Runtime Error

Solution code:
in_data = input()
data = in_data.split(' ')
A = data[0]
B = data[1]
c = (B - 1) // (A - 1)
 
print(c)

Submission status: Runtime Error

Solution code:
A = input()
B = input()
count = 1

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


print(count)

Submission status: Runtime Error

Solution code:
N = input().split(" ")
if N[0] == N[1]:
  print(1)
print(int(N[1]/N[0]+1))

Submission status: Runtime Error

Solution code:
in_data = input()
data = in_data.splite(' ')
A = data[0]
B = data[1]
c = (B - 1) // (A - 1)
 
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import os
f = open('input.txt', 'r')
sys.stdin = f

tap,out = map(int,input().split())

count = 1

while(1):
    if(out>tap):
        out = out - (tap-1)
        count += 1
    else:
        break
print(count)

Submission status: Runtime Error

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

c=a[1]%a[0]
d=b[1]//a[0]
d=d-1
if c!=0:
    d+=1

print(d)

Submission status: Runtime Error

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

ans=1
c=a[:]
if a[1]==1:
    print(0)
    exit()
while c[0]<a[1]:
    c-=1
    c+=a[0]
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
input = input()
data = input.splite(' ')
A = data[0]
B = data[1]
c = (B - 1) // (A - 1)
 
print(c)

Submission status: Runtime Error

Solution code:
N = input().split("")
for i in range(1:10):
  if N[0] == N[1]:
    print(1)
  elif N[0]*i >= N[1]:
    print(i)

Submission status: Runtime Error

Solution code:
import math

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


def h(i):
    c = 0
    for i in range(i):
        c += a
        if(c >= b): return i



ans = h(a)

print(ans+1)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=b%a
d=b//a
d=d-1
if c!=0:
    d+=1

print(d)

Submission status: Runtime Error

Solution code:
B = int(s[1])
 
sum = A
cnt = 1
flg = True
 
while flg:
  if B ==0 or B == 1:
    cnt = 0
    break
  if sum >= B:
    break
  sum += A -1
  cnt += 1
 
print(cnt)

Submission status: Runtime Error

Solution code:
import math

def h(i):
    c = 0
    for i in range(i):
        c += a
        if(c >= b): return i

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

ans = h(a)

print(ans+1)

Submission status: Runtime Error

Solution code:
import math


def h(i):
    c = 0
    for i in range(i):
        c += a
        if(c >= b): return i

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

ans = h(a)

print(ans+1)

Submission status: Runtime Error

Solution code:
x=int(input())
y=int(input())
print(int(y/x) if (y%x)==0 else int(y/x)+1)

Submission status: Runtime Error

Solution code:
in = input()
data = in.splite(' ')
A = data[0]
B = data[1]
c = (B - 1) // (A - 1)

print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=b%a
d=b//a
if c!=0:
    d+=1

print(d)

Submission status: Runtime Error

Solution code:
import math

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

if b!=1:
  num = math.ceil(((b-1)/(a-1))
else:
  num = b

print(num)

Submission status: Runtime Error

Solution code:
from sys import stdin
#a,b = [int(x) for x in stdin.readline().rstrip().split()]
"""
a,b = map(int,input().split())
s = input()
s = s.split(" ")
a = int(s[0])
b = int(s[1])
"""
s = list(map(int,input().split()))
a = int(s[0])
b = int(s[1])

count = 0
while b > 0:
  count += 1
  b -= (count*(a-1)+1):
    
print(count)

Submission status: Runtime Error

Solution code:
s=int(input())
t=int(input())
kuti=0
kosuu=0

while kuti<=t:
    kuti=kuti+s-1
    kosuu=kosuu+1

print(kosuu-1)

Submission status: Runtime Error

Solution code:
x,y = int(input().split())
i =1
while x*i<y:
  i+=1;
print(i)

Submission status: Runtime Error

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

ans = 1
if b == 0:
    print(0)
elif b <= a:
    print(1)
else :
    print((b-a)//(a-1) + 2)

Submission status: Runtime Error

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

   print(d)

Submission status: Runtime Error

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

if c >b:
  print(c//b)
else b >= c:
  print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = list(map(int, imput().split()))
ans = 0
if b == 1:
  print(ans)
else:
  while a < b:
    ans += 1
    a += a
  print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
a,b = [int(x) for x in stdin.readline().rstrip().split()]
"""
a,b = map(int,input().split())
s = input()
s = s.split(" ")
a = int(s[0])
b = int(s[1])
"""

count = 0
while b > 0:
  count += 1
  b -= (count*(a-1)+1):
    
print(count)

Submission status: Runtime Error

Solution code:
x,y = int(input().split())
i =1
while x*i<y:
  i++;
print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = list(map(int, imput().split()))
ans = 0
if b == 1:
  print(ans)
else:
  while True:
    ans += 1
    a += a
    if a >= b:
      print(ans)
      break:

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000000000)

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

i=1
while True:
    if (a*i -i + 1) >=b:
        print(i)
        exit()
    i+=1

Submission status: Runtime Error

Solution code:
from sys import stdin


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

    while True:
        if ans >= B:
            break

        sum_ += 1

        ans = ans - 1 + A

    print(sum_)


if __name__ == "__main__":
    main()
from sys import stdin


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

    while True:
        if ans >= B:
            break

        sum_ += 1

        ans = ans - 1 + A

    print(sum_)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

count = 0
while b > 0:
  count += 1
  b -= (count*(a-1)+1):
    
print(count)

Submission status: Runtime Error

Solution code:
import sys

A = list(map(int, input().split()))
a, b = A[0], A[1]
kazu = 0
kuti = 1
while True:
    if kuti >= b:
        print(kazu)
        sys.quit()
    kazu += 1
    kuti = kuti - 1 + a

Submission status: Runtime Error

Solution code:
S = input()
List = [input() for i in range(1)]
T = List[0]

Slst = list(S)
Tlst = list(T)
M = 0

for x in range(3):
    if Slst[x] == Tlst[x]:
        M += 1
print(M)

Submission status: Runtime Error

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

count = 0
while b > 0:
  count += 1
  b -= (count*(a-1)+1):
    
print(count)

Submission status: Runtime Error

Solution code:
a, b = list(map(int, imput().split()))
ans = 0
count = 1
if b == 1:
  print(ans)
else:
  while True:
    ans += 1
    count += a
    if count >= b:
      print(ans)
      break:

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0
while b > 0:
  count += 1
  b -= (count*(a-1)+1):
    
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

for i in range(1, 20):
  c = (A-1)*(i-1) + A
  if C >= B:
    break
    
print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a,b = MAP()
ans=1
while a<b:
    a += a-1
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
#include<iostream>
using namespace std;

int main() {
  int a, b;
  cin >> a >> b;

  int current = 1;
  int ans = 0;
  while (current < b) {
    current += a;
    current -= 1;
    ans += 1;
  }
  cout << ans << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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 += A
			flg = True
		else:
			to = (tp-1) + A
		if to >= B:
			break

	print(ans)

if __name__ == "__main__":
	main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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

    num = 1
    tap = 0

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

    while True:
        tap += 1
        num -= 1
        num += A

        if num >=B:
            break

    print(tap)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
k, l = 0, 0

while l < B:
  k += 1
  if k == 0:
    l += A
  else:
    l += A - 1
  
print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

num = 1

taps = 0

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

print(taps)

Submission status: Runtime Error

Solution code:
S=input()
T=input()
a=0
for i in range(3):
    if S[i]==T[i]:
        a+=1
print(a)

Submission status: Runtime Error

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！
 
def main():
    s=input()
    t=input()
    ans=0
    for i in range(3):
        if s[i]==t[i]:
            ans+=1
    print(ans)
    
    
    
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a = input()
b = input()
ans = sum(a[i] == b[i] for i in range(3))
print(ans)