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

n = int(input())

total = 1

for i in range(1, n+1):
    total *= i

print(total % (10**9 + 7))


### FIXED CODE ###

import math

n = int(input())

f = math.factorial(n)

print(f % (10**9 + 7))
### BUGGY CODE ###

S = input()
# print("Q=")
Q = int(input())

def problem_gksn(S,Q):
  check_reverse = 0 # 偶数のとき正常, 奇数の時反転
  for _ in range(Q):
    # print("queryを入力してください")
    query = input().split()
    # print("query= ",query)
    if len(query) == 1: #1の場合
      # print("文字を反転させます")
      check_reverse += 1
      # S = S[::-1]
    else: #2の場合
      # print("文字をくっつけます")
      if check_reverse % 2 == 0: #反転していない時:
        if int(query[1]) == 2:
          S = S + query[2]
        else:
          S = query[2] + S
      else: #反転している時
        if int(query[1]) == 1:
          S = S + query[2]
        else:
          S = query[2] + S
  if check_reverse % 2==1:
    S = S[::-1]
  return S
print(problem_gksn(S,Q))


### FIXED CODE ###

S = input()
# print("Q=")
Q = int(input())

def problem_gksn(S,Q):
  check_reverse = 0 # 偶数のとき正常, 奇数の時反転
  atama = ""
  oshiri = ""
  for _ in range(Q):
    # print("queryを入力してください")
    query = input().split()
    # print("query= ",query)
    if len(query) == 1: #1の場合
      # print("文字を反転させます")
      check_reverse += 1
      # S = S[::-1]
    else: #2の場合
      # print("文字をくっつけます")
      if int(query[1]) == 2 - check_reverse % 2:
        oshiri += query[2]
      else:
        atama += query[2]
      # print("atama",atama)
      # print("oshiri",oshiri)
  S = atama[::-1] + S + oshiri
  if check_reverse % 2==1:
    S = S[::-1]
  
  return S

print(problem_gksn(S,Q))
### BUGGY CODE ###

H, W, K = map(int, input().split())
HW = [[0] * W for i in range(H)]
S = [0] * H
for i in range(H):
  x = str(input())
  for j in range(len(x)):
    HW[i][j] = int(x[j])
#print(HW) 

for i in range(H):
  S[i] = sum(HW[i])
#print(S)  

ans = H + W
for i in range(2 ** (H - 1)):#521 * 9
  time = 0
  now = 0
  cut = []
  for j in range(H - 1):
    if (i >> j) & 1:#j番目とj+1番目の間で割る
      cut.append(j)
  #print(cut)
  cut2 = [[] for _ in range(len(cut) + 1)]
  for j in range(len(cut)):
    for p in range(now, cut[j] + 1):
      cut2[j].append(p)
      now = cut[j] + 1
  for p in range(now, H):
    cut2[-1].append(p)
  #print(cut2)    
    
  time = len(cut2) - 1  
  choco = [0] * len(cut2)
  for l in range(W):
    for k in range(len(cut2)):
      for p in cut2[k]:
        choco[k] += HW[p][l]
    if max(choco) > K:
      time += 1
      for k in range(len(cut2)):
        choco[k] = 0
      for k in range(len(cut2)):
        for p in cut2[k]:
          choco[k] += HW[p][l]
        
        
  ans = min(ans, time)
  #print(i, time)
  
print(ans)     
      
    

### FIXED CODE ###

H, W, K = map(int, input().split())
HW = [[0] * W for i in range(H)]
S = [0] * H
for i in range(H):
  x = str(input())
  for j in range(len(x)):
    HW[i][j] = int(x[j])
#print(HW) 

for i in range(H):
  S[i] = sum(HW[i])
#print(S)  

ans = H + W
for i in range(2 ** (H - 1)):#521 * 9
  time = 0
  now = 0
  cut = []
  for j in range(H - 1):
    if (i >> j) & 1:#j番目とj+1番目の間で割る
      cut.append(j)
  #print(cut)
  cut2 = [[] for _ in range(len(cut) + 1)]
  for j in range(len(cut)):
    for p in range(now, cut[j] + 1):
      cut2[j].append(p)
      now = cut[j] + 1
  for p in range(now, H):
    cut2[-1].append(p)
  #print(cut2)    
    
  time = len(cut2) - 1  
  choco = [0] * len(cut2)
  for l in range(W):
    for k in range(len(cut2)):
      nn = 0
      for p in cut2[k]:
        nn += HW[p][l]
      if nn > K:  
        time += 10000
      else:
        choco[k] += nn
      

    if max(choco) > K: 
      time += 1
      for k in range(len(cut2)):
        nn = 0
        for p in cut2[k]:
          nn += HW[p][l]
        choco[k] = nn  

  ans = min(ans, time)
  #print(i, time)
  
