Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):

local t = {"a", "b", "c", "d", "e","f", "g", "h", "i","j", "k", "l", "m", "n","o", "p", "q", "r","s", "t ", "u", "v", "w","x", "y", "z"}
local N = io.read()
local N = 123456789
local x = string.byte("a") - 1
local aa = ""
local function a(N)
    local n = math.floor(N / 26)
    local m = N % 26
    if n > 26 then
       a(n)
    else
        if m ~= 0 then
            aa = aa..t[n]
        end
    end
    if m == 0 then
        aa = aa..t[26]
    else
        aa = aa..t[m]
    end
end
a(N)
print(aa)

Fixed submission:
a = int(input())
s = []
ret = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
       'w', 'x', 'y', 'z',
       ]
while a > 0:
    a -= 1  # 为甚么减去1？
    shang = int(a / 26)
    yushu = int(a % 26)
    # print(shang, yushu)
    s.append(yushu)  # 上面减去的1，加在了这里，由此可以得到1-26，位置信息
    a = shang

s.reverse()
# print(s)
v = ''
for i in range(len(s)):
    v += ret[s[i]]
print(v)
Buggy python submission (verdict: Time Limit Exceeded):
N = raw_input()
ns = raw_input()
ns = ns.split(' ')

data = {}
for i in ns:
    i = int(i)
    if i in data:
        data[i] += 1
    else:
        data[i] = 1

Q = raw_input()
opr = []
for _ in range(int(Q)):
    tmp = raw_input()
    tmp = tmp.split(' ')
    opr.append([int(tmp[0]), int(tmp[1])])

ans = 0
for k, v in data.iteritems():
    ans += k * v
for op in opr:
    if op[0] not in data:
        print ans
        continue
    ans = 0
    old = data[op[0]]
    del data[op[0]]
    old2 = 0
    if op[1] in data:
        old2 = data[op[1]]
    data[op[1]] = old + old2
    for k, v in data.iteritems():
        ans += k * v
    print ans


Fixed submission:

a = int(input())
s = list(map(int, input().split()))
q = int(input())

val = {}

suss = 0
for i in s:
    if i not in val:
        val[i] = 1
    else:
        val[i] += 1

for k, v in val.items():
    suss += k *v

while q:
    c, d = map(int, input().split())
    # print(c, d)
    if c in val:
        if d in val:
            val[d] += val[c]
        else:
            val[d] = val[c]
        suss -= c * val[c]
        suss += d * val[c]
        del val[c]
    # print(val)


    print(suss)

    q -= 1

Buggy python submission (verdict: Time Limit Exceeded):

a = int(input())
s = list(map(int, input().split()))
q = int(input())


while q:
    c, d = map(int, input().split())
    # print(c, d)
    for i in range(len(s)):
        if s[i] == c:
            s[i] = d
    # print(s)
    print(sum(s))

    q -= 1


Fixed submission:

a = int(input())
s = list(map(int, input().split()))
q = int(input())

val = {}

suss = 0
for i in s:
    if i not in val:
        val[i] = 1
    else:
        val[i] += 1

for k, v in val.items():
    suss += k *v

while q:
    c, d = map(int, input().split())
    # print(c, d)
    if c in val:
        if d in val:
            val[d] += val[c]
        else:
            val[d] = val[c]
        suss -= c * val[c]
        suss += d * val[c]
        del val[c]
    # print(val)


    print(suss)

    q -= 1
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = input("")
a = [int(n) for n in arr.split()]
ans = 1
for i in range(n):
    ans = ans * int(a[i])
if ans > int(1e18):
    print("-1")
else:
    print(ans)


Fixed submission:
n = int(input())
a = list( map (int , input().split() ) )
a.sort()
ans = 1
for i in range(n):
    ans*=a[i]
    if ans>10**18:
      print(-1)
      exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split(' '))
result = int(A*B)
print(result)

