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

lines = sys.stdin.read().rstrip().split("\n")
n, m = [int(x) for x in lines[0].split(" ")]

result = set(lines[1].split(" ")[1:])

if len(lines) == 2:
  print(len(result))
else:
  for x in range lines[2:]:
    result = result & set(x.split(" ")[1:])
  print(len(result))
  

Fixed submission:
import sys
 
lines = sys.stdin.read().rstrip().split("\n")
n, m = [int(x) for x in lines[0].split(" ")]
 
result = set(lines[1].split(" ")[1:])
 
if len(lines) == 2:
  print(len(result))
else:
  for x in lines[2:]:
    result = result & set(x.split(" ")[1:])
  print(len(result))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

n = int(input())
return n * (n + 1) // 2

Fixed submission:
# coding: utf-8

n = int(input())
print(n * (n + 1) // 2)
Buggy python submission (verdict: Runtime Error):
import sys
import queue

def ni():
    return int(sys.stdin.readline())


def nia():
    data = sys.stdin.readline().split(' ')
    return [int(g) for g in data]


n = ni()
graph = []
for i in range(0, n):
    graph.append([])

for i in range(1, n):
    a, b = nia()
    a = a - 1
    b = b - 1

    graph[a].append(b)
    graph[b].append(a)


q = queue.Queue()
q.put(0)
visited = set()
visited.add(0)
last = 0
while not q.empty():
    n = q.get()
    last = n
    for nb in graph[n]:
        if nb not in visited:
            visited.add(nb)
            q.put(nb)

diam = 0
visited = set()
next = [(last, 0)]
while next:
    ind, x = next.pop()
    diam = max(diam, x)
    for nb in graph[ind]:
        if nb not in visited:
            visited.add(nb)
            next.append((nb, x + 1))


if (diam + 1) % 3 == 2:
    print 'Second'
else:
    print 'First'



Fixed submission:
import sys
from collections import deque

def ni():
    return int(sys.stdin.readline())


def nia():
    data = sys.stdin.readline().split(' ')
    return [int(g) for g in data]

n = ni()
graph = []
for i in range(0, n):
    graph.append([])

for i in range(1, n):
    a, b = nia()
    a = a - 1
    b = b - 1

    graph[a].append(b)
    graph[b].append(a)


q = deque()
q.append(0)
visited = set()
visited.add(0)
last = 0
while q:
    n = q.popleft()
    last = n
    for nb in graph[n]:
        if nb not in visited:
            visited.add(nb)
            q.append(nb)

diam = 0
visited = set()
next = [(last, 0)]
while next:
    ind, x = next.pop()
    diam = max(diam, x)
    for nb in graph[ind]:
        if nb not in visited:
            visited.add(nb)
            next.append((nb, x + 1))

if (diam + 1) % 3 == 2:
    print 'Second'
else:
    print 'First'
Buggy python submission (verdict: Runtime Error):
import math

r = int(input('整数r(1<=r<=100)を入力 >>')
arear = r * r * math.pi
area1 = 1 * 1 * math.pi

nanbai = arear / area1
print('半径{}の円の面積は半径1の円の面積の{}倍です',r,nanbai)

Fixed submission:
r = int(input())
print(r**2)
Buggy python submission (verdict: Runtime Error):
N,K,X,Y= map(int, input().split())
yen1 = K * X
yen2 = (N - K) * Y
print(yen1 + yen2)

Fixed submission:
N,K,X,Y= [int(input()) for i in range (4)]
if N > K:
    yen1 = K * X
    yen2 = (N - K) * Y
    print(yen1 + yen2)
else:
    print(N * X)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = set(input().split())
while True:
    L = list(str(N))
    for i in L:
        if i in S:
            break
    else:
        break
    N += 1
print(N)

Fixed submission:
x = list(map(int, input().split()))
x.sort()
print('YES' if x == [5,5,7] else 'NO')
Buggy python submission (verdict: Runtime Error):
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
if q+r<p+r and q+r<p+q:
    print(q+r)

Fixed submission:
p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)

Buggy python submission (verdict: Runtime Error):
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
else:
    print(q+r)



Fixed submission:
p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)