print(ans)
### BUGGY CODE ###

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k = map(int, input().split())
a=list(map(int, input().split()))
a.sort()
mod=10**9+7
min=0
max=0
for i in range(n-k+1):

    min+=a[i]*combinations_count(n-i-1,k-1)
    max+=a[n-1-i]*combinations_count(n-i-1,k-1)
    min%=mod
    max%=mod

ans=max-min


print(ans%mod)

### FIXED CODE ###

def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r=min(r,n-r)

    return g1[n] * g2[r] * g2[n - r] % mod


mod = 10 ** 9 + 7  # 出力の制限
N = 10 ** 5
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
mod =10**9+7
mi = 0
ma = 0
for i in range(n - k + 1):
    x = cmb(n - i - 1, k - 1, mod)
    mi += a[i] * x
    ma += a[n - 1 - i] * x
    mi %= mod
    ma %= mod

ans = ma - mi

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

N, K, Q = map(int, input().split())
A = [int(input())-1 for _ in range(Q)]
Point = [K]*N
for i in range(Q):
    Point[A[i]] += 1
    for j in range(N):
        Point[j] -= 1

for p in Point:
    if p>0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

N, K, Q = map(int, input().split())
A = [int(input())-1 for _ in range(Q)]
Point = [K-Q]*N
for i in range(Q):
    Point[A[i]] += 1

for p in Point:
    if p>0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

import math
from functools import reduce
K=int(input())
sum=0

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

for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      sum += gcd(i,j,k)

print(sum)

### FIXED CODE ###

K=int(input())
import math
sum=0


for i in range(1,K+1):
  for j in range(1,K+1):
    c=math.gcd(i,j)
    for k in range(1,K+1):
      sum += math.gcd(c,k)

print(sum)
### BUGGY CODE ###

import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def ifn(): return float(input()) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def fmn(): return map(float, input().split()) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

N, W = imn()
wv = [iln() for _ in range(N)]

dp = [0 for _ in range(W+1)]

for i in range(N):
    for w in range(W, -1,  -1):
        if w - wv[i][0] >= 0: dp[w] = max(dp[w], dp[w-wv[i][0]]+wv[i][1])
print(dp[W])

### FIXED CODE ###

N,W = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(N)]

dp = [[0 for _ in range(W+1)] for _ in range(N+1)] 

dp[0][0] = 0

for i in range(N):
    weight = wv[i][0]
    for j in range(W+1):
        dp[i+1][j] = dp[i][j]
        if j >= weight:
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-weight] + wv[i][1])
print(dp[N][W])
### BUGGY CODE ###

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

for i in range(n):
    p[i]=(p[i]+1)/2#p[i]を期待値に変更
    
max_sum=0    
for i in range(n-k+2):
    cnt=sum(p[0:0+k])
    max_sum=max(max_sum,sum(p[i:i+k]))
print(max_sum)

### FIXED CODE ###

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

for i in range(n):
    p[i]=(p[i]+1)/2#p[i]を期待値に変更
    
p_sum=[0]*n
ans=0
for i in range(n):
    if i==0:
        p_sum[i]=p[i]
        ans=p_sum[i]
    elif i<k:
        p_sum[i]=p_sum[i-1]+p[i]
        if p_sum[i]>ans:
            ans=p_sum[i]
    else:
        p_sum[i]=p_sum[i-1]+p[i]-p[i-k]
        if p_sum[i]>ans:
            ans=p_sum[i]
print(ans)
### BUGGY CODE ###

#??????????????????
import heapq
def SME(start,end):
    A = []
    C = set([i for i in range(N)])
    D = set([])
    if end > N : end = N
    count = 0
    for i,x in enumerate(Whole[start:end]):
        heapq.heappush(A,[x,i])
    for j in range(start,end):
        a = heapq.heappop(A)
        if None not in ANS[a[1]:a[1]+L] : continue
        for i in range(L):
            idx = a[1] + i
            try :
                if ANS[idx] : continue
                else :
                    ANS[idx] = a[0]
                    D.add(idx)
                    count += 1
            except IndexError : continue
        if count > N * parameter : break
    for i in C.difference(D):
        if i < L:
            ANS[i] = min(Whole[:i+1])
        else :
            ANS[i] = min(Whole[i+1-L:i+1])
    return ANS

