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

import sys

def log(*args, **kwargs):
    print(*args, **kwargs, file=sys.stderr)

log("hogehoge")

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

print(max(a*b, a+b, a-b))

Fixed submission:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

a,b = get_nums_l()
print(max(a+b, a-b, a*b))

Buggy python submission (verdict: Runtime Error):

import sys

def log(*args, **kwargs):
    print(*args, **kwargs, file=sys.stderr)

log("hogehoge")

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

print(max(a*b, a+b, a-b))

Fixed submission:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

a,b = get_nums_l()
print(max(a+b, a-b, a*b))
Buggy python submission (verdict: Runtime Error):
5
2 5 2
2 3 10
1 3 8
3 4 2

Fixed submission:
from collections import deque
import math
from functools import reduce

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n = int(input())
ans = [-1] * n
ans[0] = 0

edges = [ [] for _ in range(n)]
for i in range(n-1):
    u,v,w = get_nums_l()
    edges[u-1].append([v-1,w%2==0])
    edges[v-1].append([u-1,w%2==0])

def aaa(x):
    # xを含むエッジ

    # breakpoint()

    for edge in edges[x]:
        to = edge[0] # edgeのうちxじゃないほう
        if ans[to] != -1:
            continue
        same = edge[1]
        ans[to] = ans[x] ^ (not same)

        queue.append(to)

queue = deque()
queue.append(0)
while queue:
    aaa(queue.popleft())
for annn in ans:
    print(annn)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n = int(input())
ans = [-1] * n
ans[0] = 0

edges = [[]]*n
for i in range(n-1):
    u,v,w = get_nums_l()
    edges[u-1].append([v-1,w%2==0])
    edges[v-1].append([u-1,w%2==0])

def aaa(x):
    # xを含むエッジ

    for edge in edges[x]:
        to = edge[0] # edgeのうちxじゃないほう
        if ans[to] != -1:
            continue
        same = edge[1]
        ans[to] = ans[x] ^ (not same)

        aaa(x)
aaa(0)
for annn in ans:
    print(annn)

Fixed submission:
from collections import deque
import math
from functools import reduce

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n = int(input())
ans = [-1] * n
ans[0] = 0

edges = [ [] for _ in range(n)]
for i in range(n-1):
    u,v,w = get_nums_l()
    edges[u-1].append([v-1,w%2==0])
    edges[v-1].append([u-1,w%2==0])

def aaa(x):
    # xを含むエッジ

    # breakpoint()

    for edge in edges[x]:
        to = edge[0] # edgeのうちxじゃないほう
        if ans[to] != -1:
            continue
        same = edge[1]
        ans[to] = ans[x] ^ (not same)

        queue.append(to)

queue = deque()
queue.append(0)
while queue:
    aaa(queue.popleft())
for annn in ans:
    print(annn)
Buggy python submission (verdict: Time Limit Exceeded):
def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

r,g,b,n = get_nums_l()

