Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().split()))
e=list(range(1,n+1))
d=dict(zip(e,a))
f=sorted(d.items(), key=lambda x: x[1])
g=str(f[0][0])
for i in range(1,n):
    g = g + " " + str(f[i][0])
print(g)

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
b=sorted(a)
c=[0]*n
for i in range(n):
    c[a[i]-1] = i+1
print(' '.join(map(str, c)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().split()))
b=sorted(a)
c=[]
for i in range(n):
    c.append(a.index(b[i])+1)
print(' '.join(map(str, c)))

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
b=sorted(a)
c=[0]*n
for i in range(n):
    c[a[i]-1] = i+1
print(' '.join(map(str, c)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().split()))
b=sorted(a)
c=0
d=str(a.index(b[0])+1)
for i in range(1,n):
    c=a.index(b[i])+1
    d=d+" " + str(c)
print(d)

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
b=sorted(a)
c=[0]*n
for i in range(n):
    c[a[i]-1] = i+1
print(' '.join(map(str, c)))
Buggy python submission (verdict: Runtime Error):
import sys
a,b=map(int, input().split())
hole = a
if b==1:
  prnt(0)
for i in range(1,30):
    if hole<b:
        hole = hole + a -1
    elif hole>=b:
        print(int(i))
        break

Fixed submission:
s=list(i for i in input())
t=list(i for i in input())
cnt=0
for i in range(3):
    if s[i]==t[i]:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
A = list(map(int,(input().split())))

cnt=0
C=[]
for i in range(len(A)):
    for j in range(len(A)):
        if A[i]>A[j]:
            cnt= cnt+1

print((cnt*k*(k+1)(/2%(10**9+7))

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

#1つの箱の中の数を数える
cnt1=0
for i in range(n):
    for j in range(i,n):
        if A[i]>A[j]:
            cnt1+=1

#2つの箱の大小を調べる
B=A
cnt2=0
for i in range(n):
    for j in range(n):
        if B[i]>A[j]:
            cnt2+=1
ans = (cnt1*k + cnt2 * k*(k-1)//2)%(10**9+7)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
lis=list(int(input()) for _ in range(n))
for i in range(n):
    ans=max(max(lis[:i],lis[i+1:n]))
    print(ans)

Fixed submission:
n=int(input())
lis=list(int(input()) for _ in range(n))
lis2=lis
lis2=sorted(lis2)
MAX=lis2[-1]
second=lis2[-2]
if lis.count(MAX) ==1:
    lis3=[MAX for _ in range(n)]
    lis3[lis.index(MAX)]=second
    for i in range(n):
        print(lis3[i])
        
else:
    for _ in range(n):
        print(MAX)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int, input().split())
cnt=0
num_c = b//c - (a-1)//c
num_d = b//d - (a-1)//d
num_c_d = b//((c*d)//math.gcd(c,d))- (a-1)//((c*d)//math.gcd(c,d))
total = num_c + num_d - num_c_d
print(int((b-a+1) - total))

Fixed submission:
import fractions
a,b,c,d = map(int, input().split())
cnt=0
num_c = b//c - (a-1)//c
num_d = b//d - (a-1)//d
num_c_d = b//((c*d)//fractions.gcd(c,d))- (a-1)//((c*d)//fractions.gcd(c,d))
total = num_c + num_d - num_c_d
print(int((b-a+1) - total))

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int, input().split())
cnt=0
num_c = b//c - (a-1)//c
num_d = b//d - (a-1)//d
num_c_d = b//((c*d)/math.gcd(c,d))- (a-1)//((c*d)/math.gcd(c,d))
total = num_c + num_d - num_c_d
print(int((b-a+1) - total))

Fixed submission:
import fractions
a,b,c,d = map(int, input().split())
cnt=0
num_c = b//c - (a-1)//c
num_d = b//d - (a-1)//d
num_c_d = b//((c*d)//fractions.gcd(c,d))- (a-1)//((c*d)//fractions.gcd(c,d))
total = num_c + num_d - num_c_d
print(int((b-a+1) - total))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split(" ")) 
S=set(range(1,m+1))
for i in range(n):
    K, *A = map(int, input().split(" "))　
    S &=set(A) 
