It's been almost a week since Polycarp couldn't get rid of insomnia. And as you may already know, one week in Berland lasts k days!

When Polycarp went to a doctor with his problem, the doctor asked him about his sleeping schedule (more specifically, the average amount of hours of sleep per week). Luckily, Polycarp kept records of sleep times for the last n days. So now he has a sequence a_1, a_2, ..., a_{n}, where a_{i} is the sleep time on the i-th day.

The number of records is so large that Polycarp is unable to calculate the average value by himself. Thus he is asking you to help him with the calculations. To get the average Polycarp is going to consider k consecutive days as a week. So there will be n - k + 1 weeks to take into consideration. For example, if k = 2, n = 3 and a = [3, 4, 7], then the result is $\frac{(3 + 4) +(4 + 7)}{2} = 9$.

You should write a program which will calculate average sleep times of Polycarp over all weeks.


-----Input-----

The first line contains two integer numbers n and k (1 ≤ k ≤ n ≤ 2·10^5).

The second line contains n integer numbers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^5).


-----Output-----

Output average sleeping time over all weeks. 

The answer is considered to be correct if its absolute or relative error does not exceed 10^{ - 6}. In particular, it is enough to output real number with at least 6 digits after the decimal point.


-----Examples-----
Input
3 2
3 4 7

Output
9.0000000000

Input
1 1
10

Output
10.0000000000

Input
8 2
1 2 4 100000 123 456 789 1

Output
28964.2857142857



-----Note-----

In the third example there are n - k + 1 = 7 weeks, so the answer is sums of all weeks divided by 7.

Difficulty: interview

Starter code:

Solutions:
line=input().split()
n=int(line[0])
k=int(line[1])
nums=input().split()
for i in range(n):
    nums[i]=int(nums[i])

firstsum = 0
for i in range(k):
    firstsum+=nums[i]

totsum=firstsum
for i in range(n-k):
    firstsum-=nums[i]
    firstsum+=nums[k+i]
    totsum+=firstsum
print(totsum/(n-k+1))


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

movSum = sum(a[0:k])
tot = movSum
for i in range(1,n-k+1):
    movSum-=a[i-1]
    movSum+=a[i+k-1]
    tot += movSum

print(tot/(n-k+1))


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

s = sum(a[:k])
ans = s / (n - k + 1)
for i in range(n - k):
    s = s + a[i + k] - a[i]
    ans += s / (n - k + 1)
print(ans)


n,k = list(map(int,input().split()))
ai = list(map(int,input().split()))
summ = 0
k2 = n-k+1
for i in range(n):
    summ += ai[i] * min(k2,k,i+1,n-i)
print(summ/(k2))


n, k = map(int, input().split())
a = list(map(int, input().split()))
pref = [0 for i in range(n - k + 1)]
pref[0] = sum(a[:k])
for i in range(1, n - k + 1):
    pref[i] = pref[i - 1] - a[i - 1] + a[i + k - 1]
print(sum(pref) / (n - k + 1))

m,n = list(map(int,input().split()))
arr = [int(x) for x in input().split()]
s = sum(arr[:n])
val = m-n+1
ns = s/val
for i in range(n,m):
	s = s + arr[i] - arr[i-n]
	ns += s/val
print(ns)


from sys import stdin, stdout
from decimal import Decimal

n, k = map(int, stdin.readline().split())
values = list(map(Decimal, stdin.readline().split()))
cnt = [values[0]]

for i in range(1, n):
    cnt.append(cnt[-1] + values[i])

cnt.append(0)


ans = 0
for i in range(k - 1, n):
    ans += cnt[i] - cnt[i - k]


stdout.write(str(ans / Decimal((n - k + 1))))

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

s = 0
for i in range(n):
    l = max(0, i - k + 1)
    r = min(i, n - k)
    
    s += a[i] * (r - l + 1)
        
    
print(s / (n - k + 1))

def solve():
    #n = int(input())
    n, k = map(int, input().split())
    a = [0] + list(map(int, input().split()))
    #a = [list(map(int, input().split())) for _ in range(n)]
    for i in range(1, n + 1):
        a[i] = a[i - 1] + a[i]
    ans = 0.0
    for i in range(k, n + 1):
        ans += (a[i] - a[i - k]) / (n - k + 1)
    print(ans)

def __starting_point():
    solve()
__starting_point()

a = input().split()
n = int(a[0])
k = int(a[1])
v = list(map(int,input().split()))
s = 0
co = 1
cur_s = 0
cur = 0
dal = k-1
for i in range(k):
    cur_s+= v[i]
s+=cur_s

while (dal+1<n):
    co+=1
    cur_s-=v[cur]
    cur+=1
    dal+=1
    cur_s += v[dal]
    s+=cur_s
print(s/co)

n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
total = sum(a[:k])
res = total
for i in range(1, n-k+1):
    total += - a[i-1] + a[i+k-1]
    res += total
print(res/(n-k+1))

def luckyYear():
    n = int(input())
    original = n
    p = -1
    f = 0
    while n > 0:
        f = n % 10
        n //= 10
        p += 1
    f += 1
    f *= 10 ** p
    # print(f)
    print(f - original)


def averageSleepTime():
    n, k = list(map(int, input().split()))
    sleep = list(map(int, input().split()))
    run = 0
    for i in range(k):
        run += sleep[i]
    runavg = [run]
    for i in range(k, n):
        run = run - sleep[i - k] + sleep[i]
        runavg.append(run)
    print('{:.10f}'.format(sum(runavg)/(n-k+1)))


