Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
N = a[0]
K = a[1]
P = list(map(int, input().split()))

# for i in range(len(P)):
#     P[i] = (float)(P[i]+1)/2

max = 0
maxj = 0

for i in range(len(P)-K+1):
    num = 0
    for j in range(K):
        num += P[i+j]
        # print(P[i+j],end=" ")
    # print(num)
    if(max < num):
        max = num
        maxj = i

a = 0
for i in range(K):
    a += (float)(P[maxj+i]+1)/2

print("{0:6f}".format(a))


Fixed submission:
a = list(map(int, input().split()))
N = a[0]
K = a[1]
P = list(map(int, input().split()))

for i in range(len(P)):
    P[i] = (float)(P[i]+1)/2

S = []
for i in range(len(P)):
    if(i > 0):
        S.append(P[i]+S[i-1])
    else:
        S.append(P[0])
# print(S)

max = S[K-1]
for i in range(len(S)-K):
    a = S[i+K]-S[i]
    # print(a)

    if(a > max):
        max = a

# max = 0

# for i in range(len(P)-K+1):
#     num = 0
#     for j in range(K):
#         num += P[i+j]
#         # print(P[i+j],end=" ")
#     # print(num)
#     if(max < num):
#         max = num

print("{0:6f}".format(max))

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
N = a[0]
K = a[1]
P = list(map(int, input().split()))

for i in range(len(P)):
    P[i] = (float)(P[i]+1)/2

max = 0

for i in range(len(P)-K+1):
    num = 0
    for j in range(K):
        num += P[i+j]

    if(max < num):
        max = num

print("{0:6f}".format(max))


Fixed submission:
a = list(map(int, input().split()))
N = a[0]
K = a[1]
P = list(map(int, input().split()))

for i in range(len(P)):
    P[i] = (float)(P[i]+1)/2

S = []
for i in range(len(P)):
    if(i > 0):
        S.append(P[i]+S[i-1])
    else:
        S.append(P[0])
# print(S)

max = S[K-1]
for i in range(len(S)-K):
    a = S[i+K]-S[i]
    # print(a)

    if(a > max):
        max = a

# max = 0

# for i in range(len(P)-K+1):
#     num = 0
#     for j in range(K):
#         num += P[i+j]
#         # print(P[i+j],end=" ")
#     # print(num)
#     if(max < num):
#         max = num

print("{0:6f}".format(max))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

# 再起回数上限変更
# sys.setrecursionlimit(1000000)
N = int(input())
data = defaultdict(int)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a, b = (0,0)はそれを入れるのみなので，
# カウントから抜かして(a,b)の数を最後に足せば良い
# どちらかが0の場合は，
# a=0ならb=0のモノが対比となる

cnt_zero = 0