print(len(S))

Fixed submission:
n,m=map(int,input().split(" "))
S=set(range(1,m+1))
for i in range(n):
    K, *A = map(int, input().split(" "))
    S &=set(A)
print(len(S))
Buggy python submission (verdict: Runtime Error):
N, Y =map(int,input().split(" "))
for i in range(N+1):
    for j in range(N-i+1):
        if i * 10000 + j*5000 + (N-i-j)*1000 ==y:
            print(i, j, N-i-j)
            exit()
print(-1, -1, -1)

Fixed submission:
N, Y =map(int,input().split(" "))
for i in range(N+1):
    for j in range(N-i+1):
        if i * 10000 + j*5000 + (N-i-j)*1000 ==Y:
            print(i, j, N-i-j)
            exit()
print(-1, -1, -1)

Buggy python submission (verdict: Runtime Error):
N, Y =map(int,input().split(" "))
for i in range(N+1):
    for j in range(N-i+1):
        if i * 10000 + j*5000 + (N-i-j)*1000 ==y:
            print(i, j, N-i-j)
            exit()
print(-1, -1, -1)

Fixed submission:
N, Y =map(int,input().split(" "))
for i in range(N+1):
    for j in range(N-i+1):
        if i * 10000 + j*5000 + (N-i-j)*1000 ==Y:
            print(i, j, N-i-j)
            exit()
print(-1, -1, -1)
Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
    elif i=1:
        s=1
print(s)

Fixed submission:
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
    elif i=0:
        s=0
print(s)

Fixed submission:
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
print(s)

Fixed submission:
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
print(s)

Fixed submission:
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N+1):
    print(i)
    if i*i>N:
        s=(i-1)**2
        break
print(s)

Fixed submission:
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=i-1
        break
print(s)

Fixed submission:
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if b<c or d<a:
    print(0)
elif a<=c<d<=b:
    print(d-c)
elif c<a<b<d:
    print(b-a)
else:
    print(b-c)

Fixed submission:
a,b,c=input()
print("Yes" if a==c else "No")

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if b<c or d<a:
    print("0")
elif a<c<d<b:
    print(d-c)
elif c<a<b<d:
    print(b-a)
else:
    print(b-c)

Fixed submission:
a,b,c=input()
print("Yes" if a==c else "No")
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if b<c or d<a:
    print(0)
elif a<=c<d<=b:
    print(d-c)
elif a<c<b<d:
    print(b-c)
elif c<a<b<d:
    print(b-a)
elif:
    print(d-a)

Fixed submission:
a,b,c,d = map(int,input().split())
if b<=c or d<=a:
    print(0)
elif a<=c<=d<=b:
    print(d-c)
elif a<=c<=b<=d:
    print(b-c)
elif c<=a<=b<=d:
    print(b-a)
