Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

n, k = map(int, input().split())
lis = list(map(int, input().split()))
lis_score = []


for i in range(n):

  if i < k-1:
    continue
  else:
    ans = 1
    for x in range(k):
      ans *= lis[i-x]

    lis_score.append(ans)


for y in range(len(lis_score)-1):

  if lis_score[y] < lis_score[y+1]:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n, k = map(int, input().split())
lis = list(map(int, input().split()))
lis_score = []


for i in range(n):

  if i >= k:
    lis_edge_right = lis[i]
    lis_edge_left = lis[i-k]
    
    if lis_edge_right > lis_edge_left:
      print("Yes")
    else:
      print("No")
### BUGGY CODE ###

n,c = map(int,raw_input().split())

arr = [[0 for i in range((10**5+2) * 2)] for i in range(c)]

for i in range(n):
	s,t,ch = map(int,raw_input().split())
	arr[ch-1][s*2-1] = 1
	arr[ch-1][t*2] = -1

for i in range(c):
	for j in range(1,(10**5+2)*2):
		arr[i][j] = arr[i][j-1] + arr[i][j]



ans = 0
for i in range(((10**5+2)*2)):
	count = 0
	for j in range(c):
		if arr[j][i] > 0 :
			count += 1

	ans = max(ans,count)

print ans



### FIXED CODE ###

n, c = map(int, input().split())

r = [[0 for i in range(c)] for j in range(100000)] 
for dummy in range(n): 
    s, t, c = map(int, input().split())
    for j in range(s - 1, t):
        r[j][c - 1] = 1 

ans = 0
for i in range(100000):
    if sum(r[i]) > ans:
        ans = sum(r[i]) 

print(ans)
### BUGGY CODE ###