averageSleepTime()


def main():
    n, k = list(map(int, input().split()))
    a = list(map(int, input().split()))

    ans = 0

    for i in range(n):
        l = max(i - k + 1, 0)
        r = min(i, n - k)
        ans += a[i] * (r - l + 1)

    print("{:.12f}".format(ans / (n - k + 1)))


def __starting_point():
    # import sys
    # sys.stdin = open("in.txt")
    main()

__starting_point()

n,k=list(map(int,input().split()))
ans=0
a=list(map(int,input().split()))
s=sum(a[:k])
t=s
for i in range(1,1+n-k):
    s-=a[i-1]
    s+=a[i+k-1]
    t+=s
print(t/(1+n-k))



n, k = map(int, input().split())
a = list(map(int,input().split()))
d = [0 for i in range(n)]
d[0] = a[0]
for i in range(1, n):
  d[i] = a[i] + d[i - 1]

cnt = 0
sm = 0
for i in range(k - 1, n):
  cnt += 1
  if i == k - 1:
    sm += d[i]
  else:
    sm += d[i] - d[i - k]
from decimal import Decimal
summa = Decimal(sm)
count = Decimal(cnt)
print(summa / count)

n, k = [int(x) for x in input().strip().split()]
a = [int(x) for x in input().strip().split()]
initsum = sum(a[:k])
allsum = initsum
for i in range(k, n):
    initsum -= a[i-k]
    initsum += a[i]
    allsum += initsum
print(allsum/(n-k+1))


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

weeks = n - k + 1
max_sum = min(weeks, k)

s = 0
for i in range(1, n+1):
    m = max_sum
    if i < max_sum:
        m = i
    elif n - i + 1 < max_sum:
        m = n - i + 1
    s += m*h[i-1]

s /= weeks
print(s)


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

s = 0
rec = [0]
for i in range(len(a)):
    rec.append(rec[-1] + a[i])

for i in range(n - k + 1):
    s += rec[i + k] - rec[i]

print(s / (n - k + 1))

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

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

ans = 0
tmp = a[0]
i = 0
j = 0
an = 0
for s in a:
    i+=1
    if i < k+1:
        an += s
    else:
        ans += an
        j+=1
        an -= tmp
        an += s
        tmp = a[j]
##    print("i", i)
##    print("ans", ans)
##    print("an", an)
##    print("tmp", tmp)

ans += an

print(ans/(n-k+1))


# -*- coding: utf-8 -*-

import sys
import os
import math

# input_text_path = __file__.replace('.py', '.txt')
# fd = os.open(input_text_path, os.O_RDONLY)
# os.dup2(fd, sys.stdin.fileno())

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

if n == k:
    print(sum(A))
elif n - k >= k:
    v = 0
    for i in range(n):
        if i < k:
            v += (i+1) * A[i]
        elif n - k < i:
            v += (n-i) * A[i]
        else:
            v += k * A[i]
    ans = v / (n-k+1)
    print(ans)
else:
    v = 0
    for i in range(n):
        if i < n - k:
            v += (i+1) * A[i]
        elif k <= i:
            v += (n-i) * A[i]
        else:
            v += (n-k+1) * A[i]
    ans = v / (n-k+1)
    print(ans)





n, k = [int(x) for x in input().split()]
y = [0]
l = [int(x) for x in input().split()]
p =k
s =0
for x in l:
    y.append(y[-1]+x)

ln = len(y)
while k<ln:
    s+=y[k]- y[k-p]
    k = k+1

print(s/(n-p+1))

n,k = map(int,input().split())
arr = [int(i) for i in input().split()]
total =0
for i in range(n):
    #print(arr[i])*(min(n-k+1,min(n-k+1,min(i,n-i-1)+1)))
    total += (arr[i])*(min(n-k+1,min(k,min(i,n-i-1)+1)))
#print(total/k)
print ('{0:.10f}'.format(total/(n-k+1)))

def mp():  return list(map(int,input().split()))
def lt():  return list(map(int,input().split()))
def pt(x):  print(x)
def ip():  return input()
def it():  return int(input())
def sl(x):  return [t for t in x]
def spl(x): return x.split()
def aj(liste, item): liste.append(item)
def bin(x):  return "{0:b}".format(x)
def listring(l): return ' '.join([str(x) for x in l])
def ptlist(l): print(' '.join([str(x) for x in l]))


n,k = mp()
a = lt()

s = sum(a[:k])
l = 0
for i in range(n-k+1):
    l += s
    if i+k < n:
        s += (a[i+k]-a[i])
pt(l/(n-k+1))
    
            
    


"""import sys
sys.stdin = open("in", "r")"""

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

arr = list(map(int, input().split()))

for i, j in enumerate(arr):
    if(i > 0):
        arr[i] += arr[i - 1]

sum = 0
for i in range(k - 1, n):
    nm = arr[i]
    if(i != k - 1):
        nm -= arr[i - k]
    sum += nm

print(sum / (n-k+1))


n, k = map(int, input().split())
a = list(map(int, input().split()))
summ = 0
multi = 1
for i in range(n):
    if n - i > k and multi < k:
        summ += a[i] * multi
        multi += 1
    elif n - i > k or i + 1 < k:
        summ += a[i] * multi
    elif n - i <= k:
        summ += a[i] * multi
        multi -= 1
print(summ / (n - k + 1))