elif c<=a<=d<=b:
    print(d-a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b=[]
for i in range(len(a)):
    if i%2==0:
        b.append(a[i])
    if not i%2==0:
        b.insert(0,a[i])
if not n%2==0:
    b=b[::-1]
print(*b)

Fixed submission:
n=int(input())
a=input().split()
b=" ".join(a[-1::-2] + a[(n%2)::2])
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b=[]
for i in range(len(a)):
    if i%2==0:
        b.append(a[i])
    if not i%2==0:
        b.insert(0,a[i])
if not n%2==0:
    b=b[::-1]
print(*b)

Fixed submission:
n=int(input())
a=input().split()
b=" ".join(a[-1::-2] + a[(n%2)::2])
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b=[]
for i in range(n):
    b.append(a[i])
    b=b[::-1]
print(*b)

Fixed submission:
n=int(input())
a=input().split()
b=" ".join(a[-1::-2] + a[(n%2)::2])
print(b)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
left,right=0,0
for i in s:
    if i=="A":
        left = s.index(i)
    elif i=="Z":
        right = s[::-1].index(i)
print(len(s)- right-left)

Fixed submission:
s=input()
left,right=0,0
left = s.index("A")
right = s[::-1].index("Z")
print(len(s)- right-left)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

s1 = ''
s2 = ''

for i in range(a):
  s1 += str(a)

for i in range(b):
  s2 += str(b)
  
if a < b:
  print(s1)
else:
  print(s2)

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

s1 = ''
s2 = ''

for i in range(b):
  s1 += str(a)

for i in range(a):
  s2 += str(b)
  
if a < b:
  print(s1)
else:
  print(s2)
Buggy python submission (verdict: Runtime Error):
s = input()

k = 'keyence'

ans = ''
j=0
for i, c in enumerate(s):
  if c == k[i]:
    pass
  else:
    ans = s[0:i]
    s = [i:]
    j=i
    break

for i, c in enumerate(s):
  if k[j] == c:
    j = i
    ans += s[i:]
    break

if ans == k:
  print('YES')
else:
  print('NO')

Fixed submission:
s = input()

k = 'keyence'

tmp = s
ans = ''
for i in range(len(s)-1):
  for j in range(i, len(s)):
    tmp = s
    tmp = tmp[0:i] + tmp[j:]
    if k == tmp:
      print('YES')
      exit(0)
print('NO')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = input()
T = input()
# 出力
print("{}".format(S + T))

Fixed submission:
ST = input("").split()
S, T = ST[0], ST[1]
print("{}".format(T + S))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = int(input())
T = int(input())
# 出力
print("{}".format(S + T))

Fixed submission:
ST = input("").split()
S, T = ST[0], ST[1]
print("{}".format(T + S))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import fractions
from functools import reduce


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


k = int(input())
n = []
for i in range(1, k+1):
    n.append(i)
res = 0
for v in itertools.product(n, repeat=3):
    res += gcd(v[0], v[1], v[2])
print(res)


Fixed submission:
from math import gcd
k = int(input())
res = 0
for a in range(1,k+1):
    for b in range(1,k+1):
        t = gcd(a,b)
        for c in range(1,k+1):
            res += gcd(t,c)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B=list(map(int,input().split()))
l=[]
for i in range(N):
    for j in range(A):
        l.append('r')
        if len(l) >= N:
            print(l.count(('r')))
            exit()
    for k in range(B):
        l.append('b')
        if len(l) >= N:
            print(l.count(('r')))
            exit()

print(l.count(('r')))



Fixed submission:
N,A,B=list(map(int,input().split()))
a=N//(A+B)
b=N%(A+B)
if A == 0:
    print(0)
    exit()

if b > A:
    print(a*A+A)
    exit()

print(a*A+b)
Buggy python submission (verdict: Time Limit Exceeded):
#import heapq

def dice(p):
    return (1+p)/2
    #sum = 0
    #for i in range(1,p+1):
    #    sum += i/p
    #return sum

n,k = list(map(int,input().split()))
p = list(map(int,input().split()))

m = 0
l = []
for i in range(n-k+1):
    t = sum(p[i:i+k])
    if(m <= t):
        l = p[i:i+k]
        m = t
#print(l)
#l = heapq.nlargest(k, p)
#print(l)


dist = {}
res = 0
for i in l:
    if i in dist:
        ans = dist[i]
    else:
        dist[i] = dice(i)
    res += dice(i)

print(res)











Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
num_li = [0]*n
for i in range(n):
    num_li[i] = (p[i]+1)/2

num = sum(num_li[:k])
ans = num
for j in range(n-k):
    num = num - num_li[j] + num_li[j+k]
    ans = max(num,ans)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#import heapq

def dice(p):
    sum = 0
    for i in range(1,p+1):
        sum += i/p
    return sum

n,k = list(map(int,input().split()))
p = list(map(int,input().split()))

m = 0
l = []
for i in range(n-k+1):
    t = sum(p[i:i+k])
    if(m <= t):
        l = p[i:i+k]
        m = t
#print(l)
#l = heapq.nlargest(k, p)
#print(l)


dist = {}
res = 0
for i in l:
    if i in dist:
        ans = dist[i]
    else:
        dist[i] = dice(i)
    res += dice(i)

print(res)











Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
num_li = [0]*n
for i in range(n):
    num_li[i] = (p[i]+1)/2

num = sum(num_li[:k])
ans = num
for j in range(n-k):
    num = num - num_li[j] + num_li[j+k]
    ans = max(num,ans)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):