N = int(input())
X = input()
zero_pop = X.count('1') + 1
one_pop = X.count('1') - 1
pop = {0:0}
def popcount(n):
    if n in pop:
        return pop[n]
    pop[n] = popcount(n // 2) + n % 2
    return pop[n]
memo = {0:0}
def f_count(n):
    if n in memo:
        return memo[n]
    memo[n] = f_count(n % popcount(n)) + 1
    return memo[n]
for i in range(N):
    x = int(X, 2)
    if X[i] == '1' and one_pop == 0:
        print(0)
        continue
    if X[i] == '1':
        x -= 2 ** (N-1-i)
        x %= one_pop
    elif X[i] == '0':
        x += 2 ** (N-1-i)
        x %= zero_pop
    
    print(f_count(x) + 1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
N = int(input())
X = input()
zero_pop = X.count('1') + 1
one_pop = X.count('1') - 1
one_mod, zero_mod = 0, 0

for b in X:
    if one_pop != 0:
        one_mod = (one_mod * 2 + int(b)) % one_pop
    zero_mod = (zero_mod * 2 + int(b)) % zero_pop

pop = {0:0}
def popcount(n):
    if n in pop:
        return pop[n]
    pop[n] = popcount(n // 2) + n % 2
    return pop[n]
memo = {0:0}
def f_count(n):
    if n in memo:
        return memo[n]
    memo[n] = f_count(n % popcount(n)) + 1
    return memo[n]
one_p = {0:1}
def one_pow(n):
    if n in one_p:
        return one_p[n]
    one_p[n] = one_pow(n - 1) * 2 % one_pop
    return one_p[n]
zero_p = {0:1}
def zero_pow(n):
    if n in zero_p:
        return zero_p[n]
    zero_p[n] = zero_pow(n - 1) * 2 % zero_pop
    return zero_p[n]
for i in range(N):
    if X[i] == '1' and one_pop == 0:
        print(0)
        continue
    if X[i] == '1':
        x = one_mod
        x -= one_pow(N-1-i)
        x %= one_pop
    elif X[i] == '0':
        x = zero_mod
        x += zero_pow(N-1-i)
        x %= zero_pop
    
    print(f_count(x) + 1)
### BUGGY CODE ###

import heapq
N, M = map(int, input().split())
S = [False] * N
G = [[] for i in range(N)]
def root(i):
  if R[i] == i:
    return i
  else:
    R[i] = root(R[i])
    return R[i]
loop = False
for i in range(M):
  l, r, d = map(int, input().split())
  G[l - 1].append([r - 1, d])
for i in range(N):
  if not S[i]:
    _X = [None for i in range(N)]
    _X[i] = 0
    Q = []
    heapq.heappush(Q, [0, i])
    contract = False
    while Q:
      s = heapq.heappop(Q)
      S[s[1]] = True
      for adj, d in G[s[1]]:
        if _X[adj] == None:
          _X[adj] = s[0] + d
          if _X[adj] <= 10 ** 9:
            heapq.heappush(Q, [_X[adj], adj])
          else:
            contract = True
            break
        elif _X[adj] != s[0] + d:
          contract = True
          break
      if contract:
        break
    if contract:
      print('No')
      break
else:
  print('Yes')

### FIXED CODE ###

import heapq
N, M = map(int, input().split())
E = [[] for _ in range(N)]
RE = [[] for _ in range(N)]
S = [0] * N
for _ in range(M):
  l, r, d = map(int, input().split())
  S[l - 1] = 1
  E[l - 1].append([d, r - 1])
  RE[r - 1].append([d, l - 1])
D = [None] * N
def dijkstra(i):
  D[i] = 0
  Q = [[0, i]]
  while Q:
    d, s = heapq.heappop(Q)
    for dist, adj in E[s]:
      if D[adj] == None:
        D[adj] = D[s] + dist
        heapq.heappush(Q, [D[adj], adj])
      elif D[adj] == 'Error' or D[adj] != D[s] + dist:
        D[s] = 'Error'
        break
    else:
      for dist, adj in RE[s]:
        if D[adj] == None:
          D[adj] = D[s] - dist
          heapq.heappush(Q, [D[adj], adj])
        elif D[adj] == 'Error' or D[adj] != D[s] - dist:
          D[s] = 'Error'
          break
      else:
        continue
    break
for i in range(N):
  if D[i] == 'Error':
    print('No')
    break
  elif D[i] == None:
    dijkstra(i)
else:
  for d in D:
    if d == 'Error':
      print('No')
      break
  else:
    print('Yes')
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n, m, q = map(int, input().split())
t = [ [0] * (n+1) for _ in range(n+1) ]
qq = []
for _ in range(m):
    l, r = map(int, input().split())
    t[l][r] += 1
for _ in range(q):
    tmp = list(map(int, input().split()))
    qq.append(tmp)

s = [ [0] * (n+1) for _ in range(n+1) ]
for i in range(1, n+1):
    tmp = 0
    for j in range(1, n+1):
        tmp += t[i][j]
        s[j][i] = tmp

x = [ [0] * (n+1) for _ in range(n+1) ]
for i in range(1, n+1):
    for j in range(i, n+1):
        tmp = 0
        for k in range(i, j+1):
            tmp += s[j][k]
        x[i][j] = tmp

for qqq in qq:
    print(x[qqq[0]][qqq[1]])

### FIXED CODE ###

import sys
input = sys.stdin.readline

n, m, q = map(int, input().split())
t = [ [0] * (n+1) for _ in range(n+1) ]
qq = []
for _ in range(m):
    l, r = map(int, input().split())
    t[l][r] += 1
for _ in range(q):
    tmp = list(map(int, input().split()))
    qq.append(tmp)

s = [ [0] * (n+1) for _ in range(n+1) ]
for i in range(1, n+1):
    tmp = 0
    for j in range(1, n+1):
        tmp += t[i][j]
        s[j][i] = tmp

x = [ [0] * (n+1) for _ in range(n+1) ]
for i in range(1, n+1):
    for j in range(i, n+1):
        tmp = 0
        for k in range(i, j+1):
            tmp += s[j][k]
        x[i][j] = tmp

for qqq in qq:
    print(x[qqq[0]][qqq[1]])
### BUGGY CODE ###

N = int(input())
A = input().split()
A = [int(n) for n in A]
for i in range(N):
  A_init=A
  A=[n for n in A if n!=i+1]
  print(len(A_init)-len(A))

### FIXED CODE ###

N = int(input())
A =[int(n) for n in input().split()]
b = [0]*N
for i in A:
  b[i-1]+=1
for i in range(N):
  print(b[i])
### BUGGY CODE ###

def Eratosthenes(n):
	N = {i:True for i in range(2,n+1)}
	primeNumbers = []
	for i in range(2,n+1):
		if N[i]:
			primeNumbers.append(i)
			j = i*2
			while j<=n:
				N.update({j:False})
				j += i
	return primeNumbers

while True:
	n = int(input())
	print(len(Eratosthenes(n)))

### FIXED CODE ###

def Eratosthenes(n):
	N = [1 for i in range(0,n+1)]
	i = 3
	while i*i<=n:
		if N[i]:
			j = i*i
			while j<=n:
				N[j] = 0
				j += i*2
		i += 2
	return N

N = Eratosthenes(999999)
while True:
	try:
		n = int(input())
	except EOFError:
		break
	cnt = 0
	if n>=2:
		cnt = 1
	for i in range(3, n+1, 2):
		cnt += N[i]
	print(cnt)
### BUGGY CODE ###

import numpy as np
import bisect

(A,B,Q) = map(int,input().split())
inf = 10**12
s = np.empty(A+2,dtype=np.int64)
t = np.empty(B+2,dtype=np.int64)
s[0] = -inf
t[0] = -inf
s[A+1] = inf
t[B+1] = inf

for i in range(A):
    s[i+1] = np.int64(input())
for i in range(B):
    t[i+1] = np.int64(input())

for i in range(Q):
    x = np.int64(input())
    p = bisect.bisect_left(s,x)
    q = bisect.bisect_left(t,x)
    ans = min(max(s[p]-x,t[q]-x),
              max(x-s[p-1],x-t[q-1]),
                  (s[p]-x)*2 + (x-t[q-1]),
                  (s[p]-x) + (x-t[q-1])*2,
                  (t[q]-x)*2 + (x-s[p-1]),
                  (t[q]-x) + (x-s[p-1])*2)
    print(ans)

### FIXED CODE ###

import numpy as np
import bisect
 
(A,B,Q) = map(int,input().split())
inf = 10**12
s = np.empty(A+2,dtype=np.object)
t = np.empty(B+2,dtype=np.object)
s[0] = -inf
t[0] = -inf
s[A+1] = inf
t[B+1] = inf
 
for i in range(A):
    s[i+1] = int(input())
for i in range(B):
    t[i+1] = int(input())
 
for i in range(Q):
    x = int(input())
    p = bisect.bisect_left(s,x)
    q = bisect.bisect_left(t,x)
    ans = min(max(s[p]-x,t[q]-x),
              max(x-s[p-1],x-t[q-1]),
                  (s[p]-x)*2 + (x-t[q-1]),
                  (s[p]-x) + (x-t[q-1])*2,
                  (t[q]-x)*2 + (x-s[p-1]),
                  (t[q]-x) + (x-s[p-1])*2)
    print(ans)
### BUGGY CODE ###

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


n = inp()
a = inpl()
ans = 1
for i in a:
    ans *= i
if ans > 10**18:
    print(-1)
    exit()
print(ans)


### FIXED CODE ###

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


n = inp()
a = inpl()
ans = 1
if 0 in a:
    print(0)
    exit()
for i in a:
    ans *= i
    if ans > 10**18:
        print(-1)
        exit()
print(ans)
### BUGGY CODE ###

N, K, Q = map(int, input().split())
A = []
for _ in range(Q):
    A.append(int(input()))

dif = K - Q
if dif > 0:
    for i in range(N):
        print('Yes')
else:
    for n in range(N):
        freq = A.count(n + 1)
        if dif + freq <= 0:
            print('No')
        else:
            print('Yes')





### FIXED CODE ###

N, K, Q = map(int, input().split())
index_list = [int(input()) - 1 for i in range(Q)]

zero_list = [0 for n in range(N)]

ori = K - Q
for i in range(Q):
    zero_list[index_list[i]] += 1
for i in range(N):
    zero_list[i] += ori
for i in range(N):
    if zero_list[i] > 0:
        print('Yes')
    else:
        print('No')

# shakayamiさんのコードを参考にしました
# for文が入れ子になると遅くなるから，出来るだけそうしない
### BUGGY CODE ###

h,n = map(int,input().split())
a = [0]*n
b = [0]*n
for i in range(n):
    a[i],b[i] = map(int,input().split())
dp = [float('inf')]*(h+1)
dp[0] = 0

for i in range(n):
    for j in range(h+1):
        if dp[j] != float('inf'):
            nj = j + a[i]
            if nj >= h:
                nj = h
            dp[nj] = min(dp[nj],dp[j] + b[i])
print(dp[h])


### FIXED CODE ###

h,n = map(int,input().split())
a = [0]*n
b = [0]*n
for i in range(n):
    a[i],b[i] = map(int,input().split())
dp = [1e100]*(h+1)
dp[0] = 0

for i in range(n):
    for j in range(h+1):
        if dp[j] != 1e100:
            nj = j + a[i]
            if nj >= h:
                nj = h
            dp[nj] = min(dp[nj],dp[j] + b[i])
print(dp[h])
### BUGGY CODE ###

class SegmentTree(object):
    """
    セグメントツリー (0-indexed)

    1. 値の更新 O(logN)
    2. 区間クエリ O(logN)
    """
    def __BinOp(self, x, y):
        """ セグ木で使用する二項演算 """
        return x + y

    def __init__(self, init_ele, N:int):
        """
        セグ木を構築する

        init_ele: 単位元 
        N: 要素数
        """
        self.__init_ele = init_ele
        self.__n = 1
        while self.__n < N:
            self.__n <<= 1

        self.__dat = [init_ele] * (2 * self.__n)
    
    def update(self, k:int, x):
        """ k番目の値をxに変更する """
        k += self.__n - 1
        self.__dat[k] = x
        while k:
            k = (k - 1) // 2
            self.__dat[k] = self.__BinOp(
                self.__dat[k * 2 + 1], self.__dat[k * 2 + 2]
                )
    
    def query(self, p:int, q:int):
        """ 区間クエリ [p,q) """
        if q <= p: return self.__init_ele
        p += self.__n - 1
        q += self.__n - 2
        res = self.__init_ele
        while q - p > 1:
            if not (p & 1):
                res = self.__BinOp(res, self.__dat[p])
            if q & 1:
                res = self.__BinOp(res, self.__dat[q])
                q -= 1
            p = p // 2
            q = (q - 1) // 2
        res = self.__BinOp(res, self.__dat[p])
        if p != q: res = self.__BinOp(res, self.__dat[q])
        return res
    
    def get_num(self, k:int):
        """ k番目の値を取得する """
        k += self.__n - 1
        return self.__dat[k]

N = int(input())
S = input()

R = SegmentTree(0, N)
G = SegmentTree(0, N)
B = SegmentTree(0, N)

for i in range(N):
    if S[i] == "R":
        R.update(i, 1)
    elif S[i] == "G":
        G.update(i, 1)
    else:
        B.update(i, 1)

ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        if S[i] == S[j]: continue
        tmp = set(["R","G","B"])
        tmp.remove(S[i])
        tmp.remove(S[j])
        Sk = tmp.pop()
        no = j + (j - i)
        if Sk == "R":
            ans += R.query(j + 1, min(N, no)) + R.query(min(N, no + 1), N)
        elif Sk == "G":
            ans += G.query(j + 1, min(N, no)) + G.query(min(N, no + 1), N)
        else:
            ans += B.query(j + 1, min(N, no)) + B.query(min(N, no + 1), N)

print(ans)

### FIXED CODE ###

N = int(input())
S = input()

R = [0] * N
G = [0] * N
B = [0] * N

for i in range(N):
    if S[i] == "R":
        R[i] += 1
    elif S[i] == "G":
        G[i] += 1
    else:
        B[i] += 1

from itertools import accumulate

R = [0] + list(accumulate(R))
G = [0] +list(accumulate(G))
B = [0] + list(accumulate(B))

ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        if S[i] == S[j]: continue
        tmp = set(["R","G","B"])
        tmp.remove(S[i])
        tmp.remove(S[j])
        Sk = tmp.pop()
        no = j + (j - i)
        if Sk == "R":
            ans += R[min(N, no)] - R[j] + R[N] - R[min(N, no + 1)]
        elif Sk == "G":
            ans += G[min(N, no)] - G[j] + G[N] - G[min(N, no + 1)]
        else:
            ans += B[min(N, no)] - B[j] + B[N] - B[min(N, no + 1)]

print(ans)
### BUGGY CODE ###

import bisect

n, m = map(int, input().split())
item = [int(a) for a in input().split()]
item.sort()
ans = 0

for _ in range(m):
    item_max = item.pop()
    bisect.insort_left(item, item_max / 2)

for i in item:
    ans += int(i)

print(ans)

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
item = [-1 * int(a) for a in input().split()]
heapq.heapify(item)
ans = 0

for _ in range(m):
    item_max = heapq.heappop(item)
    item_max = item_max / 2
    heapq.heappush(item, item_max)

for i in item:
    ans += int(i)

print(- ans)
### BUGGY CODE ###

import numpy as np
A,B,M = map(int,input().rstrip().split())
a = list(map(int,input().rstrip().split()))
b = list(map(int,input().rstrip().split()))

suml = [[0 for _ in range(len(b))] for _ in range(len(a))]

for i in range(len(a)):
  for j in range(len(b)):
    suml[i][j] = a[i]+b[j]



sumk = [[0 for _ in range(len(b))] for _ in range(len(a))]

for k in range(M):
  i,j,c = list(map(int,input().rstrip().split()))
  if sumk[i-1][j-1] != 0:
    sumk[i-1][j-1] = max(sumk[i-1][j-1],c)
  else:
    sumk[i-1][j-1] = c

x = np.array(suml)
y = np.array(sumk)

z = x - y

print(np.amin(z))
    

### FIXED CODE ###

import numpy as np
A,B,M = map(int,input().rstrip().split())
a = list(map(int,input().rstrip().split()))
b = list(map(int,input().rstrip().split()))

minp = min(a) + min(b)

minpp = 10**6
for k in range(M):
  i,j,c = map(int,input().rstrip().split())
  minpp = min(a[i-1]+b[j-1]-c,minpp)

print(min(minp,minpp))
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in range(1,n):
  ans*=a[i]
print(ans if ans<=10**18 else -1)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
if 0 in a:
  print(0)
  exit()
for aa in a:
  if aa>10**18:
    print(-1)
    exit()
ans=a[0]
for i in range(1,n):
    ans=ans*a[i]
    if ans>10**18:
      print(-1)
      exit()
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))

mod = 10**9+7

array = [0] * 60

for i in a:
    for j in range(len(bin(i))-2):
        # print(bin(i),i >> j & 1)
        array[j] += (i >> j) & 1

ans = 0
# print(array)

for i in range(60):
    ans += array[i] * (n-array[i]) * 2**i

print(ans % mod)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))

