Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
t1, t2 = map(int, input().split())
a1,a2 = map(int, input().split())
b1, b2 = map(int, input().split())
#t1で生まれる差
P = (a1 - b1) * t1
#t2で生まれる差
Q = (a2 - b2) * t2
#P < 0 のことを仮定する
if P > 0:
    P *= -1
    Q *= -1

if P + Q < 0:
    print(0)
elif P == Q:
    print("infinity")
else:
    #つぎのPを足したときに、負にいくかどうか？
    if (-P) % (P + Q) == 0:
        print(2 * ((-P) // (P + Q)) + 2)
    else:
        print(2 * ((-P) // (P + Q)) + 1)


Fixed submission:
t1, t2 = map(int, input().split())
a1,a2 = map(int, input().split())
b1, b2 = map(int, input().split())
#t1で生まれる差
P = (a1 - b1) * t1
#t2で生まれる差
Q = (a2 - b2) * t2
#P < 0 のことを仮定する
if P > 0:
    P *= -1
    Q *= -1

if P + Q < 0:
    print(0)
elif P + Q == 0:
    print("infinity")
else:
    #つぎのPを足したときに、負にいくかどうか？
    i = P * (-1)
    if i % (P + Q) == 0:
        print(2 * (i // (P + Q)))
    else:
        print(2 * (i // (P + Q)) + 1)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
import math
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort()
A.reverse()
maxX = max(F) * max(A)
x = [-1 for i in range(maxX + 1)]
def is_able(low, up):
    target = (low + up) // 2
    if low == up - 1:
        return up
    if check(target):
        x[target] = 1
        return is_able(low, target)
    else:
        x[target] = 0
        return is_able(target, up)

def check(time):
    #time が可能かどうか
    practice = copy.deepcopy(k)
    for i in range(n):
        if A[i] * F[i] > time:
            practice -= A[i] - math.floor(time / F[i]) 
            if practice < 0:
                return False
    return True
x[0] = int(check(0))
x[maxX] = int(check(maxX))
print(is_able(-1, maxX))

Fixed submission:
import copy
import math
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort()
A.reverse()
maxX = max(F) * max(A)
def is_able(low, up):
    target = (low + up) // 2
    if low == up - 1:
        return up
    if check(target):
        return is_able(low, target)
    else:
        return is_able(target, up)
def check(time):
    #time が可能かどうか
    practice = copy.deepcopy(k)
    for i in range(n):
        if A[i] * F[i] > time:
            practice -= A[i] - math.floor(time / F[i]) 
            if practice < 0:
                return False
    return True
print(is_able(-1, maxX))

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import math
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort()
A.reverse()
maxX = max(F) * max(A)
x = [-1 for i in range(maxX + 1)]
def is_able(low, up):
    target = (low + up) // 2
    if low == up - 1:
        return up
    if check(target):
        x[target] = 1
        return is_able(low, target)
    else:
        x[target] = 0
        return is_able(target, up)

def check(time):
    #time が可能かどうか
    practice = copy.deepcopy(k)
    for i in range(n):
        if A[i] * F[i] > time:
            practice -= A[i] - math.floor(time / F[i]) 
            if practice < 0:
                return False
    return True
x[0] = int(check(0))
x[maxX] = int(check(maxX))
print(is_able(-1, maxX))

Fixed submission:
import copy
import math
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort()
A.reverse()
maxX = max(F) * max(A)
def is_able(low, up):
    target = (low + up) // 2
    if low == up - 1:
        return up
    if check(target):
        return is_able(low, target)
    else:
        return is_able(target, up)
def check(time):
    #time が可能かどうか
    practice = copy.deepcopy(k)
    for i in range(n):
        if A[i] * F[i] > time:
            practice -= A[i] - math.floor(time / F[i]) 
            if practice < 0:
                return False
    return True
print(is_able(-1, maxX))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
L = list(map(int, input().split()))
L.sort()
L.reverse()
ans = 0
pre = 0
for i in range(n):
    for j in range(i+1, n):
        flag = True
        for k in range(j+1, n):
            if L[i] >= L[j] + L[k]:
                ans += max(0, k - (j + 1))
                flag = False
                break
        if flag:
            ans += n - (j + 1)
print(ans)


Fixed submission:
import bisect
n = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(n - 1, 0, -1):
    for j in range(i - 1, 0, -1):
        ans += max(0, (j - bisect.bisect_right(L, L[i] - L[j])))
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
sum = 0
for i in h:
    if h >= k:
        sum += 1
print(sum) 

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
sum = 0
for i in h:
    if i >= k:
        sum += 1
print(sum)
Buggy python submission (verdict: Runtime Error):
import numpy as np
h, w, a, b = list(map(int, input().split()))
Ans = [[0 for i in range(h)] for j in range(w)]
for i in range(h):
    for j in range(w):
        if ( i < b and j >= a ) or ( i >= b and j < a) :
            Ans[i][j] = 1
for i in range(h):
    print(''.join(list(map(str, Ans[i]))))

Fixed submission:
import numpy as np
h, w, a, b = list(map(int, input().split()))
Ans = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        if ( i < b and j >= a ) or ( i >= b and j < a) :
            Ans[i][j] = 1
for i in range(h):
    print(''.join(list(map(str, Ans[i]))))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
def z_algo(S):
    N = len(S)
    A = [0]*N
    i = 1; j = 0
    A[0] = l = len(S)
    while i < l:
        while i+j < l and S[j] == S[i+j]:
            j += 1
        if not j:
            i += 1
            continue
        A[i] = j
        k = 1
        while l-i > k < j - A[k]:
            A[i+k] = A[k]
            k += 1
        i += k; j -= k
    return A
ans = 0
s = input()
for i in range(n):
    string = z_algo(s[i:])
    for j in range(1,len(string)):
        if j - i  + string[j] < n:
            ans = max(ans, string[j])
print(ans)

Fixed submission:
n = int(input())
def z_algo(S):
    N = len(S)
    A = [0]*N
    i = 1; j = 0
    A[0] = l = len(S)
    while i < l:
        while i+j < l and S[j] == S[i+j]:
            j += 1
        if not j:
            i += 1
            continue
        A[i] = j
        k = 1
        while l-i > k < j - A[k]:
            A[i+k] = A[k]
            k += 1
        i += k; j -= k
    return A
ans = 0
s = input()
for i in range(n):
    string = z_algo(s[i:])
    for j in range(len(string)):
        if j  >= string[j]:
            ans = max(ans, string[j])
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
pre = 0
sepS = []
happyCount = 0
RLcount = 0
for i in range(1, n):
    if s[i] == s[i - 1]:
        happyCount += 1
    if s[i] == 'L' and s[i - 1] == 'R':
        RLcount += 1
#print("now HP =>{}".format(happyCount))
happyCount += min(k, RLcount) * 2
if k > RLcount:
    happyCount += 1
print(min(n - 1, happyCount)


Fixed submission:
n, k = map(int, input().split())
s = input()
pre = 0
sepS = []
happyCount = 0
RLcount = 0
for i in range(1, n):
    if s[i] == s[i - 1]:
        happyCount += 1
    if s[i] == 'L' and s[i - 1] == 'R':
        RLcount += 1
#print("now HP =>{}".format(happyCount))
happyCount += min(k, RLcount) * 2
if k > RLcount:
    happyCount += 1
print(min(n - 1, happyCount))
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = list(range(1,n+1))
if n >= 3:
    print(sum(ans[1:-1]) + 1)
elif n == 2:
    print(1)
else:
    print(0)

Fixed submission:
n = int(input())
print(n * (n - 1) // 2)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print(red)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
data = {}
max = len(s)
for i in range(24):
    data[chr(i + ord('a'))] = max + 1
for i in range(len(s)):
    if data[s[i]] > i + 1:
        data[s[i]] = i + 1
ans = 0
pre = max
for i in range(len(t)):
    if data[t[i]] == max + 1:
        print(-1)
        exit()
    else:
        if pre < data[t[i]]:
            ans += (data[t[i]] - pre)
            pre = data[t[i]]
        else:
            ans += (max + data[t[i]] - pre)
            pre = data[t[i]]
    
print(ans)



Fixed submission:
import bisect
s = input()
t = input()
data = {}
max_s = len(s) + 1
for i in range(26):
    data[chr(i + ord('a'))] = []
for i in range(len(s)):
    data[s[i]].append(i+1)
for i in range(26):
    data[chr(i + ord('a'))].append(max_s)
pre = 0
ans = 0
for i in range(len(t)):
    char = t[i]
    if len(data[char]) == 1:
        print(-1)
        exit()
    else:
        index = bisect.bisect_left(data[char], pre+1)
        if data[char][index] == max_s:
            ans += len(s) - pre
            pre = data[char][0]
            ans += pre
        else:
            ans += data[char][index] - pre
            pre = data[char][index]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
s.reverse()
n = len(s)
mod = 10**9+7
#dp[i][j] := 下からi桁目まで決めたとき、13で割った余りがjの個数
dp = [[0 for i in range(13)] for j in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(13):
        char = s[i]
        if char == '?':
            for k in range(10):
                #i+1桁目をkにする
                tmp = (k * pow(10, i)) % 13
                dp[i+1][(j + tmp) % 13] += dp[i][j]
                dp[i+1][(j + tmp) % 13] %= mod
        else:
            x = int(char)
            tmp = (x * pow(10, i)) % 13
            dp[i+1][(j + tmp) % 13] += dp[i][j]
            dp[i+1][(j + tmp) % 13] %= mod
print(dp[n][5])



Fixed submission:
s = input()
#文字の昇順に処理していきたいため、逆順にしておく
s = s[::-1]
mod = 7 + 10**9
keta = 1
dp = [[0 for i in range(13)] for j in range(len(s) + 1)]
dp[0][0] = 1
for i in range(len(s)):
    if s[i] != "?":
        k = (int(s[i]) * keta) % 13
        for j in range(13):
            dp[i + 1][(j + k) % 13] = dp[i][j]
    else:
        for j in range(13):
            for k in range(10):
                l = ( k * keta ) % 13
                dp[i + 1][(j + l) % 13] += dp[i][j] % mod
    keta = keta *10 % 13 
print(dp[-1][5] % mod)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
s.reverse()
n = len(s)
mod = 10**9+7
#dp[i][j] := 下からi桁目まで決めたとき、13で割った余りがjの個数
dp = [[0 for i in range(13)] for j in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(13):
        char = s[i]
        if char == '?':
            for k in range(10):
                #i+1桁目をkにする
                tmp = (k * (10 ** i)) % 13
                dp[i+1][(j + tmp) % 13] += dp[i][j]
                dp[i+1][(j + tmp) % 13] %= mod
        else:
            x = int(char)
            tmp = x * (10**i)
            dp[i+1][(j + tmp) % 13] += dp[i][j]
            dp[i+1][(j + tmp) % 13] %= mod
print(dp[n][5])



Fixed submission:
s = input()
#文字の昇順に処理していきたいため、逆順にしておく
s = s[::-1]
mod = 7 + 10**9
keta = 1
dp = [[0 for i in range(13)] for j in range(len(s) + 1)]
dp[0][0] = 1
for i in range(len(s)):
    if s[i] != "?":
        k = (int(s[i]) * keta) % 13
        for j in range(13):
            dp[i + 1][(j + k) % 13] = dp[i][j]
    else:
        for j in range(13):
            for k in range(10):
                l = ( k * keta ) % 13
                dp[i + 1][(j + l) % 13] += dp[i][j] % mod
    keta = keta *10 % 13 
print(dp[-1][5] % mod)
Buggy python submission (verdict: Runtime Error):
r = input()
print(3 * r * r)

Fixed submission:
r = int(input())
print(3 * r * r)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
k = max(a)
for i in range(n):
    if a[i] < k:
        print(k)
    else:
        tmp = a[i]
        a[i] = 0
        print(max(a))
        a[i] = tmp


Fixed submission:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
bl = [0 for i in range(n)]
bl[0] = a[0]
br = [0 for i in range(n)]
br[0] = a[n - 1]
for i in range(1, n):
    bl[i] = max(bl[i - 1],a[i])
a.reverse()
for i in range(1, n):
    br[i] = max(br[i - 1],a[i])
br.reverse()
print(br[1])
for i in range(1, n - 1):
    print(max(bl[i - 1],br[i + 1]))
print(bl[n - 2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
k = max(a)
for i in range(n):
    if a[i] != k:
        print(k)
    else:
        tmp = a[i]
        a[i] = 0
        print(max(a))
        a[i] = tmp

Fixed submission:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
bl = [0 for i in range(n)]
bl[0] = a[0]
br = [0 for i in range(n)]
br[0] = a[n - 1]
for i in range(1, n):
    bl[i] = max(bl[i - 1],a[i])
a.reverse()
for i in range(1, n):
    br[i] = max(br[i - 1],a[i])
br.reverse()
print(br[1])
for i in range(1, n - 1):
    print(max(bl[i - 1],br[i + 1]))
print(bl[n - 2])
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
count = 0
min = a[0]
for i in range(n):
    if min > a[i]:
        min = a[i]
        count += 1
print(count)

Fixed submission:
import bisect
from collections import deque
n = int(input())
a = [0 for i in range(n)]
for i in range(n):
    a[i] = int(input())
count = deque()
count.append(a[0])
for i in range(1, n):
    
    index = bisect.bisect_left(count, a[i])
    
    if index == 0:
        count.appendleft(a[i])
    else:
        count[index - 1] = a[i]
    #print("{}  {}".format(count, index))
print(len(count))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = set(a)
d = [0,0,0]
index = 0
if len(b) != 3 and n % 3 != 0:
    print("No")
    exit()
for i in list(b):
    for j in a:
        if i == j:
            d[index] += 1
    index += 1
if d[0] == d[1] and d[1] == d[2]:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
temp = a[0] ^ a[1]
for i in range(2,n):
    temp = temp ^ a[i]
if temp == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = set(a)
d = [0,0,0]
index = 0
if len(b) != 3 and len(n) % 3 != 0:
    print("No")
    exit()
for i in list(b):
    for j in a:
        if i == j:
            d[index] += 1
    index += 1
if d[0] == d[1] and d[1] == d[2]:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
temp = a[0] ^ a[1]
for i in range(2,n):
    temp = temp ^ a[i]
if temp == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = set(a)
d = [0,0,0]
index = 0
if len(b) != 3 and len(n) % 3 == 0:
    print("No")
    exit()
for i in list(b):
    for j in a:
        if i == j:
            d[index] += 1
    index += 1
if d[0] == d[1] and d[1] == d[2]:
    print("Yes")
else:
    print("No")


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
temp = a[0] ^ a[1]
for i in range(2,n):
    temp = temp ^ a[i]
if temp == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
l, r = list(map(int,input().split()))
mod = 2019
min = 2019
if 2019 in range(l, r + 1):
    print(0)
    exit()
for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
        if min > (i * j) % mod:
            min = (i * j) % mod
print(min)

Fixed submission:
l, r = list(map(int,input().split()))
mod = 2019
min = 2019
for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
        if min > (i * j) % mod:
            min = (i * j) % mod
        if min == 0:
            print(0)
            exit()
print(min)

Buggy python submission (verdict: Time Limit Exceeded):
l, r = list(map(int,input().split()))
mod = 2019
min = 2019
for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
        if min > (i * j) % mod:
            min = (i * j) % mod
print(min)

Fixed submission:
l, r = list(map(int,input().split()))
mod = 2019
min = 2019
for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
        if min > (i * j) % mod:
            min = (i * j) % mod
        if min == 0:
            print(0)
            exit()
print(min)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
a = list(map(int, input().split()))
sum = 0
x = [-1 for i in range(n)]
for i in range(n):
    if a[i % n] == 0:
        x[i % n] = 0
        x[(i + 1) % n] = 0
i = 0
while (-1 in x):
    if a[i % n] == -1 and a[i + 2] != -1:
        x[i] = a[i] * 2 - a[i + 1] * 2 - x[i + 2]
    i += 1
for i in x:
    print(i,end = "")
    print(" ", end = "")

Fixed submission:
import numpy as np

n = int(input())
a = list(map(int, input().split()))
s = 0
x = [-1 for i in range(n)]
for i in range(1,n):
    if i % 2 == 1:
        s += a[i]
x[0] = sum(a) - s * 2
for i in range(1, n):
    x[i] = a[i - 1] * 2 - x[i - 1]
for i in x:
    print(i,end = "")
    print(" ", end = "")

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

n = int(input())
a = list(map(int, input().split()))
sum = 0
x = [-1 for i in range(n)]
for i in range(n):
    if a[i % n] == 0:
        x[i % n] = 0
        x[(i + 1) % n] = 0
i = 0
while (-1 in x):
    if a[i % n] == nun and a[i + 2] != -1:
        x[i] = a[i] * 2 - a[i + 1] * 2 - x[i + 2]
    i += 1
for i in x:
    print(i,end = "")
    print(" ", end = "")

Fixed submission:
import numpy as np

n = int(input())
a = list(map(int, input().split()))
s = 0
x = [-1 for i in range(n)]
for i in range(1,n):
    if i % 2 == 1:
        s += a[i]
x[0] = sum(a) - s * 2
for i in range(1, n):
    x[i] = a[i - 1] * 2 - x[i - 1]
for i in x:
    print(i,end = "")
    print(" ", end = "")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
mod = 10 ** 9 + 7
adjacent_list = [[] for i in range(n+1)]
for i in range(n - 1):
    a, b = map(int, input().split())
    adjacent_list[a].append(b)
    adjacent_list[b].append(a)
finished = set([1])
ans = k
def dfs(current, finished,num):
    global ans
    global k
    unsearched = set(adjacent_list[current]) - finished
    num = max(k - 1, num)
    if len(unsearched) == 0:
        return
    for i in unsearched:
        finished.add(i)
        num -= 1
        ans *= num
        ans %= mod
        dfs(i,finished, num)
dfs(1,finished,k)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**5)
n, k = map(int, input().split())
mod = 10 ** 9 + 7
adjacent_list = [[] for i in range(n+1)]
for i in range(n - 1):
    a, b = map(int, input().split())
    adjacent_list[a].append(b)
    adjacent_list[b].append(a)
finished = set([1])
ans = k
def dfs(current, finished,num):
    global ans
    global k
    unsearched = set(adjacent_list[current]) - finished
    num = max(k - 1, num)
    if len(unsearched) == 0:
        return
    for i in unsearched:
        finished.add(i)
        num -= 1
        ans *= num
        ans %= mod
        dfs(i,finished, num)
dfs(1,finished,k)
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(len(s)):
    if s[i] == s[i+1]:
        print("Bad")
        exit()
print("Good")

Fixed submission:
s = input()
for i in range(len(s) - 1):
    if s[i] == s[i+1]:
        print("Bad")
        exit()
print("Good")
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = list(map(int, input().split()))
def divNumCount(start, end, div):
    count = 0
    num = 0
    i = start
    while i <= end:
        if i % div == 0:
            i += div - 1
            count += 1
        i += 1
    return count
def euqlid(a,b):
    if a < b:
        temp = a
        a = b
        b = temp
    while(a % b != 0):
        temp = a % b
        a = b
        b = temp
    return b

C = 0
D = 0
CandD = 0
C = divNumCount(a, b, c)
D = divNumCount(a, b, d)
CandD = divNumCount(a, b, c * d / euqlid(c,d))
print(b - a + 1 - (C + D - CandD))

Fixed submission:
a, b, c, d = list(map(int, input().split()))
def euqlid(x,y):
    if x < y :
        temp = x
        x = y
        y = temp
    while x % y != 0:
        temp = x
        x = y
        y = temp % y
    return y
def searchCount(p,q,k):
    min = 0
    max = 0
    if p % k == 0:
        min = p // k
    else:
        min = p//k + 1
    max = q//k
    return max - min + 1
lcm = euqlid(c,d)
gcd = int((c * d) / lcm)
print((b - a + 1) - searchCount(a,b,c) - searchCount(a,b,d) + searchCount(a,b,gcd))

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = list(map(int, input().split()))
count = 0
for i in range(a, b + 1):
    if i % c != 0 and i % d != 0:
        count += 1

print(count)

Fixed submission:
a, b, c, d = list(map(int, input().split()))
def euqlid(x,y):
    if x < y :
        temp = x
        x = y
        y = temp
    while x % y != 0:
        temp = x
        x = y
        y = temp % y
    return y
def searchCount(p,q,k):
    min = 0
    max = 0
    if p % k == 0:
        min = p // k
    else:
        min = p//k + 1
    max = q//k
    return max - min + 1
lcm = euqlid(c,d)
gcd = int((c * d) / lcm)
print((b - a + 1) - searchCount(a,b,c) - searchCount(a,b,d) + searchCount(a,b,gcd))
Buggy python submission (verdict: Runtime Error):
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
length = 0
i = 0
while x >= length and n >= i:
    length += L[i]
    i += 1
print(i)

Fixed submission:
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
length = 0
i = 0
count = 1
while n > i:
    length += L[i]
    if length <= x:
        count += 1
    i += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
length = 0
i = 0
while x >= length:
    length += L[i]
    i += 1
print(i)

Fixed submission:
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
length = 0
i = 0
count = 1
while n > i:
    length += L[i]
    if length <= x:
        count += 1
    i += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
if (K == 1):
    print(0)
else:
    print(n - k)

Fixed submission:
n, k = map(int,input().split())
if (k == 1):
    print(0)
else:
    print(n - k)
Buggy python submission (verdict: Runtime Error):
n = int(input())
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
dif = dict()
data.sort()
for i in range(n):
    for j in range(i+1, n):
        x = data[i][0] - data[j][0]
        y = data[i][1] - data[j][1]
        if (x,y) in dif:
            dif[(x,y)] += 1
        else:
            dif[(x,y)] = 1
print(dif)
print(n - max([dif[i] for i in dif.keys()]))
        
        



Fixed submission:
n = int(input())
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
dif = dict()
data.sort()
for i in range(n):
    for j in range(i+1, n):
        x = data[i][0] - data[j][0]
        y = data[i][1] - data[j][1]
        if (x,y) in dif:
            dif[(x,y)] += 1
        else:
            dif[(x,y)] = 1
if len(dif.keys()) == 0:
    print(n)
    exit()
print(n - max([dif[i] for i in dif.keys()]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
dif = dict()
for i in range(n):
    for j in range(i+1, n):
        x = data[i][0] - data[j][0]
        y = data[i][1] - data[j][1]
        if (x,y) in dif:
            dif[(x,y)] += 1
        else:
            dif[(x,y)] = 1
print(n - max([dif[i] for i in dif.keys()]))
        
        



Fixed submission:
n = int(input())
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
dif = dict()
data.sort()
for i in range(n):
    for j in range(i+1, n):
        x = data[i][0] - data[j][0]
        y = data[i][1] - data[j][1]
        if (x,y) in dif:
            dif[(x,y)] += 1
        else:
            dif[(x,y)] = 1
if len(dif.keys()) == 0:
    print(n)
    exit()
print(n - max([dif[i] for i in dif.keys()]))