Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
y,m,d=int(input().split("/"))
if y<=2018:
  ans="Heisei"
else:
  if m<=4:
    ans="Heisei"
  else:
    ans="TBD"
print(ans)

Fixed submission:
y,m,d=map(int,input().split("/"))
if y<=2018:
  ans="Heisei"
else:
  if m<=4:
    ans="Heisei"
  else:
    ans="TBD"
print(ans)

Buggy python submission (verdict: Runtime Error):
y,m,d=str(input().split("/"))
if y<=2018:
  ans="Heisei"
else:
  if m<=4:
    ans="Heisei"
  else:
    ans="TBD"
print(ans)

Fixed submission:
y,m,d=map(int,input().split("/"))
if y<=2018:
  ans="Heisei"
else:
  if m<=4:
    ans="Heisei"
  else:
    ans="TBD"
print(ans)

Buggy python submission (verdict: Runtime Error):
y,m,d=str(input().split("/")
if y<=2018:
  ans="Heisei"
else:
  if m<=4:
    ans="Heisei"
  else:
    ans="TBD"
print(ans)


Fixed submission:
y,m,d=map(int,input().split("/"))
if y<=2018:
  ans="Heisei"
else:
  if m<=4:
    ans="Heisei"
  else:
    ans="TBD"
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(N):
  x, u = input().split()
  x = int(x)
  u = str(u)
  if u == "BTC":
    ans += x*380000.0
  else:
    ans += x

print(ans)

Fixed submission:
N = int(input())
ans = 0
for i in range(N):
  x, u = input().split()
  x = float(x)
  u = str(u)
  if u == "BTC":
    ans += x*380000.0
  else:
    ans += x

print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
if B%A=0:
  print(A+B)
else:
  print(B-A)

Fixed submission:
A, B = map(int, input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Buggy python submission (verdict: Runtime Error):
A, B =map(int, input().split())
if B%A=0:
    print(A+B)
else:
    print(B-A)

Fixed submission:
A, B = map(int, input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import numpy as np

def solve(N: int, K: int, A: "List[int]"):
    ans = 0
    max_bit = 40
    A = np.array(A)
    for i in range(max_bit+1):
        t = 2**(max_bit-i)
        count = sum([1 for a in A if a&t > 0])
        if t <= K and count < N / 2:
            count = N - count
            K -= t
        ans += count * t
    print(ans)
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys

def solve(N: int, K: int, A: "List[int]"):
    ans = 0
    max_bit = 40
    for i in range(max_bit+1):
        t = 2**(max_bit-i)
        count = len([1 for a in A if a&t > 0])
        if t <= K and count < N / 2:
            count = N - count
            K -= t
        ans += count * t
    print(ans)
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
S = str(input())
ans = 10**3
for i in range(0, len(S)-2):
　　ans = min(ans, abs(753 - int(S[i:i+2])))
print(ans)

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(S: int):
    S = str(S)
    ans = 10**3
    for i in range(0, len(S)-2):
        ans = min(ans, abs(753 - int(S[i:i+3])))
    print(ans)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = int(next(tokens))  # type: int
    solve(S)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = str(input())
for i, s in enumerate(n):
  if s == "1":
    n[i] = "9"
  elif s == "9":
    n[i] = "1"

print(int(n))

Fixed submission:
n = str(input()).replace("1","q").replace("9","1").replace("q","9")
print(n)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def solve(N: int, K: int):
    d = int(N % K)
    if d == 0:
      print(d)
    elif:
      print(1)
    return

def main():
    N, K = map(int, input().split())
    solve(N, K)

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3

def solve(N: int, K: int):
    d = int(N % K)
    if d == 0:
      print(d)
    else:
      print(1)
    return

def main():
    N, K = map(int, input().split())
    solve(N, K)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import math

def solve(N: int, a: "List[int]"):
    # 素因数分解して，2の個数 == ans
    def factorization(n):
        factor = []
        n_ = n
        for i in range(2, int(math.sqrt(n) + 1)):
            if n_ % i == 0:
                cnt = 0
                while n_ % i == 0:
                    n_ = n_ // i
                    cnt += 1
                factor.append([i, cnt])
        if n_ != 1:
            factor.append([n_, 1])
        if n == []:
            factor.append([n, 1])
        return factor

    ans = 0
    for ai in a:
        factor = factorization(ai)
        if factor[0][0] == 2:
            ans += factor[0][1]

    print(ans)

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import math

def solve(N: int, a: "List[int]"):
    # 素因数分解して，2の個数 == ans
    def factorization(n):
        factor = []
        n_ = n
        for i in range(2, int(math.sqrt(n) + 1)):
            if i == 3:
                break
            if n_ % i == 0:
                cnt = 0
                while n_ % i == 0:
                    n_ = n_ // i
                    cnt += 1
                factor.append([i, cnt])
        if n_ != 1:
            factor.append([n_, 1])
        if n == []:
            factor.append([n, 1])
        return factor

    ans = 0
    for ai in a:
        factor = factorization(ai)
        if factor[0][0] == 2:
            ans += factor[0][1]

    print(ans)

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
dp = [float("inf")]*(N + 1)
dp[0] = 0
pull_list_9 = [9**i for i in range(1, 6)]
pull_list_6 = [6**i for i in range(1, 7)]
pull_list = np.array(pull_list_9 + pull_list_6 + [1])
p_s = sorted(pull_list)
for i in range(1, N + 1):
  for j in p_s:
    if i - j < 0:
      break
    dp[i] = min(dp[i], dp[i-j] + 1)
print(dp[-1])


Fixed submission:
N = int(input())
dp = [float("inf")]*(N + 1)
dp[0] = 0
pull_list_9 = [9**i for i in range(1, 6)]
pull_list_6 = [6**i for i in range(1, 7)]
pull_list = pull_list_9 + pull_list_6 + [1]
p_s = sorted(pull_list)

for i in range(1, N + 1):
  for j in p_s:
    if i - j < 0:
      break
    dp[i] = min(dp[i], dp[i-j] + 1)

print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import numpy as np

def solve(N: int):
    #9 ** 5 == 59049 < 10 ** 5
    #6 ** 6 == 46656 < 10 ** 5
    dp = [float("inf")]*(N + 1)
    dp[0] = 0
    pull_list_9 = [9**i for i in range(1, 6)]
    pull_list_6 = [6**i for i in range(1, 7)]
    pull_list = np.array(pull_list_9 + pull_list_6 + [1])
    p_s = sorted(pull_list)
    for i in range(1, N + 1):
        for j in p_s:
            if i - j < 0:
                break
            dp[i] = min(dp[i], dp[i-j] + 1)
    print(dp[-1])

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Fixed submission:
N = int(input())
dp = [float("inf")]*(N + 1)
dp[0] = 0
pull_list_9 = [9**i for i in range(1, 6)]
pull_list_6 = [6**i for i in range(1, 7)]
pull_list = pull_list_9 + pull_list_6 + [1]
p_s = sorted(pull_list)

for i in range(1, N + 1):
  for j in p_s:
    if i - j < 0:
      break
    dp[i] = min(dp[i], dp[i-j] + 1)

print(dp[-1])
Buggy python submission (verdict: Runtime Error):
a,b,c,d =map(int, input().split())
if abs(a-c)<=d:
  print("Yes")
  return
if a<=b<=c or c<=b<=a:
  if abs(a-b)<=d and abs(c-b)<=d:
    print("Yes")
    return
print("No")

Fixed submission:
a,b,c,d =map(int, input().split())
ans="No"
if abs(a-c)<=d:
  ans ="Yes"
if a<=b<=c or c<=b<=a:
  if abs(a-b)<=d and abs(c-b)<=d:
    ans="Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
print(min(a,b)+min(c,d))

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a,b)+min(c,d))
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
num = input().split()

ass = 0

for i in range(k):
    for j in range(i+1,k):
        n1 = int(num[i]) % (10**9 + 7)
        n2 = int(num[j]) % (10**9 + 7)
        n3 = n1 * n2
        ass += n3
        ass = ass % (10**9 + 7)
    ass = ass % (10**9 + 7)


ans = ass % (10**9 + 7)
print(ans)

Fixed submission:
k = int(input())
num = input().split()

l = 0
ass = 0
ans = 0

for i in range(k):
    l += int(num[i])

for i in range(k):
    l -= int(num[i])
    ass += int(num[i]) * l
    

ans = ass % (10**9 + 7 )
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
num = input().split()

ass = 0

for i in range(k):
    for j in range(i+1,k):
        n1 = int(num[i]) % (10**9 + 7)
        n2 = int(num[j]) % (10**9 + 7)
        n3 = n1 * n2
        ass += n3
    ass = ass % (10**9 + 7)


ans = ass % (10**9 + 7)
print(ans)

Fixed submission:
k = int(input())
num = input().split()

l = 0
ass = 0
ans = 0

for i in range(k):
    l += int(num[i])

for i in range(k):
    l -= int(num[i])
    ass += int(num[i]) * l
    

ans = ass % (10**9 + 7 )
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
num = input().split()

ass = 0

for i in range(k):
    for j in range(i+1,k):
        n1 = int(num[i])
        n2 = int(num[j])
        n3 = n1 * n2
        ass += n3
        ass = ass % (10**9 + 7)


ans = ass % (10**9 + 7)
print(ans)

Fixed submission:
k = int(input())
num = input().split()

l = 0
ass = 0
ans = 0

for i in range(k):
    l += int(num[i])

for i in range(k):
    l -= int(num[i])
    ass += int(num[i]) * l
    

ans = ass % (10**9 + 7 )
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
num = input().split()

ass = 0

for i in range(k):
    for j in range(i+1,k):
        n1 = int(num[i])
        n2 = int(num[j])
        n3 = n1 * n2
        ass += n3

ans = ass % (10**9 + 7)
print(ans)

Fixed submission:
k = int(input())
num = input().split()

l = 0
ass = 0
ans = 0

for i in range(k):
    l += int(num[i])

for i in range(k):
    l -= int(num[i])
    ass += int(num[i]) * l
    

ans = ass % (10**9 + 7 )
print(ans)
Buggy python submission (verdict: Runtime Error):
nd = input().split()
N = int(nd[0])
D = int(nd[1])

ans = 0

for i in range(N-1):
    xy = input().split()
    x = int(xy [2*i])
    y = int(xy [2*i+1])
    d = x**2 + y**2
    if d < D:
        ans += 1

print(ans)

Fixed submission:
nd = input().split()
N = int(nd[0])
D = int(nd[1])
D = D**2

ans = 0

for i in range(N):
    ls = input().split()
    x = int(ls[0])
    y = int(ls[1])
    d = x**2 + y**2
    if d <= D :
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
num = int(input())

k = input().split()

mul = 1

for i in range(num):
    mul *= int(k[i])

if mul > 10**18:
    print(-1)

else:
    print(mul)


Fixed submission:
num = int(input())

k = input().split()

for i in range(len(k)):
    k[i] = int(k[i])

k.sort()

mul = 1

for i in range(num):
    mul *= int(k[i])
    if mul > 10**18:
        break

if mul > 10**18:
    print(-1)

else:
    print(mul)
Buggy python submission (verdict: Runtime Error):
num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")
    if i >= len(word):
        break

if len(word) > num:
    print("...")

Fixed submission:
num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")
    if i+1 >= len(word):
        break

if len(word) > num:
    print("...")

Buggy python submission (verdict: Runtime Error):
num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")

if len(word) > num:
    print("...")

Fixed submission:
num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")
    if i+1 >= len(word):
        break

if len(word) > num:
    print("...")
Buggy python submission (verdict: Time Limit Exceeded):
l = input().split()
n1 = int(l[0])
n0 = int(l[1])
n = int(l[2])
k = int(l[3])

ans = 0

for i in range(n1):
    if k < 1:
        break
    k -= 1
    ans += 1

for i in range(n0):
    if k < 1:
        break
    k -= 1
    ans += 0

for i in range(n):
    if k < 1:
        break
    k -= 1
    ans -= 1 

print(ans)

Fixed submission:
l = input().split()
n1 = int(l[0])
n0 = int(l[1])
n = int(l[2])
k = int(l[3])

ans = 0

if k >= n1:
    ans += n1

else:
    ans += k

k -= n1

k -= n0

if k > 0:
    ans -= k

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l = input().split()
n1 = l[0]
n0 = l[1]
n = l[2]
k = l[3]

list = []

for i in range(int(n1)):
    list.append(1)

for i in range(int(n0)):
    list.append(0)

for i in range(int(n)):
    list.append(-1)

ans = 0

for i in range(int(k)):
    ans += int(list[i])

print(ans)

Fixed submission:
l = input().split()
n1 = int(l[0])
n0 = int(l[1])
n = int(l[2])
k = int(l[3])

ans = 0

if k >= n1:
    ans += n1

else:
    ans += k

k -= n1

k -= n0

if k > 0:
    ans -= k

print(ans)
Buggy python submission (verdict: Runtime Error):
mn = input().split()
ob = input().split()

n = int(mn[0])
m = int(mn[1])

votes = 0

for i in range(n):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort(reverse=true)

line = votes/4/m

ans = 0

for i in range(m):
    if ob[i] <= line:
        ans += 1

if ans == 0:
    print("Yes")
else:
    print("No")


Fixed submission:
mn = input().split()
ob = input().split()

n = int(mn[0])
m = int(mn[1])

votes = 0

for i in range(n):
    ob[i] = int(ob[i])
    votes += ob[i]

ob.sort(reverse = True)

line = votes/4/m

ans = 0

for i in range(m):
    if ob[i] < line:
        ans += 1

if ans == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
nm = input()
n = int(nm[0])
m = int(nm[1])

ans = 0

n1 = n*(n-1)/2

n2 = m*(m-1)/2

ans = n1 + n2

print(ans)

Fixed submission:
nm = input().split()
n = int(nm[0])
m = int(nm[1])

ans = 0

n1 = n*(n-1)/2

n2 = m*(m-1)/2

ans = int(n1 + n2)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
z = input().split()

al = int(z[0])
blue = int(z[1])
red = int(z[2])

ans = 0
k = 0

while k <= al - blue -red:
    ans += blue
    k += blue
    k += red

while k <= al-1:
    ans += 1
    k += 1

print(ans)

Fixed submission:
n,a,b = map(int,input().split())
ab = a + b
m = n // ab
n %= ab
print(m*a+min(n,a))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
import math
N,M=map(int,input().split())
"""
BFSする。探索される側をメモ。
"""
dist = [-1 for i in range(N)]
graph = [[] for i in range(N)]
for i in range(M):
  A,B=map(int,input().split())
  graph[A-1].append(B)
  graph[B-1].append(A)
  
#print(dist, graph)

# init
ans = [0]*N
dist = [-1]*N
nodes_ = deque()
q = deque()
q.append(1)
change = False
while len(q)>0:
  #print(q,dist)
  node = q.popleft()
  if node is None:
    break
  elif -1 not in dist:
    break
  if node not in dist:
    dist[node-1] = 0
    if node != 1:
      ans[node-1] = nodes_.popleft()
    #for i in graph[node-1]:
    #  if i not in dist:
    q_ = q
    add = 0
    for j in graph[node-1]:
      if dist[j-1] == -1 and (j not in q):
        q.append(j)
        add+=1
    judge_index = add
    # q.extend(graph[node-1])
  for i in range(add):
    nodes_.append(node)
print("Yes")
print("\n".join(list(map(str,ans[1:]))))

Fixed submission:
from collections import deque
import math
N,M=map(int,input().split())
"""
BFSする。探索される側をメモ。
"""
dist = [-1 for i in range(N)]
graph = [[] for i in range(N+1)]
for i in range(M):
  A,B=map(int,input().split())
  graph[A].append(B)
  graph[B].append(A)
  
#print(dist, graph)

# init
ans = [-1]*(N+1)
q = deque()
q.append(1)
while len(q)>0:
  #print(q,dist)
  node = q.popleft()
  for j in graph[node]:
    if ans[j] == -1:
      ans[j]=node
      q.append(j)
print("Yes")
print("\n".join(list(map(str,ans[2:]))))
Buggy python submission (verdict: Runtime Error):
i = input()
if i = "ABC":
  print("ARC")
else:
  print("ABC")

Fixed submission:
i = input()
if i == "ABC":
  print("ARC")
else:
  print("ABC")
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
# A>B
for i in range(1,int(x**(1))+1):
  if x%i==0:
    for j in range(i):
      a=j
      b=j-i
      if a**5-b**5==x:
        print(a,b)
        break

Fixed submission:
x=int(input())
import math
import sys
A=[math.pow(i,5) for i in range(-1000,1000,1)]
B=[math.pow(i,5) for i in range(-1000,1000,1)]
for n in A:
  for m in B:
    if n-m==x:
      print(-1000+A.index(n),-1000+B.index(m))
      sys.exit()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
import collections
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
ss.sort()
#d = defaultdict(lambda: 0)
c = collections.Counter(ss)
d_=c.most_common()
mx = d_[0][1]
for i in range(N):
  if d_[i][1] == mx:
    print(d_[i][0])
  else:
    break

Fixed submission:
from collections import defaultdict
import collections
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
#d = defaultdict(lambda: 0)
c = collections.Counter(ss)
d_=c.most_common()
mx = d_[0][1]
d_.sort()
#print(d_)
m=len(d_)
for i in range(m):
  if d_[i][1] == mx:
    print(d_[i][0])
  else:
    pass

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
d = defaultdict(lambda: 0)

for i in range(N):
  s = ss[i]
  d[s] += 1

d_ =[k for k, v in d.items() if v == max(d.values())]
d_.sort()
print("\n".join(d_))

Fixed submission:
from collections import defaultdict
import collections
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
#d = defaultdict(lambda: 0)
c = collections.Counter(ss)
d_=c.most_common()
mx = d_[0][1]
d_.sort()
#print(d_)
m=len(d_)
for i in range(m):
  if d_[i][1] == mx:
    print(d_[i][0])
  else:
    pass

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

d = {}
for i in range(N):
  s = input()
  if s in d:
    d[s] += 1
  else:
    d[s]  = 1

d_ =[k for k, v in d.items() if v == max(d.values())]
d_.sort()
for st in d_:
  print(st)

Fixed submission:
from collections import defaultdict
import collections
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
#d = defaultdict(lambda: 0)
c = collections.Counter(ss)
d_=c.most_common()
mx = d_[0][1]
d_.sort()
#print(d_)
m=len(d_)
for i in range(m):
  if d_[i][1] == mx:
    print(d_[i][0])
  else:
    pass
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K=map(int,input().split())
p=list(map(int,input().split()))
mx = 0
p=np.array(list(map(lambda x: (1+x)/2, p)))
#print(p)
for i in range(N-K+1):
  s = np.sum(p[i:i+K])
  #print(s)
  mx = max(s,mx)
  
print(mx)

Fixed submission:
import numpy as np
N,K=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(list(map(lambda x: (1+x)/2, p)))
mx_0 = np.sum(p[:K])
mx=0
#print(p)
if N!=K:
  for i in range(1,N-K+1):
    s = mx_0-p[i-1]+p[i+K-1]
    mx_0=s
    #print(s)
    mx = max(s,mx)
else:
  mx=np.sum(p)
  
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
p=list(map(int,input().split()))
mx = 0
p=list(map(lambda x: (1+x)/2, p))
#print(p)
for i in range(N-K+1):
  s = sum(p[i:i+K])
  #print(s)
  mx = max(s,mx)
  
print(mx)

Fixed submission:
import numpy as np
N,K=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(list(map(lambda x: (1+x)/2, p)))
mx_0 = np.sum(p[:K])
mx=0
#print(p)
if N!=K:
  for i in range(1,N-K+1):
    s = mx_0-p[i-1]+p[i+K-1]
    mx_0=s
    #print(s)
    mx = max(s,mx)
else:
  mx=np.sum(p)
  
print(mx)
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
ls1 = [int(input()) for i in range(Q)]
ls_ = [K]*N
for i in ls1:
  ls_ = list(map(lambda x: x-1,ls_))
  ls_[i-1]+=1
for i in ls_:
  if i <=0:
    print("No")
  else:
    print("Yes")

Fixed submission:
N,K,Q=map(int,input().split())
ls_ = [K]*N
for i in range(Q):
  ls_[int(input())-1]+=1
ls__ = ["No" if i <= Q else "Yes" for i in ls_]
string = "\n".join(ls__)
print(string)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ls = list(map(int,input().split()))
ans = 0
for i in range(n-1):
  for j in range(n-i):
    if i+1!=n and ls[i]<ls[i+1]:
      break
    else:
      i+=1
  ans = max(ans,j)
  if ans > n-1-i:
    break
print(ans)

Fixed submission:
n=int(input())
ls = list(map(int,input().split()))
ls2 = [0]*(n+1)
for i in range(n-1):
  if ls[i]<ls[i+1]:
    ls2[i+1]=ls2[i]*0
  elif ls[i]>=ls[i+1]:
    ls2[i+1]=ls2[i]+1
print(max(ls2))
Buggy python submission (verdict: Runtime Error):
n=int(input())
ls=[None]*n
ls2=[None]*n
for i in range(n):
  ls[i]=i+1
  ls2[i]=i+2
ls2[-1]=1
ans = 0
for i in range(n):
  ans += ls[i]%ls2[i]
print(ans)

Fixed submission:
n=int(input())
print(int(n*(n-1)//2))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(max([a+b,a-b,a×b]
          ))


Fixed submission:
a,b=map(int,input().split())
print(max([a+b,a-b,a*b]
          ))

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(max(a+b,a-b,a×b))


Fixed submission:
a,b=map(int,input().split())
print(max([a+b,a-b,a*b]
          ))
Buggy python submission (verdict: Runtime Error):
k,x=map(int,input().split())
t=[i for i in range(x-k+1,x+k-1)]
print(" ".join(t))

Fixed submission:
k,x=map(int,input().split())
t=[str(i) for i in range(x-k+1,x+k)]
print(" ".join(t))
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
k=(A**2-B**2)/(2*A-2*B)
if k == int(k):
  print(int(k))
else:
  print(IMPOSSIBLE)
    

Fixed submission:
A,B = map(int,input().split())
k=(A**2-B**2)/(2*A-2*B)
if k == int(k):
  print(int(k))
else:
  print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
import math
n,d=map(int,input())
k=math.ceil(n/(2*d))
print(k)

Fixed submission:
import math
n,d=map(int,input().split())
k=math.ceil(n/(2*d+1))
print(k)