def dice(p):
    sum = 0
    for i in range(1,p+1):
        sum += i/p
    return sum

n,k = list(map(int,input().split()))
p = list(map(int,input().split()))

m = 0
l = []
for i in range(n-k+1):
    t = sum(p[i:i+k])
    if(m <= t):
        l = p[i:i+k]
        m = t

res = 0
for i in l:
    res += dice(i)

print(res)











Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
num_li = [0]*n
for i in range(n):
    num_li[i] = (p[i]+1)/2

num = sum(num_li[:k])
ans = num
for j in range(n-k):
    num = num - num_li[j] + num_li[j+k]
    ans = max(num,ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))

for i in range(k):
    if len(h) == 0:
        print(0)
        exit()
    m = max(h)
    h.remove(m)

print(sum(h))

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

h = sorted(h)

if n <= k:
    print(0)
    exit()
print(sum(h[0:n-k]))
Buggy python submission (verdict: Runtime Error):
alpha = "abcdefghijklmnopqrstuvwxy"
C = input()
print(alpha[alpha.index(C)+1])


Fixed submission:

alpha = "abcdefghijklmnopqrstuvwxyz"
C = input()
print(alpha[alpha.index(C)+1])
Buggy python submission (verdict: Runtime Error):
import math
import random

def is_prime3(q,k=50):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True


a = int(input())
while True:
 if is_prime3(a) == 1:
  break
 a = a + 1

print(a)



Fixed submission:
import random

def is_prime(n):
    if n == 2: return True
    if n == 1 or n & 1 == 0: return False

    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    for k in range(100):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)

        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1

        if y != n - 1 and t & 1 == 0:
            return False

    return True

a = int(input())

while True:
 if is_prime(a) == 1:
  break
 a = a + 1

print(a)

Buggy python submission (verdict: Runtime Error):
import math
import random

def is_prime3(q,k=50):
    q = abs(q)
    #計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #判定をk回繰り返す
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]の範囲すべてをチェック
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True


a = int(input())
while True:
 if is_prime(a) == 1:
  break
 a = a + 1

print(a)



Fixed submission:
import random

def is_prime(n):
    if n == 2: return True
    if n == 1 or n & 1 == 0: return False

    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    for k in range(100):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)

        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1

        if y != n - 1 and t & 1 == 0:
            return False

    return True

a = int(input())

while True:
 if is_prime(a) == 1:
  break
 a = a + 1

print(a)
Buggy python submission (verdict: Time Limit Exceeded):
# abc148_e.py
from sys import stdin
def f(n):
	sum = 1
	while n >= 2:
		sum = sum * n
		n = n - 2
	return sum
N = int(stdin.readline().rstrip())
sum = f(N)
#print(sum)
l = [int(x) for x in list(str(sum))]
l.reverse();
cnt = 0
for i in l:
	if i == 0:
		cnt = cnt + 1
	else:
		break
print(cnt)


Fixed submission:
n = int(input())
if n % 2 == 1:
 print(0)
else:
 i = 10
 ans = 0
 while i <= n:
  ans += n // i
  i *= 5
 print(ans)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main(){
 int a,b;
 cin >> a >> b;
 if(a <= 9 && b <= 9){
  cout << a * b << endl;
 }else{
  cout << -1 << endl;
 }
 return 0;
}



Fixed submission:

a,b = map(int,input().split())
if a <=9 and b <=9:
 print(a*b)
else:
 print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[]
for _ in range(N):
    s=input()
    S.append("".join(sorted(s)))
    #S.append(sorted(s))
