Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
dp = [0] * N
for _ in range(M):
    a = int(input())
    dp[a-1] = -1

k = 1000000007

if dp[0] == 0 and dp[1] == 0:
    dp[0] = 1
    dp[1] = 2

if dp[0] == -1 and dp[1] == 0:
    dp[0] = 0
    dp[1] = 1


if dp[0] == 0 and dp[1] == -1:
    dp[0] = 1
    dp[1] = 0


if dp[0] == -1 and dp[1] == -1:
    dp[0] = 0
    dp[1] = 0


for i in range(2, N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    dp[i] = dp[i-1] + dp[i-2]

n = dp[-1] % k

print(n)


### FIXED CODE ###

N, M = map(int, input().split())
dp = [0] * N
for _ in range(M):
    a = int(input())
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]

n = dp[-1] % k

print(n)
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

total = 1


def fib(n):
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return b


i = 0
for x in a:
    if x == i:
        print(0)
        exit()
    total *= fib(x - i - 1)
    i = x + 1
total *= fib(n - a[-1] - 1)

print(total % 1000000007)

### FIXED CODE ###

def fib(n):
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return b


n, m = map(int, input().split())
if m == 0:
    print(fib(n) % 1000000007)
    exit()
a = [int(input()) for _ in range(m)]

total = 1
i = 0
for x in a:
    if x == i:
        print(0)
        exit()
    total *= fib(x - i - 1)
    i = x + 1
if a[-1] != n:
    total *= fib(n - (a[-1] + 1))

print(total % 1000000007)
#ずっとre
from math import gcd
from functools import reduce

def get_gcd(number_list):
    return reduce(gcd, number_list)

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

gcd_list = [0] * N
for i in range(N):
    tmp_list = Numbers[:i] + Numbers[i + 1:]
    gcd_list[i] = get_gcd(tmp_list)
    
print(int(max(gcd_list)))

### FIXED CODE ###

from functools import reduce
from itertools import combinations
from fractions import gcd

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


Left = [0] * (N + 1)
Right = [0] * (N + 1)

for i in range(N):
    Left[i + 1] = gcd(Left[i], A[i])
    Right[N - i - 1] = gcd(Right[N - i], A[N - i - 1])
ans = 0
for i in range(N):
    ans = max(ans, gcd(Left[i], Right[i + 1]))
    
print(ans)
a, b = map(int,input().split())

print(int(a * b))

### FIXED CODE ###

a_s, b_s = input().split()

b_s = b_s.replace(".", "")

s = str(int(a_s) * int(b_s))
if len(s) > 2:
    print(str(int(a_s) * int(b_s))[:-2])
else:
    print(0)
a = int(input())
print(a + a**2 + a***3)

### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
nums = input().split()
N = int(nums[0])
A = int(nums[1])
B = int(nums[2])
S = input()
count = 0
bcount = 0
for x in S:
	if x == 'a' and A+B > count:
		count += 1
		print("Yes")
	elif x == 'b' and A+B > count and bcount < B :
		count += 1
		bcount += 1
		print("Yes")
	else :
		print("No")


### FIXED CODE ###

s = input()
count = 0;
anser = "CODEFESTIVAL2016"
for i in range(0,16):
	if not s[i] == anser[i]:
		count+=1