for i in range(N):
    a, b = map(int, input().split())
    div = gcd(abs(a), abs(b))

    # マイナスはaだけ
    if a <0 and b <0:
        a, b = -a, -b
    elif b < 0:
        a, b = -a, -b

    if a ==0 and b==0:
        cnt_zero += 1
        continue

    if a ==0:
        data[(0, 1)] += 1
        data[(1, 0)] += 0
        continue

    if b ==0:
        data[(1, 0)] += 1
        data[(0, 1)] += 0
        continue

    data[(a//div, b//div)] += 1
    if a > 0:
        data[(-b//div, a//div)] += 0
    else:
        data[(b // div, -a // div)] += 0

mod = 1000000007
res = 1


for d in data:
    if d[0]>=0 and d[1]>=0:
        val = data[d]
        a1 = data[(-d[1], d[0])]
        # print(d, val, a1)
        if val == 0:
            res *= pow(2, a1, mod)
        elif a1 > 0:
            res *= pow(2, val, mod) + pow(2, a1, mod) - 1
            data[(-d[1], d[0])] = 0
        else:
            res *= pow(2, val, mod)
        res %= mod
        # print(res)


print(res+cnt_zero-1)


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

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

# 再起回数上限変更
# sys.setrecursionlimit(1000000)
N = int(input())
data = defaultdict(int)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a, b = (0,0)はそれを入れるのみなので，
# カウントから抜かして(a,b)の数を最後に足せば良い
# どちらかが0の場合は，
# a=0ならb=0のモノが対比となる

cnt_zero = 0

for i in range(N):
    a, b = map(int, input().split())
    div = gcd(abs(a), abs(b))

    # マイナスはaだけ
    if a <0 and b <0:
        a, b = -a, -b
    elif b < 0:
        a, b = -a, -b

    if a ==0 and b==0:
        cnt_zero += 1
        continue

    if a ==0:
        data[(0, 1)] += 1
        data[(1, 0)] += 0
        continue

    if b ==0:
        data[(1, 0)] += 1
        data[(0, 1)] += 0
        continue

    data[(a//div, b//div)] += 1
    if a > 0:
        data[(-b//div, a//div)] += 0
    else:
        data[(b // div, -a // div)] += 0

mod = 1000000007
res = 1


for d in data:
    if d[0]>0 and d[1]>0:
        val = data[d]
        a1 = data[(-d[1], d[0])]
        # print(d, val, a1)
        if val == 0:
            res *= pow(2, a1, mod)
        elif a1 > 0:
            res *= pow(2, val, mod) + pow(2, a1, mod) - 1
            data[(-d[1], d[0])] = 0
        else:
            res *= pow(2, val, mod)
        res %= mod
        # print(res)
    # aが0の場合
    if d[0]==0:
        val = data[d]
        a1 = data[(1, 0)]

        if val == 0:
            res *= pow(2, a1, mod)
        elif a1 > 0:
            res *= pow(2, val, mod) + pow(2, a1, mod) - 1
        else:
            res *= pow(2, val, mod)
        res %= mod

print((res+cnt_zero-1)%mod)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
'''
11 3 2
ooxxxoxxxoo
'''

import numpy as np

N, K, C = map(int, input().split())
S = input()

oks = [idx for idx, i in enumerate(S) if i == 'o']
# print(oks)

for ok in oks:
    temp = oks.copy()
    temp.remove(ok)
    temp = np.array(temp)
    cnt = 0

    while True:
        if len(temp) == 0:
            print(ok + 1)
            break
        val = temp[0]
        temp = temp[temp > val + C]
        cnt += 1
        if cnt >= K:
            break


Fixed submission:
a, b, c = map(int, input().split())
print(c, a, b)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import numpy as np

H, W, K = map(int, input().split())

data = np.array([[None] * W for _ in range(H)])

for i in range(H):
    temp = input()
    for j in range(W):
        data[i, j] = int(temp[j])


current_best = np.inf

# Hに関する全ての場合を試す
for cnt in range(2 ** (H-1)):
    # bitで1の場所が切れ目とする
    option_h = np.array([int(s) for s in list(bin(cnt))[2:][::-1]])
    kireme = np.where(option_h == 1)[0]

    # 各グループについて1の数を集計する
    li = 0
    g = np.array([[None] * W for _ in range(len(kireme) + 1)])
    if len(kireme) == 0:
        g[0] = data[li:, :].sum(axis=0)
    else:
        for cnt, j in enumerate(kireme):
            g[cnt] = data[li:j+1, :].sum(axis=0)
            li = j + 1
        g[-1] = data[li:, :].sum(axis=0)

    # 左から順に足していく
    score = len(kireme)
    if score > current_best:
        # すでにこの時点で回数かかっていれば探索打ち切り
        continue
    cnt = np.zeros(len(kireme) + 1)
    for col in range(W):
        cnt = cnt + g[:, col]
        # どこか1つのグループでもKを超えてしまったらその左で切る
        if (cnt > K).any():
            score += 1
            # 最小を求めたいので、それまでの結果と同じ値になってしまったら終了
            if score >= current_best:
                break
            cnt = g[:, col]
            # 現在の列だけで条件を満たせないのであれば不可能なので終了
            if (cnt > K).any():
                score = np.inf
                break
    # スコアの更新
    if score < current_best:
        current_best = score


print(current_best)


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

'''
2 1
'''

# n1 偶数
n1, n2 = map(int, input().split())

# 奇数＋奇数 /  偶数+偶数
print(int(n1 * (n1-1) / 2 + (n2 * (n2-1))/2))
Buggy python submission (verdict: Runtime Error):
print((H+W)/2)

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

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

h,w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
elif (h%2==1) and (w%2==1):
    print(int((h * w // 2)+1))
else:
    print(int(h*w/2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))

for i in a:
    if i % 2 == 0:
        if (i % 3 == 0) or (i % 5 == 0):
            continue
        else:
            print('DENIED')
            sys.exit()

print('APPROVED')


Fixed submission:

import sys


N = int(input())
a = list(map(int, input().split()))

for i in a:
    if i % 2 == 0:
        if (i % 3 == 0) or (i % 5 == 0):
            continue
        else:
            print('DENIED')
            sys.exit()

print('APPROVED')
Buggy python submission (verdict: Runtime Error):

import math
H = int(input())


def iterated_power(z: int, n: int, mod=None) -> int:
    beta = bin(n)[2:]

    Z, q, t = z, 0, len(beta)
    while beta[t - q - 1] == '0':
        Z = Z * Z
        if mod is not None:
            Z = Z % mod
        q += 1
    result = Z

    for k in range(q + 1, t):
        Z = Z * Z
        if mod is not None:
            Z = Z % mod
        if beta[t - k - 1] == '1':
            result = result * Z
            if mod is not None:
                result = result % mod

    if mod is not None:
        result = result % mod

    return result

cnt = 0
while True:
    H = math.floor(H/2)
    cnt += 1
    if H ==1:
        break
cnt += 1

ans = iterated_power(2, cnt) - 1

print(ans)


Fixed submission:

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

if H % A == 0:
    print(int(H / A))
else:
    print((H // A)+1)
Buggy python submission (verdict: Runtime Error):

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

data = {}
ps = [0] * N
ACs = []

num_ac = 0
num_wa = 0


for i in range(M):
    p, S = input().split()
    p = int(p)

    if ps[p] == 0:
        ps[p] = 1
        data[p] = {'AC':0, 'WA':0}

    if S == 'AC' and data[p]['AC'] == 0:
        ACs.append(p)
        data[p]['AC'] += 1
        num_ac += 1
        num_wa += data[p]['WA']

    if S == 'WA' and data[p]['AC'] == 0:
        data[p][S] += 1

print(num_ac, num_wa)




Fixed submission:

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

data = {}
ps = [0] * N
ACs = []

num_ac = 0
num_wa = 0


for i in range(M):
    p, S = input().split()
    p = int(p) - 1

    if ps[p] == 0:
        ps[p] = 1
        data[p] = {'AC':0, 'WA':0}

    if S == 'AC' and data[p]['AC'] == 0:
        ACs.append(p)
        data[p]['AC'] += 1
        num_ac += 1
        num_wa += data[p]['WA']

    if S == 'WA' and data[p]['AC'] == 0:
        data[p][S] += 1

print(num_ac, num_wa)

Buggy python submission (verdict: Time Limit Exceeded):

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

data = {}
ps = []
ACs = []

num_ac = 0
num_wa = 0

for i in range(M):
    p, S = input().split()
    p = int(p)

    if not (p in ps):
        ps.append(p)
        data[p] = {'AC':0, 'WA':0}

    if S == 'AC' and data[p]['AC'] == 0:
        ACs.append(p)
        data[p]['AC'] += 1
        num_ac += 1
        num_wa += data[p]['WA']

    if S == 'WA' and data[p]['AC'] == 0:
        data[p][S] += 1

print(num_ac, num_wa)


Fixed submission:

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

data = {}
ps = [0] * N
ACs = []

num_ac = 0
num_wa = 0


for i in range(M):
    p, S = input().split()
    p = int(p) - 1

    if ps[p] == 0:
        ps[p] = 1
        data[p] = {'AC':0, 'WA':0}

    if S == 'AC' and data[p]['AC'] == 0:
        ACs.append(p)
        data[p]['AC'] += 1
        num_ac += 1
        num_wa += data[p]['WA']

    if S == 'WA' and data[p]['AC'] == 0:
        data[p][S] += 1

print(num_ac, num_wa)

Buggy python submission (verdict: Time Limit Exceeded):

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

data = {}
ps = []
ACs = []
for i in range(M):
    p, S = input().split()
    p = int(p)

    if not (p in ps):
        ps.append(p)
        data[p] = {'AC':0, 'WA':0}

    if S == 'AC' and data[p]['AC'] ==0:
        ACs.append(p)
        data[p]['AC'] += 1

    if S == 'WA' and data[p]['AC']==0:
        data[p][S] += 1

ans = 0
for p in ACs:
    ans += data[p]['WA']

print(len(ACs), ans)



Fixed submission:

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

data = {}
ps = [0] * N
ACs = []

num_ac = 0
num_wa = 0


for i in range(M):
    p, S = input().split()
    p = int(p) - 1

    if ps[p] == 0:
        ps[p] = 1
        data[p] = {'AC':0, 'WA':0}

    if S == 'AC' and data[p]['AC'] == 0:
        ACs.append(p)
        data[p]['AC'] += 1
        num_ac += 1
        num_wa += data[p]['WA']

    if S == 'WA' and data[p]['AC'] == 0:
        data[p][S] += 1

print(num_ac, num_wa)
Buggy python submission (verdict: Runtime Error):

N = int(input())
C = list(map(int, input().split()))
C.sort()

ans = 0
mod = 10**9 + 7

for l in range(N):
    r = N - l - 1
    if r > 0:
        ans += C[l] * (pow(2, r-1, mod) * r + pow(2, r, mod)) * pow(2, l, mod)
    else:
        ans += C[l] * (pow(2, r, mod)) * pow(2, l, mod)
        
print(int(ans * pow(2, N, mod)) % mod)




Fixed submission:

K, X = map(int, input().split())

if 500 * K >= X:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from itertools import permutations

N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

data = P.copy()
data.sort()

for idx, i in enumerate(list(permutations(data, N))):
    if list(i) == P:
        a = idx
    if list(i) == Q:
        b = idx

print(abs(a-b))


Fixed submission:
from itertools import permutations

N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

data = P.copy()
data.sort()

for idx, i in enumerate(list(permutations(data, N))):
    if list(i) == P:
        a = idx
    if list(i) == Q:
        b = idx

print(abs(a-b))
Buggy python submission (verdict: Runtime Error):
from functools import reduce
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))


def lcm(a,b):
    return int(a * b / gcd(a, b))

def gcd(a, b):
    import math
    return math.gcd(a, b)


def temp(a):
    return int(a * 0.5)

max_a = max(A)

i = 0
while True:
    num = int((i+0.5) * max_a)
    if num > M:
        print(0)
        sys.exit()

    found = True
    for a in A:
        if int(num - 0.5 * a) % a != 0:
            found = False
            break
    if found:
        ans = 1
        break
    i += 1

aa = reduce(lcm, A)

ans += (M - num) // aa

print(int(ans))


Fixed submission:
from functools import reduce
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))


def lcm(a,b):
    return int(a * b / gcd(a, b))

def gcd(a, b):
    import fractions
    return fractions.gcd(a, b)


def temp(a):
    return int(a * 0.5)

max_a = max(A)

i = 0
while True:
    num = int((i+0.5) * max_a)
    if num > M:
        print(0)
        sys.exit()

    found = True
    for a in A:
        if int(num - 0.5 * a) % a != 0:
            found = False
            break
    if found:
        ans = 1
        break
    i += 1

aa = reduce(lcm, A)

ans += (M - num) // aa

print(int(ans))
Buggy python submission (verdict: Runtime Error):

N = int(input())
C = list(map(int, input().split()))
C.sort()

ans = 0
mod = 10**9 + 7

for l in range(N):
    r = N - l - 1
    ans += C[l] * (pow(2, r-1, mod) * r + pow(2, r, mod)) * pow(2, l, mod)

print(int(ans * pow(2, N, mod)) % mod)




Fixed submission:

N = int(input())
C = list(map(int, input().split()))
C.sort()

ans = 0
mod = 10**9 + 7

for l in range(N):
    r = N - l - 1
    if r > 0:
        ans += C[l] * (pow(2, r-1, mod) * r + pow(2, r, mod)) * pow(2, l, mod)
    else:
        ans += C[l] * (pow(2, r, mod)) * pow(2, l, mod)
        
print(int(ans * pow(2, N, mod)) % mod)
Buggy python submission (verdict: Runtime Error):

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

print(int(a * b / math.gcd(a, b)))


Fixed submission:

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

print(int(a * b / fractions.gcd(a, b)))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# D-Knapsack

'''
3 8
3 30
4 50
5 60
'''

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

w, v = [None] * N, [None] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())

dp = [[None] * (W+1) for _ in range(N+1)]
dp[0] = [0] * (W+1)
# print(dp)

for i in range(N):
    for j in range(W + 1):
        if j >= w[i]:
            dp[i + 1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i])
        else:
            dp[i + 1][j] = dp[i][j]

# print(dp)
print(dp[N][W])


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

'''
3 8
3 30
4 50
5 60
'''

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

w, v = [None] * N, [None] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())

dp = [[None] * (W+1) for _ in range(N+1)]
dp[0] = [0] * (W+1)
# print(dp)

for i in range(N):
    for j in range(W + 1):
        if j >= w[i]:
            dp[i + 1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i])
        else:
            dp[i + 1][j] = dp[i][j]

# print(dp)
print(dp[N][W])
Buggy python submission (verdict: Runtime Error):
N=int(input())
l=list(map(int,input().split()))
if N==1:
    print("Yes")
elif N==2:
    if l[1]-l[0]<-2:
        print("No")
    else:
        print("Yes")
else:
    for i in range(N-1):
        if l[i+1]-l[i]<-2 or l[i]>l[i+1]>l[i+2]:
            print("No")
            break
        else:
            continue
    else:
        print("Yes")
    

Fixed submission:
N=int(input())
l=list(map(int,input().split()))
l[0]-=1

if N==1:
    print("Yes")
else:
    for i in range(N-1):
        if l[i]<l[i+1]:
            l[i+1]-=1
            continue
        elif l[i]>l[i+1]:
            print("No")
            break
        else:
            pass
    else:
        print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X_list = list(map(int, input().split()))

for i in range(N):
    tmp = X_list.copy()
    tmp.pop(i)
    tmp.sort()
    print(tmp[int(N/2)-1])

Fixed submission:
N = int(input())
X_list = list(map(int, input().split()))
tmp = X_list.copy()

tmp.sort()
a = tmp[int(N/2)-1]
b = tmp[int(N/2)]
for i in range(N):
    if(X_list[i] <= a):
        print(b)
    else:
        print(a)
Buggy python submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n;
    cin>>n;
    ll arr[n];
    map<ll,ll, greater<ll>>mp;
    for(ll i=0; i<n; i++ )
    {
        cin>>arr[i];
        mp[arr[i]]++;
    }
    ll c=0;
    ll ar=1;
    ll f=0;
    for(auto it=mp.begin(); it!=mp.end(); ++it)
    {
        ll s=it->second;
        if(c==0)
        {
            if(s>=4)
            {
                cout<<it->first*it->first<<endl;
                f=1;
                break;
            }
        }
        if(s>=2)
        {
            ar=ar*it->first;
            c++;
            if(c==2)
            {
                break;
            }
        }
    }
    if(c!=2&&f==0)
    {
        cout<<0<<endl;
    }
    else if(c==2&&f==0)
    {
        cout<<ar<<endl;
    }

}


Fixed submission:
n=int(input())
a=list(map(int,input().split(' ')))
x=0
y=0
a.sort()
a.reverse()
for i in range(len(a)-1):
    if a[i]==a[i+1]:
        x=a[i]
        p=i+1
        break
if x!=0:
    for i in range((p+1),len(a)-1):
        if a[i]==a[i+1]:
            y=a[i]
            break
print(x*y)

Buggy python submission (verdict: Runtime Error):
n=int(input()) a=list(map(int,input().split(' '))) x=0 y=0 a.sort() a.reverse() for i in range(len(a)-1): if a[i]==a[i+1]: x=a[i] p=i+1 break if x!=0: for i in range((p+1),len(a)-1): if a[i]==a[i+1]: y=a[i] break print(x*y)

Fixed submission:
n=int(input())
a=list(map(int,input().split(' ')))
x=0
y=0
a.sort()
a.reverse()
for i in range(len(a)-1):
    if a[i]==a[i+1]:
        x=a[i]
        p=i+1
        break
if x!=0:
    for i in range((p+1),len(a)-1):
        if a[i]==a[i+1]:
            y=a[i]
            break
print(x*y)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    return gcd(b, a % b)


inputs = input().strip().split()

N  = int(inputs[0])
X  = int(inputs[1])

xi = list(map(lambda x: abs(X - int(x)), input().strip().split()))

if N == 1:
    print(xi[0])
else:
    a = xi[0]
    b = xi[1]

    nx = gcd(a, b)

    for i in range(2, len(xi)):
        nx = gcd(nx, xi[i])     

    print(nx)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


inputs = input().strip().split()

N  = int(inputs[0])
X  = int(inputs[1])

xi = list(map(lambda x: abs(X - int(x)), input().strip().split()))

if N == 1:
    print(xi[0])
else:
    a = xi[0]
    b = xi[1]

    nx = gcd(a, b)

    for i in range(2, len(xi)):
        nx = gcd(nx, xi[i])     

    print(nx)
Buggy python submission (verdict: Time Limit Exceeded):
inputs = input().strip().split()

N = int(inputs[0])
K = int(inputs[1])

inputs = input().strip().split()
problem = list(map(lambda x: int(x), inputs))

ans = 10000000000000

if N == K:
    left = problem[0]
    right = problem[K - 1]
    if left * right >= 0:
        if abs(right) > abs(left):
            if ans > abs(right):
                ans = abs(right)
        else:
            if ans > abs(left):
                ans = abs(left)
    else:
        if abs(right) > abs(left):
            if ans > (2 * abs(left) + abs(right)):
                ans = (2 * abs(left) + abs(right))
        else:
            if ans > 2*abs(right)+abs(left):
                ans = 2*abs(right)+abs(left)
else:
    for i in range(N - K):
        part = problem[i:i+K]
        left = part[0]
        right = part[K - 1]
        if left * right >= 0:
            if abs(right) > abs(left):
                if ans > abs(right):
                    ans = abs(right)
            else:
                if ans > abs(left):
                    ans = abs(left)
        else:
            if abs(right) > abs(left):
                if ans > (2 * abs(left) + abs(right)):
                    ans = (2 * abs(left) + abs(right))
            else:
                if ans > 2*abs(right)+abs(left):
                    ans = 2*abs(right)+abs(left)

print(ans)

Fixed submission:
inputs = input().strip().split()

N = int(inputs[0])
K = int(inputs[1])

inputs = input().strip().split()
problem = list(map(lambda x: int(x), inputs))

ans = 10000000000000000000000000

if N == K:
    left = problem[0]
    right = problem[K - 1]
    if left * right >= 0:
        if abs(right) > abs(left):
            if ans > abs(right):
                ans = abs(right)
        else:
            if ans > abs(left):
                ans = abs(left)
    else:
        if abs(right) > abs(left):
            if ans > (2 * abs(left) + abs(right)):
                ans = (2 * abs(left) + abs(right))
        else:
            if ans > 2*abs(right)+abs(left):
                ans = 2*abs(right)+abs(left)
else:
    for i in range(N - K + 1):
        left = problem[i]
        right = problem[i+K-1]
        if left * right >= 0:
            if abs(right) > abs(left):
                if ans > abs(right):
                    ans = abs(right)
            else:
                if ans > abs(left):
                    ans = abs(left)
        else:
            if abs(right) > abs(left):
                if ans > (2 * abs(left) + abs(right)):
                    ans = (2 * abs(left) + abs(right))
            else:
                if ans > 2*abs(right)+abs(left):
                    ans = 2*abs(right)+abs(left)

print(ans)
Buggy python submission (verdict: Runtime Error):
inputs = input()

yoko = int(inputs[0])
tate = int(inputs[1])

print((yoko - 1) * (tate - 1))

Fixed submission:
inputs = input().strip().split()

yoko = int(inputs[0])
tate = int(inputs[1])

print((yoko - 1) * (tate - 1))
Buggy python submission (verdict: Runtime Error):
inputs  input()
R = int(inputs)

if R < 1200:
    print("ARC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Fixed submission:
inputs = input()
R = int(inputs)

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")