Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

from itertools import accumulate

def getAccumulate(A):
    return list(accumulate(A))

def solve(A):
    accum = getAccumulate(A)
    l_index = 0
    r_index = 2
    accum_max = accum[-1]

    diff = accum_max
    for i in range(1, len(A)-2):
        while accum[i] > accum[l_index] + accum[l_index + 1]:
            l_index += 1
        while accum_max + accum[i] > accum[r_index] + accum[r_index + 1]:
            r_index += 1
        
        print(i)
        print(accum)
        left = accum[l_index]
        center = accum[i] - accum[l_index]
        right = accum[r_index] - accum[i]
        last = accum_max - accum[r_index]
        print(accum[l_index], accum[i], accum[r_index], accum[-1])
        diff = min(diff, max(left, center, right, last) - min(left, center, right, last))
        
    return diff

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
	print(solve(A))


Fixed submission:
# coding: utf-8

from itertools import accumulate

def getAccumulate(A):
    return list(accumulate(A))

def solve(A):
    accum = getAccumulate(A)
    l_index = 0
    r_index = 2
    accum_max = accum[-1]

    diff = accum_max
    for i in range(1, len(A)-2):
        while accum[i] > accum[l_index] + accum[l_index + 1]:
            l_index += 1
        while accum_max + accum[i] > accum[r_index] + accum[r_index + 1]:
            r_index += 1
        
        left = accum[l_index]
        center = accum[i] - accum[l_index]
        right = accum[r_index] - accum[i]
        last = accum_max - accum[r_index]
        diff = min(diff, max(left, center, right, last) - min(left, center, right, last))
        
    return diff

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    print(solve(A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = [int(i) for i in input().split()]
M = max(L)
A = min(L)
Z_L = list()
for i in range(A, M):
  ZZ = 0
  for j in range(N):
    Z =  pow(L[j] - i, 2)
    ZZ += Z
  Z_L.append(ZZ)
print(min(Z_L))

Fixed submission:
N = int(input())
L = [int(i) for i in input().split()]
M = max(L)
A = min(L)
Z_L = list()
for i in range(A, M + 1):
  ZZ = 0
  for j in range(N):
    Z =  pow(L[j] - i, 2)
    ZZ += Z
  Z_L.append(ZZ)
print(min(Z_L))

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = [int(i) for i in input().split()]
M = max(L)
Z_L = list()
for i in range(1, M):
  ZZ = 0
  for j in range(N):
    Z =  pow(L[j] - i, 2)
    ZZ += Z
  Z_L.append(ZZ)
print(min(Z_L))

Fixed submission:
N = int(input())
L = [int(i) for i in input().split()]
M = max(L)
A = min(L)
Z_L = list()
for i in range(A, M + 1):
  ZZ = 0
  for j in range(N):
    Z =  pow(L[j] - i, 2)
    ZZ += Z
  Z_L.append(ZZ)
print(min(Z_L))
Buggy python submission (verdict: Runtime Error):
import math

H, N  = map(int, input().split())
use_mp = 0
use_mp_list = list()
mag = list()
for i in range(N):
  temp = [int(j) for j in input().split()]
  mag.append([temp[0] / temp[1], temp[0], temp[1]])			#(ap, mp, dpm)
mag.sort(reverse=True)

for i in range(N):
  if H == 0:
    break
  t = H // mag[i][1]
  if t > 0:
    H = H - mag[i][1] * t
    use_mp += mag[i][2] * t
  if H == 0:
    abc = 0
  else:
    abc = (mag[i][2] * math.ceil(H / mag[i][1]))
  #print(mag)
  use_mp_list.append(use_mp + abc)
print(min(use_mp_list))

Fixed submission:
def calc(a):
  if a > 1:
    return 2 * calc(a // 2) + 1
  else:
    return 1

a = int(input())
i = 0
print(calc(a))

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

H, N  = map(int, input().split())
use_mp = 0
use_mp_list = list()
mag = list()
for i in range(N):
  temp = [int(j) for j in input().split()]
  mag.append([temp[0] / temp[1], temp[0], temp[1]])			#(ap, mp, dpm)
mag.sort(reverse=True)

for i in range(N):
  if H == 0:
    break
  t = H // mag[i][1]
  if t > 0:
    H = H - mag[i][1] * t
    use_mp += mag[i][2] * t
  if H == 0:
    abc = 0
  else:
    abc = (mag[i][2] * math.ceil(H / mag[i][1]))
  #print(mag)
  print(use_mp + abc, mag[i][1], mag[i][2], H, use_mp)
  use_mp_list.append(use_mp + abc)
print(min(use_mp_list))

Fixed submission:
def calc(a):
  if a > 1:
    return 2 * calc(a // 2) + 1
  else:
    return 1

a = int(input())
i = 0
print(calc(a))
Buggy python submission (verdict: Runtime Error):
time,rate = map(int,input().split())
ans = 0
if time >= 10:
  ans = rate
else:
  ans = rate - 100*(10 − time)
print(ans)

Fixed submission:
time,rate = map(int,input().split())
ans = 0
if time >= 10:
  ans = rate
else:
  ans = rate + 100*(10 - time)
print(ans)

Buggy python submission (verdict: Runtime Error):
time,rate = map(int,input().split())
ans = 0
if time >= 10:
  ans = r
else:
  ans = r - 100*(10 − time)
print(ans)

Fixed submission:
time,rate = map(int,input().split())
ans = 0
if time >= 10:
  ans = rate
else:
  ans = rate + 100*(10 - time)
print(ans)
Buggy python submission (verdict: Runtime Error):
imports sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
  	n /= k
    count += 1
print(count)

Fixed submission:
import sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
    n //= k
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
l = sys.stdin.readline().strip()
N = int(l)
l = sys.stdin.readline().strip()
nums = map(int, l.split())
a = sum(nums) / len(nums)
a1 = int(a)
a2 = int(a) + 1
def count(p):
    d = 0
    for n in nums:
        d += (n-p)**2
    return d
print(min(count(a1), count(a2)))


Fixed submission:
import sys
l = sys.stdin.readline().strip()
N = int(l)
l = sys.stdin.readline().strip()
nums = map(int, l.split())
nums = sorted(nums)
start = nums[0]
end = nums[-1] + 1
mi = float("INF")
def compute_dist(p):
  dist = 0
  for n in nums:
    dist += (n-p) ** 2
  return dist
for i in range(start, end):
  d = compute_dist(i)
  if d < mi:
    mi = d
print(mi)
Buggy python submission (verdict: Runtime Error):
a = raw_input()
n, k = a.split()
n = int(n)
k = int(k)
b = raw_input()
data = [int(one) for one in b.split()]
res = []
for i in range(len(data) - 1):
  for j in range(i+1, len(data)):
    res.append(data[i]*data[j])
res = sorted(res)
print(res[k-1])

Fixed submission:
d = raw_input()
a, b, c =  d.split()
a = int(a)
b = int(b)
c = int(c)
if (a==b):
  if c == a:
    print("No")
  else:
    print("Yes")
else:
  if a==c or b == c:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = input()
d = dict()
for i in range(n):
  w = raw_input()
  if w in d:
    d[w] += 1
  else:
    d[w] = 1
di = d.items()
def com(a,b):
  if a[1] > b[1]:
    return True
  elif a[1] == b[1]:
    return a[0]>b[0]
  else:
    return False
di = sorted(di, cmp=com)
print(di[0][0])
if len(di) > 1:
  print(di[1][0])

Fixed submission:
d = raw_input()
a, b, c =  d.split()
a = int(a)
b = int(b)
c = int(c)
if (a==b):
  if c == a:
    print("No")
  else:
    print("Yes")
else:
  if a==c or b == c:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sys
l= sys.stdin.readline()
count = int(l.strip())
l = sys.stdin.readline()
nums = list(map(int, l.split()))
check = dict()
for n in nums:
  if n in check:
    print("YES")
   	break
  else:
    check[n] = True
print("YES")

Fixed submission:
import sys
def main():
    l= sys.stdin.readline()
    count = int(l.strip())
    l = sys.stdin.readline()
    nums = list(map(int, l.split()))
    check = dict()
    for n in nums:
        if n in check:
            return "NO"
            
        else:
            check[n] = True
    return "YES"
if __name__ == "__main__":
    print(main())
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def main():
    l= sys.stdin.readline()
    N, K = list(map(int, l.split()))
    l = sys.stdin.readline()
    nums = list(map(lambda a:(int(a)+1)/2.0, l.split()))
    
    M = [sum(nums[:K])]
    for i in range(K, len(nums)):
        M.append(max(M[-1], sum(nums[i-K+1:i+1])))
    return M[-1]
if __name__ == "__main__":
    print(main())

Fixed submission:
import sys
def main():
    l= sys.stdin.readline()
    N, K = map(int, l.split())
    
    l = sys.stdin.readline()
    nums = list(map(lambda a:(int(a)+1)/2.0, l.split()))
    
    M = sum(nums[:K])
    mx = M
    for i in range(K, len(nums)):
        #print(nums[i-K], nums[i])
        M = M - nums[i-K] + nums[i]

        if M > mx:
            mx = M
        
    return mx
if __name__ == "__main__":
    print(main())
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from functools import reduce
mod = 10**9+7


def nCk(n, k):
    # c = reduce(lambda x, y: x*y % mod, range(n, n-k, -1))
    # m = reduce(lambda x, y: x*y % mod, range(1, k+1))
    c = reduce(lambda x, y: x*y % mod, range(n, n-k+1, -1))
    m = reduce(lambda x, y: x*y % mod, range(1, k))
    return c*pow(m, mod-2, mod) % mod


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

ans = pow(2, n, mod) - nCk(n, a) - nCk(n, b) - 1
ans %= mod
print(ans)


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from functools import reduce
mod = 10**9+7

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


def nCk(n, k):
    numer = reduce(lambda x, y: (x * y) % mod, range(n, n - k, -1))
    denom = reduce(lambda x, y: (x * y) % mod, range(1, k + 1))
    return numer * pow(denom, mod - 2, mod) % mod


ans = pow(2, n, mod) - nCk(n, a) - nCk(n, b) - 1
ans %= mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


A, B = list(map(int, input().split()))
# A, B = [12, 18]
# A, B = [420, 660]
# A, B = [1, 2019]


# 1. A,B の gcd を取得して C とする
# 2. C を素因数分解する
# 3. 「素因数分解の数 + 1」を返す

def gcd(a, b):
    # a の方が大きいと仮定
    def _gcd(a, b):
        # print(a, b)
        if a % b == 0:
            return b
        else:
            return gcd(b, a % b)

    if a < b:
        return _gcd(b, a)
    else:
        return _gcd(a, b)


def factorize(x):
    res = {}
    for i in range(2, x):  # x まで行かずともよさそう
        if x % i == 0:
            while x % i == 0:
                x //= i
                res[i] = res.get(i, 0) + 1

    if x != 1:
        res[x] = 1

    return res

C = gcd(A, B)
# print('gcd', C)
factors = factorize(C)
# print(factors)
print(len(factors) + 1)


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math


A, B = list(map(int, input().split()))
# A, B = [12, 18]
# A, B = [420, 660]
# A, B = [1, 2019]


# 1. A,B の gcd を取得して C とする
# 2. C を素因数分解する
# 3. 「素因数分解の数 + 1」を返す

def gcd(a, b):
    # a の方が大きいと仮定
    def _gcd(a, b):
        # print(a, b)
        if a % b == 0:
            return b
        else:
            return gcd(b, a % b)

    if a < b:
        return _gcd(b, a)
    else:
        return _gcd(a, b)


def factorize(x):
    res = {}
    for i in range(2, int(math.sqrt(x) + 1)):  # x まで行かずともよさそう
        if x % i == 0:
            while x % i == 0:
                x //= i
                res[i] = res.get(i, 0) + 1

    if x != 1:
        res[x] = 1

    return res

C = gcd(A, B)
factors = factorize(C)
print(len(factors) + 1)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

N, Y = map(int, input().split())

for i in range(N + 1):
    for j in range(N - i + 1):
        if i * 10000 + j * 5000 + (N - i - j) * 1000 == Y:
            print('{} {} {}'.format(i, j, N - i - j))
            exit()
print('-1 -1 -1')


Fixed submission:
# -*- coding: utf-8 -*-

int(input())  # Skip
lst = list(map(int, input().split()))

lst_length = len(lst)
idx = max_distance = 0

while True:
    distance = 0
    current_height = lst[idx]
    for i in range(idx + 1, lst_length):
        idx = i
        if current_height >= lst[idx]:
            current_height = lst[idx]
            distance += 1
        else:
            break

        if max_distance < distance:
            max_distance = distance

    if idx == (lst_length - 1):
        if max_distance < distance:
            max_distance = distance
        break

print(max_distance)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# pascal = [[] for _ in range(4005)]

pascal_triangle = [
    [0 for _ in range(1 + i)] for i in range(4005)
    # [0 for _ in range(1 + i)] for i in range(10)
]

def init():
    pascal_triangle[0][0] = 1
    for i in range(1, len(pascal_triangle)):
        for j in range(len(pascal_triangle[i])):
            new_value = 0
            if j < len(pascal_triangle[i-1]):
                new_value += pascal_triangle[i-1][j]
            if 0 <= j - 1:
                new_value += pascal_triangle[i-1][j-1]
            pascal_triangle[i][j] = new_value


# x 個の玉を y グループに分ける場合の数 (1個以上の玉のグループ)
def f2(x, y):
    return pascal_triangle[x + y - 1][y - 1]


# x 個の玉を y グループに分ける場合の数 (0個以上の玉のグループ)
def f(x, y):
    if x < y:
        return 0
    if x == 0 and y == 0:
        return 1
    if x == 0:
        return 0
    if y == 0:
        return 0
    return f2(x - y, y)


init()

# N = 5, K = 3
N, K = list(map(int, input().split()))

for i in range(1, K + 1):
    result = f(K, i) * (
        f(N - K, i - 1) +
        f(N - K, i) +
        f(N - K, i) +
        f(N - K, i + 1)
    )
    # print('0', i)
    # print('1', f(K, i))
    # print('2', f(N - K, i - 1))
    # print('3', f(N - K, i))
    # print('4', f(N - K, i + 1))
    print(result % 1000000007)
    # print("")

# for line in pascal_triangle:
#     print(line)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import math

# pascal = [[] for _ in range(4005)]

# pascal_triangle = [
#     [0 for _ in range(1 + i)] for i in range(4005)
#     # [0 for _ in range(1 + i)] for i in range(10)
# ]

def init():
    # pascal_triangle[0][0] = 1
    # for i in range(1, len(pascal_triangle)):
    #     for j in range(len(pascal_triangle[i])):
    #         new_value = 0
    #         if j < len(pascal_triangle[i-1]):
    #             new_value += pascal_triangle[i-1][j]
    #         if 0 <= j - 1:
    #             new_value += pascal_triangle[i-1][j-1]
    #         pascal_triangle[i][j] = new_value
    pass


# x 個の玉を y グループに分ける場合の数 (1個以上の玉のグループ)
def f2(x, y):
    # return pascal_triangle[x + y - 1][y - 1]
    n = x + y - 1
    r = y - 1
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


# x 個の玉を y グループに分ける場合の数 (0個以上の玉のグループ)
def f(x, y):
    if x < y:
        return 0
    if x == 0 and y == 0:
        return 1
    if x == 0:
        return 0
    if y == 0:
        return 0
    return f2(x - y, y)


init()

# N = 5, K = 3
N, K = list(map(int, input().split()))

for i in range(1, K + 1):
    result = f(K, i) * (
        f(N - K, i - 1) +
        f(N - K, i) +
        f(N - K, i) +
        f(N - K, i + 1)
    )
    # print('0', i)
    # print('1', f(K, i))
    # print('2', f(N - K, i - 1))
    # print('3', f(N - K, i))
    # print('4', f(N - K, i + 1))
    print(result % 1000000007)
    # print("")

# for line in pascal_triangle:
#     print(line)
Buggy python submission (verdict: Runtime Error):
str = input()
data = "".split(str)
n1 = int(data[0])
n2 = int(data[1])
if (n1 >9 or n2 > 9):
    print(-1)
else:
    print(n1*n2)

Fixed submission:
str = input()
data = str.split()
n1 = int(data[0])
n2 = int(data[1])
if (n1 >9 or n2 > 9):
    print(-1)
else:
    print(n1*n2)
Buggy python submission (verdict: Runtime Error):
n1 = int(input())
for i in range(1, 10):
  if n1 % i == 0 and n1 / i < 10:
    print("Yes")
    sys.exit()
print("No")

Fixed submission:
import sys
n1 = int(input())
for i in range(1, 10):
  if n1 % i == 0 and n1 / i < 10:
    print("Yes")
    sys.exit()
print("No")

Buggy python submission (verdict: Runtime Error):
n1 = int(input())
for i in range(1, 10):
  if n1 % i == 0 and n1 / i < 10:
    print("Yes")
    return
print("No")

Fixed submission:
import sys
n1 = int(input())
for i in range(1, 10):
  if n1 % i == 0 and n1 / i < 10:
    print("Yes")
    sys.exit()
print("No")
Buggy python submission (verdict: Runtime Error):
weather = ["Sunny", "Cloudy", "Rainy", "Sunny"]
s = input()
for c, i in weather:
    if i == s:
        print(weather[c+1])
        break

Fixed submission:
weather = ["Sunny", "Cloudy", "Rainy", "Sunny"]
s = input()
for c, i in enumerate(weather):
    if i == s:
        print(weather[c+1])
        break

Buggy python submission (verdict: Runtime Error):
weat = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']
for c in weat:
  if c == S:
    print(weat[weat.index(c)+1])
    break

Fixed submission:
weather = ["Sunny", "Cloudy", "Rainy", "Sunny"]
s = input()
for c, i in enumerate(weather):
    if i == s:
        print(weather[c+1])
        break
Buggy python submission (verdict: Runtime Error):
import re
s = input()
odd = s[::2]
eve = s[1::2]
odd_re = re.compile(^[RUD]*$)
eve_re = re.compile(^[LUD]*$)
if odd_re.findall(odd) != [] and eve_re.findall(eve) != []:
    print("Yes")
else:
    print("No")

    

Fixed submission:
import re
s = input()
odd = s[::2]
eve = s[1::2]
odd_re = re.compile(r"^[RUD]*$")
eve_re = re.compile(r"^[LUD]*$")
if odd_re.findall(odd) != [] and eve_re.findall(eve) != []:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import re
s = input()
odd = s[::2]
eve = s[1::2]
odd_re = re.compile{^[RUD]*$}
eve_re = re.compile{^[LUD]*$}
if odd_re.findall(odd) != [] and eve_re.findall(eve) != []:
    print("Yes")
else:
    print("No")

Fixed submission:
import re
s = input()
odd = s[::2]
eve = s[1::2]
odd_re = re.compile(r"^[RUD]*$")
eve_re = re.compile(r"^[LUD]*$")
if odd_re.findall(odd) != [] and eve_re.findall(eve) != []:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
X =input()
A =input()
if X < A:
  print(0)
else:
  print(10)
  

Fixed submission:
list = input().split(" ")
X = list[0]
A = list[1]
if X < A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
import sys

def main(lines):
  n, r = lines[0].split()
    if n >= 10:
      print(r)
    else:
      print(r + 100*(10-n))
    return
    
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)


Fixed submission:
import sys

def main(lines):
  n, r = map(int,lines[0].split())

  if n >= 10:
    print(r)
  else:
    print(r + 100*(10-n))
  return
    
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)

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

def main(lines):
	n, r = lines[0].split()
    if n >= 10:
      print(r)
    else:
      print(r + 100*(10-n))
    return
    
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)


Fixed submission:
import sys

def main(lines):
  n, r = map(int,lines[0].split())

  if n >= 10:
    print(r)
  else:
    print(r + 100*(10-n))
  return
    
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)

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

