Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def solve():
    a, b, c, d = map(int, input().split())
    
    x = c / b
    y = a / d


    if c % b == 0 and x - y <= 1:
        return 'Yes'
        

    return 'Yes' if x < y else 'No'

print(solve())

Fixed submission:
def solve():
    N, M = map(int, input().split())

    return 'safe' if N > M else 'unsafe'

print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    N, M = map(int, input().split())
    
    if M == 1:
        return 0
    
    n = N
    c = 0
    while True:
        n = n-M
        c = (abs(n) - M)
        
        if c <= 0:
            break

    return min(abs(n), abs(c))

print(solve())

Fixed submission:
def solve():
    N, M = map(int, input().split())
    
    if N % M == 0:
        return 0
    
    a = N % M

    return min(a, abs(a-M))

print(solve())

Buggy python submission (verdict: Runtime Error):
def solve():
    N, M = map(int, input().split())
    a = abs(N-M)
    
    if a >= N:
        return N
    
    return min(N % a, N % M)

print(solve())

Fixed submission:
def solve():
    N, M = map(int, input().split())
    
    if N % M == 0:
        return 0
    
    a = N % M

    return min(a, abs(a-M))

print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    N, A, B = map(int, input().split())

    if A + B == 0:
        return 0

    s = 'b'*A + 'r'*B
    r = N // (A+B)
    m = N % (A+B)
    
    rest = 0
    if A >= m:
        rest = m
    else:
        rest = A

    ans = A*r + rest
    
    return ans

print(solve())

Fixed submission:
def solve():
    N, A, B = map(int, input().split())

    r = N // (A+B)
    m = N % (A+B)
    
    rest = 0
    if A >= m:
        rest = m
    else:
        rest = A

    ans = A*r + rest

    return ans

print(solve())

Buggy python submission (verdict: Runtime Error):
def solve():
    N, A, B = map(int, input().split())

    s = 'b'*A + 'r'*B
    r = N // (A+B)
    m = N % (A+B)
    
    rest = 0
    if A >= m:
        rest = m
    else:
        rest = A

    ans = A*r + rest
    
    return ans

print(solve())

Fixed submission:
def solve():
    N, A, B = map(int, input().split())

    r = N // (A+B)
    m = N % (A+B)
    
    rest = 0
    if A >= m:
        rest = m
    else:
        rest = A

    ans = A*r + rest

    return ans

print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

def solve():
    S = list(input())
    M = int(input())

    s = deque(S)
    
    for _ in range(M):
        q = list(input().split())
    
        if q[0] == '1':
            s.reverse()
        else:
            ad = q[2]
            if q[1] == '1':
                s.appendleft(ad)
            else:
                s.append(ad)
    ans = ''.join(s)
    return ans

print(solve())

Fixed submission:
from collections import deque

def solve():
    S = list(input())
    M = int(input())
    Q = [list(input().split()) for _ in range(M)]
    
    bef = deque([])
    s = deque(S)
    aft = deque([])
    c = 0
    
    for q in Q:
        if q[0] == '1':
            c += 1
        else:
            ad = q[2]
            if q[1] == '1':
                # 先頭
                if c % 2 == 0:
                    bef.appendleft(ad)
                else:
                    aft.append(ad)
            else:
                # 末尾
                if c % 2 == 0:
                    aft.append(ad)
                else:
                    bef.appendleft(ad)

    ans = ''.join(bef) + ''.join(s) + ''.join(aft)
    if c % 2 == 1:
        ans = ans[::-1]

    return ans

print(solve())

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

def solve():
    S = list(input())
    M = int(input())
    Q = [list(input().split()) for _ in range(M)]
    
    s = deque(S)
    for q in Q:
        if q[0] == '1':
            s.reverse()
        else:
            ad = q[2]
            if q[1] == '1':
                s.appendleft(ad)
            else:
                s.append(ad)
    ans = ''.join(s)
    return ans

print(solve())

Fixed submission:
from collections import deque