mod = 10**9+7

array = [0] * 60

for i in a:
    for j in range(len(bin(i))-2):
        # print(bin(i),i >> j & 1)
        array[j] += (i >> j) & 1

ans = 0
# print(array)

for i in range(60):
    ans += array[i] * (n-array[i]) * 2**i

print(ans % mod)
### BUGGY CODE ###

import numpy as np
N, K = map(int, input().split())
H = np.array([int(h) for h in input().split()])



dp = np.zeros(N, dtype=int)
k = np.array([i for i in range(1, K+1)])

for n in range(1, N):
    if n < K:
        dp[n] = np.amin(dp[np.maximum(n-k, 0)] + np.abs(H[n]-H[np.maximum(n-k, 0)]))
    else:
        dp[n] = np.min(dp[n - k] + np.abs(H[n] - H[n - k]))


print(dp[N-1])



### FIXED CODE ###

import numpy as np
N, K = map(int, input().split())
# H = np.array([int(h) for h in input().split()])
H = np.array(list(map(int, input().split())))

dp = np.zeros(N, dtype=int)
k = np.array([i for i in range(1, K+1)])

for n in range(1, N):
    start = max(n-K, 0)
    #if n < K:
    #   dp[n] = np.amin(dp[start] + np.abs(H[n]-H[start]))
    #else:
    #   dp[n] = np.min(dp[n - k] + np.abs(H[n] - H[n - k]))
    dp[n] = np.min(dp[start:n] + np.abs(H[n]-H[start:n]))