def main(lines):
	n, r = lines[0].split()
    if n >= 10:
      print(r)
    else:
      print(n + 100*(10-n))
    return
    
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)


Fixed submission:
import sys

def main(lines):
  n, r = map(int,lines[0].split())

  if n >= 10:
    print(r)
  else:
    print(r + 100*(10-n))
  return
    
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)
Buggy python submission (verdict: Runtime Error):
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

i = list(map(int, input().split()))
out = Base_10_to_n(i[0], i[1])
pritnt(out)

Fixed submission:
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
  
i = list(map(int, input().split()))
out = Base_10_to_n(i[0], i[1])
print(len(str(out)))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
c = a*b
if c % 2 = 0
    print("Even")
else
    print("Odd")

Fixed submission:
a, b = map(int, input().split())
c = a*b
if c % 2:
    print("Odd")
else:
    print("Even")

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input())
c = a*b
if c%2 = 0,
    print("Even")
else print("Odd")

Fixed submission:
a, b = map(int, input().split())
c = a*b
if c % 2:
    print("Odd")
else:
    print("Even")
Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
if n >= 10:
  print(r)
 else:
  print(r + 1000 - 100*n)

Fixed submission:
n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r + 1000 - 100*n)
Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
    c += 1
print(c)

Fixed submission:
n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
	c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
