Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,y=map(int,input().split())

flag=0
for i in range(y//10000 + 1):
    for j in range(y//5000 + 1):
        if y-(10000*i + 5000*j)>=0 and (y-(10000*i + 5000*j))//1000 + i + j==n:
            print(i,j,(y-(10000*i + 5000*j))//1000)
            flag=1
            break
    if flag==1:
        break
if flag==0:
    print(-1,-1,-1)

Fixed submission:
n,y=map(int,input().split())

flag=0
for i in range(n+1):
    for j in range(n-i+1):
        if y-(10000*i + 5000*j)>=0 and (y-(10000*i + 5000*j))//1000 + i + j==n:
            print(i,j,(y-(10000*i + 5000*j))//1000)
            flag=1
            break
    if flag==1:
        break
if flag==0:
    print(-1,-1,-1)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        for k in range(k+1):
            if i+j+k==s:
                ans+=1
print(ans)

Fixed submission:
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        if i+j<=s and i+j+k>=s:
            ans+=1    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from itertools import product

X, Y = map(int, input().split())
flag = 0

for x in product('24', repeat=X):
    a = np.array(list(map(int, x)))
    if a.sum() == Y:
        flag = 1
        break
if flag == 1:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np
from itertools import combinations_with_replacement

X, Y = map(int, input().split())
flag = 0

for x in combinations_with_replacement('24', X):
    a = np.array(list(map(int, x)))
    if a.sum() == Y:
        flag = 1
        break
if flag == 1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M = map(int, input().split())
ans_list = np.zeros(N-1, dtype=int)
AB = []
flag = 0
ans_num_1 = []
for i in range(M):
    ab = list(map(int, input().split()))
    AB.append(ab)
    if 1 in ab:
        for j in ab:
            if j != 1:
                ans_num_1.append(j)
                ans_list[j-2] = 1
        AB.remove(ab)
if 0 not in ans_list:
    flag = 1
    print("Yes")
# print(ans_list)
while(flag != 1):
    if flag == 0:
        for ab in AB:
            for ans_num in ans_num_1:
                if ans_num in ab:
                    for j in ab:
                        if ans_num != j:
                            ans_list[j-2] = ans_num
                    AB.remove(ab)
            
        if 0 not in ans_list:
            flag = 1
            print("Yes")
if flag == 1:
    for ans in ans_list:
        print(ans)

Fixed submission:
from collections import deque

N, M = map(int, input().split())
AB = []
for i in range(M):
    ab = list(map(int, input().split()))
    AB.append(ab)
# print(AB)

graph = [[] for _ in range(N)]
for a, b in AB:
    graph[a-1].append(b)
    graph[b-1].append(a)
# print(graph) -> [[], [2], [1, 3, 4], [2, 4], [3, 2]]

que = deque([1])
ans = [0 for _ in range(N)]

while que:
    x = deque.popleft(que)
    for i in graph[x-1]:
        if ans[i-1] != 0:
            continue
        ans[i-1] = x
        que.append(i)
for a in ans[1:]:
    if a == 0:
        print('No')
        break
else:
    print('Yes')
    print('\n'.join(map(str, ans[1:])))
Buggy python submission (verdict: Runtime Error):
import itertools


X = int(input())
ans_A = 0
ans_B = 0
for i, j in itertools.combinations(range(0, 1000), 2):
    j *= -1
    if i**5 - j**5 == X:
        ans_A = i
        ans_B = j
        break
if ans_A == 0 and ans_B == 0:
    for i, j in itertools.combinations(range(0, 1000), 2):
        if i**5 - j**5 == X:
            ans_A = i
            ans_B = j
            break
print(ans_A, ans_B)


Fixed submission:
S = input()
if S == 'ABC':
    print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd
from functools import reduce


def gcd_kai(*numbers):
    return reduce(gcd, numbers)


K = int(input())
ans = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += gcd_kai(i + 1, j + 1, k + 1)
print(ans)


Fixed submission:
from math import gcd
from functools import reduce


def gcd_kai(*numbers):
    return reduce(gcd, numbers)


K = int(input())
ans = 1
if K == 1:
    next
else:
    ans += (K - 1) * K * 3
    ans_sub = 0
    for i in range(2, K):
        for j in range(i + 1, K + 1):
            for k in range(i, K + 1):
                ans_sub += gcd_kai(i, j, k)
    ans += ans_sub * 3
    for i in range(2, K + 1):
        ans += i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
a = 0
for i in range(10**K):
    a += 7*(10**i)
    a = a % K
    if a == 0:
        print(i+1)
        exit()
print(-1)

Fixed submission:
K = int(input())
a = 0
for i in range(K):
    a = (10*a+7)%K
    if a == 0:
        print(i+1)
        exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
D = int(input())
c = [int(x) for x in input().split()]
s = []
for i in range(D):
    s.append([int(x) for x in input().split()])
kotae = 0
for k in range(26):
    ans = 0
    nissuu = [0] * 26
    for i in range(D):
        t = (i+k) % 26 + 1
        for j in range(26):
            if j == t-1:
                nissuu[j] = 0
            else:
                nissuu[j] += 1
            ans -= c[j]*nissuu[j]
        ans += s[i][t-1]
    if kotae <= ans:
        kotae = ans
        key = k
for i in range(D):
    print((i+key) % 26 + 1)

Fixed submission:
for i in range(365):
  print(1)

Buggy python submission (verdict: Runtime Error):
D = int(input())
c = [int(x) for x in input().split()]
s = []
for i in range(D):
    s.append([int(x) for x in input().split()])
kotae = 0
k2 = 0
for k in range(26):
    ans = 0
    nissuu = [0] * 26
    for i in range(D):
        t = (i+k) % 26 + 1
        for j in range(26):
            if j == t-1:
                nissuu[j] = 0
            else:
                nissuu[j] += 1
            ans -= c[j]*nissuu[j]
        ans += s[i][t-1]
    if kotae <= ans:
        kotae = ans
        key = k
for i in range(D):
    print((i+key) % 26 + 1)

Fixed submission:
for i in range(365):
  print(1)

Buggy python submission (verdict: Runtime Error):
D = int(input())
c = [int(x) for x in input().split()]
s = []
for i in range(D):
    s.append([int(x) for x in input().split()])
kotae = 0
nissuu = [0] * 26
k2 = 0
for k in range(26):
    ans = 0
    print(k)
    for i in range(D):
        t = (i+k) % 26 + 1
        for j in range(26):
            if j == t-1:
                nissuu[j] = 0
            else:
                nissuu[j] += 1
            ans -= c[j]*nissuu[j]
        ans += s[i][t-1]
    if kotae <= ans:
        kotae = ans
        key = k
for i in range(D):
    print((i+key) % 26 + 1)

Fixed submission:
for i in range(365):
  print(1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
i = 0
while True:
    i += 1
    if N*i % 360 == 0:
        print(i)

Fixed submission:
N = int(input())
i = 0
while True:
    i += 1
    if N*i % 360 == 0:
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
b =　int(float(b) * 100)
print(a * b // 100)

Fixed submission:
a, b = input().split()
a = int(a)
b = round(float(b) * 100)
print(a * b // 100)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
b = []
if True:
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
kosuu = 1
mae = a[0]
for i in range(1,len(a)):
    if mae == a[i]:
        kosuu += 1
    else:
        mae = a[i]
        b.append(kosuu)
        kosuu = 1
b.append(kosuu)
ans = 0
for i in range(len(b)):
    for j in range(2,100):
        if b[i] < j*(j+1)//2:
            ans += j-1
            break
print(ans)

Fixed submission:
n = int(input())
a = []
b = []
if n == 1:
    print(0)
    exit()
if True:
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
kosuu = 1
mae = a[0]
for i in range(1,len(a)):
    if mae == a[i]:
        kosuu += 1
    else:
        mae = a[i]
        b.append(kosuu)
        kosuu = 1
b.append(kosuu)
ans = 0
for i in range(len(b)):
    for j in range(2,100):
        if b[i] < j*(j+1)//2:
            ans += j-1
            break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    for j in range(i+1,N):
        if j - i == a[j] + a[i]:
            ans += 1
print(ans)

Fixed submission:
N = int(input())
a = [int(x) for x in input().split()]
l = [0]*N
r = [0]*N
for i in range(N):
    l[i] = a[i] + i + 1
    r[i] = i + 1 - a[i]
from collections import defaultdict
d = defaultdict(int)
for i in range(N):
    d[r[i]] += 1
ans = 0
for i in range(N):
    d[r[i]] -= 1
    ans += d[l[i]]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
l = list(input())
amari = [0]*len(l)
mod = 2019
count = [0]*2020
import math
for i in range(len(l)):
    n = int("".join(l[i:])) % mod
    count[n] += 1
ans = 0
for i in range(1,2020):
    if count[i] == 0 or count[i] == 1:
        continue
    ans += count[i] * (count[i]-1)//2
ans += count[0]
print(ans)

Fixed submission:
S = input()
N = len(S)
P = 2019
num = [0] * P
num[0] = 1
now, ans = 0, 0
_10 = 1
for i in range(N-1, -1, -1):
    now = (now + int(S[i]) * _10) % P
    _10 *= 10
    _10 %= P
    ans += num[now]
    num[now] += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l = list(input())
amari = [0]*len(l)
mod = 2019
import math
for i in range(len(l)):
    amari[i] = int(l[i])*(10**(len(l)-1-i)) % mod
rui = [0]*len(l)
rui[len(l)-1] = amari[-1]
for i in range(len(l)-2,-1,-1):
    rui[i] = rui[i+1] + amari[i]
count = [0]*2020
for i in range(len(l)):
    count[rui[i]%2019] += 1
ans = 0
for i in range(1,2020):
    if count[i] == 0 or count[i] == 1:
        continue
    ans += count[i] * (count[i]-1)//2
ans += count[0]
print(ans)

Fixed submission:
S = input()
N = len(S)
P = 2019
num = [0] * P
num[0] = 1
now, ans = 0, 0
_10 = 1
for i in range(N-1, -1, -1):
    now = (now + int(S[i]) * _10) % P
    _10 *= 10
    _10 %= P
    ans += num[now]
    num[now] += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l = list(input())
amari = [0]*len(l)
mod = 2019
import math
for i in range(len(l)):
    amari[i] = int(l[i])*(10**(len(l)-1-i)) % mod
rui = [0]*len(l)
rui[len(l)-1] = amari[-1]
for i in range(len(l)-2,-1,-1):
    rui[i] = (rui[i+1] + amari [i])%mod
count = [0]*2020
for i in range(len(l)):
    count[rui[i]] += 1
ans = 0
for i in range(1,2020):
    if count[i] == 0 or count[i] == 1:
        continue
    ans += count[i] * (count[i]-1)//2
ans += count[0]
print(ans)

Fixed submission:
S = input()
N = len(S)
P = 2019
num = [0] * P
num[0] = 1
now, ans = 0, 0
_10 = 1
for i in range(N-1, -1, -1):
    now = (now + int(S[i]) * _10) % P
    _10 *= 10
    _10 %= P
    ans += num[now]
    num[now] += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l = list(input())
amari = [0]*len(l)
mod = 2019
import math
for i in range(len(l)):
    amari[i] = int(l[i])*(10**(len(l)-1-i)) % mod
rui = [0]*len(l)
rui[len(l)-1] = amari[-1]
for i in range(len(l)-2,-1,-1):
    rui[i] = (rui[i+1] + amari [i])%mod
count = [0]*2020
for i in range(len(l)):
    count[rui[i]] += 1
ans = 0
for i in range(1,2020):
    if count[i] == 0 or count[i] == 1:
        continue
    ans += math.factorial(count[i]) // (math.factorial(count[i]-2)*2)
ans += count[0]
print(ans)

Fixed submission:
S = input()
N = len(S)
P = 2019
num = [0] * P
num[0] = 1
now, ans = 0, 0
_10 = 1
for i in range(N-1, -1, -1):
    now = (now + int(S[i]) * _10) % P
    _10 *= 10
    _10 %= P
    ans += num[now]
    num[now] += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range1,(N+1):
    if i%3 != 0 and i%5 != 0:
        ans += i
print(ans)

Fixed submission:
N = int(input())
ans = 0
for i in range(N+1):
    if i%3 != 0 and i%5 != 0:
        ans += i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
ans = 0
N = int(input())
for i in range(N):
    for j in range(N):
        for k in range(N):
            ans += math.gcd(math.gcd(i+1,j+1),k+1)
print(ans)


Fixed submission:
import math
ans = 0
N = int(input())
if N <= 5:
  for i in range(N):
    for j in range(N):
        for k in range(N):
            ans += math.gcd(math.gcd(i+1,j+1),math.gcd(j+1,k+1))
else:
    for i in range(N):
        ans += i+1
    for i in range(N-1):
        for j in range(i+1,N):
            ans += 6*math.gcd(i+1,j+1)
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                ans += 6*math.gcd(math.gcd(i+1,j+1),math.gcd(j+1,k+1))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
ans = 0
N = int(input())
for i in range(N):
    for j in range(N):
        for k in range(N):
            ans += math.gcd(math.gcd(i+1,j+1),math.gcd(j+1,k+1))
print(ans)

Fixed submission:
import math
ans = 0
N = int(input())
if N <= 5:
  for i in range(N):
    for j in range(N):
        for k in range(N):
            ans += math.gcd(math.gcd(i+1,j+1),math.gcd(j+1,k+1))
else:
    for i in range(N):
        ans += i+1
    for i in range(N-1):
        for j in range(i+1,N):
            ans += 6*math.gcd(i+1,j+1)
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                ans += 6*math.gcd(math.gcd(i+1,j+1),math.gcd(j+1,k+1))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
ans = 0
N = int(input())
for i in range(N):
    for j in range(N):
        for k in range(N):
            ans += math.gcd(i,j,k)
print(ans)

Fixed submission:
import math
ans = 0
N = int(input())
if N <= 5:
  for i in range(N):
    for j in range(N):
        for k in range(N):
            ans += math.gcd(math.gcd(i+1,j+1),math.gcd(j+1,k+1))
else:
    for i in range(N):
        ans += i+1
    for i in range(N-1):
        for j in range(i+1,N):
            ans += 6*math.gcd(i+1,j+1)
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                ans += 6*math.gcd(math.gcd(i+1,j+1),math.gcd(j+1,k+1))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n,x,y = [int(x) for x in input().split()]
l = [[] for i in range(n+1)]
p = []
q = []
l[1].append(2)
for i in range(2,n):
    l[i].append(i+1)
    l[i].append(i-1)
l[n].append(n-1)
l[x].append(y)
l[y].append(x)
clist = [0]*(n+1)
#ここまでで、グラフが隣接リスト表記で表される
for k in range(1,n+1):
    d = deque()
    dist = [-1]*(n+1)
    dist[k] = 0
    d.append(k)
    while True:
        v = d.popleft()
        for i in l[v]:
            if dist[i] != -1:
                continue
            dist[i] = dist[v] + 1
            d.append(i)
        if not d:
            break
    for j in dist[k+1:]:
        clist[j] += 1
for i in range(1,n):
    print(clist[i])

Fixed submission:
n,x,y = [int(x) for x in input().split()]
count = [0]*(n+1)
for i in range(1,n):
    for j in range(i+1,n+1):
        if i < x and j <= x:
            nagasa = j - i
        elif i < x and x < j and j < y:
            nagasa = x-i + min(j-x,y-j+1)
        elif i < x and y <= j:
            nagasa = x-i + j - y + 1
        elif x <= i and i < y and j <= y:
            nagasa = min(j-i,i-x+y-j+1)
        elif x <= i and i < y and y < j:
            nagasa = j - y + min(y-i,i-x+1)
        elif y <= i:
            nagasa = j -i
        count[nagasa] += 1
for i in range(1,n):
    print(count[i])

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n,x,y = [int(x) for x in input().split()]
l = [[] for i in range(n+1)]
p = []
q = []
l[1].append(2)
for i in range(2,n):
    l[i].append(i+1)
    l[i].append(i-1)
l[n].append(n-1)
l[x].append(y)
l[y].append(x)
clist = [0]*(n+1)
#ここまでで、グラフが隣接リスト表記で表される
for i in range(1,n+1):
    d = deque()
    dist = [-1]*(n+1)
    dist[i] = 0
    d.append(i)
    while True:
        v = d.popleft()
        for i in l[v]:
            if dist[i] != -1:
                continue
            dist[i] = dist[v] + 1
            d.append(i)
        if not d:
            break
    for j in dist:
        if j == -1:
            continue
        clist[j] += 1
for i in range(1,n):
    print((clist[i])//2)

Fixed submission:
n,x,y = [int(x) for x in input().split()]
count = [0]*(n+1)
for i in range(1,n):
    for j in range(i+1,n+1):
        if i < x and j <= x:
            nagasa = j - i
        elif i < x and x < j and j < y:
            nagasa = x-i + min(j-x,y-j+1)
        elif i < x and y <= j:
            nagasa = x-i + j - y + 1
        elif x <= i and i < y and j <= y:
            nagasa = min(j-i,i-x+y-j+1)
        elif x <= i and i < y and y < j:
            nagasa = j - y + min(y-i,i-x+1)
        elif y <= i:
            nagasa = j -i
        count[nagasa] += 1
for i in range(1,n):
    print(count[i])
Buggy python submission (verdict: Runtime Error):
from collections import deque
x,y,a,b,c = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
r = [int(x) for x in input().split()]
#入力を受け取った
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
d = deque(r)
#ソートした。rはdequeにした
aka = x-1#赤いリンゴのうち、交換するか調べるもの
midori = y-1#緑リンゴ同上
while True:
  siraberu = d.popleft()#無職リンゴのうち一番美味しいものを取り出す
  if min(p[aka],q[midori]) < siraberu:#調べるリンゴのうちのまずい方がsiraberuよりまずいか
    if p[aka] <= q[midori]:#調べる赤リンゴの方がまずいとき
      p[aka] = siraberu#交換
      aka = aka - 1#調べるものを一個ずらす
    else:
      q[midori] = siraberu
      midori = midori - 1
  if aka == -1:
    aka = 0
  elif midori == -1:
    midori = 0
  else:
    break
pd = deque(p)
qd = deque(q)
ans = 0
for i in range(x):
  ans = ans + pd.popleft()
for i in range(y):
  ans = ans + qd.popleft()
print(ans)

Fixed submission:
from collections import deque
x,y,a,b,c = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
r = [int(x) for x in input().split()]
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
d = deque(r)
aka = x-1
midori = y-1
ps = p[:x]
qs = q[:y]
li = ps + qs
li.sort(reverse=True)
i = 0
z = d.popleft()
while li[x+y-1-i] < z:
  li[x+y-1-i] = z
  i += 1
  if not d:
    break
  z = d.popleft()
ans = 0
for i in range(x+y):
  ans += li[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(x) for x in input().split()]
def motomeru(i):
  m = l.count(i)
  return int(m*(m-1)/2)
def herasu(i):
  m = l.count(i)-1
  return int(m*(m-1)/2)
zenbu = 0
for i in range(n):
  zenbu = zenbu + motomeru(i+1)
for i in range(n):
  a = zenbu - motomeru(l[i]) + herasu(l[i])
  print(a)


Fixed submission:
n = int(input())
l = [int(x) for x in input().split()]
k = [0]*n
for i in range(n):
  k[l[i] - 1] = k[l[i] - 1] + 1
def motomeru(i):
  return int((k[i-1])*(k[i-1]-1)/2)
def herasu(i):
  if k[i-1] == 0 or k[i-1] == 1:
    return 0
  else:
    return int((k[i-1]-1)*(k[i-1]-2)/2)
zenbu = 0
for i in range(n):
  zenbu = zenbu + motomeru(i+1)
for i in range(n):
  a = zenbu - motomeru(l[i]) + herasu(l[i])
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(x) for x in input().split()]
def motomeru(i):
  m = l.count(i)
  return int(m*(m-1)/2)
def herasu(i):
  m = l.count(i)-1
  return int(m*(m-1)/2)
zenbu = 0
for i in range(n):
  zenbu = zenbu + motomeru(i+1)
for i in range(n):
  a = zenbu - motomeru(l[i]) + herasu(l[i])
  print(a)

Fixed submission:
n = int(input())
l = [int(x) for x in input().split()]
k = [0]*n
for i in range(n):
  k[l[i] - 1] = k[l[i] - 1] + 1
def motomeru(i):
  return int((k[i-1])*(k[i-1]-1)/2)
def herasu(i):
  if k[i-1] == 0 or k[i-1] == 1:
    return 0
  else:
    return int((k[i-1]-1)*(k[i-1]-2)/2)
zenbu = 0
for i in range(n):
  zenbu = zenbu + motomeru(i+1)
for i in range(n):
  a = zenbu - motomeru(l[i]) + herasu(l[i])
  print(a)
Buggy python submission (verdict: Runtime Error):
a,b = [int(x) for x in input().split()]
amax = int((a+1)*12.5)
amin = int(a*12.5)
bmax = int((b+1)*10)
bmin = int(b*10)
hantei = bmin
if amax < bmin:
  hantei = str(-1)
elif bmax < amin:
  hantei = str(-1)
elif bmin < amin:
  hantei = amin
print(hantei)

Fixed submission:
a = input()
b = list(a)
hantei = "Yes"
if b[0] == b[1] and b[1] == b[2] and b[2] == b[0]:
  hantei = "No"
print(hantei)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
maxwa = 0
for i in range(N-K+1):
    wa = 0
    for j in range(K):
        wa += l[i+j]
    maxwa = max(maxwa,wa)
print((maxwa+K)/2)

Fixed submission:
N,K = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
rui = [0]*(N+1)
for i in range(1,N+1):
    rui[i] = rui[i-1] + l[i-1]
maxwa = 0
for i in range(N-K+1):
    wa = rui[K+i]-rui[i]
    maxwa = max(maxwa,wa)
print((maxwa+K)/2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
from functools import lru_cache
@lru_cache(maxsize=20000000)
def gcd(x,y):
    if x >= y:
        b = x % y
        return gcd(b,y)
    return fractions.gcd(x,y)
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans = (ans + (lcm//a[i]))%mod
print(ans)

Fixed submission:
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // fractions.gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans += lcm//a[i]
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
from functools import lru_cache
@lru_cache(maxsize=20000000)
def gcd(x,y):
    if x >= y:
        b = x % y
        return gcd(b,y)
    return fractions.gcd(x,y)
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans = (ans + (lcm//a[i]))%mod
print(ans)

Fixed submission:
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // fractions.gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans += lcm//a[i]
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // fractions.gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans = (ans + (lcm//a[i]))%mod
print(ans)

Fixed submission:
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // fractions.gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans += lcm//a[i]
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // fractions.gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans = (ans + (lcm//a[i]))%mod
print(ans)

Fixed submission:
N = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7
#最小公倍数を割った商の和を求める
import fractions
lcm = a[0]
for i in range(1,N):
    lcm = lcm * a[i] // fractions.gcd(lcm,a[i])
ans = 0
for i in range(N):
    ans += lcm//a[i]
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = "No"
for i in range(1,10):
  for j in range(1,10):
    if N = i*j:
      ans = "Yes"
      break
print(ans)

Fixed submission:
N = int(input())
ans = "No"
for i in range(1,10):
  for j in range(1,10):
    if N == i*j:
      ans = "Yes"
      break
print(ans)