print(dp[N-1])
### BUGGY CODE ###

def gcd(M, m):
	a = max(M, m)
	b = min(M, m)
	q = b
	r = a % b
	while r != 0:
		p = q
		q = r
		r = p % q
	return q
	
K = int(input())
count = 0
temp = []
for a in range(1, K+1):
	for b in range(1, a):
		temp.append(gcd(a, b))
for c in range(1, K+1):
	for j in range(len(temp)):
		count += gcd(c, temp[j]) * 2
	for k in range(1, K+1):
		count += gcd(c, k)
print(count)

### FIXED CODE ###

def gcd(a, b):
  if a < b:
    a_init = a
    a = b
    b = a_init
  while b != 0:
    r = a % b
    a = b
    b = r
  return a
	
K = int(input())
count = 0
temp = []
for a in range(1, K+1):
	for b in range(1, a):
		temp.append(gcd(a, b))
for c in range(1, K+1):
	for j in range(len(temp)):
		count += gcd(c, temp[j]) * 2
	for k in range(1, K+1):
		count += gcd(c, k)
print(count)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, K: int, x: "List[int]"):
    def search_naive(cur, k, x):
        if k == K:
            return 0
        costs = []
        for i in range(len(x)):
            xi = x[i]
            dist = abs(xi-cur)
            costs.append(dist + search_naive(xi, k+1, x[:i]+x[i+1:]))
        return min(costs)
    print(search_naive(0, 0, x)) 
    return


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
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, K, x)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, K: int, x: "List[int]"):
    def search(N, window_size, x):
        costs = []
        for i in range(N-window_size+1):
            right_end = x[i+window_size-1]
            left_end = x[i]
            dist = abs(right_end-left_end)
            costs.append(min(abs(right_end)+dist, abs(left_end)+dist))
        return min(costs)
    print(search(N, K, x))
    return


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
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, K, x)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**9)
from collections import defaultdict

IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())

n,m=IA()
a=list(IA())
ans=float(0)
for i in  range(0,n):
    if i+m>n:break
    sum1=float(0)
    for j in range(0,m):
        
        sum1+=(a[i+j]+1)/2
    #print(sum1)
    ans=max(ans,sum1)
print("%.12lf"%ans)
N=int(100005)
a=[int(0) for i in range(N)]




### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
from collections import defaultdict

IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())

n,m=IA()
a=list(IA())
ans=float(0)

N=int(200005)
s=[int(0) for i in range(N)]

s[1]=a[0]
for i in  range(1,n):
    s[i+1]=s[i]+a[i]
   

    
for i in  range(1,n+1):
   

    if i+m-1>n:break
    #print(s[i+m-1]-s[i-1])
    sum1=(s[i+m-1]-s[i-1]+m)/2

    #print(sum1)
    ans=max(ans,sum1)
    
print("%.12lf"%ans)
### BUGGY CODE ###

import sys
from collections import deque

def main():
  inp = sys.stdin.readline
  n = int(inp())
  target_num = n*(n-1)//2

  all_set = set()
  all_add = all_set.add
  a = [None] * n
  for i in range(n):
    a[i] = deque(map(int, inp().split()))
  ans = 0

  while True:
    cur_set = set()
    flag = False
    for i in range(n):
      if len(a[i]):
        tup = (min(i+1, a[i][0]), max(i+1, a[i][0]))
      else:
        continue
      if tup not in cur_set:
        cur_set.add(tup)
      elif tup in cur_set:
        all_add(tup)
        t1, t2 = tup
        a[t1-1].popleft()
        a[t2-1].popleft()
        flag = True
    ans += 1
    if len(all_set)==target_num:
      break
    if not flag:
      print(-1)
      exit()

  print(ans)