[N,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
parameter = 0.9997
ANS = [None]*N
ANS = SME(0, N)
for i in ANS[L-1:-1]:print(i, end=" ")
print(ANS[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

N, M = map(int, input().split())
ps = [input().split() for i in range(M)]

ac = 0
wa = [0 for i in range(N)]
ansed = []
for psn in ps:
    if psn[1] == 'AC':
        if psn[0] not in ansed:
            ac += 1
            ansed.append(psn[0])
    else:
        if psn[0] not in ansed:
            wa[int(psn[0])-1] += 1
for i in range(N):
    if str(i+1) not in ansed:
        wa[i] = 0

print(ac, sum(wa))

### FIXED CODE ###

N, M = map(int, input().split())
ps = [input().split() for i in range(M)]

ac = 0
wa = [0 for i in range(N)]
ansed = set()
for psn in ps:
    if psn[1] == 'AC':
        if psn[0] not in ansed:
            ac += 1
            ansed.add(psn[0])
    else:
        if psn[0] not in ansed:
            wa[int(psn[0])-1] += 1
for i in range(N):
    if str(i+1) not in ansed:
        wa[i] = 0

print(ac, sum(wa))
### BUGGY CODE ###

n,m=map(int, input().split())
l={}
for i in range(n):
    a,b=map(int, input().split())
    if not a in l:
        l[a]=[b]
    else:
        l[a].append(b)

res=0
target=[0]
for i in range(1,m+1):
    if i in l:
        target.extend(l[i])
    val=max(target)
    if val != 0:
        target.remove(val)
    res+=val
    #print(target, max(target))

print(res)




### FIXED CODE ###

import bisect
import array

n,m=map(int, input().split())
l={}
for i in range(n):
    a,b=map(int, input().split())
    if not a in l:
        l[a]=[b]
    else:
        l[a].append(b)

res=0
target=array.array('I', [])
for i in range(1,m+1):
    if i in l:
        for j in l[i]:
            bisect.insort_left(target, j)

    if not target:
        val=0
    else:
        val=target.pop()
    res+=val
    #print(target, max(target))

print(res)
### BUGGY CODE ###

def C_Good_Sequence():
    N=int(input())
    a=list(map(int, input().split()))
    b=set(a)
    count=0
    ans=0
    
    for i in b:
        for j in range(N):
            if a[j]==i:
                count += 1
        if count<i:
            ans += count
        elif count >i:
            ans += count-i
        count=0
    print(ans)
   
C_Good_Sequence()

### FIXED CODE ###

def C_Good_Sequence():
    N=int(input())
    a=list(map(int, input().split()))
    count={}
    ans=0
    
    for num in a:
        count[num]= count.get(num,0)+1

    for num in count:
        if num > count[num]:
            ans += count[num]
        elif num < count[num]:
            ans += count[num]-num
    
    print(ans)
   
C_Good_Sequence()
### BUGGY CODE ###

N = int(input())
names = []
words = {}
for i in range(N):
  name = input()
  if name not in names:
    words[name] = 1
    names.append(name)
  elif name in names:
    words[name] += 1
        
max_name_list = [nm[0] for nm in words.items() if nm[1] == max(words.values())]
max_name_list = sorted(max_name_list)

for i in range(len(max_name_list)):
  print(max_name_list[i])


### FIXED CODE ###

N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)
### BUGGY CODE ###

n = int(input())

print(sum(range(1, n)))



### FIXED CODE ###

n = int(input())

print((n * (n - 1))// 2)
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
Q=int(input())

trans=[[] for _ in range(Q)]
for i in range(Q):
    B,C=map(int,input().split())
    trans[i].append(B)
    trans[i].append(C)
    
for i in range(Q):
    B=trans[i][0]
    C=trans[i][1]
    A=[i if i != B else C for i in A]
    print(sum(A))


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Q = int(input())
BC = []
for i in range(Q):
    BC.append(list(map(int,input().split())))

num = [0]*(10**5+1)

S = []
 
#1 iterlation
S.append(sum(A))
for i in range(N):
    num[A[i]]+=1

    
for j in range(Q):
    if num[BC[j][0]] != 0:
        #Bに当たる交換するものがある時
        B = BC[j][0]
        C = BC[j][1]
        S.append(S[-1] + (C - B)*num[B] )
        #S[-1]で合計の一番最新のもの
        dammy = num[B]
        num[B] = 0
        num[C] += dammy
 
    else:
        B = BC[j][0]
        C = BC[j][1]
        S.append(S[-1])

        
for i in range(1,Q+1):
    print(S[i])
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
if n % 2:
    if a.count(0) != 1:
        print(0)
        exit()
    for i in range(2, n, 2):
        if a.count(i) != 2:
            print(0)
            exit()
else:
    if a.count(1) != 2:
        print(0)
        exit()
    for i in range(1, n, 2):
        if i == 1:
            continue
        if a.count(i) != 2:
            print(0)
            exit()
mod = 10 ** 9 + 7
ans = 1
for i in range(n // 2):
    ans = (ans % mod) * 2
print(ans % mod)

### FIXED CODE ###

import collections

n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)
if n % 2 == 1:
    for i in ac:
        if i == 0:
            if ac[i] != 1:
                print(0)
                exit()
        else:
            if ac[i] != 2:
                print(0)
                exit()
    print((2 ** (n // 2)) % (10 ** 9 + 7))
else:
    for i in ac:
        if i == 0:
            if ac[i] != 0:
                print(0)
                exit()
        else:
            if ac[i] != 2:
                print(0)
                exit()
    print((2 ** (n // 2)) % (10 ** 9 + 7))
### BUGGY CODE ###

import numpy as np
import math





n= int(input())



xandy=np.ones((n,n))

xandy=xandy*(-1)

flag=0
for i in range(0,n):
    a=int(input())
    for j in range(0,a):
        x,y= map(int, input().split())
        xandy[i][x-1]=y

max=0


for i in range(0,2**n):
    flag=1
    for j in range(0,n):
       
       #iを2進数表示した時kの位置ででの0-1が対応してあるか立っているか？
        if  bin( i& 2**j).count("1")>0:
             for k in range(0,n):
                  if  xandy[j][k]!=-1 and xandy[j][k]!=(i >> k)%2:
                      flag=0

    if flag==1 and max<bin(i).count("1"):
         max=bin(i).count("1")

print(max)

### FIXED CODE ###

import numpy as np
import math





n= int(input())



xandy=np.ones((n,n))

xandy=xandy*(-1)

flag=0
for i in range(0,n):
    a=int(input())
    for j in range(0,a):
        x,y= map(int, input().split())
        xandy[i][x-1]=y

max=0


for l in range(0,2**n):
    i=2**n-1-l
    flag=1
    if max<bin(i).count("1"):
        for j in range(0,n):
       
        #iを2進数表示した時kの位置ででの0-1が対応してあるか立っているか？
            if  bin( i& 2**j).count("1")>0:
                 for k in range(0,n):
                      if  xandy[j][k]!=-1 and xandy[j][k]!=(i >> k)%2:
                          flag=0 
                          break
                       
            if flag==0:
                break
        if flag==1 and max<bin(i).count("1"):
             max=bin(i).count("1")
         

print(max)
### BUGGY CODE ###

import sys
N, K = map(int, input().split())
first = N
list_a = []

if K == 1:
    print(0)
    sys.exit()
elif K == 2:
    if N % 2 == 0:
        print(0)
    else:
        print(1)
else:
    while N > 0:
        N = N - K

second = N + K

N = abs(N)

list_a.append(N)
list_a.append(second)
list_a.append(first)

list_a = sorted(list_a)

print(list_a[0])


### FIXED CODE ###

import sys
N, K = map(int, input().split())
first = N
list_a = []

if N % K == 0:
    print(0)
    sys.exit()
else:
    X = N // K
    N = N - (K * (X+1))

second = N + K

N = abs(N)

list_a.append(N)
list_a.append(second)
list_a.append(first)

list_a = sorted(list_a)

print(list_a[0])
### BUGGY CODE ###

n = int(input())
ans = 0
for i in range(n):
	ans += i
print(ans)

### FIXED CODE ###

n = int(input())
print(n*(n-1)//2)
### BUGGY CODE ###

from collections import deque

N = int(input())
As = [deque([])]
for _ in range(N):
  As.append(deque(list(map(int, input().split()))))

cnt = 0
eset = set()
while len(eset) < N:
  cnt += 1
  fset = set()
  f = 1
  for i in range(1, N+1):
    if len(As[i]) == 0:
      eset.add(i)
    if i not in eset and i not in fset:
      if As[As[i][0]][0] == i and As[i][0] not in fset:
        fset.add(As[As[i][0]].popleft())
        fset.add(As[i].popleft())
        if len(As[i]) == 0:
          eset.add(i)
        f = 0
  if f == 1:
    print('-1')
    exit()
      
print(cnt)

### FIXED CODE ###

from collections import deque
 
N = int(input())
As = [[]]
iset = [0]*(N+1)
for _ in range(N):
  As.append(list(map(int, input().split())))

cnt = 0
cset = set([i for i in range(1,N+1)])
while len(cset) > 0:
  cnt += 1
  fset = set()
  nex = set()
  f = 1
  for i in cset:
    if i not in fset:
      vis = As[i][iset[i]]
      if As[vis][iset[vis]] == i and vis not in fset:
        iset[i] += 1
        iset[vis] += 1
        fset.add(i)
        fset.add(vis)
        if iset[i] < N-1:
          nex.add(i)
        if iset[vis] < N-1:
          nex.add(vis)
        f = 0
  cset = nex
  if f == 1:
    print('-1')
    exit()
    
print(cnt)
### BUGGY CODE ###

import numpy as np
import sys
import math

S = input()

mod = 1000000000 + 7

mm = [0] * (2019)
mm[0] = 1
T = 0
ten = 1
for ind , s in enumerate( S[::-1] ):
    if ind > 0:
        ten = ten * 10
    T = T + ( int(s) * (ten) )
    mm[T % 2019 ] += 1

ans = 0

for m in mm:
    ans += int( (m * (m-1) ) / 2 )

print(ans)

### FIXED CODE ###

import numpy as np
import sys
import math

S = input()

mm = [0] * (2019)
mm[0] = 1
a = [0] * (len(S) + 1 ) 
T = 0
ten = 1
ll = len(S)
for i in range(ll):
    if i > 0:
        ten = ( ten * 10 ) % 2019
    a[i+1] =  ( a[i] + (int(S[ll-1-i])*ten ) ) % 2019
    mm[ a[i+1] ] += 1
    #print(s)

ans = 0

for m in mm:
    ans += int( (m * (m-1) ) / 2 )

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

N = int(input())

s = input().split(" ")
judge = False

for i in range(N):
  if s[i+1:N].count(s[i]) > 0:
      judge = True

if judge == True:
  print("NO")
else:
  print("YES")







### FIXED CODE ###

N = int(input())

s = input().split(" ")

b = len(s)

s = set(s)

a = len(s)



if a == b:
  print("YES")
else:
  print("NO")
### BUGGY CODE ###

# coding: utf-8
# Your code here!
N=int(input())

for _ in range(N):
    l,r=map(int,input().split())
    count=0
    for num in range(l,r+1)[::2]:
        temp=num*(num+1)//2
        flag=True
        for waru in range(2,(num+1)//2):
            if temp%waru==0:
                flag=False
                break
        if flag:
            count+=1
    print(count if l!=1 else count-1)


### FIXED CODE ###

# coding: utf-8
# Your code here!
N=int(input())

lr=[]
ma=0
for _ in range(N):
    l,r=map(int,input().split())
    ma=max(l,r,ma)
    lr.append([l,r])

#print(ma)

l=[0]*(ma+1)

for n in range(3,ma+1)[::2]:
    temp=(n*(n+1))//2
    flag=True
    for i in range(2,-int(-temp**0.5//1)):
        if temp%i==0:
            if i!=(n+1)//2:
                #print(n,i)
                flag=False
                break
    if flag:
        l[n]=l[n-2]+1
    else:
        l[n]=l[n-2]

#print(l)
for item in lr:
    print(l[item[1]]-l[item[0]] if l[item[0]-2]==l[item[0]] or item[0]==1 else l[item[1]]-l[item[0]]+1)
### BUGGY CODE ###

n,k=map(int, input().split())
A=[((int(i)*(int(i)+1))/2)/int(i) for i in input().split()]
ans=0
for i in range(n-k+1):ans=max((sum(A[i:i+k])), ans)
print(ans)


### FIXED CODE ###

from itertools import accumulate
n,k=map(int, input().split())
A=[((int(i)*(int(i)+1))/2)/int(i) for i in input().split()]
al = list(accumulate(A))
ans = al[k-1]
for i in range(k, n):ans=max(ans, al[i]-al[i-k])
print(ans)