def solve():
    S = list(input())
    M = int(input())
    Q = [list(input().split()) for _ in range(M)]
    
    bef = deque([])
    s = deque(S)
    aft = deque([])
    c = 0
    
    for q in Q:
        if q[0] == '1':
            c += 1
        else:
            ad = q[2]
            if q[1] == '1':
                # 先頭
                if c % 2 == 0:
                    bef.appendleft(ad)
                else:
                    aft.append(ad)
            else:
                # 末尾
                if c % 2 == 0:
                    aft.append(ad)
                else:
                    bef.appendleft(ad)

    ans = ''.join(bef) + ''.join(s) + ''.join(aft)
    if c % 2 == 1:
        ans = ans[::-1]

    return ans

print(solve())
Buggy python submission (verdict: Runtime Error):
def ten_to_n(X, n):
    i = int(X / n)
    s = str(X % n)
    if (i):
        return Base_10_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    n = Base_10_to_n(N, M)
    return len(n)
 
print(solve())

Fixed submission:
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

def solve():
    N, M = map(int, input().split())
    n = Base_10_to_n(N, M)
    return len(n)

print(solve())
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [input() for _ in range(N)]
d = defaultdict(int)
for a in A:
    d[a] += 1

li = sorted(d.items())
l = sorted(li, key = itemgetter(0), reverse=True)
max_key = l[0][0]

for k, v in li:
    if k == max_key:
        print(k)
    else:
        continue

Fixed submission:
def solve():
    import itertools
    from operator import itemgetter

    N = int(input())
    B = [input() for _ in range(N)]
    B.sort()

    l = []
    gr = itertools.groupby(B)
    max_key = 0
    for key, group in gr:
        length = len(list(group))
        l.append((length, key))
        if length > max_key:
            max_key = length

    l.sort(key = itemgetter(0), reverse=True)

    key = l[0][0]
    for k, v in l:
        if key == k:
            print(v)
        else:
            break

solve()

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [input() for _ in range(N)]
d = defaultdict(int)
for a in A:
  d[a] += 1

  li = sorted(d.items())
  l = sorted(li, key = itemgetter(0), reverse=True)
  max_key = l[0][0]

  for k, v in li:
    if k == max_key:
      print(k)
      else:
        continue

Fixed submission:
def solve():
    import itertools
    from operator import itemgetter

    N = int(input())
    B = [input() for _ in range(N)]
    B.sort()

    l = []
    gr = itertools.groupby(B)
    max_key = 0
    for key, group in gr:
        length = len(list(group))
        l.append((length, key))
        if length > max_key:
            max_key = length

    l.sort(key = itemgetter(0), reverse=True)

    key = l[0][0]
    for k, v in l:
        if key == k:
            print(v)
        else:
            break

solve()
Buggy python submission (verdict: Runtime Error):
# import math
# import numpy as np

# S = input()
# N = int(input())
H, N = map(int, input().split())
# A = list(map(int, input().split()))
# B = [int(input()) for _ in range(n)]
# A = []
# B = []
# for _ in range(N):
#     a, b = list(map(int, input().split()))
#     A.append(a)
#     B.append(b)

# 二次元配列
# [[inf, inf, inf], [inf, inf, inf]]
# dp = [[float('inf')] * (H + 1) for i in range(N + 1)]

INF = 10 ** 18
dp = [INF] * (H + 1)
dp[0] = 0

def solve():
    for i in range(N):
        a, b = list(map(int, input().split()))

        for j in range(H):
            nj = min(j + a, H)
            dp[nj] = min(dp[nj], dp[j] + b)
    return dp[H]

print(solve())


Fixed submission:
def solve():
    N, M = map(int, input().split())
    return N // M if N % M == 0 else N //M + 1

print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    N = int(input())
    C = []
    for _ in range(N):
        a, b = list(map(int, input().split()))
        C.append((a-b+1, a+b-1))

    C.sort()

    for i in range(len(C)-1):
        if C[i][1] > C[i+1][0]:
            C.pop(0)

    return len(C)

print(solve())

Fixed submission:
from operator import itemgetter

def solve():
    N = int(input())
    C = []
    for _ in range(N):
        a, b = list(map(int, input().split()))
        C.append((a-b, a+b))

    C.sort(key = itemgetter(1))
    
    c = 0
    cur = -float('inf')
    for i in range(N):
        if cur <= C[i][0]:
            c += 1
            cur = C[i][1]

    return c

print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    N, M = map(int, input().split())
    return 'Yes' if None*500 >= M else 'No'

print(solve())