Buggy python submission (verdict: Runtime Error):
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if q+r<p+q and p+r<q+r:
    print(p+r)
else:
    print(q+r)



Fixed submission:
p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)

Buggy python submission (verdict: Runtime Error):
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
else:
    print(q+r)



Fixed submission:
p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)

Buggy python submission (verdict: Runtime Error):
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)

else:
    print(q+r)



Fixed submission:
p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)
Buggy python submission (verdict: Runtime Error):
S = input()
out = ""

for i in range(S.len()):
  out += "x"

print(out)

Fixed submission:
S = input()

tmp = ""

for i in range(len(S)):
  tmp += "x"

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

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

"""
任意の2組みの数字の符号を変えることができる
したがって負の数が偶数個の場合全てを正にして総和をとれば良い
負の数が奇数個の場合絶対値の最小のもののみ負にして総和をとればよい
0が存在する場合はすべて正にできる
"""

A_abs = np.abs(A)

if 0 in A:
    print(np.sum(A_abs))

else:
    num = 0
    for i in range(N):
        if A[i] < 0:
            num += 1

    if num % 2 == 0:
        print(np.sum(A_abs))
    else:
        print(np.sum(A_abs) - 2 * min(A_abs))



Fixed submission:
A, B, T = map(int, input().split())

N = 1
for i in range(100):
    if N * A > T + 0.5:
        N -= 1
        break

    N += 1

ret = N * B
print(ret)
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

"""
任意の2組みの数字の符号を変えることができる
したがって負の数が偶数個の場合全てを正にして総和をとれば良い
負の数が奇数個の場合絶対値の最小のもののみ負にして総和をとればよい
0が存在する場合はすべて正にできる
"""

A_abs = np.abs(A)

if 0 in A:
    print(np.sum(A_abs))

else:
    num = 0
    for i in range(N):
        if A[i] < 0:
            num += 1

    if num % 2 == 0:
        print(np.sum(A_abs))
    else:
        print(np.sum(A_abs) - 2 * min(A_abs))

Fixed submission:
import numpy as np

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

"""
任意の2組みの数字の符号を変えることができる
したがって負の数が偶数個の場合全てを正にして総和をとれば良い
負の数が奇数個の場合絶対値の最小のもののみ負にして総和をとればよい
0が存在する場合はすべて正にできる
"""

A_abs = np.abs(A)

if 0 in A:
    print(np.sum(A_abs))

else:
    num = 0
    for i in range(N):
        if A[i] < 0:
            num += 1

    if num % 2 == 0:
        print(np.sum(A_abs))
    else:
        print(np.sum(A_abs) - 2 * min(A_abs))
Buggy python submission (verdict: Runtime Error):
N = int(input())
Hs = map(int, input().split())

"""
SEA H_1 H_2 H_3 H_4 ... H_N
"""

# 0 ~ i番目の旅館のうち最も高いもの
# max(Hs[0:i+1])

ret = 0
for i in range(N):
    if Hs[i] == max(Hs[0:i+1]):
        ret += 1

print(ret)

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

"""
SEA H_1 H_2 H_3 H_4 ... H_N
"""

# 0 ~ i番目の旅館のうち最も高いもの
# max(Hs[0:i+1])

ret = 0
for i in range(N):
    if Hs[i] == max(Hs[0:i+1]):
        ret += 1

print(ret)

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

"""
SEA H_1 H_2 H_3 H_4 ... H_N
"""

# 0 ~ i番目の旅館のうち最も高いもの
# max(Hs[0:i+1])

ret = 0
for i in range(N):
    if Hs[i] == max(0:i+1):
        ret += 1

print(ret)

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

"""
SEA H_1 H_2 H_3 H_4 ... H_N
"""

# 0 ~ i番目の旅館のうち最も高いもの
# max(Hs[0:i+1])

ret = 0
for i in range(N):
    if Hs[i] == max(Hs[0:i+1]):
        ret += 1

print(ret)

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

"""
SEA H_1 H_2 H_3 H_4 ... H_N
"""

# 0 ~ i番目の旅館のうち最も高いもの
# max(Hs[0:i+1])