Fixed submission:
A, B = map(str, input().split()) # take the input in one line
A = int(A) # convert A into integer
C = B[0]+B[2]+B[3]
C = int(C)
print(A*C//100) # printing the output

# time complixity O(1)

Buggy python submission (verdict: Runtime Error):
m = eval(input(""))
n = eval(input(""))
num = m*n
num = int(num)
print(num)

Fixed submission:
A, B = map(str, input().split()) # take the input in one line
A = int(A) # convert A into integer
C = B[0]+B[2]+B[3]
C = int(C)
print(A*C//100) # printing the output

# time complixity O(1)

Buggy python submission (verdict: Runtime Error):
import math

num1= str(input()) #take input as a string
num2= str(input())

num1=str(num1)
num2=str(num2)

result= int(num1)*float(num2) #calculate the multiplication of inputs as integer and float
result= math.floor(result) #rounding down the output using floor function

print(result)

Fixed submission:
A, B = map(str, input().split()) # take the input in one line
A = int(A) # convert A into integer
C = B[0]+B[2]+B[3]
C = int(C)
print(A*C//100) # printing the output

# time complixity O(1)

Buggy python submission (verdict: Runtime Error):

A = float(input("Enter A: "))
B= float(input("Enter B: "))

print(int(A*B))

Fixed submission:
A, B = map(str, input().split()) # take the input in one line
A = int(A) # convert A into integer
C = B[0]+B[2]+B[3]
C = int(C)
print(A*C//100) # printing the output

# time complixity O(1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
n = n % 10
if n == 2 or n == 4 or n == 5 or n == 7 or n == 9:
    print("hon")
elif n == 0 or n == 1 or n == 6 or n == 8:
    print("pon")
else
    print("bon")


Fixed submission:
n = int(input())
n = n % 10
if n == 2 or n == 4 or n == 5 or n == 7 or n == 9:
    print("hon")
elif n == 0 or n == 1 or n == 6 or n == 8:
    print("pon")
else:
    print("bon")
Buggy python submission (verdict: Time Limit Exceeded):
cards=input()
list=cards.split()
a=int(list[0])
b=int(list[1])
c=int(list[2])
k=int(list[3])
i,j,l=(0,0,0)
min=c*(-1)
while i<=a:
    while j<=b:
        while l<=c:
            if i+j+l==k:
              new=i*1+j*0+l*(-1)
              if new>min:
                  min=new
            l=l+1
        l=0
        j=j+1
    i=i+1
    l=0
    j=0
print(min)


Fixed submission:
cards=input()
new=cards.split()
a=int(new[0])
b=int(new[1])
c=int(new[2])
k=int(new[3])
if a>k:
    print(k)
else:
    if a+b>k:
        print(a)
    else:
        sum=a+(k-(a+b))*(-1)
        print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
import math


def eq_value(a, b, x):
    return math.floor(a * x / b) - a * math.floor(x / b)


A, B, n = map(int, input().split())
start, end = 0, n

maximum = 0
for i in range(n + 1):
    value = eq_value(A, B, i)
    if value > maximum:
        maximum = value

print(maximum)


Fixed submission:
from sys import stdout, stdin
from queue import Queue
from collections import defaultdict
import math
a,b,n = map(int, stdin.readline().strip().split())
x = min(b - 1, n)
ans = math.floor(a * x / b) - a * math.floor(x / b)
stdout.writelines(str(ans) + '\n')
Buggy python submission (verdict: Runtime Error):
for i in range(2):
    S, W = [int(x) for x in input().split()]
if W >= S:
    print('unsafe')
else:
    print('safe')

Fixed submission:
a,b=map(int,input().split(' '))
if(a>b):
    print('safe')
else:
    print('unsafe')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list1=list(map(int, input().split()))
list2=[0]*n
for i in list1:
      list2[i-1]=list1.count(i)
for j in list2:
      print(j,"\n")

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
c=[]
for q in range(a):
    c.append(0)
x=int(1)
for x in b:
    c[x-1]=c[x-1]+1
for t in range(a):
    print(c[t])
Buggy python submission (verdict: Runtime Error):
import math


def f(xxx):
    return math.factorial(xxx)


arr = list(map(int, input().split()))
n = arr[0]
m = arr[1]
cnt = 0
cnt += int(f(n) / (2 * f(n - 2)))
if m > 1:
    cnt += int(f(m) / (2 * f(m - 2)))
print(int(cnt))

Fixed submission:
inp=input().split()
n=int(inp[0])
m=int(inp[1])
arr=[]
pares=0
impares=0
count=1
nums=0

def binary(arr, menor, mayor, x): 
    if mayor >= menor: 
        med = (mayor + menor) // 2
        if arr[med] == x: 
            return med 

        elif arr[med] > x: 
            return binary(arr, menor, med - 1, x) 
  
        else: 
            return binary(arr, med + 1, mayor, x) 
    else: 
        return -1

while len(arr)<(m+n):
    if count%2==0 and pares<n:
        arr.append(count)
        pares+=1
    elif count%2!=0 and impares<m:
        arr.append(count)
        impares+=1
    count+=1
sums=[]


for x in arr:
   for y in arr:
        if(x+y)%2==0 and binary(sums, 0, len(sums)-1, [y,x])==-1 and x!=y:
            sums.append([x,y])
            nums+=1
print(nums)
Buggy python submission (verdict: Runtime Error):
def shortie (L):
 R= L/3
 return (R**3)

L=int(input())
Shortie (L)

Fixed submission:
#maximum volume problem
J = int(input()) #to take input from the user, input function is used
K = J /3   
M= K
print(M ** 3) #to print the solution of the problem
Buggy python submission (verdict: Runtime Error):
h=int(input())
w=int(input())

s=ceil(h/2.0)*ceil(w/2.0)+floor(h/2.0)*floor(w/2.0)

print(s)

Fixed submission:
import math
a,b = list(map(int, input().split()))
if(a== 1 or b==1):
    print(1)
else:
    print(math.ceil((a*b)/2))

Buggy python submission (verdict: Runtime Error):
from itertools import chain, permutations, dropwhile
from heapq import merge
from functools import wraps

def listify(fn):
  @wraps(fn)
  def wraper(*args, **kwargs):
    return list(fn(*args, **kwargs))
  return wraper

def comp_wild(a,b):
  return all(x==y or "?" in (x,y) for x,y in zip(a, b))

@listify
def includers(a,b):
  for i in range(len(a)-len(b)+1):
    if comp_wild(a[i:], b):
      yield i

@listify
def connectors(a,b):
  la = len(a)
  for i in range(max(la-len(b)+1, 1), la):
    if comp_wild(a[i-la:], b):
      yield i
  yield la

class c_int(int):
  def __new__(cls, *args, **kwargs):
    cond = kwargs.pop("cond", lambda:True)
    i = int.__new__(cls, *args, **kwargs)
    i.cond = cond
    return i

def iter_from(it, fm):
  return dropwhile(fm.__gt__, it)

def solve(a, b, c):
  keys = sorted((a,b,c), key=len, reverse=True)
  len_keys = list(map(len, keys))
  inc = { (i,j):includers(keys[i],keys[j]) for i,j in permutations(range(3), 2) }
  con = { (i,j):connectors(keys[i],keys[j]) for i,j in permutations(range(3), 2) }
  
  for i in inc[0,1]:
    for j in inc[0,2]:
      if (
        j+len_keys[2] <= i or i+len_keys[2] <= j or
        j-i in inc[1,2] or j-i in con[1,2] or i-j in con[2,1]
      ):
        return len_keys[0]
  
  def candicates(x,y,z):
    return chain(
      ( c_int(
          i+len_keys[z], 
          cond=lambda:(
            (inc[x,y] and inc[x,y][0]+len_keys[y] <= i) or 
            (inc[z,y] and len_keys[x] <= i+inc[z,y][-1]) or 
            any(
              (i-j in con[y,z] if i>j else j-i in inc[z,y])
               for j in iter_from(inc[x,y]+con[x,y], i-len_keys[y])
            )
          )
        ) for i in iter_from(con[x,z], len_keys[y]-len_keys[z]+1)
      ),
      ( c_int(
          min( i+next(iter_from(q, len_keys[x]-i+1))+len_keys[z] for i in p )
        ) for (p, q) in [sorted((con[x,y], con[y,z]), key=len)]
      ),
    )
  
  for c in merge(*( candicates(*xyz) for xyz in permutations(range(3), 3) )):
    if c.cond():
      return c
  
  return sum(len_keys)

print(solve(*(input() for _ in range(3))))


Fixed submission:
import math
a,b = list(map(int, input().split()))
if(a== 1 or b==1):
    print(1)
else:
    print(math.ceil((a*b)/2))
Buggy python submission (verdict: Runtime Error):
S = input()
list_num = S.split(' ')
list_num = map(int, list_num)
N, A, B = list_num[0], list_num[1], list_num[2]

if A+B>N:
  print(N-A-B)
elif A+B=N:
  print(A)

Fixed submission:
N,A,B= input().split()
if int(N)%(int(A)+int(B))>=int(A):
    ans=int(N)//(int(A)+int(B))*int(A)+int(A)
    print(ans)
else:
    ans=int(N)//(int(A)+int(B))*int(A)+int(N)%(int(A)+int(B))
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def divisible():
    n, p = map(int, input().strip().split())
    s = input()
    s = [int(s[i:j+1]) for i in range(n) for j in range(i, n)]
    count = 0
    for i in range(len(s)):
        if s[i] % p == 0:
            count += 1
    print(count)
divisible()

Fixed submission:
def sol(s, p):
	n = len(s)
	cnt = 0
	if p == 2 or p == 5:
		for i in range(n):
			if (s[i] % p == 0):
				cnt += i + 1
	else:
		pre = [0] * (n+2)
		pre[n+1] = 0
		b = 1
		for i in range(n, 0, -1):
			pre[i] = (pre[i+1] + s[i-1] * b) % p
			b = (b * 10) % p
		rec = [0] * p
		rec[0] = 1
		for i in range(n, 0, -1):
			cnt += rec[pre[i]]
			rec[pre[i]] += 1
	return cnt

if __name__ == "__main__":
	n, p = map(int, input().split())
	s = input()
	print (sol([int(i) for i in s], p))
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

if A==B and B==C:
    print("No")
elif A != B and B != C:
    print("No")
else:
    print("Yes")

Fixed submission:
def main():
    a, b, c = map(int, input().split())
    if (a == b and a != c) or (a == c and b != c) or (b == c and a != b):
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list([ input() for i in range(n)])

s = list(set(l) ) 
s.sort( key = lambda x : l.count(x), reverse=True)

m =l.count(s[0])
f = list( filter ( lambda x: l.count(x ) == m  , s ))
f.sort()
print(*f, sep = '\n')


Fixed submission:

n = int (input ())
s = []
ha = {}
for i in range (n) :
    s.append (input ())
    if (s[i] not in ha.keys()) :
        ha[s[i]] = 1
    else :
        ha[s[i]] += 1

ans = sorted (ha.items(), key=lambda x : x[1], reverse=True)

k = ans[0][1]
i = 0
while (i < len (ans) and ans[i][1] == k) :
    i += 1

ans = ans[ : i]
ans.sort()
for ss in ans :
    print (ss[0])
Buggy python submission (verdict: Runtime Error):
import math


def get_inputs():
    inputs = input().split(" ")
    monsters_num, diff, attack = int(inputs[0]), int(inputs[1]), int(inputs[2])
    monsters = []
    for monster in range(monsters_num):
        inputs = input().split(" ")
        coordinate, health = int(inputs[0]), int(inputs[1])
        monsters.append({"coordinate": coordinate, "health": health})
    return monsters, diff, attack, monsters_num


def between_coordinates(monster, coordinate, diff):
    if (coordinate - diff <= monster["coordinate"] <= coordinate) or (
            coordinate <= monster["coordinate"] <= coordinate + diff):
        return True
    return False


def sort_monsters_coordinates(monsters):
    return sorted(monsters, key=lambda k: k['coordinate'])


def get_alive_monsters(monsters):
    return [monster for monster in monsters if monster["health"] > 0]


def attack_leftmost_monster(coordinate, monsters, attack, diff):
    bombs_num = 0
    if len(monsters) == 0:
        return 0
    leftmost_monster = monsters.pop(0)
    needed_attacks = math.ceil(leftmost_monster["health"] / attack)
    bombs_num += needed_attacks
    for monster in monsters:
        if between_coordinates(monster, coordinate, diff):
            monster["health"] -= (needed_attacks * attack)
    monsters = get_alive_monsters(monsters)
    return monsters, bombs_num


def get_max_health(monsters):
    if len(monsters) == 0:
        return 0

    max_health = - math.inf
    for monster in monsters:
        if monster["health"] >= max_health:
            max_health = monster["health"]
    return max_health


monsters, diff, attack, monsters_num = get_inputs()
if len(monsters) > 0:
    monsters = sort_monsters_coordinates(monsters)
else:
    print(0)

coordinate = monsters[0]["coordinate"] + diff
total_bombs_num = 0

while len(monsters) > 0 and coordinate <= monsters[-1]["coordinate"] - diff:
    monsters, bombs_num = attack_leftmost_monster(coordinate, monsters, attack, diff)
    total_bombs_num += bombs_num
    if len(monsters) > 0:
        coordinate = monsters[0]["coordinate"] + diff
        
print(total_bombs_num + math.ceil(get_max_health(monsters) / attack))

Fixed submission:
from sys import stdin
import math

def main():
    H,A = map(int,stdin.readline().split())
    res = H/A
    print(math.ceil(res))
main()
Buggy python submission (verdict: Runtime Error):
N=int(input("Enter test cases:"))
M=int(input("Enter M:"))
if(N==M):
    print("Yes")
else:
    print("No")

Fixed submission:
from sys import stdin
n,m = map(int,stdin.readline().split())
print("Yes" if n==m else "No")

Buggy python submission (verdict: Runtime Error):
N= int(input("N:"))
M= int(input("M:"))

if (N==M):
    print("Yes")
else:
    print("No")


Fixed submission:
from sys import stdin
n,m = map(int,stdin.readline().split())
print("Yes" if n==m else "No")

Buggy python submission (verdict: Runtime Error):
from sys import stdin
n,m = map(int,stdin.readline().split()
print("Yes" if n==m else "No")

Fixed submission:
from sys import stdin
n,m = map(int,stdin.readline().split())
print("Yes" if n==m else "No")
Buggy python submission (verdict: Runtime Error):
for k in range (10):
    n = list(map(int,input().split()))
    a,b = n
    fb = 0
    fa = 0
    for i in range (a):
        tmp = b * (10 ** i)
        fb += tmp

    for i in range (b):
        tmp = a * (10 ** i)
        fa += tmp
    if fa > fb:
        print (fb)
    else:
        print (fa)

Fixed submission:
from sys import stdin

def main():
    N,M  = map(int,stdin.readline().split())
    if(N < M):
        res = str(N)
        print(res*M)
    else:
        res = str(M)
        print(res*N)
        
main()
Buggy python submission (verdict: Runtime Error):
 y= list(map(str,input().rstrip().split()))
print(y[1]+y[0])

Fixed submission:
x = list(map(str,input().rstrip().split()))
print(x[1]+x[0])
Buggy python submission (verdict: Runtime Error):
s=input()
cnt=0
for i in range(s.len()):
if(s[i]!=s[-1-i]):
cnt=cnt+1


print(cnt)

Fixed submission:
given = input()
a = len(given) // 2
count = 0
for i in range(1, a + 1):
    last = given[-i]
    first = given[i - 1]
    if last != first:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
 
 
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    
    ans = 0
    ruiseki = [0]
    d = defaultdict(int)
    d[0]=1
    for i in range(n):
        if i - k + 1>= 0:
            d[ruiseki[i - k+1]]-=1
        ruiseki.append((ruiseki[i] + a[i] - 1)%k)
        ans += d[ruiseki[i+1]]
        d[ruiseki[i + 1]] += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Fixed submission:
from collections import defaultdict 
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    
    ans = 0
    ruiseki = [0]
    d = defaultdict(int)
    d[0]=1
    for i in range(n):
        if i - k + 1>= 0:
            d[ruiseki[i - k+1]]-=1
        ruiseki.append((ruiseki[i] + a[i] - 1)%k)
        ans += d[ruiseki[i+1]]
        d[ruiseki[i + 1]] += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
if n%2==0:
  s1=s[:n/2]
  s2=s[n/2:]
  if s1==s2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Fixed submission:
N=int(input())
S=input()
if (N%2!=0):
    print('No')
else:
    a1=S[:int(N/2)]
    a2=S[int(N/2):]
    if (a1==a2):
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
if (N%2!=0):
    print('No')
else:
    a1=S[:N/2]
    a2=S[N/2:]
    if (a1==a2):
        print('Yes')
    else:
        print('No')

Fixed submission:
N=int(input())
S=input()
if (N%2!=0):
    print('No')
else:
    a1=S[:int(N/2)]
    a2=S[int(N/2):]
    if (a1==a2):
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
while True:
    try:
        a = int(input())
        b = int(input())
    except EOFError:
        break
    if a <= 9 and b <= 9:
        print(a * b)
    else:
        print(-1)

Fixed submission:
inp = input().split()

A = int(inp[0])
B = int(inp[1])

C=A*B
if A <= 9 and B <= 9:
	print(C)
else:
	print(-1)

Buggy python submission (verdict: Runtime Error):
a=variable
b=variable_2
a=9
b=9
if a*b=81 then;
	print("81")
else;
	print(-1)

Fixed submission:
inp = input().split()

A = int(inp[0])
B = int(inp[1])

C=A*B
if A <= 9 and B <= 9:
	print(C)
else:
	print(-1)
Buggy python submission (verdict: Runtime Error):
s=int(input)
def c(x):
  co=0
  for i in range(1,9):
    if x%i==0 and x//i<=9:
      co+=1
  if co>0:
    return("Yes")
  else:
    return("No")
print(c(s))

Fixed submission:
N = int(input())
mylist = []
for i in range(1,10):
    for j in range(1,10):
        mylist.append(i*j)
if mylist.count(N):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
arr = list(map(int, input().split()))

ans = arr[0]+arr[N-1]
for i in range(1,N-1,1):
   ans += min(arr[i],arr[i-1])
   
print(ans)


Fixed submission:
n = int(input()) #waiting_for_pudging
b = list(map(int, input().split())) #waiting_for_pudging
summ = b[0] #waiting_for_pudging

for i in range(1, len(b)): #pudging
    summ += min(b[i-1], b[i]) #pudging
print(summ + b[-1]) #pugding
#accepted
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
socket = 0
count = 0
if B==1 :
    count=0
elif i != 0 :
    while socket < B :
        if socket + A < B :
            socket = socket + A - 1
            count += 1
        elif socket+A >= B :
            socket = socket + A
            count += 1
print(count)


Fixed submission:
a,b=map(int,input().split())
now=a
i=1
if b>1:
    while now<b:
        now+=a-1
        i+=1
    print(i)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
a= int(input())
b=int(input())
print(int((b-1)/(a-1)+0.99999))


Fixed submission:
a,b=map(int,input().split())
now=a
i=1
if b>1:
    while now<b:
        now+=a-1
        i+=1
    print(i)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
from math import ciel
a,b=[int(x) for x in input().split()]
if b==1:
    print(0)
else :
    print(ciel((b-1)/(a-1)))

Fixed submission:
a,b=map(int,input().split())
now=a
i=1
if b>1:
    while now<b:
        now+=a-1
        i+=1
    print(i)
else:
    print(0)