Fixed submission:
def solve():
    N, M = map(int, input().split())
    return 'Yes' if N*500 >= M else 'No'

print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import groupby 

N = int(input())

def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

def solve(N):
    if (N % 2 == 1): return 0
    
    ans = 0
    for i in range(2, N + 2, 2):
        if (i % 5 == 0):
            ans += prime_factors(i).count(5)
    return ans

print(solve(N))


Fixed submission:
from itertools import groupby 

N = int(input())

def solve(N):
    if (N % 2 == 1):
        return 0
    
    d = N // 10
    ans = d
    while d:
        d //= 5
        ans += d
    return ans

print(solve(N))
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10)
    for j in range(1, 10)
		if n == i * j:
			print("Yes")
			break
 
print("No")



Fixed submission:
def solve():
    N, M = map(int, input().split())
    return N*M if max(N, M) < 10 else -1

print(solve())
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10)
  for j in range(1, 10)
    if n == i * j:
      print("Yes")
      break
 
print("No")



Fixed submission:
n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10)
    for j in range(1, 10)
		if n == i * j:
			print("Yes")
			break
 
print("No")



Fixed submission:
n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
 
for i in range(1, 9)
  for j in range(1, 9)
    if n == i * j:
      print("Yes")
      break
 
print("No")


Fixed submission:
n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
 
for i in range(1, 9)
	for j in range(1, 9)
		if n == i * j:
			print("Yes")
			break
 
print("No")

Fixed submission:
n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(1, 9)
	for j in range(1, 9)
    	if n == i * j:
			print("Yes")
			break

print("No")


Fixed submission:
n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(1, 9)
	for j in range(1, 9)
    	if n == i * j:
        	print("Yes")
            break

print("No")


Fixed submission:
n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(1, 9)
	for j in range(1, 9)
    	if n == i * j:
        	print("Yes")
            exit

print("No")

Fixed submission:
n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

if N == 1:
    print(0)
else:
    print(sum([i for i in range(1, N)]))


Fixed submission:
N = int(input())
print(N * (N-1) // 2)
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int(), input()))
print(a+b if b%a == 0 else b-a)

Fixed submission:
a, b = list(map(int, input().split()))
print(a+b if b%a == 0 else b-a)
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    
    INF = 10 ** 9
    dp = [INF] * (N+1)
    dp[0] = 0
    
    for i in range(1, N):
        for j in range(K, 0, -1):
            if i-j < 0: continue
            dp[i] = min(dp[i], dp[i-j] + abs(A[i] - A[i-j]))

    return dp[N-1]

print(solve())

Fixed submission:
def solve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    
    INF = 10 ** 9
    dp = [INF] * (N+1)
    dp[0] = 0
    
    for i in range(1, N):
        for j in range(K, 0, -1):
            if i-j < 0: continue
            dp[i] = min(dp[i], dp[i-j] + abs(A[i] - A[i-j]))

    return dp[N-1]

print(solve())
Buggy python submission (verdict: Runtime Error):
N = int(input())
dp = [0,0,0]
for _ in range(N):
    a, b, c = map(int, input().split())
    ndp = [0,0,0]
    ndp[0] = max(dp[1], dp[2]) + a
    ndp[1] = max(dp[0], dp[2]) + b
    ndp[2] = max(dp[0], dp[1]) + c
    dp = ndp
return max(dp)


Fixed submission:
N = int(input())
dp = [0,0,0]
for _ in range(N):
    a, b, c = map(int, input().split())
    ndp = [0,0,0]
    ndp[0] = max(dp[1], dp[2]) + a
    ndp[1] = max(dp[0], dp[2]) + b
    ndp[2] = max(dp[0], dp[1]) + c
    dp = ndp
print(max(dp))
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for i in range(N)]
    dp = [[0] * (M+1) for i in range(N+1)]
    
    for i in range(N):
        for s in range(M+1):
            a, b = A[i]
            if s-a >= 0:
                dp[i+1][s] = max(dp[i+1][s], dp[i][s-a] + b)
            dp[i+1][s] = max(dp[i+1][s], dp[i][s])
    return dp[N][M]

print(solve())