ans = 0
for ra in range(n//r + 1):
    for ga in range(n//g + 1):
        now = r * ra + g * ga
        nokori = n - now
        if nokori >= 0 and nokori % b == 0:
            ans += 1

print(ans)

Fixed submission:
def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

r,g,b,n = get_nums_l()

ans = 0
for ra in range(n//r + 1):
    for ga in range(n//g + 1):
        now = r * ra + g * ga
        nokori = n - now
        if nokori >= 0 and nokori % b == 0:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
tmp=input().sprit(" ")
a = int(tmp[0])
b = int(tmp[1])

if a == b:
    print (a*2)
else:
    print (max(a,b)*2-1)


Fixed submission:
tmp=input().split(" ")
a = int(tmp[0])
b = int(tmp[1])

if a == b:
    print (a*2)
else:
    print (max(a,b)*2-1)

Buggy python submission (verdict: Runtime Error):
tmp=input().sprit(" ")
a = int(tmp[0])
b = int(tmp[1])

if a = b:
    print (a*2)
else:
    print (max(a,b)*2-1)


Fixed submission:
tmp=input().split(" ")
a = int(tmp[0])
b = int(tmp[1])

if a == b:
    print (a*2)
else:
    print (max(a,b)*2-1)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
nums = reversed([ int(s) for s in input().split(" ")])

pass_n = set([2])
for n in nums:

    # pass_n = このラウンドを通過する人数として可能性のある候補

    new_pass_n = set()
    # pass_n人通過させることが可能か？
    found=False
    for p in pass_n:
        if p % n == 0:
            # 可能
            found = True
            # このラウンドに進出する人数として可能性のある候補
            for i in range(n):
                new_pass_n.add(p + i)
            
    if not found:
        # 不可能
        print(-1)
        exit()

    pass_n = new_pass_n

print(min(pass_n), max(pass_n))

Fixed submission:
k = int(input())
nums = reversed([ int(s) for s in input().split(" ")])

pass_min = 2
pass_max = 2
for n in nums:

    # pass_min = このラウンドを通過する人数の下限
    # pass_max = このラウンドを通過する人数の上限

    # pass_min以上の最小のnの倍数
    aaa = pass_min + (n - pass_min % n) % n

    # pass_max以下の最大のnの倍数
    bbb = pass_max - pass_max % n

    # 不可能チェック
    if aaa > pass_max or bbb < pass_min:
        print(-1)
        exit()
    
    pass_min = aaa
    pass_max = bbb + (n - 1)

print(pass_min, pass_max)
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

def log(*args, **kwargs):
    print(*args, **kwargs, file=sys.stderr)


n = int(input())
lines = sys.stdin.readlines()
edges = [ [] for _ in range(n+1) ]
for i in range(n-1):
    e = tuple(map(int, lines[i].split(" ")))
    log(e)
    edges[e[0]].append((e[1],e[2]))
    edges[e[1]].append((e[0],e[2]))

q,k = map(int, lines[n-1].split(" "))

ddd = [0] * (n+1)


que = deque()
que.append(k)
def bfs(x):
    for y, d in edges[x]:
        if ddd[y]:
            continue
        ddd[y] = ddd[x] + d
        que.append(y)


while que:
    bfs(que.pop())

for i in range(n, n+q):
    x, y = map(int, lines[i].split(" "))
    log(x,y)
    print(ddd[x] + ddd[y])


Fixed submission:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

def log(*args):
    print(*args, file=sys.stderr)


n = int(input())
lines = sys.stdin.readlines()
edges = [ [] for _ in range(n+1) ]
for i in range(n-1):
    e = tuple(map(int, lines[i].split(" ")))
    log(e)
    edges[e[0]].append((e[1],e[2]))
    edges[e[1]].append((e[0],e[2]))

q,k = map(int, lines[n-1].split(" "))

ddd = [0] * (n+1)


que = deque()
que.append(k)
def bfs(x):
    for y, d in edges[x]:
        if ddd[y]:
            continue
        ddd[y] = ddd[x] + d
        que.append(y)


while que:
    bfs(que.pop())

for i in range(n, n+q):
    x, y = map(int, lines[i].split(" "))
    log(x,y)
    print(ddd[x] + ddd[y])
Buggy python submission (verdict: Runtime Error):
s = input()
print(s[0] + (len(s)-2) + s[-1])

Fixed submission:
s = input()
print(s[0] + str(len(s)-2) + s[-1])
Buggy python submission (verdict: Runtime Error):
cost = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
def solve(yoshida, possible, dp):
    if(yoshida == 0):
        dp[0] = 0
    elif(dp[yoshida] == -1):
        for x in possible:
            if(yoshida >= cost[x]):
                idx = yoshida - cost[x]
                solve(idx, possible, dp)
                a = (dp[idx]) * 10 + x
                dp[yoshida] = max(dp[yoshida], a)

if __name__ == '__main__':
    n, m = map(int, input().split())
    lst = list(map(int, input().split(" ")))
    DP = [-1] * (n + 1)
    solve(n, lst, DP)
    '''
    for i in range(n + 1):
        print("{} : {}".format(i, DP[i]))
    '''
    print(DP[n])


Fixed submission:
cost = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

''' 再帰が深すぎて, 再起不能
def solve(yoshida, possible, dp):
    if(yoshida == 0):
        dp[0] = 0
    elif(dp[yoshida] == -1):
        for x in possible:
            if(yoshida >= cost[x]):
                idx = yoshida - cost[x]
                solve(idx, possible, dp)
                a = (dp[idx]) * 10 + x
                dp[yoshida] = max(dp[yoshida], a)
'''

def solve(yoshida, possible, dp):
    dp[0] = 0
    for i in range(n):
        a = 10 * dp[i]
        for x in possible:
            dp[i + cost[x]] = max(dp[i + cost[x]], a + x)
if __name__ == '__main__':
    n, m = map(int, input().split())
    lst = list(map(int, input().split(" ")))
    DP = [-1] * (n + 10)
    solve(n, lst, DP)
    '''
    for i in range(n + 1):
        print("{} : {}".format(i, DP[i]))
    '''
    print(DP[n])

Buggy python submission (verdict: Runtime Error):
# Pythonで楽々いけちゃったりしないかな？
cost = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
def solve(yoshida, possible, dp):
    if(yoshida == 0):
        dp[0] = 0
        return 0
    if(dp[yoshida] != -1):
        return dp[yoshida]
    for x in possible:
        if(yoshida >= cost[x]):
            if(solve(yoshida - cost[x], possible, dp) != -2):
                a = dp[yoshida - cost[x]] * 10 + x
                dp[yoshida] = max(dp[yoshida], a)
    if(dp[yoshida] == -1):
        dp[yoshida] = -2
    return dp[yoshida]

if __name__ == '__main__':
    n, m = map(int, input().split())
    lst = list(map(int, input().split()))
    DP = [-1] * (n + 1)
    print(solve(n, lst, DP))
    '''
    for i in range(n + 1):
        print("{} : {}".format(i, solve(i, lst, DP)))
    '''

Fixed submission:
cost = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

''' 再帰が深すぎて, 再起不能
def solve(yoshida, possible, dp):
    if(yoshida == 0):
        dp[0] = 0
    elif(dp[yoshida] == -1):
        for x in possible:
            if(yoshida >= cost[x]):
                idx = yoshida - cost[x]
                solve(idx, possible, dp)
                a = (dp[idx]) * 10 + x
                dp[yoshida] = max(dp[yoshida], a)
'''

def solve(yoshida, possible, dp):
    dp[0] = 0
    for i in range(n):
        a = 10 * dp[i]
        for x in possible:
            dp[i + cost[x]] = max(dp[i + cost[x]], a + x)
if __name__ == '__main__':
    n, m = map(int, input().split())
    lst = list(map(int, input().split(" ")))
    DP = [-1] * (n + 10)
    solve(n, lst, DP)
    '''
    for i in range(n + 1):
        print("{} : {}".format(i, DP[i]))
    '''
    print(DP[n])
Buggy python submission (verdict: Time Limit Exceeded):
import math
if __name__ == "__main__":
    n, p = map(int, input().split())
    res = 1
    sup = math.ceil(p ** (1 / n))
    i = 2
    while(i <= sup and i <= p):
        if p % i == 0:
            k = 1
            p /= i
            while(p % i == 0):
                p /= i
                k += 1
            if k >= n:
                for s in range(k // n):
                    res *= i
        i += 1
    print(res)

Fixed submission:
import math
if __name__ == "__main__":
    n, p = map(int, input().split())
    if n == 1:
        print(p)
    else:
        res = 1
        sup = math.ceil(p ** (1 / n))
        i = 2
        while(i <= sup and i <= p):
            if p % i == 0:
                k = 1
                p /= i
                while(p % i == 0):
                    p /= i
                    k += 1
                if k >= n:
                    for s in range(k // n):
                        res *= i
            i += 1
        print(res)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = tmp
        tmpa = i
print(tmpa + 1)
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = temp
        tmpa = i
print(tmpa + 1)


Fixed submission:
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = temp
        tmpa = i
print(tmpa + 1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    if temp < tmp:
        tmp = tmp
        tmpa = i
print(tmpa + 1)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = temp
        tmpa = i
print(tmpa + 1)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from math import gcd

def LGcd(l):
    a = l[0]
    for i in range(1,len(l)):
        a = gcd(a,l[i])
    return a
N, X = map(int,input().split())
k = np.array(input().split())
k = k.astype(np.int64)
k -= X
if N == 1:
    print(str(abs(k[0])))
else:
    print(str(LGcd(k)))

Fixed submission:
# 正の数を受け取るように定義
def gcd(a,b):
    if b == 0:
        return a 
    return gcd(b,a % b)

N, X = map(int,input().split())
k = [abs(int(x) - X) for x in input().split()] # リスト内包表記で入力の受け取り
a = k[0]
for i in range(1,N):
    a = gcd(a,k[i])
print(str(a))

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

def LGcd(l):
    a = l[0]
    for i in range(1,len(l)):
        a = gcd(a,l[i])
    return a
N, X = map(int,input().split())
k = np.array(input().split())
k = k.astype(np.int32)
k -= X
if N == 1:
    print(str(abs(k[0])))
else:
    print(str(LGcd(k)))

Fixed submission:
# 正の数を受け取るように定義
def gcd(a,b):
    if b == 0:
        return a 
    return gcd(b,a % b)

N, X = map(int,input().split())
k = [abs(int(x) - X) for x in input().split()] # リスト内包表記で入力の受け取り
a = k[0]
for i in range(1,N):
    a = gcd(a,k[i])
print(str(a))

Buggy python submission (verdict: Runtime Error):
import numpy as np
from math import gcd
from functools import reduce
def LGcd(l):
    a = l[0]
    for i in range(1,len(l)):
        a = gcd(a,l[i])
    return a
N, X = map(int,input().split())
k = np.array(input().split())
k = k.astype(np.int32)
k -= X
if N == 1:
    print(str(abs(k[0])))
else:
    print(str(LGcd(k)))

Fixed submission:
# 正の数を受け取るように定義
def gcd(a,b):
    if b == 0:
        return a 
    return gcd(b,a % b)

N, X = map(int,input().split())
k = [abs(int(x) - X) for x in input().split()] # リスト内包表記で入力の受け取り
a = k[0]
for i in range(1,N):
    a = gcd(a,k[i])
print(str(a))

Buggy python submission (verdict: Runtime Error):
import numpy as np
from math import gcd
from functools import reduce
def LGcd(l):
    return reduce(gcd,l)
N, X = map(int,input().split())
k = np.array(input().split())
k = k.astype(np.int32)
k -= X
if N == 1:
    print(str(abs(k[0])))
else:
    print(str(LGcd(k)))

Fixed submission:
# 正の数を受け取るように定義
def gcd(a,b):
    if b == 0:
        return a 
    return gcd(b,a % b)

N, X = map(int,input().split())
k = [abs(int(x) - X) for x in input().split()] # リスト内包表記で入力の受け取り
a = k[0]
for i in range(1,N):
    a = gcd(a,k[i])
print(str(a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = [int(x) for x in input().split()]
a = 0
for i in range(n):
    lst[i] = lst[i] - (i + 1)
lst.sort()
def sum(k):
    a = 0
    for i in range(n):
        a += abs(lst[i]-k)
    return a
ans = 0
if ans % 2 == 0:
    ans = min([sum(lst[int(n/2)]),sum(lst[int(n/2)+1])])
else:
    ans = sum(lst[int(n/2)+1])
print(str(ans))

Fixed submission:
n = int(input())
lst = [int(x) for x in input().split()]
a = 0
for i in range(n):
    lst[i] = lst[i] - (i + 1)
lst.sort()
def sum(k):
    a = 0
    for i in range(n):
        a += abs(lst[i]-k)
    return a
ans = 0
if ans % 2 == 0:
    ans = min([sum(lst[int(n/2)-1]),sum(lst[int(n/2)])])
else:
    ans = sum(lst[int(n/2)])
print(str(ans))

Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = [int(x) for x in input().split()]
a = 0
for i in range(n):
    lst[i] = lst[i] - (i + 1)
def sum(k):
    a = 0
    for i in range(n):
        a += abs(lst[i]-k)
    return a
ans = min([sum(lst[int(n/2)]),sum(lst[int(n/2)+1])])
print(str(ans))

Fixed submission:
n = int(input())
lst = [int(x) for x in input().split()]
a = 0
for i in range(n):
    lst[i] = lst[i] - (i + 1)
lst.sort()
def sum(k):
    a = 0
    for i in range(n):
        a += abs(lst[i]-k)
    return a
ans = 0
if ans % 2 == 0:
    ans = min([sum(lst[int(n/2)-1]),sum(lst[int(n/2)])])
else:
    ans = sum(lst[int(n/2)])
print(str(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
t1 = 0
x1 = 0
y1 = 0
boolean = True

for _ in range(n):
    t, x, y = [int(_) for _ in input().split()]
    if boolean:
        temp1 = x
        temp2 = t
        x = abs(x - x1) + abs(y - y1)
        t -= t1
        x1 = temp
        y1 = y
        t1 = temp2
        if x > t or (x + t) % 2 == 1:
            boolean = False
if boolean:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np
n = int(input())
T = []
X = []
Y = []
t1 = 0
x1 = 0
y1 = 0
for i in range(n):
    m = input().split()
    T.append(int(m[0]) - t1)
    t1 = int(m[0])
    X.append(abs(int(m[1]) - x1))
    x1 = int(m[1])
    Y.append(abs(int(m[2]) - y1))
    y1 = int(m[2])
T = np.array(T)
X = np.array(X)
Y = np.array(Y)
for i in range(n):
    if X[i] + Y[i] > T[i] or (X[i] + Y[i] + T[i]) % 2 == 1:
        print('No')
        break
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
res = min(n * a, b)
print(res)

Fixed submission:
n, a, b = map(int, input().split())
print(min(n * a, b))
Buggy python submission (verdict: Runtime Error):
N , K = map(int,input().split())
lst = []
for i in range(K):
    lst.append(input())
start = N
while True:
    for num in str(start):
        if num in lst:
            break
    else:
        break
    start += 1
print(str(start))

Fixed submission:
N , K = map(int,input().split())
lst = input().split()

start = N
while True:
    for num in str(start):
        if num in lst:
            break
    else:
        break
    start += 1
print(str(start))
Buggy python submission (verdict: Time Limit Exceeded):
l = input().split()

res = 'a'

for a in range(int(l[0]),int(l[1])+1):
    for b in range(int(l[2]),int(l[3])+1):
        tmp = a * b
        if res == 'a':
            res = tmp
        if res < tmp:
            res = tmp

print(res)
        

Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])
c = int(l[2])
d = int(l[3])
r = []
r.append(a*c)
r.append(a*d)
r.append(b*c)
r.append(b*d)
print(max(r))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def std_in():
    return sys.stdin.readline().strip()


def calc_score(a, f, e):
    score = 1

    for i in range(f, e):
        score *= a[i]
    return score


def main():
    n, k = get_ints()
    a = list(get_ints())

    score = calc_score(a, 0, k)

    for i in range(k, n):
        if a[i-k] == 0:
            n_score = calc_score(a, i-k+1, i+1)
        else:
            n_score = int(score / a[i-k] * a[i])

        if n_score > score:
            print("Yes")
        else:
            print("No")
        score = n_score


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def main():
    n, k = get_ints()
    a = list(get_ints())

    for i in range(k, n):
        if a[i] > a[i-k]:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def std_in():
    return sys.stdin.readline().strip()


def calc_score(a, f, e):
    score = 1

    for i in range(f, e):
        score *= a[i]
    return score


def main():
    n, k = get_ints()
    a = list(get_ints())

    score = calc_score(a, 0, k)

    for i in range(k, n):
        if a[i-k] == 0:
            n_score = calc_score(a, i-k+1, i+1)
        else:
            n_score = int(score / a[i-k] * a[i])

        if n_score > score:
            print("Yes")
        else:
            print("No")
        score = n_score


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def main():
    n, k = get_ints()
    a = list(get_ints())

    for i in range(k, n):
        if a[i] > a[i-k]:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def _main():
    input()
    an = list(get_ints())

    t = 0
    old = 1000000000
    while 1:
        ans = sq(t, an)
        g = sq(t+1, an) - ans
        t -= g / abs(g)
        if old > ans:
            old = ans
        else:
            break
    print(int(old))


def sq(t, an):
    ans = 0
    for ai in an:
        ans += pow(ai - t, 2)
    return ans


if __name__ == "__main__":
    _main()


Fixed submission:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def std_in():
    return sys.stdin.readline().strip()


def _main():
    N = int(std_in())
    r = range(1, N + 1)
    print(sum(r))


if __name__ == "__main__":
    _main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def input():
    return sys.stdin.readline().strip()


def _main():
	input()
    s = sorted(list(input().split()))
    print("".join(s))


if __name__ == "__main__":
    _main()


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

s = input()
if s.count("5") == 2 and s.count("7") == 1:
	print("YES")
else:
  	print("NO")