import heapq

n, m, l = map(int, input().split())
v = [[] for i in range(n)]
for i in range(m):
    a, b, c, = map(int, input().split())
    a, b, = a-1, b-1
    if c > l:
        continue
    v[a].append((c, b))
    v[b].append((c, a))


def dijkstra(home):
    visited = [False for i in range(n)]
    visited[home] = -1
    queue = []
    for edge in v[home]:
        heapq.heappush(queue, edge)


    while queue:
        value, x = heapq.heappop(queue)
        if visited[x]:
            continue
        visited[x] = value
        for new_value, new_x in v[x]:
            if not visited[new_x]:
                heapq.heappush(queue, new_value+value)

    return visited


def dijkstra2(home):
    visited = [None for _ in range(n)]
    visited[home] = 0
    queue = []
    for fuel_needed, x in v[home]:
        heapq.heappush(queue, (0, fuel_needed, x))


    while queue:
        tanked, fuel_needed, x = heapq.heappop(queue)
        fuel = l-fuel_needed
        if visited[x] is not None:
            continue
        visited[x] = tanked
        for child_value, child_x in v[x]:
            if visited[child_x] is None:
                if child_value > fuel:
                    heapq.heappush(queue, (tanked+1, child_value, child_x))
                else:
                    heapq.heappush(queue, (tanked, fuel_needed+child_value, child_x))

    return visited






visited_collection = [None for _ in range(n)]



q = int(input())
queries = []
for i in range(q):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    if visited_collection[a]:
        print(visited_collection[a][b] if visited_collection[a][b] is not None else -1)
    elif visited_collection[b]:
        print(visited_collection[b][a] if visited_collection[b][a] is not None else -1)
    else:
        visited_collection[a] = dijkstra2(a)
        print(visited_collection[a][b] if visited_collection[a][b] is not None else -1)

    # queries.append((a, b))








Fixed submission:
a, b, = map(int, input().split())
print(0 if 2*b >= a else a - 2*b)