Fixed submission:
def solve():
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for i in range(N)]
    dp = [[0] * (M+1) for i in range(N+1)]
    
    for i in range(N):
        for s in range(M+1):
            a, b = A[i]
            if s-a >= 0:
                dp[i+1][s] = max(dp[i+1][s], dp[i][s-a] + b)
            dp[i+1][s] = max(dp[i+1][s], dp[i][s])
    return dp[N][M]

print(solve())

Buggy python submission (verdict: Time Limit Exceeded):
# import math
# import numpy as np

# S = input()
# N = int(input())
N, W = map(int, input().split())
# A = list(map(int, input().split()))
# B = [int(input()) for _ in range(n)]
A = []
B = []
for _ in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
# As = np.array(As)
# Bs = np.array(Bs)

# 二次元配列の初期化
# [[inf, inf, inf], [inf, inf, inf]]
dp = [[0] * (W + 1) for i in range(N + 1)]

def solve():
    for i in range(N):
        for w in range(W + 1):
            if w - A[i] >= 0:
                dp[i+1][w] = max(dp[i+1][w], dp[i][w - A[i]] + B[i])

            dp[i+1][w] = max(dp[i+1][w], dp[i][w])

    return dp[N][W]

# 0 [0, 0, 0, 0, 0, 0, 0, 0, 0]
# 1 [0, 0, 0, 30, 30, 30, 30, 30, 30]
# 2 [0, 0, 0, 30, 50, 50, 50, 80, 80]
# 3 [0, 0, 0, 30, 50, 60, 60, 80, 90]

print(solve())


Fixed submission:
def solve():
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for i in range(N)]
    dp = [[0] * (M+1) for i in range(N+1)]
    
    for i in range(N):
        for s in range(M+1):
            a, b = A[i]
            if s-a >= 0:
                dp[i+1][s] = max(dp[i+1][s], dp[i][s-a] + b)
            dp[i+1][s] = max(dp[i+1][s], dp[i][s])
    return dp[N][M]

print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
A = list(input())
n = len(A)

count = 0
for i in range(n):
    if A[i] == 'W':
        count += A[:i].count('B')

print(count)


Fixed submission:
A = list(input())

count = 0
ans = 0
for a in A:
    if a == 'B':
        count += 1
    else:
        ans += count

print(ans)

Buggy python submission (verdict: Runtime Error):
A = list(input())
n = len(A)

count = 0
for i in reversed(range(1, n)):
    if  A[i-1] == 'B' and A[i] == 'W':
        A[i-1] = 'W'
        A[i] = 'B'
        count += 1
        a += 1

print(count * 2)


Fixed submission:
A = list(input())

count = 0
ans = 0
for a in A:
    if a == 'B':
        count += 1
    else:
        ans += count

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A = list(input())
n = len(A)

count = 0
for _ in range(n):
    a = 0
    for i in reversed(range(1, n)):
        if  A[i-1] == 'B' and A[i] == 'W':
            A[i] = 'B'
            A[i-1] = 'W'
            count += 1
            a += 1
    
    if a == 0: break

print(count)


Fixed submission:
A = list(input())

count = 0
ans = 0
for a in A:
    if a == 'B':
        count += 1
    else:
        ans += count

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A = list(input())
n = len(A)

count = 0
for _ in range(n):
    for i in reversed(range(1, n)):
        if  A[i-1] == 'B' and A[i] == 'W':
            A[i] = 'B'
            A[i-1] = 'W'
            count += 1

print(count)


Fixed submission:
A = list(input())

count = 0
ans = 0
for a in A:
    if a == 'B':
        count += 1
    else:
        ans += count