ret = 0
for i in range(N):
    elif Hs[i] == max(0:i+1):
        ret += 1

print(ret)

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

"""
SEA H_1 H_2 H_3 H_4 ... H_N
"""

# 0 ~ i番目の旅館のうち最も高いもの
# max(Hs[0:i+1])

ret = 0
for i in range(N):
    if Hs[i] == max(Hs[0:i+1]):
        ret += 1

print(ret)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

num = A

if num >= B:
    num = B
else:
    continue

if num >= C:
    num = C
else: 
    continue

if num >= D:
    num = D
else: 
    continue

if num >= E:
    num = E
else: 
    continue

if N % num == 0:
    print(N // num + 4)
else:
    print((N + 1) // num + 4)

Fixed submission:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

num = N

if num >= A:
    num = A 

if num >= B:
    num = B

if num >= C:
    num = C

if num >= D:
    num = D

if num >= E:
    num = E

if N % num == 0:
    print(N // num + 4)
else:
    print(N // num + 5)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from copy import copy

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

# 時刻nに都市xにいる人数をI_x_n, 都市xで載せられる人数をJ_xとする
# I_x_n+1_prov = I_x_n - J_x (if I_x_n >= J_x)
# I_x_n+1_prov = 0           (if I_x_n < J_x)
# I_x_n+1 = I_x_n+1_prov + I_x-1_n (if I_x-1_n <= J_x-1)
# I_x_n+1 = I_x_n+1_prov+ J_x-1    (if I_x-1_n > J_x-1)
# 都市6の人数がNになった時が求める時刻である

# 以下仮想の都市0を加える
I = [0, N, 0, 0, 0, 0, 0]
I_buf = [0, 0, 0, 0, 0, 0, 0]
J = [0, A, B, C, D, E, 0]

time = 0
while(True):
    if sum(I) != N:
        sys.exit()
    if I[6] == N:
        print(time)
        break
    time += 1
    for num in range(1, 7, 1):
        if I[num] > J[num]:
            I_buf[num] = I[num] - J[num]
        else:
            I_buf[num] = 0

        if I[num - 1] > J[num - 1]:
            I_buf[num] += J[num - 1]
        else:
            I_buf[num] += I[num - 1]
    I = copy(I_buf)

Fixed submission:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

num = N

if num >= A:
    num = A 

if num >= B:
    num = B

if num >= C:
    num = C

if num >= D:
    num = D

if num >= E:
    num = E

if N % num == 0:
    print(N // num + 4)
else:
    print(N // num + 5)
Buggy python submission (verdict: Runtime Error):
# N A B C
# l1
# l2
# ...

(N, A, B, C) = (int(input().split()[i]) for i in range(4))
L = []
for i in range(N):
    l = int(input())
    L.append(l)
# N = 5
# A = 100
# B = 90
# C = 80
# L = [98, 40, 30, 21, 80]

def recur_function(a, b, c, n):
    if n == N:
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else 10**9
    ret0 = recur_function(a + L[n], b, c, n + 1) + 10 if a > 0 else recur_function(a + L[n], b, c, n + 1)
    ret1 = recur_function(a, b + L[n], c, n + 1) + 10 if b > 0 else recur_function(a, b + L[n], c, n + 1)
    ret2 = recur_function(a, b, c + L[n], n + 1) + 10 if c > 0 else recur_function(a, b, c + L[n], n + 1)
    ret3 = recur_function(a, b, c, n + 1)
    return min(ret0, ret1, ret2, ret3)

print(recur_function(0, 0, 0, 0))

Fixed submission:
S = input()
S_split = S.split("/")
(year, month, day) = (int(S_split[i]) for i in range(3))

if month > 4:
    print("TBD")

else:
    print("Heisei")

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = []
U = []
for i in range(N):
    I = input().split()
    (x, u) = (int(I[0]), I[1])
    X.append(x)
    U.append(u)

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Fixed submission:
S = input()
S_split = S.split("/")
(year, month, day) = (int(S_split[i]) for i in range(3))

if month > 4:
    print("TBD")

else:
    print("Heisei")

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = []
U = []
for i in range(N):
    I = input().split()
    (x, u) = (int(I[0]), I[1])
    X[i] = x
    U[i] = u

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Fixed submission:
S = input()
S_split = S.split("/")
(year, month, day) = (int(S_split[i]) for i in range(3))

if month > 4:
    print("TBD")

else:
    print("Heisei")

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = []
U = []
for i in range(N):
    (x, u) = int(input().split())
    X[i] = x
    U[i] = u

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Fixed submission:
S = input()
S_split = S.split("/")
(year, month, day) = (int(S_split[i]) for i in range(3))

if month > 4:
    print("TBD")

else:
    print("Heisei")
Buggy python submission (verdict: Runtime Error):
N = input()
X = []
U = []
for i in range(N):
    (x, u) = int(input().split())
    X[i] = x
    U[i] = u

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Fixed submission:
N = int(input())
X = []
U = []
for i in range(N):
    I = input().split()
    (x, u) = (float(I[0]), I[1])
    X.append(x)
    U.append(u)

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)
Buggy python submission (verdict: Runtime Error):
# N A B C
# l1
# l2
# ...

(N, A, B, C) = int(input().split())
L = []
for i in range(N):
    l = int(input())
    L.append(l)
# N = 5
# A = 100
# B = 90
# C = 80
# L = [98, 40, 30, 21, 80]

def recur_function(a, b, c, n):
    if n == N:
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else 10**9
    ret0 = recur_function(a + L[n], b, c, n + 1) + 10 if a > 0 else recur_function(a + L[n], b, c, n + 1)
    ret1 = recur_function(a, b + L[n], c, n + 1) + 10 if b > 0 else recur_function(a, b + L[n], c, n + 1)
    ret2 = recur_function(a, b, c + L[n], n + 1) + 10 if c > 0 else recur_function(a, b, c + L[n], n + 1)
    ret3 = recur_function(a, b, c, n + 1)
    return min(ret0, ret1, ret2, ret3)

print(recur_function(0, 0, 0, 0))

Fixed submission:
# N A B C
# l1
# l2
# ...

tmp = input().split()
(N, A, B, C) = (int(tmp[i]) for i in range(4))
L = []
for i in range(N):
    l = int(input())
    L.append(l)
# N = 5
# A = 100
# B = 90
# C = 80
# L = [98, 40, 30, 21, 80]

def recur_function(a, b, c, n):
    if n == N:
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else 10**9
    ret0 = recur_function(a + L[n], b, c, n + 1) + 10 if a > 0 else recur_function(a + L[n], b, c, n + 1)
    ret1 = recur_function(a, b + L[n], c, n + 1) + 10 if b > 0 else recur_function(a, b + L[n], c, n + 1)
    ret2 = recur_function(a, b, c + L[n], n + 1) + 10 if c > 0 else recur_function(a, b, c + L[n], n + 1)
    ret3 = recur_function(a, b, c, n + 1)
    return min(ret0, ret1, ret2, ret3)

print(recur_function(0, 0, 0, 0))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
x = [[int(i), 0] for i in input().split()]
x.sort(key=lambda a: a[0])
for i in range(m - 1):
    x[i][1] = x[i + 1][0] - x[i][0]

if n >= m:
    print(0)
else:
    sumdis = sum(map(lambda a: a[1], x))
    h = 0
    skipdis = 0
    while h < n - 1:
        maxdis = max(x, key=lambda a: a[1])
        skipdis += maxdis[1]
        x.remove(maxdis)
        h += 1
    print(sumdis - skipdis)

Fixed submission:
def main():
    n, m = map(int, input().split())
    t = list(map(int, input().split()))
    if n >= m:
        return 0
    t.sort()
    x = [[t[i], t[i+1] - t[i]] for i in range(m-1)]
    x.append([t[m-1], 0])
    x.sort(key=lambda a: a[1], reverse=True)
    sum_dis = t[m-1] - t[0]
    skip_dis = sum([x[i][1] for i in range(n - 1)])
    return sum_dis - skip_dis


print(main())

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
x = [[int(i), 0] for i in input().split()]
x.sort(key=lambda a: a[0])
for i in range(m - 1):
    x[i][1] = x[i + 1][0] - x[i][0]

if n >= m:
    print(0)
else:
    sumdis = sum(map(lambda a: a[1], x))
    h = 0
    skipdis = 0
    while h < n - 1:
        maxdis = max(x, key=lambda a: a[1])
        skipdis += maxdis[1]
        x.remove(maxdis)
        h += 1
    print(sumdis - skipdis)

Fixed submission:
def main():
    n, m = map(int, input().split())
    t = list(map(int, input().split()))
    if n >= m:
        return 0
    t.sort()
    x = [[t[i], t[i+1] - t[i]] for i in range(m-1)]
    x.append([t[m-1], 0])
    x.sort(key=lambda a: a[1], reverse=True)
    sum_dis = t[m-1] - t[0]
    skip_dis = sum([x[i][1] for i in range(n - 1)])
    return sum_dis - skip_dis


print(main())
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int,input().split()))

h.sort(reverse = True)
for i in range(k-1):
    h[i] = 0
print(sum(h))

Fixed submission:
n, k = map(int, input().split())
h = list(map(int,input().split()))

h.sort(reverse = True)
print(sum(h[k::]))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = a + b

if c == 3:
    print("3")
elif c == 4:
    print("2")
elif c == 5:
    print*("1")

Fixed submission:
a = int(input())
b = int(input())
c = a + b
print(6-c)
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int,input().split())
ans = (a * b) / math.gcd(a,b)
print(int(ans))

Fixed submission:
import fractions
a, b = map(int,input().split())
ans = (a * b) / fractions.gcd(a,b)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
魔法両面テープ

Fixed submission:
r = int(input())

print(r*r)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

if a > 9 or b > 9:
    print("-1")
else:
    num = a*b
print(num)

Fixed submission:
a,b = map(int,input().split())

if a > 9 or b > 9:
    print("-1")
else:
    num = a*b
    print(int(num))
Buggy python submission (verdict: Runtime Error):
input_tap = input()

for i in range(0,len(input_tap),2):
    if input_tap[i] == 'R' or input_tap[i] == 'U' or input_tap[i] == 'D':
        flag = 'Yes'
    elif input_tap[i+1] == 'R' or input_tap[i+1] == 'U' or input_tap[i+1] == 'D':
        flag = 'Yes'
    else:
        flag = 'No'
print(flag)


Fixed submission:
input_tap = input()
flag = 'No'
input_tap1 = input_tap[0::2]
input_tap2 = input_tap[1::2]

if 'L' in input_tap1:
    flag = 'No'
elif 'R' in input_tap2:
    flag = 'No'
else:
    flag = 'Yes'
print(flag)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, K= map(int, input().split())
p = np.array(list(map(int, input().split())))

max = 0
j = N-K+1
for i in range(j):
    tmp = np.sum(p[i:i+K])
    if tmp>max:
        max = tmp

print((max+K)/2)

Fixed submission:
import numpy as np

N, K= map(int, input().split())
p = np.array(list(map(int, input().split())))

tmp = np.sum(p[:K])
max = tmp
for i in range(N-K):
    tmp = tmp-p[i]+p[i+K]
    if tmp>max:
        max = tmp

print((max+K)/2)

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


N, K= map(int, input().split())
p = np.array(list(map(int, input().split())))

max = 0
for i in range(N-K+1):
    tmp = np.sum(p[i:i+K])
    if tmp>max:
        max = tmp

print((max+K)/2)


Fixed submission:
import numpy as np

N, K= map(int, input().split())
p = np.array(list(map(int, input().split())))

tmp = np.sum(p[:K])
max = tmp
for i in range(N-K):
    tmp = tmp-p[i]+p[i+K]
    if tmp>max:
        max = tmp

print((max+K)/2)

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


N, K= np.array(list(map(int, input().split())))
p = np.array(list(map(int, input().split())))

max = 0
for i in range(N-K+1):
    tmp = np.sum(p[i:i+K])
    if tmp>max:
        max = tmp

print((max+K)/2)


Fixed submission:
import numpy as np

N, K= map(int, input().split())
p = np.array(list(map(int, input().split())))

tmp = np.sum(p[:K])
max = tmp
for i in range(N-K):
    tmp = tmp-p[i]+p[i+K]
    if tmp>max:
        max = tmp

print((max+K)/2)
Buggy python submission (verdict: Runtime Error):
n = input()
if n == "a":
    print("b")
if n == "b":
    print("c")
if n == "c":
    print("d")
if n == "d":
    print("e")
if n == "e:"
    print("f")
if n == "f":
    print("g")
if n == "g":
    print("h")
if n =="h":
    print("i")
if n == "i":
    print("j")
if n == "j":
    print("k")
if n == "k":
    print("l")
if n == "l":
    print("m")
if n == "m":
    print("n")
if n == "n":
    print("o")
if n == "o":
    print("p")
if n == "p":
    print("q")
if n == "q":
    print("r")
if n == "r":
    print("s")
if n == "s":
    print("t")
if n == "t":
    print("u")
if n == "u":
    print("v")
if n == "v":
    print("w")
if n == "w":
    print("x")
if n == "x":
    print("y")
if n == "y":
    print("z")
if n == "z":
    print("a")

Fixed submission:
n = input()
if n == "a":
    print("b")
if n == "b":
    print("c")
if n == "c":
    print("d")
if n == "d":
    print("e")
if n == "e":
    print("f")
if n == "f":
    print("g")
if n == "g":
    print("h")
if n =="h":
    print("i")
if n == "i":
    print("j")
if n == "j":
    print("k")
if n == "k":
    print("l")
if n == "l":
    print("m")
if n == "m":
    print("n")
if n == "n":
    print("o")
if n == "o":
    print("p")
if n == "p":
    print("q")
if n == "q":
    print("r")
if n == "r":
    print("s")
if n == "s":
    print("t")
if n == "t":
    print("u")
if n == "u":
    print("v")
if n == "v":
    print("w")
if n == "w":
    print("x")
if n == "x":
    print("y")
if n == "y":
    print("z")
if n == "z":
    print("a")
Buggy python submission (verdict: Runtime Error):
n = input()
m = n.split()
P = [int(i) for i in m]
if P[1] == 0:
    for i in range(P[1]): #因数注意！
        n = input()    
    print("0 0")
else:
    
    AC = [0] * P[0]
    WA = [0] * P[0]

    for i in range(P[1]): #因数注意！
        n = input()    
        m = n.split()
        p = [i for i in m] #1列の数列をリスト化
        if p[1] == "AC":
            AC[int(p[0])-1] = 1
        else:
            if AC[int(p[0])-1] == 0:
                WA[int(p[0])-1] = WA[int(p[0])-1] +1
            else:
                pass
A1 = 0
A2 = 0
for i in range(P[0]):
    if AC[i] == 1:
        A1 = A1+1
        A2 = A2 + WA[i]
print(str(A1)+" "+str(A2))

Fixed submission:
n = input()
m = n.split()
P = [int(i) for i in m]
if P[1] == 0:
    for i in range(P[1]): #因数注意！
        n = input()    
    print("0 0")
else:
    
    AC = [0] * P[0]
    WA = [0] * P[0]

    for i in range(P[1]): #因数注意！
        n = input()    
        m = n.split()
        p = [i for i in m] #1列の数列をリスト化
        if p[1] == "AC":
            AC[int(p[0])-1] = 1
        else:
            if AC[int(p[0])-1] == 0:
                WA[int(p[0])-1] = WA[int(p[0])-1] +1
            else:
                pass
    A1 = 0
    A2 = 0
    for i in range(P[0]):
        if AC[i] == 1:
            A1 = A1+1
            A2 = A2 + WA[i]
    print(str(A1)+" "+str(A2))
Buggy python submission (verdict: Runtime Error):
n = input()
m = input()
a = m+n
print(a)

Fixed submission:
n = input()    
m = n.split()
p = [i for i in m]
a = p[1]+p[0]
print(a)
Buggy python submission (verdict: Runtime Error):
a = int(input())

def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i => a]

s = sieve(a * 2)
print(s[0])

Fixed submission:
a = int(input())

def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i >= a]

s = sieve(a * 2)
print(s[0])