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

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

def main():
	N, K = MAP()
	A = LIST()

	tmp = 1
	for i in range(K):
		tmp *= A[i]

	tmp2 = tmp
	for i in range(K, N):
		tmp =  tmp // A[i-K] * A[i]
		if tmp2 < tmp:
			print("Yes")
		else:
			print("No")
		tmp2 = tmp
if __name__ == '__main__':
	main()



### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

def main():
	N, K = MAP()
	A = LIST()

	for i in range(K, N):
		if A[i-K] < A[i]:
			print("Yes")
		else:
			print("No")

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

from scipy.sparse.csgraph import floyd_warshall as wf
n, m = map(int, input().split())
L = [[0]*n for i in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    L[a-1][b-1] = 1
    L[b-1][a-1] = 1

L = wf(L)

if L[0][n-1] == 2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

n, m = map(int, input().split())
L = []
for i in range(m):
    a,b = map(int, input().split())
    L.append((a,b))

st,go = [],[]
for i in range(m):
    if 1 in L[i]:
        st.append(L[i][1])
    if n in L[i]:
        go.append(L[i][0])

if set(st)&set(go):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
### BUGGY CODE ###

n = int(input())
x = [int(i) for i in input().split()]
x = [x_ - i for i, x_ in enumerate(x)]
min_x = min(x)
max_x = max(x)
ans = []
for i in range(min_x, max_x+1):
    p = sum([abs(x_ - i) for x_ in x])
    ans.append(p)
print(min(ans))

### FIXED CODE ###

import statistics
n = int(input())
x = [int(i) for i in input().split()]
x = [x_ - i for i, x_ in enumerate(x)]
median = statistics.median(x)
x = [abs(x_ - median) for x_ in x]
ans = int(sum(x))
print(ans)
### BUGGY CODE ###

N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())

#==--------------

for i in range(N):
    print(joushi_no_bangou.count(i+1))

### FIXED CODE ###

N = int(input())
As = list(map(int, input().split()))
ct = [0] * N
     
for a in As: #ここがキモ．リスト「As」にはそれぞれの上司が入っていて，その中からaを取り出すので，a=上司になっている．これにより，ctの上司を正確に呼び出すことができる．
    ct[a-1] += 1
     
for c in ct:
    print(c)

#別解
#print(*c,sep='\n')
### BUGGY CODE ###

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

ans = 1
for i in range(1, n):
    if min(P[:i+1]) == P[i]:
        ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
P = list(map(int, input().split()))
ans = 1
x = P[0]
for p in P:
    if x > p:
        ans += 1
        x = p
print(ans)
### BUGGY CODE ###

n, m = list(map(int, input().split()))
key = []

for i in range(m):
    a, _ = list(map(int, input().split()))
    s = 0

    cs = list(map(int, input().split()))
    for c in cs:
        s |= 1<<(c-1)
    key.append([s, a])

INF = 10**7
dp = [INF]*(1<<n)
dp[0] = 0

for s in range(1<<n):
    for i in range(m):
        t = s | key[i][0]
        cost = dp[s] + key[i][1]
        dp[t] = min(dp[t],cost)
ans = dp[-1]
if ans==INF:
  print(-1)
else:
  print(ans)

### FIXED CODE ###

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

INF = 10**7
p = 1<<n
dp = [INF]*p
dp[0] = 0

for _ in range(m):
    a, _ = map(int, input().split())
    c = sum([1<<(int(i)-1) for i in input().split()])
    def k(s):
        dp[s|c] = dp[s] + a
    [k(s) for s in range(p) if dp[s|c] > dp[s] + a]
ans = dp[-1]
if ans==INF:
    ans = -1
print(ans)
### BUGGY CODE ###

N = int(input())
la = list(map(int, input().split()))

for i in range(1, N+1):
    print(la.count(i))
    la = [j for j in la if j != i]

### FIXED CODE ###

N = int(input())
la = list(map(int, input().split()))

la.append(N+1)

lb = [0] * N
for i in range(N-1):
    lb[la[i]-1] += 1

for j in range(N):
    print(lb[j])
### BUGGY CODE ###

#!/usr/bin/env python3
import sys

N, M = map(int, input().rstrip().split())