print(count)
p=1
s=[0]*2
n=int(input())
q=sorted([[int(input()),i//n]for i in range(2*n)])
for i in q:
    if s[1-i[1]]==0:
        s[i[1]]+=1
    else:
        p*=s[1-i[1]]
        s[1-[i[1]]-=1
print(p%(10**9+7))

### FIXED CODE ###

p=1
m=10**9+7
s=[0]*2
n=int(input())
q=sorted([[int(input()),i//n]for i in range(2*n)])
for i in q:
    if s[1-i[1]]==0:
        s[i[1]]+=1
    else:
        p=(p*s[1-i[1]])%m
        s[1-i[1]]-=1
print(p)
import sys
from collections import Counter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=sorted(lmp(),reverse=True)
i=0
l=[]
while i<n:
    if a[i]==a[i+1]:
        l.append(a[i])
        i+=1
    i+=1
if len(l)>=2:
    print(l[0]*l[1])
else:
    print(0)

### FIXED CODE ###

import sys
from collections import Counter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=sorted(lmp(),reverse=True)
i=0
l=[]
while i<n-1:
    if a[i]==a[i+1]:
        l.append(a[i])
        i+=1
    i+=1
if len(l)>=2:
    print(l[0]*l[1])
else:
    print(0)
n = str(input())

totL = 0
for i in n:
  total += int(i)
if total % 9 == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
 
if n%9 == 0:
  print("Yes")
else:
  print("No")
print(x * 3)

### FIXED CODE ###

x = int(input())

print(x ** 3)
n,m=map(int,input().split())
l=[[0,0]]*m
t=[0]*m
tc=0
a=False
f=0
for k in range(m):
  l[k]=list(map(int,input().split()))
l.sort()
for k in l:
  if k[0]!=1 & f==0:
    del t[tc:]
  if k[0]==1:
    t[tc]=k[1]
    tc+=1
  elif k[1]==n:
    if k[0] in t:
      a=True
      break
if a:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")


### FIXED CODE ###

n,m=map(int,input().split())
l=[[0,0]]*m
at=[0]*m
bt=[0]*m
atc=0
btc=0
a=False

f=0
for k in range(m):
  ln=list(map(int,input().split()))
  if ln[0]==1:
    at[atc]=ln[1]
    atc+=1
  elif ln[1]==n:
    bt[btc]=ln[0]
    btc+=1
del at[atc:]
del bt[btc:]
at.sort()
bt.sort()
c=list(set(at)^set(bt))
if len(c)!=(atc+btc):
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")
a, b, c = map(int, raw_input().split())
2.2.if (b-a) == (c-b):
3.3.    print("YES")
4.4.else:
5.5.    print("NO")


### FIXED CODE ###

a, b, c = map(int, input().split())
if (b-a) == (c-b):
    print("YES")
else:
    print("NO")
# cf16-finalA - Where's Snuke?
def main():
    h, w = list(map(int, input().rstrip().split()))
    A = [input().rstrip().split() for _ in range(h)]
    S = "ABCDEFGHIJ"
    for i in range(h):
        for j in range(w):
            if A[i][j] == "snuke":
                print(S[j], i + 1, sep="")
                return


if __name__ == "__main__":
    main()

### FIXED CODE ###

# cf16-finalA - Where's Snuke?
from string import ascii_uppercase


def main():
    h, w = list(map(int, input().rstrip().split()))
    A = [input().rstrip().split() for _ in range(h)]
    S = ascii_uppercase
    for i in range(h):
        for j in range(w):
            if A[i][j] == "snuke":
                print(S[j], i + 1, sep="")
                return


if __name__ == "__main__":
    main()
s = input()

checker = ''

if len(s) == 2:
    if s[0] == s[1]:
        print(1, 2)
        checker += '*'
    else:
        print(-1, -1)
        checker += '*'


if checker == '':
    for a, b in zip(range(len(s)-1), range(1,len(s))):
        if s[a] == s[b]:
            print(a+1, b+1)
            checker += '*'
            break

if checker == '':
    for a, c in zip(list(range(len(s)-2)), list(range(2, len(s)))):
        if s[a] == s[c]:
            print(a+1, c+1)
            chekcher += '*'
            break

if checker == '':
    print(-1, -1)

### FIXED CODE ###

s = input()

checker = ''

if len(s) == 2:
    if s[0] == s[1]:
        print(1, 2)
        checker += '*'
    else:
        print(-1, -1)
        checker += '*'


if checker == '':
    for a, b in zip(range(len(s)-1), range(1,len(s))):
        if s[a] == s[b]:
            print(a+1, b+1)
            checker += '*'
            break

if checker == '':
    for a, c in zip(range(len(s)-2), range(2, len(s))):
        if s[a] == s[c]:
            print(a+1, c+1)
            checker += '*'
            break

if checker == '':
    print(-1, -1)
from collections import Counter
R,C=map(int,input().split())
sx,sy=1,1
gx,gy=R,C
count=0
mp = [[i for i in input().rstrip()] for i in range(R)]
for i in range(R):
  mp[i]=list(mp[i])
for i in range(R):
	for j in range(C):
		if(mp[i][j]=='#'):
			count+=1
ans=[[3000 for i in range(C)] for j in range(R)]
ans[sx-1][sy-1]=0
start=[sx-1,sy-1]
goal=[gx-1,gy-1]
nsx=[1,0,-1,0]
nsy=[0,1,0,-1]

def bfs(graph,st,end):
  queue=[st]
  while queue:
    nw=queue.pop(0)
    if nw==end:
      return ans[end[0]][end[1]]
    else:
      for i in range(4):
        ns1=nw[0]+nsx[i]
        ns2=nw[1]+nsy[i]
        if (0 <= ns1)and(ns1<=(R-1))and(0<=ns2)and(ns2<=(C-1)) and ans[ns1][ns2]==3000 and mp[ns1][ns2]==".":
          ans[ns1][ns2]=ans[nw[0]][nw[1]]+1
          queue.append([ns1,ns2])
  return

print(R*C-bfs(mp,start,goal)-1-count)


### FIXED CODE ###

R,C=map(int,input().split())
sx,sy=1,1
gx,gy=R,C
count=0
mp = [[i for i in input().rstrip()] for i in range(R)]
for i in range(R):
  mp[i]=list(mp[i])
for i in range(R):
	for j in range(C):
		if(mp[i][j]=='#'):
			count+=1
ans=[[3000 for i in range(C)] for j in range(R)]
ans[sx-1][sy-1]=0
start=[sx-1,sy-1]
goal=[gx-1,gy-1]
nsx=[1,0,-1,0]
nsy=[0,1,0,-1]

def bfs(graph,st,end):
  queue=[st]
  while queue:
    nw=queue.pop(0)
    if nw==end:
      return ans[end[0]][end[1]]
    else:
      for i in range(4):
        ns1=nw[0]+nsx[i]
        ns2=nw[1]+nsy[i]
        if (0 <= ns1)and(ns1<=(R-1))and(0<=ns2)and(ns2<=(C-1)) and ans[ns1][ns2]==3000 and mp[ns1][ns2]=='.':
          ans[ns1][ns2]=ans[nw[0]][nw[1]]+1
          queue.append([ns1,ns2])
  return

while True:
	try:
		print(R*C-bfs(mp,start,goal)-1-count)
		break
	except (RuntimeError,TypeError,NameError):
		print(-1)
		break
a,b=map(int,input().split())
print("Possible" iaf any([a%3==0,b%3==0,(a+b)%3==0]) else "Impossible")

### FIXED CODE ###

a,b=map(int,input().split())
print("Possible" if any([a%3==0,b%3==0,(a+b)%3==0]) else "Impossible")
line = input()
num = [int(n) for n in line.split()]

smaller_divisible_number = num
if num%2 != 0:
    smaller_divisible_number *= 2
print(smaller_divisible_number)

### FIXED CODE ###

#jiaofhaosfhao
n=int(input())
if(n%2==1):
	n*=2
print(n)
sx, sy, tx, ty = [int(x) for x in stdin().readline().rstrip().split()]
x = tx - sx
y = ty - sy
l = ["R"]*x + ["U"]*y + ["L"]*x + ["D"]*y + ["D"] + ["R"] * (x+1) + ["U"]*(y+1) + ["L"] + ["U"] + ["L"]*(x+1) + ["D"]*(y+1) +["R"]
print("".join(l))

### FIXED CODE ###

sx, sy, tx, ty = [int(x) for x in input().split()]
x = tx - sx
y = ty - sy
l = ["R"]*x + ["U"]*y + ["L"]*x + ["D"]*y + ["D"] + ["R"] * (x+1) + ["U"]*(y+1) + ["L"] + ["U"] + ["L"]*(x+1) + ["D"]*(y+1) +["R"]
print("".join(l))
num = int(input())
base = 26

checker = True
ind = 1
while checker:
  if num > base ** ind:
    ind += 1
  else:
    checker = False
    ind += -1

pre_ans_num = []
for i in range(ind):
  ind_2 = ind - i
  quot = num // base ** ind_2
  pre_ans_list.append(quot)
  num = a % base ** ind_2

ans = ""
for n in pre_ans_num:
  if n==0:
    ans += "0"
  else:
    order = ord("a") + n - 1
    ans += chr(order)

print(ans)
    

### FIXED CODE ###

N = int(input())
ans = ''
for i in range(1, 10000):
#     print(N)
#     print("-> ",26 ** i)
    if N <= 26 ** i: 
#         print("ok")
        N += -1
        for j in range(i):
#             print("N:", N)
#             print("N % 26:", N % 26)
            ans += chr(ord('a') + N % 26)
            N = N // 26  # 26で割った商
        break
    else:
        N -= 26 ** i

print(ans[::-1])
from math import inf
n,k=map(int,input().split())
h=list(map(int,input().split()))
li=[inf]*n
li[0]=0
li[1]=abs(h[1]-h[0])
for i in range(2,n):
    for j in range(i-1,(i-k)-1,-1):
        if j>=0:
            #3print(i,j)
            li[i]=min(li[i],li[j]+abs(h[i]-h[j]))
##print(li)
print(li[n-1])


### FIXED CODE ###

import numpy as np
inf=10000007

n,k=map(int,input().split())
h=np.array(list(map(int,input().split())))
dp = np.zeros(n,dtype=int)
dp[0]=0

for i in range(1,n):
    l=max(0,i-k)

    dp[i] = np.min(dp[l:i] + abs(h[l:i] - h[i]))




##print(li)
print(dp[-1])
a =  input()
print("Yes" if a[0]==a[1]==a[2] or a[3]==a[1]==a[2] "No")

### FIXED CODE ###

a =  input()
print("Yes" if a[0]==a[1]==a[2] or a[3]==a[1]==a[2] else "No")
K,X=map(int,input().split())
print(*list(range[X-K+1,X+K]))

### FIXED CODE ###

K,X=map(int,input().split())
print(*list(range(X-K+1,X+K)))
N = int(input())
mylist = (input().split(" "))
result = 1

if 0 in mylist:
    result = 0

else:
    for i in mylist:
        
        if result > 10 ** 18:
            result = -1
            break
        else:
            result *= i
print(result)

### FIXED CODE ###

N = int(input())
mylist = list(map(int , input().split(" ")))
result = 1

if 0 in mylist:
    result = 0

else:
    for i in mylist:
        
        if result * i > 10 ** 18:
            result = -1
            break
        else:
            result *= i
            
print(result)
N = int(input())
D = list(map(int, input().split()))

diff = [0]*13
D.sort()
for i in range(N):
    diff[D[i]] += 1

if diff[0] > 0:
    print(0)
    exit(0)
else:
    diff2 = [diff[12 - i] for i in range(1, N-1)]

for i in range(13):
    if diff[i] > 2:
    print(0)
    exit(0)

ans = [0]
for i in range(N):
    if i % 2 == 0:
        ans.append(D[i])
    else:
        ans.append(24 - D[i])

ans = [abs(ans[i+1] - ans[i]) for i in range(N-1)]

print(min(ans))


### FIXED CODE ###

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


D.sort()
ans = [0]
ans = [D[i]
       for i in range(N) if i % 2 == 0] + [24 - D[i] for i in reversed(range(N)) if i % 2 == 1]

ans = [0] + ans + [0]

ans = [abs(ans[i+1] - ans[i]) for i in range(N+1)]

print(min(ans))
import sys
sys.setrecursionlimit(10 ** 10)
lst = [[1,2], [2, 5], [3, 5], [4, 4], [5, 5], [6, 6], [7, 3], [8, 7], [9, 6]]
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
# print (A)

def num(k):
    return lst[k-1][1]

# for i in A:
    # print (num(i), end = ', ')
# print ()

INF = 10 ** 9
dp_lst = [-INF] * (N + 1)
dp_lst[0] = 0
def dp(i):
    if dp_lst[i] != -INF:
        return dp_lst[i]
    tmp = -INF
    for j in A:
        if i >= num(j):
            tmp = max(tmp, dp(i - num(j)) + 1)
    dp_lst[i] = tmp
    return dp_lst[i]

a = dp(N)
# print (a)
# print (dp_lst)   
# print ([0] * 10 +[i+1 for i in range(20)])

# print (len(str(71111111111111111111111111111111111111111111111111)))

def check(A):
    if dp_lst[N-num(A)] == dp_lst[N] - 1:
        return True
    else:
        return False

# print (a)
while a > 0:
    for i in A:
        if check(i):
            print (i, end = '')
            N -= num(i)
            a -= 1
            break
        else:
            pass
            # print ('B')
print ()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5)
lst = [[1,2], [2, 5], [3, 5], [4, 4], [5, 5], [6, 6], [7, 3], [8, 7], [9, 6]]
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
# print (A)

def num(k):
    return lst[k-1][1]

# for i in A:
    # print (num(i), end = ', ')
# print ()

INF = 10 ** 5
dp_lst = [-INF] * (N + 1)
dp_lst[0] = 0
def dp(i):
    if dp_lst[i] != -INF:
        return dp_lst[i]
    tmp = -INF
    for j in A:
        if i >= num(j):
            tmp = max(tmp, dp(i - num(j)) + 1)
    dp_lst[i] = tmp
    return dp_lst[i]

a = dp(N)
# print (a)
# print (dp_lst)   
# print ([0] * 10 +[i+1 for i in range(20)])

# print (len(str(71111111111111111111111111111111111111111111111111)))

def check(A):
    if N - num(A) < 0:
        return False
    if dp_lst[N-num(A)] == dp_lst[N] - 1:
        return True
    else:
        return False

# print (a)
while a > 0:
    for i in A:
        if check(i):
            print (i, end = '')
            N -= num(i)
            a -= 1
            break
        else:
            pass
            # print ('B')
print ()
n,l=map(int,input().split())
a=list(map(int, input().split()))
for i in range(n-1):
  if a[i]+a[i+1]>=L:
    print("Possible")
    for j in range(i):print(j+1)
    for j in range(n-1,i,-1):print(i)
    exit()
print("Impossible")

### FIXED CODE ###

n,l=map(int,input().split())
a=list(map(int, input().split()))
for i in range(n-1):
  if a[i]+a[i+1]>=l:
    print("Possible")
    for j in range(i):print(j+1)
    for j in range(n-1,i,-1):print(j)
    exit()
print("Impossible")
n = int(input())
a = list(map(int,input().split()))
ma1 = [1]*n
ma2 = [0]*n
mi2 = [0]*n

for i in range(1,n):
    ma1[i]=ma1[i-1]*2-a[i]
    if ma1[i]<0:
        print(-1)
        exit()
if n == 1:
    if a[0]==1:
        print(-1)
        exit()
    if a[0]==0:
        if a[1]==1:
            print(2)
            exit()
        elif a[1]==2:
            print(3)
            exit()
        else:
            print(-1)
            exit()


ma2[n-1]=a[n]
ma2[n-2]=ma2[n-1]
mi2[n-1]=a[n]
mi2[n-2]=mi2[n-1]//2 + mi2[n-1]%2
for i in range(2,n):
    ma2[n-1-i]=min(ma2[n-i]+a[n-i+1],2**(n-i)-a[n-i])
    mi2[n-1-i]=(mi2[n-i]+a[n-i+1])//2 + (mi2[n-i]+a[n-i+1])%2
    if mi2[n-1-i]>ma2[n-1-i]:
        print(-1)
        exit()
ma2 = [1]+ma2
ans = 0
for i in range(n):
    ans += min(ma1[i],ma2[i])
ans +=sum(a)

print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ma1 = [1]*n
ma2 = [0]*n
mi2 = [0]*n

if n ==0:
    if a[0]==1:
        print(1)
        exit()
    else:
        print(-1)
        exit()

for i in range(1,n):
    ma1[i]=ma1[i-1]*2-a[i]
    if ma1[i]<0:
        print(-1)
        exit()
if n == 1:
    if a[0]==1:
        print(-1)
        exit()
    if a[0]==0:
        if a[1]==1:
            print(2)
            exit()
        elif a[1]==2:
            print(3)
            exit()
        else:
            print(-1)
            exit()

ma2[n-1]=a[n]
ma2[n-2]=ma2[n-1]
mi2[n-1]=a[n]
mi2[n-2]=mi2[n-1]//2 + mi2[n-1]%2
if n!=2:
    for i in range(2,n):
        ma2[n-1-i]=min(ma2[n-i]+a[n-i+1],2**(n-i)-a[n-i])
        mi2[n-1-i]=(mi2[n-i]+a[n-i+1])//2 + (mi2[n-i]+a[n-i+1])%2
        if mi2[n-1-i]>ma2[n-1-i]:
            print(-1)
            exit()
ma2 = [1]+ma2
ans = 0
for i in range(n):
    ans += min(ma1[i],ma2[i])
ans +=sum(a)

print(ans)
import math
from functools import reduce
n = int(input())
A = list(map(int, input().split()))


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


ans = 0
for i in range(n):
    gcd = gcd_list(A[0:i] + A[i + 1:])
    if (ans < gcd):
        ans = gcd

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from functools import reduce
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))

def gcd(a, b):
	while (b):
		a, b = b, a % b
	return a


L = [0] + [None] * (n - 1)
R = [0] + [None] * (n - 1)
for i in range(1, n):
	L[i] = gcd(L[i - 1], A[i - 1])
	R[i] = gcd(R[i - 1], A[-i])

M = [None] * n
R = R[::-1]
for i in range(n):
	M[i] = gcd(L[i], R[i])

print(max(M))
import math

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

mod = 10**9 + 7

l = []
for i in range(n-1):
    d = x[i+1] - x[i]
    l.append(d)

# print(l)

f = math.factorial(n-1)

count = 0
k = f
plus = 0
for i in range(1,n):
    print(k)
    k = f + plus
    count += l[i-1] * k
    plus += f / (i+1)

print(int(count)%mod)

### FIXED CODE ###

import math

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

mod = 10**9 + 7

f = math.factorial(n-1)
f %= mod

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

l = []
for i in range(n-1):
    d = x[i+1] - x[i]
    l.append(d)

# print(l)

count = 0
k = f
plus = 0
for i in range(1,n):
    # print(k)
    k = f + plus
    count += l[i-1] * k
    plus += f * modinv(i+1,mod)

print(int(count)%mod)
a,b,c=map(int,input().split())
if a+b+c=17 and a*b*c=175:
    print(YES)
else:
    print(NO)


### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b+c==17 and a*b*c==175:
    print("YES")
else:
    print("NO")
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextFloat64() float64 {
	sc.Scan()
	f, _ := strconv.ParseFloat(sc.Text(), 64)
	return f
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func expectedValue(x float64) float64 {
	s := (x + 1) * (x / 2)
	return s / x
}

func main() {
	sc.Split(bufio.ScanWords)
	n, k := nextInt(), nextInt()
	evs := make([]float64, n)
	for i := 0; i < n; i++ {
		p := nextFloat64()
		evs[i] = expectedValue(p)
	}

	// initialize
	var ev float64
	for i := 0; i < k; i++ {
		ev += evs[i]
	}

	maxEv := ev
	left := 0
	for i := k; i < n; i++ {
		ev = ev - evs[left] + evs[i]
		left++
		if ev > maxEv {
			maxEv = ev
		}
	}
	fmt.Printf("%0.7f\n", maxEv)
}


### FIXED CODE ###

def expected_value(x):
    a = int(x)
    s = (a+1) * (a/2)
    # e = 0
    # for i in range(1, a+1):
    #     e += i / a
    return s / a

n, k = [int(x) for x in input().split()]
evs = list(map(expected_value, input().split())) 

# initialize
left = 0
max_ev = 0
ev = 0
for i in range(k):
    ev += evs[i]

max_ev = ev
for i in range(k, n):
    ev = ev - evs[left] + evs[i]
    left += 1
    if ev > max_ev:
        max_ev = ev
print('{:.7f}'.format(max_ev))
n,q = map(int,input().split())
S = input()
d = [0] * n
for i in range(n - 1):
        if S[i]+S[i + 1] == 'AC':
                d += 1
for i in range(q):
        r,l = map(int,input().split())
        su = 0
        for j in range(r-1,l):
                su += d[j]
        print(su-d[r-1])

### FIXED CODE ###

n,q = map(int,input().split())
S = input()
d = [0] * n
counter = 1
for i in range(n - 1):
    d[i] = counter
    if S[i]+S[i + 1] == 'AC':
            d[i+1] = counter
            counter += 1
d[len(S)-1] = counter
for i in range(q):
    r,l = map(int,input().split())
    print(d[l-1]-d[r-1])
L, R = map(int,input().split())
l , r = L//2019, R//2019
if R - L >= 2019:
    print(0)
else:
    flag=0
    Amari=[]
    for i in range(L,R-1):
        amari = i % 2019
        if i %3 == 0:
            flag = True
        Amari.append(amari)
    if 673 in Amari and flag:
        print(0)
    else:
        print(min(Amari)*(min(Amari)+1))


### FIXED CODE ###

L, R = map(int,input().split())
l , r = L//2019, R//2019
if R - L >= 2019:
    print(0)
elif R-L == 1:
    print(R*L%2019)
else:
    Amari=[]
    for i in range(L,R-1):
        for j in range(i+1,R+1):
            k = i*j
            Amari.append(k%2019)
    print(min(Amari))
N = int(input())
H = list(map(int, input().split()))
ans = []
count = 0
for i in range(N-1):
    if H[i] < H[i+1]:
        count = 0
    else:
        count += 1
    ans.append(count)
print(max(ans))

### FIXED CODE ###

import sys
N = int(input())
H = list(map(int, input().split()))
ans = []
count = 0
if N == 1:
    print(0)
    sys.exit()
for i in range(N-1):
    if H[i] < H[i+1]:
        count = 0
    else:
        count += 1
    ans.append(count)
print(max(ans))
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
%matplotlib inline
#整数 A,B,C,D が与えられます。A 以上 B 以下の整数のうち、C でも D でも割り切れないものの個数を求めてください。
#B 以下の整数の個数 (B 個) から、B 以下の C の倍数の個数と B 以下の D の倍数の個数を引き、
#重複して引いたものを足し戻す

A, B, C, D = map(int, input().split())

#B以下のCの倍数の数
if A%C==0 or B%C==0:
    c = B//C - A//C + 1
else:
    c = B//C - A//C
#B以下のDの倍数の数
if A%D==0 or B%C==0:
    d = B//D - A//D + 1
else:
    d = B//D - A//D 
#重複分（最小公倍数）
x = C*D//math.gcd(C,D)
if A%x == 0 or B%x == 0:
    cd = B//x - A//x +1
else:
    cd = B//x - A//x

print(B - A + 1 - c - d + cd)

### FIXED CODE ###

A, B, C, D = map(int, input().split())
def gcd(a,b):
    while b != 0:
        a, b = b, a%b
    return a
def lcm(a,b):
    return int(a*b / gcd(a,b))
X = A-B
Y = lcm(C,D)
i = B//C-(A-1)//C
j = B//D-(A-1)//D
k = B//Y-(A-1)//Y
print(int(B-A+1-(i+j-k)))
def update(i, x):
    i += base
    while i>0:
        st[i] = min(st[i], x)
        i//=2


def find(a, b):
    return _find(a, b+1, 0, 0, n)


def _find(a, b, k, l, r):
    if b <= l or r <= a:
        return 2**31-1

    if a <= l and r <= b:
        return st[k]

    rl = _find(a, b, 2*k+1, l, (l+r)/2)
    rr = _find(a, b, 2*k+2, (l+r)/2, r)
    return min(rl, rr)


(_n, q) = map(int, input().split())

n=1
while(n<=_n):
    n *= 2
base = n-1
st = [2**31-1]*(2*n-1)

for i in range(q):
    (c, l, r) = map(int, input().split())
    if c:
        print(find(l, r))
    else:
        update(l, r)

### FIXED CODE ###

def update(i, x):
    i += base
    st[i] = x
    while i>0:
        i = (i-1)//2
        st[i] = min(st[i*2+1], st[i*2+2])


def find(a, b):
    return _find(a, b+1, 0, 0, n)


def _find(a, b, k, l, r):
    if b <= l or r <= a:
        return 2**31-1

    if a <= l and r <= b:
        return st[k]

    rl = _find(a, b, 2*k+1, l, (l+r)/2)
    rr = _find(a, b, 2*k+2, (l+r)/2, r)
    return min(rl, rr)


(_n, q) = map(int, input().split())

n=1
while(n<=_n):
    n *= 2
base = n-1
st = [2**31-1]*(2*n-1)

for i in range(q):
    (c, l, r) = map(int, input().split())
    if c:
        print(find(l, r))
    else:
        update(l, r)