if __name__ == '__main__':
  main()

### FIXED CODE ###

from collections import deque
import time

start = time.time() # なにこれ

n = int(input())
target_num = n*(n-1)//2

all_set = set()
a = [deque(list(map(int, input().split()))) for i in range(n)]
ans = 0

while True:
  cur_set = set()
  flag = False
  for i in range(n):
    if len(a[i]):
      tup = (min(i+1, a[i][0]), max(i+1, a[i][0]))
    else:
      continue
    if tup not in cur_set:
      cur_set.add(tup)
    elif tup in cur_set:
      all_set.add(tup)
      t1, t2 = tup
      a[t1-1].popleft()
      a[t2-1].popleft()
      flag = True
  ans += 1
  if len(all_set)==target_num:
    break
  if time.time()-start>1.8:
    print(1000*999//2)
    exit()
  if not flag:
    print(-1)
    exit()

print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = [0] + H
dp = [0] * (N + 1)
dp[1] = 0
dp[2] = abs(H[2] - H[1])

for i in range(3, N+1):
    dp[i] = dp[i - 1] + abs(H[i] - H[i - 1])
    for j in range(1, K + 1):
        if i - j <= 0:
            break
        dp[i] = min(dp[i], dp[i - j] + abs(H[i] - H[i - j]))
print(dp[N])

### FIXED CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = [0] + H
dp = [0] * (N + 1)
dp[1] = 0
dp[2] = abs(H[2] - H[1])

for i in range(3, N+1):
    dp[i] = dp[i - 1] + abs(H[i] - H[i - 1])
    for j in range(1, K + 1):
        if i - j <= 0:
            break
        dp[i] = min(dp[i], dp[i - j] + abs(H[i] - H[i - j]))
print(dp[N])