L = []
R = []
for _ in range(M):
    l, r = map(int, input().rstrip().split())
    L.append(l)
    R.append(r)

Ans = set(range(L[0], R[0] + 1))
for i in range(1, len(L)):
    Ans = set(range(L[i], R[i] + 1)) & Ans
    if not Ans:
        print(0)
        sys.exit(0)

print(len(Ans))


### FIXED CODE ###

#!/usr/bin/env python3
import sys

N, M = map(int, input().rstrip().split())

L = []
R = []
for _ in range(M):
    l, r = map(int, input().rstrip().split())
    L.append(l)
    R.append(r)

Ans = min(R) - max(L) + 1
if Ans < 0:
    Ans = 0
print(Ans)
### BUGGY CODE ###

from math import factorial

def comb(n,k,p):
  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=factorial(n) %p
  b=factorial(k) %p
  c=factorial(n-k) %p
  return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p
def power_func(a,b,p):
  if b==0: return 1
  if b%2==0:
    d=power_func(a,b//2,p)
    return d*d %p
  if b%2==1:
    return (a*power_func(a,b-1,p ))%p

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

def f(x, y):
  s=max(x, y)
  t=min(x, y)
  st=s+t
  ans=1
  for i in range(1, t+1):
    ans=ans*(st+1-i)//i
    ans=ans%(10**9+6)
    
  return ans
  
      
b=(2*X-Y)//3
btemp=(2*X-Y)%3
if btemp>0:
  ans=0
else:
  a=(Y-b)//2
  
  #ans=mt.factorial(a+b)//(mt.factorial(a)*mt.factorial(b))
  #ans=tool.permutations(a+b)//(tool.permutations(a)*tool.permutations(b))
  s=max(a, b)
  t=min(a, b)
  ans=comb(s+t, t, 10**9+7)
print(ans)

### FIXED CODE ###

p=10**9+7
X, Y=map(int, input().split())

if (X+Y)%3>0:
  print(0)
  exit()
  
a=(2*X-Y)//3
b=(2*Y-X)//3

if a*b<0:
  print(0)
  exit()

ab=a+b
ue=[1]*(ab+1)
for i in range(1, ab+1):
  ue[i]=ue[i-1]*i%p
  
out=ue[-1]*pow(ue[a], p-2, p)%p
out=out*pow(ue[b], p-2, p)%p

print(out)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(500000)

from sys import stdin
input = stdin.readline
def Tsundoku(i,j,k):
    if (i,j) in dp:
        return dp[(i,j)]
    ans1,ans2 = 0,0
    if i<n and k-a[i]>=0:
        ans1 = 1+Tsundoku(i+1,j,k-a[i])
    if j<m and k-b[j]>=0:
        ans2 = 1+Tsundoku(i,j+1,k-b[j])
    dp[(i,j)] = max(ans1,ans2)
    return dp[(i,j)]
        
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
dp = dict()
ans = Tsundoku(0,0,k)
print(ans)
#print(dp)

### FIXED CODE ###

from itertools import accumulate

def bs(t):
    l,h = 0,len(b)-1
    while l<=h:
        m = (l+h)//2
        if b[m]<t:
            l=m+1
        elif b[m]>t:
            h=m-1
        else:
            return m
    return h

n,m,k = map(int,input().split())
a = list(accumulate([0]+list(map(int,input().split()))))
b = list(accumulate([0]+list(map(int,input().split()))))
ans = 0
for idx,i in enumerate(a):
    if i<=k:
        #print(idx,bs(k-i))
        ans = max(ans,bs(k-i)+idx)
print(ans)
### BUGGY CODE ###

n = int(input())
l = [int(_) for _ in input().split()]
len_l = len(l)
ans = 0

for s in range(len_l):
    a = l[s]
    t = s + 1
    while t <= len_l - 1:
        b = l[t]
        u = t + 1
        while u <= len_l - 1:
            c = l[u]
            if a != b and b != c and a != c and a < b + c and b < c + a and c < a + b:
                ans += 1
            u += 1
        t += 1

print(ans)

### FIXED CODE ###

from bisect import bisect_left

n = int(input())
l = [int(_) for _ in input().split()]
l.sort()
ans = 0

for s in range(n - 2):
    for t in range(s + 1, n - 1):
        x = bisect_left(l, l[s] + l[t])
        ans += x - t - 1

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

from itertools import permutations

n, m, r = map(int, input().split())
A = list(map(int, input().split()))
d = [[1e9]*n for i in range(n)]
for i in range(m):
        a, b, c = map(int, input().split())
        d[a-1][b-1] = d[b-1][a-1] = c

for i in range(n):
        for j in range(n):
                for k in range(n):
                        d[i][j] = min(d[i][j], d[i][k]+d[k][j])


ans = 1e11
for x in permutations(A):
        l = 0
        for i in range(r-1):
                l += d[x[i]-1][x[i+1]-1]
        ans = min(ans, l)
print(ans)

### FIXED CODE ###

from itertools import permutations

n, m, r = map(int, input().split())
A = list(map(int, input().split()))
d = [[1e18]*n for i in range(n)]
for i in range(m):
        a, b, c = map(int, input().split())
        d[a-1][b-1] = d[b-1][a-1] = c

for k in range(n):
        for i in range(n):
                for j in range(n):
                        d[i][j] = min(d[i][j], d[i][k]+d[k][j])


ans = 1e18
for x in permutations(A):
        l = 0
        for i in range(r-1):
                l += d[x[i]-1][x[i+1]-1]
        ans = min(ans, l)
print(ans)
### BUGGY CODE ###

n = int(input())
person = list(map(int,input().split()))
for i in range(n-1) :
    p = person.count(i+1)
    print(p)
print(0)

### FIXED CODE ###

n = int(input())
paisen = [0] * n
person = list(map(int,input().split()))
for i in range(n-1) :
    paisen[person[i]-1] += 1
for j in range(n) :
    print(paisen[j])
### BUGGY CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()


m = {}
tm = {}
def ff(n):
    if n <= 1:
        return set([1])
    if n in m:
        return m[n]
    fa = factorization(n)
    t = ff(n//fa[0][0])
    t |= set([fa[0][0] * _ for _ in t])
    m[n] = t
    return t

def main():
    n,m = LI()
    d = [LI() for _ in range(n)]
    a = [1] * (10001)
    t = [set([1]),set([1])]
    for i in range(2,10001):
        if a[i] == 1:
            t.append(set([1,i]))
        else:
            ti = t[a[i]]
            c = i//a[i]
            ti = ti | set(c*_ for _ in ti)
            t.append(ti)
        ai = i*2
        while ai <= 10000:
            a[ai] = i
            ai += i

    e = [0] * 10001
    for l,r in d:
        s = t[r]
        for i in range(l,r):
            s = s | t[i]
        for c in s:
            e[c] += 1
    for i in range(1,m+1):
        print(e[i])


main()


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

class BIT():
    def __init__(self, n):
        i = 1
        while 2**i <= n:
            i += 1
        self.H = i
        self.N = 2**i
        self.A = [0] * self.N

    def find(self, i):
        r = 0
        while i:
            r += self.A[i]
            i -= i & (i-1) ^ i
        return r

    def update(self, i, x):
        while i < self.N:
            self.A[i] += x
            i += i & (i-1) ^ i

    def query(self, a, b):
        return self.find(b-1) - self.find(a-1)

def main():
    n,m = LI()
    d = collections.defaultdict(list)
    for _ in range(n):
        l,r = LI()
        d[r-l+1].append((l,r))
    r = [n]
    bit = BIT(m+3)
    c = n
    for i in range(2,m+1):
        for a,b in d[i-1]:
            c -= 1
            bit.update(a,1)
            bit.update(b+1,-1)
        t = c
        for j in range(i,m+1,i):
            t += bit.find(j)
        r.append(t)

    return '\n'.join(map(str,r))


print(main())
### BUGGY CODE ###

from functools import lru_cache
import sys

sys.setrecursionlimit(10**6)

N=int(input())
h=[int(i) for i in input().split()]
@lru_cache(maxsize=10**6)
def cost(n):
    if n == 0:
        return 0
    elif n == 1:
        return abs(h[1]-h[0])
    else:
        return min(cost(n-2)+abs(h[n]-h[n-2]), cost(n-1)+abs(h[n]-h[n-1]))
print(cost(N-1))

### FIXED CODE ###

N=int(input())
h=[int(i) for i in input().split()]
cost = [-1]*N
cost[0]=0
cost[1]=abs(h[1]-h[0])
for i in range(2,N):
    cost[i] = min(cost[i-2]+abs(h[i]-h[i-2]), cost[i-1]+abs(h[i]-h[i-1]))
print(cost[-1])
### BUGGY CODE ###

INF=10**18

A=list(map(lambda x:ord(x)-48,list(input())))
B=list(map(lambda x:ord(x)-48,list(input())))

fl=False

for i in B:
	fl|=i

if fl==False:
	for i in A:
		if i:
			print("-1")
			exit(0)
	print("0")
	exit(0)

n=len(A)

bi=[]

for i in range(n):
	bi.append([0,0,i])
	for j in range(n):
		if B[(i-j)%n]:
			bi[i][0]=-j
			break
	for j in range(n):
		if B[(i+j)%n]:
			bi[i][1]=j
			break

bi.sort()

ans=INF

def Update(d):
	q=[]
	nr=max(0,d)
	for i in range(n):
		x=bi[i][2]
		if A[x]!=B[(x+d)%n]:
			q.append(bi[i][:2])
	ans=INF
	for i in q:
		ans=min(ans,2*(nr-min(0,min(d,i[0])))-abs(d))
		nr=max(nr,i[1])
	ans=min(ans,2*(nr-min(0,d))-abs(d))+len(q)
	return ans

for i in range(-n,n):
	ans=min(ans,Update(i))

print(ans)


### FIXED CODE ###

INF=10**18

A=list(map(lambda x:ord(x)-48,list(input())))
B=list(map(lambda x:ord(x)-48,list(input())))

fl=False

for i in B:
	fl|=i

if fl==False:
	for i in A:
		if i:
			print("-1")
			exit(0)
	print("0")
	exit(0)

n=len(A)

bi=[]

for i in range(n):
	bi.append([0,0,i])
	for j in range(n):
		if B[(i-j)%n]:
			bi[i][0]=-j
			break
	for j in range(n):
		if B[(i+j)%n]:
			bi[i][1]=j
			break

bi.sort()

ans=INF

def Update(d):
	q=[]
	nr=max(0,d)
	for i in range(n):
		x=bi[i][2]
		if A[x]!=B[(x+d)%n]:
			q.append(bi[i][:2])
	ans=INF
	for i in q:
		ans=min(ans,2*(nr-min(0,min(d,i[0])))-abs(d))
		nr=max(nr,i[1])
	ans=min(ans,2*(nr-min(0,d))-abs(d))+len(q)
	return ans

for i in range(-n,n):
	ans=min(ans,Update(i))

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

def cmb(a,b):
    b = min(b,a-b)
    num = 1
    for i in range(b):
        num = num*(a-i)
    den = 1
    for i in range(b):
        den = den*(i+1) 
    return num // den 
mod = 10**9 + 7
n,k = map(int,input().split())
inv = [0,1]
for i in range(2,n):
  inv += [inv[mod % i]*(mod - mod//i) % mod]
a = list(map(int,input().split()))
a.sort()
ans = 0
c = cmb(n-1,k-1)
if k == 1:
    print(0)
    exit()
for i in range(n-k+1):
    ans -= a[i] * c
    ans += a[-i-1] * c
    ans %= mod
    c = c*(n-k-i)*inv[n-i-1]
if ans < 0:
    ans += mod
print(ans)

### FIXED CODE ###

def cmb(a,b,c):
    b = min(b,a-b)
    num = 1
    for i in range(b):
        num = num*(a-i) % c
    den = 1
    for i in range(b):
        den = den*(i+1) % c
    return num * pow(den,c-2,c) % c
mod = 10**9 + 7
n,k = map(int,input().split())
inv = [0,1]
for i in range(2,n):
  inv += [inv[mod % i]*(mod - mod//i) % mod]
a = list(map(int,input().split()))
a.sort()
ans = 0
c = 1
x = 1
if k == 1:
    print(0)
    exit()
for i in range(n-k+1):
    ans -= a[n-k-i] * c
    ans += a[k+i-n-1] * c
    ans %= mod
    c = c*(i+k)*inv[i+1] % mod
if ans < 0:
    ans += mod
print(ans)
### BUGGY CODE ###

R,G,B,N = map(int,input().split())
res = 0
for i in range(N//R + 1):
    for j in range(N//G + 1):
        if i*R + j*G > N: # はそもそもむり
            continue
        k = (N - R*i - G*j)
        if k % B != 0: # その倍数じゃないと無理
            continue
        res += 1
print(res)


### FIXED CODE ###

R,G,B,N = map(int,input().split())
res = 0
for i in range(N//R + 1):
    for j in range(N//G + 1):
        if i*R + j*G > N: # はそもそもむり
            continue
        k = (N - R*i - G*j)
        if k % B != 0: # その倍数じゃないと無理
            continue
        res += 1
print(res)
### BUGGY CODE ###

X,Y,A,B,C=map(int,input().split())
P=sorted(list(map(int,input().split())))
Q=sorted(list(map(int,input().split())))
R=sorted(list(map(int,input().split())))
S=sorted(P[A-X:]+Q[B-Y:])
for i in range(X+Y):
    if len(R)==0 or S[0]>R[-1]:
        break
    S.pop(0)
    S.append(R.pop(-1))
print(sum(S))

### FIXED CODE ###

X,Y,A,B,C=map(int,input().split())
P=sorted(list(map(int,input().split())))
Q=sorted(list(map(int,input().split())))
R=sorted(list(map(int,input().split())))
S=sorted(P[A-X:]+Q[B-Y:])
ans=sum(S)
for i in range(min(len(R),len(S))):
    if S[i]<R[-1-i]:
        S[i]=R[-1-i]
    else:
        break
print(sum(S))
### BUGGY CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
L = [LIST() for i in range(N)]

dp = [[0] * (T) for i in range(N+1)]

L.sort()
for i in range(N):
    for j in range(T):
        if j - L[i][0] >= 0:
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-L[i][0]]+L[i][1])
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])
# print(dp[N][T-1])

ans = 0
for k in range(N):
    # k番目を食べずにk-1番目まで食べたT-1秒以下での最大値に，
    # k番目のものをT-1秒目に食べた値の中での最大値
    # 一番いいものを最後に食べる
    ans = max(dp[k][T-1] + L[k][1], ans)
print(ans)





### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
A = []
B = []
L = [LIST() for i in range(N)]

# 1からi番目の料理で，j分以内に完食できるおいしさの合計の最大値
# dp1[i][j]
dp1 = [[0] * (T) for i in range(N+1)]
# # iからN番目の料理で，j分以内に完食できるおいしさの合計の最大値
# # dp2[i][j]
# dp2 = [[0] * (T) for i in range(N+1)]
# print(L)
# 昇順にする
L.sort()
for a, b in L:
    A.append(a)
    B.append(b)

for i in range(N):
    for j in range(T):
        if j - A[i] >= 0:
            dp1[i+1][j] = max(dp1[i][j-A[i]] + B[i], dp1[i+1][j])
        dp1[i+1][j] = max(dp1[i][j], dp1[i+1][j])

ans = 0
# 最後に一番時間のかかるものをT-1秒目に食べればいい
for k in range(1, N+1):
    ans = max(dp1[k-1][T-1] + B[k-1], ans)
print(ans)




exit()
for i in range(N):
    for j in range(T):
        if j - A[i] >= 0:
            dp1[i+1][j] = max(dp1[i][j-A[i]] + B[i], dp1[i+1][j])
        dp1[i+1][j] = max(dp1[i][j], dp1[i+1][j])
# やりやすく
L = L[::-1]
for i in range(N):
    for j in range(T):
        if j - A[i] >= 0:
            dp2[i+1][j] = max(dp2[i][j-A[i]] + B[i], dp2[i+1][j])
        dp2[i+1][j] = max(dp2[i][j], dp2[i+1][j])
# 戻す
L = L[::-1]
print(L)
ans = 0
for i in range(1, N+1):
    tmp = 0
    for j in range(T):
        tmp = max(tmp, dp1[i-1][j] + dp1[N-i][T-1-j])
    ans = max(ans, tmp+L[i-1][1])
print(ans)
### BUGGY CODE ###

n,m=map(int,input().split())
H=list(map(int,input().split()))
L=[[]]*(n+1)
for i in range(m):
	a,b=map(int,input().split())
	L[a] = L[a]+[H[b-1]]
	L[b] = L[b]+[H[a-1]]
	
#print(L)

count=0
for i in range(1,len(L)):
	
	if L[i]!=[]:
		if H[i-1]>max(L[i]):
			count+=1
	else:
		count+=1
		
print(count)

### FIXED CODE ###

from sys import stdin,stdout
n,m=map(int,stdin.readline().split())
H=list(map(int,stdin.readline().split()))
L=[0]*n
for i in range(m):
	a,b=map(int,stdin.readline().split())
	L[a-1]=max(L[a-1],H[b-1])
	L[b-1]=max(L[b-1],H[a-1])
ans=0
for i in range(n):
	if H[i]>L[i]:
		ans+=1
		
stdout.write(str(ans))
### BUGGY CODE ###

import itertools

def primes(n):
    l = []
    i = 2
    while i <= n**(1/2):
        while n % i == 0:
            n //= i
            l.append(i)
        i += 1
    l.append(n)
    return l

def mul(l):
    result = 1
    for i in l:
        result *= i
    return result

n = int(input())

per = list(set(itertools.permutations(primes(n))))

i,j = 1,n
for p in per:
    for k in range(len(p)):
        s,t = mul(p[:k]), mul(p[k:])
        if abs(s-t) < abs(i-j):
            i,j = s,t

print(i+j-2)


### FIXED CODE ###

import math

N = int(input())

ans = 10**15
for k in range(1, int(math.sqrt(N))+1):
    if N % k > 0:
        continue
    ans = min(ans, k + N//k - 2)
print(ans)
### BUGGY CODE ###

# if the remainders (mod 2019) are equal, the difference will be divisible
# x = Q*2019+5 y = R*2019+5 then x-y=(Q-R)*2019
# unless Q-R<=0
# where the substring itself is (Q-R)*2019/10**(something)
# 2019 = 3*673 in prime factorization
# so multiplying by 10 doesn't affect whether a number is divisible by it
from collections import Counter
s = input()
remainders = [int(s[i::])%2019 for i in range(len(s))]
histo = Counter(remainders)
non_single_count = int(sum(count*(count-1)/2 for value, count in histo.items() if value!=0))
single_count = int(sum(count for value, count in histo.items() if value==0))
print(non_single_count+single_count)

### FIXED CODE ###

# if the remainders (mod 2019) are equal, the difference will be divisible
# x = Q*2019+5 y = R*2019+5 then x-y=(Q-R)*2019
# unless Q-R<=0
# where the substring itself is (Q-R)*2019/10**(something)
from collections import Counter
s = input()[::-1]
partial = 0
remainders = list()
num = (int(character) for character in s)
for i, int_char in enumerate(num):
  partial = (partial+(int_char*pow(10,i,2019))%2019)%2019
  remainders.append(partial)
histo = Counter(remainders)
non_single_count = int(sum(count*(count-1)/2 for value, count in histo.items() if value!=0))
single_count = int(sum(count+count*(count-1)/2 for value, count in histo.items() if value==0))
print(non_single_count+single_count)
### BUGGY CODE ###

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

n, k = int(n), int(k)

a = []

for i in range(n - k + 1):
    c = 0
    for j in range(k):
        c += p[i + j]
    a.append(c + k)

ans = max(a)

print(ans / 2)
    


### FIXED CODE ###

N,K = map(int,input().split())
Data  = map(int,input().split())
Data2 = [0]*N
for idx,data in enumerate(Data):
    e = data * (data+1) / 2 / data
    Data2[idx] = e
#print(Data2)
sum1 = 0
for i in range(K):
    sum1 += Data2[i]
ans = sum1
for i in range(0,N-K):
    sum1 -= Data2[i]
    sum1 += Data2[i+K]
    if ans < sum1:
        ans = sum1
print(ans)