print(ans)
Buggy python submission (verdict: Runtime Error):
def solve():
    N = int(input())
    
    c = 0
    for i in range(1, N+1, 2):
        f = factorize(i)
        l = []
        for j in f:
            l.append(j)
            l.append(N // j)
        l.append(N)
        l.append(1)
        s = len(set(l))
        if s == 8:
            c += 1

    return c

print(solve())


Fixed submission:
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

def solve():
    N = int(input())
    
    c = 0
    for i in range(1, N+1, 2):
        f = factorize(i)
        b = 1
        for j in f:
            b += b * j[1]
        if b == 8:
            c += 1

    return c

print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    N = list(input().split())[0]
    a,b,c,d = int(N[0]),int(N[1]),int(N[2]),int(N[3])

    if a+b+c+d == 7:
        print(f'{a}+{b}+{c}+{d}=7')
        return 

    if a+b+c-d == 7:
        print(f'{a}+{b}+{c}-{d}=7')
        return 

    if a+b-c+d == 7:
        print(f'{a}+{b}-{c}+{d}=7')
        return 

    if a-b+c+d == 7:
        print(f'{a}-{b}+{c}+{d}=7')
        return 

    if a+b-c-d == 7:
        print(f'{a}+{b}-{c}-{d}=7')
        return 

    if a-b+c-d == 7:
        print(f'{a}-{b}+{c}-{d}=7')
        return 

    if a-b-c+d == 7:
        print(f'{a}-{b}-{c}+{d}=7')
        return 

    if a-b-c-d == 7:
        print(f'{a}-{b}-{c}-{d}=7')
        return 
      
solve()

Fixed submission:
def solve():
    N = list(input().split())[0]
    a,b,c,d = int(N[0]),int(N[1]),int(N[2]),int(N[3])

    if a+b+c+d == 7:
        print('{0}+{1}+{2}+{3}=7'.format(a,b,c,d))
        return 

    if a+b+c-d == 7:
        print('{0}+{1}+{2}-{3}=7'.format(a,b,c,d))
        return 

    if a+b-c+d == 7:
        print('{0}+{1}-{2}+{3}=7'.format(a,b,c,d))
        return 

    if a-b+c+d == 7:
        print('{0}-{1}+{2}+{3}=7'.format(a,b,c,d))
        return 

    if a+b-c-d == 7:
        print('{0}+{1}-{2}-{3}=7'.format(a,b,c,d))
        return 

    if a-b+c-d == 7:
        print('{0}-{1}+{2}-{3}=7'.format(a,b,c,d))
        return 

    if a-b-c+d == 7:
        print('{0}-{1}-{2}+{3}=7'.format(a,b,c,d))
        return 

    if a-b-c-d == 7:
        print('{0}-{1}-{2}-{3}=7'.format(a,b,c,d))
        return 

# print(solve())

# テスト用

solve()
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

colors = [0 for _ in range(N + 1)]

for a in A:
    if 1<= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = sum(colors[:-1])
zero_count = colors.count(0)
over_count = colors[-1]

max = 0
max = min(zero_count, over_count) + minimum

print(minimum, max)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))

colors = [0 for _ in range(8)]
over = 0

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        over += 1

c = colors.count(1)

if over == 0:
    maxi = c
else:
    maxi = c + over

if c == 0:
    mini = 1
else:
    mini = c

print(mini, maxi)
Buggy python submission (verdict: Runtime Error):
from itertools import combinations

N = int(input())

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

A = factorize(N)

list = []
c = 1
for a in A:
    c *= a
    b = N // c
    maxi = max((len(str(b)), len(str(c))))
    list.append(maxi)

ans = min(list)

print(ans)

Fixed submission:
from itertools import combinations

N = int(input())

def int_len(n):
    return len(str(n))

a = i = 1
list = []
while a <= N:
    if N % i == 0:
        b = N // i
        c = N // b
    list.append(max(int_len(b), int_len(b)))
    
    i += 1
    a = i ** 2

ans = min(list)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    K, S = map(int, input().split())
    
    c = 0
    for x in range(K+1):
        for y in range(K+1):
            for z in range(K+1):
                if x+y+z == S:
                    c += 1
    return c

print(solve())


Fixed submission:
def solve():
    K, S = map(int, input().split())
    
    c = 0
    for x in range(K+1):
        for y in range(K+1):
            if 0 <= S-(x+y) <= K:
                z = S-(x+y)
                if x+y+z == S:
                    c += 1
    return c

print(solve())
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

if N > 0:
    print('Positive')
elif N <= 0 =< M:
    print('Zero')
elif M < 0:
    if N-M % 2:
        print('Negative')
    else:
        print('Positive')

Fixed submission:
def solve():
    N, M = map(int, input().split())
    if N > 0:
        return 'Positive'
    elif N <= 0 <= M:
        return 'Zero'
    else:
        
        if (-(N-M)+1) % 2 == 0:
            return 'Positive'
        else:
            return 'Negative'
            
    return 0

print(solve())