#print(S)
re=0
for i in range(N-1):
    for j in range(i+1,N):
        if S[i]==S[j]:
            re+=1
            #break
print(re)


Fixed submission:
N=int(input())
S=[]
for _ in range(N):
    s=input()
    S.append("".join(sorted(s)))
    #S.append(sorted(s))
#print(S)
re=0
dt={}
for i in range(N):
    if S[i] in dt:
        dt[S[i]]+=1
    else:
        dt[S[i]]=1
for v in dt.values():
    if v>=2:
        v-=1
        re+=(v*(v+1)//2)

print(re)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[]
for _ in range(N):
    s=input()
    #S.append("".join(sorted(s)))
    S.append(sorted(s))
#print(S)
re=0
for i in range(N-1):
    for j in range(i+1,N):
        if S[i]==S[j]:
            re+=1
            #break
print(re)


Fixed submission:
N=int(input())
S=[]
for _ in range(N):
    s=input()
    S.append("".join(sorted(s)))
    #S.append(sorted(s))
#print(S)
re=0
dt={}
for i in range(N):
    if S[i] in dt:
        dt[S[i]]+=1
    else:
        dt[S[i]]=1
for v in dt.values():
    if v>=2:
        v-=1
        re+=(v*(v+1)//2)

print(re)
Buggy python submission (verdict: Runtime Error):
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[]
# l=[a,b,c,d,e]
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)

size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit(-1)

print("Yay!")


Fixed submission:
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[]
# l=[a,b,c,d,e]
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)

size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit()

print("Yay!")

Buggy python submission (verdict: Runtime Error):
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[a,b,c,d,e]
size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit(-1)

print("Yay!")


Fixed submission:
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[]
# l=[a,b,c,d,e]
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)

size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit()

print("Yay!")

Buggy python submission (verdict: Runtime Error):
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[a,b,c,d,e]
size=len(l)
for i in range(size-1):
 if (l[i+1]-l[i]) > k:
  print(":(")
  exit(-1)

print("Yay!")


Fixed submission:
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[]
# l=[a,b,c,d,e]
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)

size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit()

print("Yay!")

Buggy python submission (verdict: Runtime Error):
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[a,b,c,d,e]
size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit(-1)

print("Yay!")

Fixed submission:
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[]
# l=[a,b,c,d,e]
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)

size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit()

print("Yay!")
Buggy python submission (verdict: Runtime Error):
# abc121_a
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w)9


Fixed submission:
# abc121_a
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int,input().split()))
p_list = list(map(int,input().split()))

max = 0
for n in range(N):
  l = n
  r = n
  sum = 0.5 * (p_list[n]+1)
  len = 1
  while(len < K):
    if(l == 0):
      r += 1
      sum += 0.5 * (p_list[r]+1)
      len += 1
      continue
    if(r == N - 1):
      l += -1
      sum += 0.5 * (p_list[l]+1)
      len += 1
      continue
    if(p_list[l-1] >= p_list[r+1]):
      l += -1
      sum += 0.5 * (p_list[l]+1)
      len += 1
    else:
      r += 1
      sum += 0.5 * (p_list[r]+1)
      len += 1
  if(sum > max):
        max = sum
print(max)

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

sum = 0
for k in range(K):
  sum += p_list[k]
max = sum

i = 0
while(i + K  < N):
  sum = sum - p_list[i] + p_list[i+K]
  if(sum > max):
    max = sum
  i += 1

print(0.5 * (max+K))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int,input().split()))
p_list = list(map(int,input().split()))

max = 0
for n in range(N):
  if(n+K <= N):
    sum = 0
    for k in range(K):
      sum += 0.5 * (p_list[n+k]+1)
      if(sum > max):
        max = sum
print(max)

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

sum = 0
for k in range(K):
  sum += p_list[k]
max = sum

i = 0
while(i + K  < N):
  sum = sum - p_list[i] + p_list[i+K]
  if(sum > max):
    max = sum
  i += 1

print(0.5 * (max+K))