n= int(input())
for i in range(n):
    line=input()
    value= line.split()
    x = value[0]/value[2]
    if(x>=value[1]):
        print(value[1])
    if(x<value[1]):
        if(x==value[1]-x):
            print('0')
        else:
            if(((value[1]-x)/(value[2]-1))%2=0):
                y=(value[1]-x)/(value[2]-1)
                print(x-y)
            else:
                y=((value[1]-x)/(value[2]-1)) +1
                print(x-y)


n= int(input())
for i in range(n):
    line=input()
    value= line.split()
    value[0]= int(value[0])
    value[1]= int(value[1])
    value[2]= int(value[2])
    x = value[0]/value[2]
    if(x>=value[1]):
        print(value[1])
    if(x<value[1]):
            if(((value[1]-x)/(value[2]-1))%2==0):
                y=(value[1]-x)/(value[2]-1)
                print(int(x-y))
            else:
                y=(((value[1]-x)/(value[2]-1)) +1)
                print(int(x-y))


import math
n= int(input())
for i in range(n):
    line=input()
    value= line.split()
    value[0]= int(value[0])
    value[1]= int(value[1])
    value[2]= int(value[2])
    x = value[0]/value[2]
    if(x>=value[1]):
        print(value[1])
    if(x<value[1]):
        y=math.ceil(((value[1]-x)/(value[2]-1)))
        print(int(x-y))


t = int(input())
r =[]
def init(a):
    for l in range(len(a)):
        a[l] = int(a[l])
    return(a)
for i in range(t):
    n,m,k = input().split()
    n =int(n)
    m = int(m)
    k = int(k)
    a =[]
    p= 0
    for j in range(k-1):
        a.append(0)
    if m == 0:
        r.append(0)
    elif (n/k) >= m:
        r.append(m)
    elif (n/k) < m:
        while p < (m-(n/k)):
            if p < k-1:
                a[p] = a[p]+1
            elif p >= k-1:
                a[p-k] = a[p-k]+1
            p = p+1
        r.append(int((n/k)-int(max(a))))

for k in range(t):
    print(r[k])


t = int(input())
r =[]
def init(a):
    for l in range(len(a)):
        a[l] = int(a[l])
    return(a)
for i in range(t):
    n,m,k = input().split()
    n =int(n)
    m = int(m)
    k = int(k)
    a =[]
    cnt = 0

    if m == 0:
        r.append(0)
    elif (n/k) >= m:
        r.append(m)
    elif (n/k) < m:
        p = m -(n/k)
        while p > 0:
            p = p-(k-1)
            cnt = cnt+1
        r.append(int(n/k)-cnt)

for k in range(t):
    print(r[k])


t = int(input())
r =[]
def init(a):
    for l in range(len(a)):
        a[l] = int(a[l])
    return(a)
for i in range(t):
    n,m,k = input().split()
    n =int(n)
    m = int(m)
    k = int(k)
    a =[]
    p= 0
    a =[0]*(k-1)
    if m == 0:
        r.append(0)
    elif (n/k) >= m:
        r.append(m)
    elif (n/k) < m:
        while p <= (m-(n/k)):
            if p < k-1:
                a[p] = a[p]+1
            elif p >= k-1:
                a[p-k+1] = a[p-k+1]+1
            p = p+1
        r.append(int((n/k)-int(max(a))))

for k in range(t):
    print(r[k])


t = int(input())
r =[]
def init(a):
    for l in range(len(a)):
        a[l] = int(a[l])
    return(a)
for i in range(t):
    n,m,k = input().split()
    n =int(n)
    m = int(m)
    k = int(k)
    a =[]
    p= 0
    a =[0]*(k-1)
    if m == 0:
        r.append(0)
    elif (n/k) >= m:
        r.append(m)
    elif (n/k) < m:
        while p <= (m-(n/k)):
            if p < k-1:
                a[p] = a[p]+1
            elif p >= k-1:
                a[p-k] = a[p-k]+1
            p = p+1
        r.append(int((n/k)-int(max(a))))

for k in range(t):
    print(r[k])


t = int(input())
r =[]
def init(a):
    for l in range(len(a)):
        a[l] = int(a[l])
    return(a)
for i in range(t):
    n,m,k = input().split()
    n =int(n)
    m = int(m)
    k = int(k)
    a =[]
    p= 0
    for j in range(k-1):
        a.append(0)
    if m == 0:
        r.append(0)
    elif (n/k) >= m:
        r.append(m)
    elif (n/k) < m:
        while p <= (m-(n/k)):
            if p < k-1:
                a[p] = a[p]+1
            elif p >= k-1:
                a[p-k] = a[p-k]+1
            p = p+1
        r.append(int((n/k)-int(max(a))))

for k in range(t):
    print(r[k])


import sys
import math as mt
I=lambda:list(map(int,input().split()))
for tc in range(int(input())):
    n,m,k=I()
    if n==k:
        print(0)
        continue
    if m==0:
        print(0)
        continue
    x=n//k

    if m<=x:
        print(m)
        continue
    t=m-x
    tt=t//(x-1)
    if t%(x-1):
        tt+=1
    print(abs(x-tt))


import sys
import math as mt
I=lambda:list(map(int,input().split()))
for tc in range(int(input())):
    n,m,k=I()
    if n==m:
        print(0)
    if n==k:
        if m==1:
            print(1)
        else:
            print(0)
        continue
    if m==0:
        print(0)
        continue
    x=n//k
    if m<=x:
        print(m)
    else:
        t=m-x
        temp=t//(x-1)
        if t%(x-1):
            temp+=1
        print(x-temp)


import sys
import math as mt
I=lambda:list(map(int,input().split()))
for tc in range(int(input())):
    n,m,k=I()
    if n==m:
        print(0)
        continue
    if n==k:
        if m==1:
            print(1)
        else:
            print(0)
        continue
    if m==0:
        print(0)
        continue
    x=n//k
    if m<=x:
        print(m)
    else:
        t=m-x
        temp=t//(x-1)
        if t%(x-1):
            temp+=1
        print(x-temp)


import sys
import math as mt
I=lambda:list(map(int,input().split()))
for tc in range(int(input())):
    n,m,k=I()
    if n==k:
        if m==1:
            print(1)
        else:
            print(0)
        continue
    if m==0:
        print(0)
        continue
    x=n//k
    if m<=x:
        print(m)
    else:
        t=m-x
        temp=t//(x-1)
        if t%(x-1):
            temp+=1
        print(t-temp)


import sys
import math as mt
I=lambda:list(map(int,input().split()))
for tc in range(int(input())):
    n,m,k=I()
    if n==m:
        print(0)
        continue
    if n==k:
        if m==1:
            print(1)
        else:
            print(0)
        continue
    if m==0:
        print(0)
        continue
    x=n//k
    if m<=x:
        print(m)
        continue
    else:
        t=m-x
        temp=t//(k-1)
        if t%(k-1):
            temp+=1
        print(x-temp)


import sys
import math as mt
I=lambda:list(map(int,input().split()))
for tc in range(int(input())):
    n,m,k=I()
    if n==m:
        print(0)
    if n==k:
        if m==1:
            print(1)
        else:
            print(0)
        continue
    if m==0:
        print(0)
        continue
    x=n//k
    if m<=x:
        print(m)
    else:
        t=m-x
        temp=t//(x-1)
        if t%(x-1):
            temp+=1
        print(t-temp)


import sys
import math as mt
I=lambda:list(map(int,input().split()))
for tc in range(int(input())):
    n,m,k=I()
    if n==k:
        if m==1:
            print(1)
        else:
            print(0)
        continue
    if m==0:
        print(0)
        continue
    x=n//k
    if m<=x:
        print(m)
        continue
    t=m-x
    tt=t//(x-1)
    if t%(x-1):
        tt+=1
    print(abs(x-tt))


try:
    for _ in range(int(input())):
        n,m,k=map(int,input().split())
        c_pp=n//k
        if c_pp>=m:
            print(m)
        else:
            r_j=m-c_pp
            r_p=k-1
            if r_j%r_p==0:
                print(c_pp-(r_j//r_p))
            else:
                print(c_pp-((r_j//r_p)+1))
except:
    pass


try:
    for _ in range(int(input())):
        n,m,k=map(int,input().split())
        c_pp=n//k
        if c_pp>=m:
            print(m)
        else:
            r_j=m-c_pp
            r_p=k-1
            if r_j%r_p==0:
                print(c_pp-r_j//r_p)
            else:
                print(c_pp-((r_j//r_p)-1))
except:
    pass


try:
    for _ in range(int(input())):
        n,m,k=map(int,input().split())
        c_pp=n//k
        if c_pp>=m:
            print(m)
        else:
            r_j=m-c_pp
            r_p=k-1
            if r_j%r_p==0:
                print(c_pp-(r_j//r_p))
            else:
                print(c_pp-((r_j//r_p)+r_j%r_p))
except:
    pass


try:
    for _ in range(int(input())):
        n,m,k=map(int,input().split())
        c_pp=n//k
        if c_pp>=m:
            print(m)
        else:
            r_j=m-c_pp
            r_p=k-1
            if r_j%r_p==0:
                print(c_pp-(r_j//r_p))
            else:
                print(c_pp-((r_j//r_p)+1))
except:
    pass
###


# -*- coding: utf-8 -*-
"""
Created on Thu May 28 20:20:02 2020

@author: Mridul Garg
"""
def BS1(t, h, c):
    l, r = 0, 2**32

    while l < r:
        mid = l + (r-l)//2

        if (mid*(h+c) + h)/(2*mid+1) <= t:
            r = mid
        else:
            l = mid + 1

    return l

q = int(input())
for _ in range(q):
    h, c, t = list(map(int, input().split(" ")))

    if t >= h:
        print(1)

    else:

        a = BS1(t, h, c)
        b = a - 1
        a = int(a)
        b = int(b)

        t1 = (a*(h+c) + h)/(2*a+1)
        t2 = (b*(h+c) + h)/(2*b+1)

        o = (h+c)/2
        o = abs(t- o)

        if o < abs(t-t1) and o < abs(t-t2):
            print(2)
            continue

        if abs(t-t1) < abs(t-t2):
            print(2*a + 1)
        elif abs(t-t1) > abs(t-t2):
            print(2*b + 1)

        else:
            print(2*b + 1)


# -*- coding: utf-8 -*-
"""
Created on Thu May 28 19:57:43 2020

@author: Mridul Garg
"""

q = int(input())
for _ in range(q):
    n, m, k = list(map(int, input().split(" ")))

    if m <= n//k:
        print(m)

    else:
        temp = n//k
        ans = (m - temp)//(k-1)
        if (m - temp)%(k-1) != 0:
            ans += 1

#        print((m - temp)//(k-1))
#        print((m-temp)%(k-1))
        ans = temp - ans

        print(ans)


# -*- coding: utf-8 -*-
"""
Created on Thu May 28 19:57:43 2020

@author: Mridul Garg
"""

q = int(input())
for _ in range(q):
    n, m, k = list(map(int, input().split(" ")))

    if m <= n//k:
        print(m)

    else:
        temp = n//k
        ans = (m - temp)//(k-1) + 1

#        print((m - temp)//(k-1))
#        print((m-temp)%(k-1))
        ans = temp - ans

        print(ans)


# -*- coding: utf-8 -*-
"""
Created on Thu May 28 19:57:43 2020

@author: Mridul Garg
"""

q = int(input())
for _ in range(q):
    n, m, k = list(map(int, input().split(" ")))

    if m <= n//k:
        print(m)

    else:
        temp = n//k
        ans = (m - temp)//(k-1) + (m-temp)%(k-1)

#        print((m - temp)//(k-1))
#        print((m-temp)%(k-1))
        ans = temp - ans

        print(ans)


import math
test = int(input())

for x in range(test):
    n,m,k = map(int,input().split())

    if m == 0:
        print(0)

    elif n//k >= m:
        print(m)

    elif n//k < m:
        x = (n//k)
        a = m - n//k
        k -= 1

        y = math.ceil(a/k)

        if x == y:
            print(0)
        else:
            print(x-y)


test = int(input())

for x in range(test):
    n,m,k = map(int,input().split())

    if m == 0:
        print(0)

    elif n//k >= m:
        print(m)

    elif n//k < m:
        x = (n//k)
        m -= (n//k)
        n -= (n//k)
        k -= 1

        while k != 1 or m != 0 :
            if k == 1:
                break
            if m == 1:
                break
            k -= 1
            m -= 1

        y = m

        if x == y:
            print(0)
        else:
            print(x-y)


test = int(input())

for x in range(test):
    n,m,k = map(int,input().split())

    if m == 0:
        print(0)

    elif n//k >= m:
        print(m)

    elif n//k < m:
        x = (n//k)
        m -= (n//k)
        n -= (n//k)
        k -= 1

        y = m//k + m%k

        if x == y:
            print(0)
        else:
            print(x-y)


import math
t = int(input())
for i in range(t):
    n,m,k=map(int,input().split())
    per_p=n//k
    if per_p>=m:
        print(m)
    else:
        maxi_m=per_p
        min_m=math.ceil((m-per_p)/(k-1))
        print(maxi_m-min_m)


t=int(input())
for i in range(t):
    n,m,k=map(int,input().split())
    if n==k or m==0:
        print(0)
    else:
        x=n//k
        if x>m:
            print(m)
        else:
            res=x-(m//x)
            print(res)


import math
t=int(input())
for i in range(t):
    n,m,k=map(int,input().split())
    mx=n//k
    if mx>=m:
        print(m)
    else:
        rem=m-mx
        a=rem//(k-1)
        b=rem%(k-1)
        ans=mx-(a+b)
        print(ans)


import math
t=int(input())
for i in range(t):
    n,m,k=map(int,input().split())
    t1=n//k
    t2=m//k
    if m==0:
        print(m)
    elif k>m:
        print(t1-1)
    else:
        print(t1-t2)


import math
for _ in range(int(input())):
    n,m,k=map(int,input().split())
    card=n//k
    if(m<=card):
        print(m)
    else:
        m=m-card
        m=math.ceil(m/(k-1))
        print(card-m)


for _ in range(int(input())):
    n,m,k=map(int,input().split())
    card=n//k
    if(m<=card):
        print(m)
    else:
        m=m-card
        a=m
        m=math.ceil(m/(k-1))
        print(a-m)


for _ in range(int(input())):
    n,m,k=map(int,input().split())
    card=n//k
    if(m<=card):
        print(m)
    else:
        m=m-card
        m=math.ceil(m/(k-1))
        print(card-m)


import math
t=int(input())
for you in range(t):
	l=input().split()
	n=int(l[0])
	m=int(l[1])
	k=int(l[2])
	cards=min(m,n//k)
	if(cards==m):
		print(m)
	else:
		z=m-cards
		curr=math.ceil((m-cards)/(k-1))
		print(cards-curr)


import math
t=int(input())
for you in range(t):
	l=input().split()
	n=int(l[0])
	m=int(l[1])
	k=int(l[2])
	cards=min(m,n//k)
	if(cards==m):
		print(m)
	else:
		z=n-cards
		curr=math.ceil((n-cards)/(k+1))
		print(cards-curr)


import sys
input=sys.stdin.readline
t=int(input())
for you in range(t):
    l=input().split()
    n=int(l[0])
    m=int(l[1])
    k=int(l[2])
    z=min(n//k,m)
    y=(m-z+k-2)//(k-1)
    print(z-y)


import math
t=int(input())
for you in range(t):
	l=input().split()
	n=int(l[0])
	m=int(l[1])
	k=int(l[2])
	cards=min(m,n//k)
	if(cards==m):
		print(m)
	else:
		z=m-cards
		curr=math.ceil((m-cards)/(k+1))
		print(cards-curr)


for _ in range(int(input())):
    n,m,k=map(int,input().split())
    if m==0:
        print(0)
    elif n//k > m:
        print(m)
    elif n//k == 1 and n//k <=m:
        print(0)
    else:
        print(n//k - (m-n//k)//((n-1)//k) - ((m-n//k)%((n-1)//k)))


for _ in range(int(input())):
    n,m,k=map(int,input().split())
    e=n//k
    if e>=m:
        print(m)
    else:
        f=n//k
        m-=e
        k-=1
        a=m//k
        b=m%k
        s=a
        if b:
            s+=1
        print(f-s)


for _ in range(int(input())):
    n,m,k=map(int,input().split())
    if m==0:
        print(0)
    elif n//k >= m:
        print(m)
    elif n//k == 1 and n//k <m:
        print(0)
    else:
        print(n//k - (m-n//k)//((n-1)//k) - ((m-n//k)%((n-1)//k)))


t = int(input())

for i in range(t):
	m,n,k = map(int,input().split())
	c = m//k
	if ((c<n and n<k) or (n == 0) or (m==n)):
		print(0)
		continue
	if ((c==n)or (c>n)):
		print(n)
		continue
	if((c<n) and (n>k)):
		print(1)


t = int(input())

for i in range(t):
	m,n,k = map(int,input().split())
	c = m//k
	if ((c<n and n<k) or (n == 0) or (m==n)):
		print(0)
		continue
	if ((c==n)or (c>n)):
		print(n)
		continue
	if((c<n) and (n>=k)):
		print(1)


n = int(input())

for i in range(n):
	m,n,k = map(int,input().split())
	s = m//k
	if ((n ==0) or( ((m//k)==1) and (s < n))):
		print(0)
		continue

	if s > n:
		print(n)
	else:
		print(1)


t = int(input())

for i in range(t):
	m,n,k = map(int,input().split())
	c = m//k
	if ((n==0)or(m==n)):
		print(0)
		continue
	if (c >= n):
		print(n)
		continue
	if(c<n):
		r = n-c
		print(c-r)


t = int(input())

for i in range(t):
	m,n,k = map(int,input().split())
	c = m//k
	if ((n==0)or(m==n)):
		print(0)
		continue
	if (c >= n):
		print(n)
		continue
	if(c<n):
		r = (n-c)%(k-1)
		v = (n-c)//(k-1)
		if r == 0:
			print(c-v)
		else:
			print(c-v-1)


n = int(input())

for i in range(n):
	m,n,k = map(int,input().split())
	s = m//k
	if ((n ==0) or( ((m//k)==1) and (s < n))):
		print(0)
		continue

	if s > n:
		print(n)
	elif s==n:
		print(n)
	else:
		print(1)


n = int(input())

for i in range(n):
	m,n,k = map(int,input().split())
	s = m//k
	if n ==0 or( (m//k)==1 and (s < n)):
		print(0)
		continue

	if s > n:
		print(n)
	else:
		print(1)


n = int(input())

for i in range(n):
	m,n,k = map(int,input().split())
	if n ==0 or (m//k)==1:
		print(0)
		continue
	s = m//k
	if s > n:
		print(n)
	else:
		print(1)


n = int(input())

for i in range(n):
	m,n,k = map(int,input().split())
	s = m//k
	if ((n ==0) or( ((m//k)==1) and (s < n))):
		print(0)
		continue

	if s > n:
		print(n)
	elif s==n:
		print(n)
        else:
                print(1)


def solve():
    n, m, k = map(int, input().split())
    if n // k >= m:
        print(m)
    else:
        rp = k-1  #remaining players
        rj = m - n // k  #remaining jokers
        if rj % rp == 0:
            print(m - rj // rp)
        else:
            j = rj // rp + 1
            print(n//k - j)

def main():
    t = int(input())
    for _ in range(t):
        solve()

if __name__ == "__main__":
    # execute only if run as a script
    main()


def solve():
    n, m, k = map(int, input().split())
    if n // k >= m:
        print(m)
    else:
        rp = k-1  #remaining players
        rj = m - n // k  #remaining jokers
        if rj % rp == 0:
            print(n//k - rj // rp)
        else:
            j = rj // rp + 1
            print(n//k - j)

def main():
    t = int(input())
    for _ in range(t):
        solve()

if __name__ == "__main__":
    # execute only if run as a script
    main()


def solve():
    n, m, k = map(int, input().split())
    if n / k >= m:
        print(m)
    else:
        rp = k-1  #remaining players
        rj = m - n/k  #remaining jokers
        if rj / rp == 0:
            print(m - rj / rp)
        else:
            j = rj // rp + 1
            print(int(n/k-j))

def main():
    t = int(input())
    for _ in range(t):
        solve()

if __name__ == "__main__":
    # execute only if run as a script
    main()


def solve():
    n, m, k = map(int, input().split())
    if n / k >= m:
        print(m)
    else:
        rp = k-1  #remaining players
        rj = m - n/k  #remaining jokers
        if rj % rp == 0:
            print(m - rj / rp)
        else:
            j = rj // rp + 1
            print(int(n/k-j))

def main():
    t = int(input())
    for _ in range(t):
        solve()

if __name__ == "__main__":
    # execute only if run as a script
    main()


for _ in range(int(input())):
    n,m,k=list(map(int,input().split()))
    r=n//k
    v1=min(r,m)
    v2=max(r-m,0)
    v3=v2//(k-1)
    print(v1-v3)


import math
for _ in range(int(input())):
    n,m,k=list(map(int,input().split()))
    r=n//k
    x=min(r,m)
    y=max(m-r,0)
    y=math.ceil(y/(k-1))
    print(x-y)


for _ in range(int(input())):
    n,m,k=list(map(int,input().split()))
    r=n//k
    x=min(r,m)
    y=max(m-r,0)
    y=y//(k-1)+y%(k-1)
    print(x-y)


q = int(input())
for i in range(1,q+1):
    n,m,k = input().split()
    n = int(n)
    m = int(m)
    k = int(k)
    if m == 0 or n == k and m != 1:
        print("0")
    elif m == 1 or n//k < m:
        print("1")
    elif k == 1 or n//k > m:
        print(m)


t = int(input())

for i in range(t):
    n, m, k = map(int, input().split())
    d = n // k
    a1 = min(m, d)
    a2 = (m - a1 + k - 2) // (k - 1)
    print(a1 - a2)


q = int(input())
for i in range(1,q+1):
    n,m,k = input().split()
    n = int(n)
    m = int(m)
    k = int(k)
    if m == 0 or n == k and m != 1:
        print("0")
    elif m == 1 or n//k < m:
        print("1")
    elif k == 1 or n//k >= m:
        print(m)


import sys

strInp = lambda : input().strip().split()
intInp = lambda : list(map(int,strInp()))

for t in range(int(input())):
    n,m,k = intInp()
    cfe = n//k
    if cfe > m:
        print(m)
    else:
        mx = cfe
        re = m - mx
        if re % (k-1)  == 0:
            md = re // (k-1)
        else:
            md = re // (k-1)
            md += 1
        print(mx - md)


import sys

strInp = lambda : input().strip().split()
intInp = lambda : list(map(int,strInp()))

for t in range(int(input())):
    n,m,k = intInp()
    ma = min(m, n//k)
    dv = n//k
    re = m - ma
    if n == k:
        print(0)
    else:
        if re//dv % 2 == 0:
            md = re//dv
        else:
            md = re//dv + 1
        print(ma - md)


import sys

strInp = lambda : input().strip().split()
intInp = lambda : list(map(int,strInp()))

for t in range(int(input())):
    n,m,k = intInp()
    ma = min(m, n//k)
    re = m - ma
    if n == k:
        print(0)
    elif re == 0:
        print(ma)
    else:
        if (re//(k-1)) % 2 == 0:
            md = re//(k-1)
        else:
            md = (re//(k-1)) + 1
        print(ma - md)


n= int(input())
for _ in range(n):
    n,m,k = map(int, input().split())
    n=n//k
    if(n>=m):
        print(m)
    else:
        x=m-n
        if((n-1) ==0 or m==0):
            print(0)
        else:
            x= (x+1)//(n-1)
            print(n-x)


n= int(input())
for _ in range(n):
    n,m,k = map(int, input().split())
    n=n//k
    if(n>=m):
        print(m)
    else:
        x=m-n
        if((n-1) ==0 or m==0):
            print(0)
        else:
            if(x==1):
                print(n-1)
            else:
                x= (x+1)//(n-1)
                print(n-x)


import math
n= int(input())
for _ in range(n):
    n,m,k = map(int, input().split())
    n=n//k
    if(n>=m):
        print(m)
    else:
        x=m-n
        if((n-1) ==0 or m==0):
            print(0)
        else:
            if(x==1):
                print(n-1)
            else:
                x= math.ceil((x)/(k-1))
                print(n-x)


n= int(input())
for _ in range(n):
    n,m,k = map(int, input().split())
    n=n//k
    if(n>=m):
        print(m)
    else:
        x=m-n
        if((n-1) ==0 or m==0):
            print(0)
        else:
            if(x==1):
                print(n-1)
            else:
                x= (x+1)//(k-1)
                print(n-x)


for _ in range(int(input())):
    lis = list(map(int, input().split()))
    cards, jokers, plrs = lis[0], lis[1], lis[2]
    if (jokers == 0) or ((cards//plrs)==1):
        # everybody is winner or everybody gets one card all jokers distri
        print(0)
    elif cards//plrs >= jokers:
        print(jokers)
    else:
        joks_taken_max = jokers - (cards//plrs)
        joks_left = jokers - joks_taken_max
        plr_left = plrs - 1
        y = min(plr_left, joks_left)
        print(joks_taken_max - y)


import math
for _ in range(int(input())):
    lis = list(map(int, input().split()))
    cards, jokers, plrs = lis[0], lis[1], lis[2]
    # n m k
    if (jokers == 0) or ((cards//plrs)==1):
        print(0)
    else:
        if cards//plrs >= jokers:
            print(jokers)
        else:
            joks_taken_max = jokers - (cards/plrs)
            joks_left = jokers - joks_taken_max
            plr_left = plrs - 1
            y = math.ceil(joks_left/plr_left)
            print(int(joks_taken_max - y))

# (cards-ceil(((float)(m-cards))/((float)(k-1))))


import math
for _ in range(int(input())):
    lis = list(map(int, input().split()))
    cards, jokers, plrs = lis[0], lis[1], lis[2]
    if (jokers == 0) or ((cards//plrs)==1):
        print(0)
    elif cards//plrs >= jokers:
        print(jokers)
    else:
        joks_taken_max = cards//plrs
        remaining_jokers = jokers - joks_taken_max
        max_joker_per_person = math.ceil(remaining_jokers/(plrs-1))
        print(joks_taken_max - max_joker_per_person)


for _ in range(int(input())):
    lis = list(map(int, input().split()))
    cards, jokers, plrs = lis[0], lis[1], lis[2]
    if (jokers == 0) or (cards == plrs):
        # everybody is winner or everybody gets one card all jokers distri
        print(0)
    elif cards//plrs >= jokers:
        print(jokers)
    else:
        joks_taken_max = jokers - (cards//plrs)
        joks_left = jokers - joks_taken_max
        plr_left = plrs - 1
        y = min(plr_left, joks_left)
        print(joks_taken_max - y)


import math
for _ in range(int(input())):
    lis = list(map(int, input().split()))
    cards, jokers, plrs = lis[0], lis[1], lis[2]
    # n m k
    cards_p_plr = cards//plrs
    if cards_p_plr > jokers:
        print(jokers)
    else:
        print(cards_p_plr - math.ceil((jokers-cards_p_plr)/(plrs-1)))

# (cards-ceil(((float)(m-cards))/((float)(k-1))))


import math
for _ in range(int(input())):
    lis = list(map(int, input().split()))
    cards, jokers, plrs = lis[0], lis[1], lis[2]
    # n m k
    if cards//plrs > jokers:
        print(jokers)
    else:
        joks_taken_max = jokers - (cards//plrs)
        joks_left = jokers - joks_taken_max
        plr_left = plrs - 1
        y = math.ceil(joks_taken_max/plr_left)
        print(int(joks_taken_max - y))

# (cards-ceil(((float)(m-cards))/((float)(k-1))))


import math
for _ in range(int(input())):
    lis = list(map(int, input().split()))
    cards, jokers, plrs = lis[0], lis[1], lis[2]
    # n m k
    if (jokers == 0) or ((cards//plrs)==1):
        print(0)
    else
        if cards//plrs >= jokers:
            print(jokers)
        else:
            joks_taken_max = jokers - (cards/plrs)
            joks_left = jokers - joks_taken_max
            plr_left = plrs - 1
            y = math.ceil(joks_left/plr_left)
            print(joks_taken_max - y)

# (cards-ceil(((float)(m-cards))/((float)(k-1))))


from math import ceil
def main():
    for _ in range(int(input())):
        n,j,k=map(int,input().split())
        c=n//k
        if(c>=j):
            print(j)
        else:
            print(c-(ceil((j-c)/(k-1))))
if __name__ == "__main__":
    main()


#include<bits/stdc++.h>
using namespace std;
int main()
{

    int n,k;
    scanf("%d%d",&n,&k);
    int week=n-k+1;
    long long x;
    long long cnt=1;
    double sum=0.0;
    for(int i=1; i<=n; i++)
    {
        cin>>x;

        if(i<k)
        {
             //cout<<cnt<<endl;
           //cout<<sum<<endl;

            sum+=cnt*x;
            cnt++;
        }
        else if(i>((n-k)+1))
        {
             //cout<<cnt<<endl;
           //cout<<sum<<endl;
            sum+=cnt*x;
            cnt--;
        }
        else
        {
             //cout<<sum<<endl;
            sum+=(x*k);
            cnt=k-1;
        }

    }
   // cout<<sum<<endl;

    double res=(double)sum/(double)week;
    printf("%.10f\n",res);

    return 0;

}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4, INF = 1e9;

long long int dp[N], n, k, a;
long double cnt, lnt;
int main(){
    TIME;
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a;
        dp[i] += a;
    }
    lnt = n - k + 1;
    for( int i = 1; i <= lnt; i ++ ){
        cnt += dp[i - 1] + dp[i + k - 1];
    }
    cout << setprecision(7);
    cout << fixed << cnt / lnt;
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

double n, k, a[N], t[N * 4], lz[N * 4], cnt;
void push( ll v ){
    t[v * 2] += lz[v];
    t[v * 2 + 1] += lz[v];
    lz[v * 2] += lz[v];
    lz[v * 2 + 1] += lz[v];
    lz[v] = 0;
}
void upd( ll v, ll tl, ll tr, ll l, ll r, double val ){
    if( l > r )return;
    if( tl == l && tr == r ){
        t[v] += val;
        lz[v] += val;
    }
    else {
        push(v);
        ll tm = ( tl + tr ) / 2;
        upd( v * 2, tl, tm, l, min( tm, r ), val );
        upd( v * 2 + 1, tm + 1, tr, max( tm + 1, l ), r, val );
    }
}
double gt( ll v, ll tl, ll tr, ll pos ){
    if( tl == tr )return t[v];
    else{
        push(v);
        ll tm = ( tr + tl ) >> 1;
        if( pos <= tm )
            return gt( v * 2, tl, tm, pos );
        else
            return gt( v * 2 + 1, tm + 1, tr, pos );
    }
}
main(){
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a[i];
        if( i <= n - k + 1 )
            upd( 1ll, 1ll, n, i, i + k - 1, 1 );
    }
    for( int i = 1; i <= n; i ++ )
        cnt += a[i] * gt( 1ll, 1ll, n, i );
    cout << setprecision(10);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( long double i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += ( i - ( n - k + 1 ) ) * a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    cout << setprecision(6);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += ( i - ( n - k + 1 ) ) * a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    pr( "%.7lf", cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += ( i - ( n - k + 1 ) ) * a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    cout << setprecision(7);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( double i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    cout << setprecision(6);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n, k1, kol[N];
main(){
    cin >> n >> k;
    k1 = k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a;
        kol[i] = k;
        if( i < k )kol[i] = i,cnt += kol[i] * a;
        else if( i > n - k + 1 )kol[i] = --k1,cnt += kol[i] * a;
        else cnt += kol[i] * a;
        //cout << cnt << ' ' << i << ' ' << kol[i] << endl;
    }
    cout << setprecision(7);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

double n, k, a[N], t[N * 4], lz[N * 4], cnt;
void push( ll v ){
    t[v * 2] += lz[v];
    t[v * 2 + 1] += lz[v];
    lz[v * 2] += lz[v];
    lz[v * 2 + 1] += lz[v];
    lz[v] = 0;
}
void upd( ll v, ll tl, ll tr, ll l, ll r, double val ){
    if( l > r )return;
    if( tl == l && tr == r ){
        t[v] += val;
        lz[v] += val;
    }
    else {
        push(v);
        ll tm = ( tl + tr ) / 2;
        upd( v * 2, tl, tm, l, min( tm, r ), val );
        upd( v * 2 + 1, tm + 1, tr, max( tm + 1, l ), r, val );
    }
}
double gt( ll v, ll tl, ll tr, ll pos ){
    if( tl == tr )return t[v];
    else{
        push(v);
        ll tm = ( tr + tl ) >> 1;
        if( pos <= tm )
            return gt( v * 2, tl, tm, pos );
        else
            return gt( v * 2 + 1, tm + 1, tr, pos );
    }
}
main(){
    TIME;
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a[i];
        if( i <= n - k + 1 )
            upd( 1ll, 1ll, n, i, i + k - 1, 1 );
    }
    for( int i = 1; i <= n; i ++ )
        cnt += a[i] * gt( 1ll, 1ll, n, i );
    cout << setprecision(10);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4, INF = 1e9;

long long int dp[N], n, k, a;
long double cnt, lnt;
int main(){
    TIME;
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a;
        dp[i] += a + dp[i - 1];
    }
    lnt = n - k + 1;
    for( int i = 1; i <= lnt; i ++ ){
        cnt += abs( dp[i - 1] - dp[i + k - 1] );
    }
    //cout << cnt << ' ' << lnt << endl;
    cout << setprecision(7);
    cout << fixed << cnt / lnt;
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += ( i - ( n - k + 1 ) ) * a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    cout << setprecision(9);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( long double i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    cout << setprecision(10);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4, INF = 1e9;

long long int dp[N], n, k, a;
long double cnt, lnt;
int main(){
    TIME;
    cin >> n >> k;
    for( int i = 1; i <= n; i ++ ){
        cin >> a;
        dp[i] += a;
    }
    lnt = n - k + 1;
    for( int i = 1; i <= lnt; i ++ ){
        cnt += dp[i - 1] + dp[i + k - 1];
    }
    cout << setprecision(7);
    cout << fixed << cnt;
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( double i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += ( i - ( n - k + 1 ) ) * a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    cout << setprecision(6);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fr first
#define sc scanf
#define sz size
#define pr printf
#define ll long long
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll N = 2e5 + 4;

long double cnt, k, a, n;
main(){
    cin >> n >> k;
    for( long double i = 1; i <= n; i ++ ){
        cin >> a;
        if( i < k )cnt += i * a;
        else if( i > n - k + 1 )cnt += a;
        else cnt += k * a;
        //cout << cnt << ' ' << i << endl;
    }
    cout << setprecision(6);
    cout << fixed << ( cnt / ( n - k + 1 ) );
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
long double  t[555555];
int main()
{
    int N,k;
    cin >>N>>k;
    long double ans = 0;
    for (int i = 1;i<=N;i++)
    {
        cin >>t[i];
        if (i<k) ans+=(i)*(t[i]);
        else if (i+k>N) ans+=(N-i+1)*(t[i]);
        else ans+=t[i] * k;
    }
    ans = ans/(N-k+1);
    printf("%.20f",(double)ans);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
    long long  N,k;
    cin >>N>>k;
     long long ans1 = 0LL;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t);
        else if (i+k>N) ans1+=(N-i+1LL)*(t);
        else ans1+=t*k;
    }
    double ans2 = ans1*1.0/(N-k+1);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long  N,k;
    cin >>N>>k;
     long long ans1 = 0LL;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k||i+k>N) ans1+=min(i,(N-i+1LL))*(t);
        else ans1+=t*k;
    }
    double ans2 = ans1*1.0/(N-k+1LL);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
    long long  N,k;
    cin >>N>>k;
     long long ans1 = 0;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t);
        else if (i+k>N) ans1+=(N-i+1)*(t);
        else ans1+=t * k;
    }
    double ans2 = ans1*1.0/(N-k+1);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
double t;
int main()
{
    int N,k;
    cin >>N>>k;
     double ans = 0;
    for (int i = 1;i<=N;i++)
    {
        scanf("%lf",&t);
        if (i<k) ans+=(i)*(t)/(N-k+1);
        else if (i+k>N) ans+=(N-i+1)*(t)/(N-k+1);
        else ans+=t * k/(N-k+1);
    }
    printf("%.20f",(double)ans);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
    long long  N,k;
    cin >>N>>k;
     long long ans1 = 0;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t);
        else if (i+k>=N) ans1+=(N-i+1)*(t);
        else ans1+=t*k;
    }
    double ans2 = ans1*1.0/(N-k+1);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
    int N,k;
    cin >>N>>k;
     long long ans1 = 0;
    for (int i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t);
        else if (i+k>N) ans1+=(N-i+1)*(t);
        else ans1+=t * k;
    }
    double ans2 = ans1*1.0/(N-k+1);
    printf("%.20f",(double)ans2);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
    int N,k;
    cin >>N>>k;
     long long ans1 = 0;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t);
        else if (i+k>N) ans1+=(N-i+1)*(t);
        else ans1+=t * k;
    }
    double ans2 = ans1*1.0/(N-k+1);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
double  t[555555];
int main()
{
    int N,k;
    cin >>N>>k;
    double ans = 0;
    for (int i = 1;i<=N;i++)
    {
        cin >>t[i];
        if (i<k) ans+=(i)*(t[i])/(N-k+1);
        else if (i+k>N) ans+=(N-i+1)*(t[i])/(N-k+1);
        else ans+=t[i]/(N-k+1) * k;
    }
    printf("%.10f",ans);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
    int N,k;
    cin >>N>>k;
    double ans1 = 0;
    for (int i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t)/(N-k+1);
        else if (i+k>N) ans1+=(N-i+1)*(t)/(N-k+1);
        else ans1+=t * k/(N-k+1);
    }
    double ans2 = ans1;
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long  N,k;
    cin >>N>>k;
     long long ans1 = 0LL;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        ans1+=(min(N,i+k-1)-(max(1LL,i-k+1)+k-1LL)+1LL)*t;
    }
    double ans2 = ans1*1.0/(N-k+1LL);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long  N,k;
    cin >>N>>k;
     long long ans1 = 0LL;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t);
        else if (i+k>N) ans1+=(N-i+1LL)*(t);
        else ans1+=t*k;
    }
    double ans2 = ans1*1.0/(N-k+1LL);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
int main()
{
    long long  N,k;
    cin >>N>>k;
     long long ans1 = 0;
    for (long long  i = 1;i<=N;i++)
    {
        long long t;
        cin >> t;
        if (i<k) ans1+=(i)*(t);
        else if (i+k-1>N) ans1+=(N-i+1)*(t);
        else ans1+=t*k;
    }
    double ans2 = ans1*1.0/(N-k+1);
    printf("%.20f",ans2);
}


#include <bits/stdc++.h>
const long long mod = 1e9+7;
const double ex = 1e-10;
#define inf 0x3f3f3f3f
using namespace std;
double  t[555555];
int main()
{
    int N,k;
    cin >>N>>k;
    double ans = 0;
    for (int i = 1;i<=N;i++)
    {
        cin >>t[i];
        if (i<k) ans+=(i)*(t[i]);
        else if (i+k>N) ans+=(N-i+1)*(t[i]);
        else ans+=t[i] * k;
    }
    ans = ans /(N-k+1);
    printf("%.10f",ans);
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  int n, k; cin >> n >> k;
  vector<ll> nu; for(ll i = 0; i < n; i++){ll temp; cin >> temp; nu.push_back(temp);}
  long double su = accumulate(nu.begin(), nu.begin()+(k),0);
  ll prevsum = su;
  ll i = 0;
  //for(int i = 0; i < (n-k); i++){
  while(i + k != n){
    // i need to take away
    prevsum -= nu[i];
    prevsum += nu[i + k];
    su += prevsum;
    i++;

  }
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  int n, k; cin >> n >> k;
  vector<int> nu; for(int i = 0; i < n; i++){int temp; cin >> temp; nu.push_back(temp);}
  //if(k == 1){
  //  cout << setprecision (6) << fixed << accumulate(nu.begin(),nu.end(),0)/(n-k+1) << endl;
  //  return 0;
  //}
  long double su = 0;
  //int j = 0;
  for(int i = 0; i < (n-k+1); i++){
    su += accumulate(nu.begin()+i, nu.begin()+i+(k),0);
    //DEBUG(accumulate(nu.begin()+j, nu.begin()+j+(k),0))
    //j += (k-1);
  }
  //DEBUG(su)
  //cout << su/(n-k+1) << endl;
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  long double n, k; cin >> n >> k;
  vector<long double> nu; for(int i = 0; i < n; i++){long double temp; cin >> temp; nu.push_back(temp);}
  long double su = 0;
  int j = 0;
  for(int i = 0; i < (n-k + 1); i++){
    su += accumulate(nu.begin()+j, nu.begin()+j+(k),0);
    //DEBUG(accumulate(nu.begin()+j, nu.begin()+j+(k),0))
    j += (k-1);
  }
  //DEBUG(su)
  //cout << su/(n-k+1) << endl;
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  ll n, k; cin >> n >> k;
  vector<ll> nu; for(ll i = 0; i < n; i++){ll temp; cin >> temp; nu.push_back(temp);}
  long double su = accumulate(nu.begin(), nu.begin()+(k),0);
  ll prevsum = su;
  ll i = 0;
  //for(int i = 0; i < (n-k); i++){
  while(i + k != n){
    // i need to take away
    prevsum -= nu[i];
    prevsum += nu[i + k];
    su += abs(prevsum);
    i++;

  }
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  int n, k; cin >> n >> k;
  vector<ll> nu; for(ll i = 0; i < n; i++){ll temp; cin >> temp; nu.push_back(temp);}
  long double su = accumulate(nu.begin(), nu.begin()+(k),0);
  ll prevsum = su;
  ll i = 0;
  //for(int i = 0; i < (n-k); i++){
  while(i + k != n){
    // i need to take away
    prevsum -= nu[i];
    prevsum += nu[i + k];
    su += abs(prevsum);
    i++;

  }
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  long double n, k; cin >> n >> k;
  vector<long double> nu; for(int i = 0; i < n; i++){long double temp; cin >> temp; nu.push_back(temp);}
  //if(k == 1){
  //  cout << setprecision (6) << fixed << accumulate(nu.begin(),nu.end(),0)/(n-k+1) << endl;
  //  return 0;
  //}
  long double su = 0;
  //int j = 0;
  for(int i = 0; i < (n-k+1); i++){
    su += accumulate(nu.begin()+i, nu.begin()+i+(k),0);
    //DEBUG(accumulate(nu.begin()+j, nu.begin()+j+(k),0))
    //j += (k-1);
  }
  //DEBUG(su)
  //cout << su/(n-k+1) << endl;
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  int n, k; cin >> n >> k;
  vector<int> nu; for(int i = 0; i < n; i++){int temp; cin >> temp; nu.push_back(temp);}
  long double su = accumulate(nu.begin(), nu.begin()+(k),0);
  long double prevsum = su;
  for(int i = 0; i < (n-k); i++){
    // i need to take away
    prevsum -= nu[i];
    prevsum += nu[i + k];
    su += prevsum;
  }
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  int n, k; cin >> n >> k;
  vector<int> nu; for(int i = 0; i < n; i++){int temp; cin >> temp; nu.push_back(temp);}
  long double su = accumulate(nu.begin(), nu.begin()+(k),0);
  long double prevsum = su;
  int i = 0;
  //for(int i = 0; i < (n-k); i++){
  while(i + k != n){
    // i need to take away
    prevsum -= nu[i];
    prevsum += nu[i + k];
    su += prevsum;
    i++;

  }
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  long double n, k; cin >> n >> k;
  vector<long double> nu; for(int i = 0; i < n; i++){long double temp; cin >> temp; nu.push_back(temp);}
  if(k == 1){
    cout << setprecision (6) << fixed << accumulate(nu.begin(),nu.end(),0)/(n-k+1) << endl;
    return 0;
  }
  long double su = 0;
  //int j = 0;
  for(int i = 0; i < (n-k + 1); i++){
    su += accumulate(nu.begin()+i, nu.begin()+i+(k),0);
    //DEBUG(accumulate(nu.begin()+j, nu.begin()+j+(k),0))
    //j += (k-1);
  }
  //DEBUG(su)
  //cout << su/(n-k+1) << endl;
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  ll n, k; cin >> n >> k;
  vector<ll> nu; for(ll i = 0; i < n; i++){ll temp; cin >> temp; nu.push_back(temp);}
  double su = accumulate(nu.begin(), nu.begin()+(k),0ll);
  ll prevsum = su;
  ll i = 0;
  //for(int i = 0; i < (n-k); i++){
  while(i + k < n){
    // i need to take away
    prevsum -= nu[i];
    prevsum += nu[i + k];
    su += prevsum;
    i++;
  }
  printf("%.7f",su/(n-k+1));
  //cout << setprecision (7) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  long double n, k; cin >> n >> k;
  vector<long double> nu; for(int i = 0; i < n; i++){long double temp; cin >> temp; nu.push_back(temp);}
  long double su = 0;
  int j = 0;
  for(int i = 0; i < (n-k + 1); i++){
    su += accumulate(nu.begin()+j, nu.begin()+j+(k),0);
    //DEBUG(accumulate(nu.begin()+j, nu.begin()+j+(k),0))
    j += (k-1);
  }
  //DEBUG(su)
  //cout << su/(n-k+1) << endl;
  cout << setprecision (10) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  long double n, k; cin >> n >> k;
  vector<long double> nu; for(int i = 0; i < n; i++){long double temp; cin >> temp; nu.push_back(temp);}
  long double su = 0;
  int j = 0;
  for(int i = 0; i < (n-k + 1); i++){
    su += accumulate(nu.begin()+j, nu.begin()+j+(k),0);
    //DEBUG(accumulate(nu.begin()+j, nu.begin()+j+(k),0))
    j += (k-1);
  }
  DEBUG(su)
  //cout << su/(n-k+1) << endl;
  cout << setprecision (10) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}}return ans;}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  long double n, k; cin >> n >> k;
  vector<long double> nu; for(int i = 0; i < n; i++){long double temp; cin >> temp; nu.push_back(temp);}
  if(k == 1){
    cout << setprecision (6) << fixed << accumulate(nu.begin(),nu.end(),0)/(n-k+1) << endl;
    return 0;
  }
  long double su = 0;
  int j = 0;
  for(int i = 0; i < (n-k + 1); i++){
    su += accumulate(nu.begin()+j, nu.begin()+j+(k),0);
    //DEBUG(accumulate(nu.begin()+j, nu.begin()+j+(k),0))
    j += (k-1);
  }
  //DEBUG(su)
  //cout << su/(n-k+1) << endl;
  cout << setprecision (6) << fixed << su/(n-k+1) << endl;
  //fin.close();
  //fout.close();
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

ll n,k;
ll a[200006];
ll sum[200006];
ll m,ans;

int main(){
    cin >> n>> k;
    m=0;
    for(int i=0;i<k;i++){
        scanf("%I64d",&a[i]);
        m+=a[i];
    }
    ans=m;
    for(int i=k;i<n;i++){
        scanf("%I64d",&a[i]);
        m=m+a[i]-a[i-k];
        ans+=m;
    }

   // for(int i=0;i<=n-k;i++){
 //       l+=sum[i];
  //  }
   // float m=(float)();
    printf("%.10f\n",ans*1.0/(n-k+1));
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

ll n,k;
ll a[1000005];
ll sum[1000005];
ll m,ans;

int main(){
    cin >> n>> k;
    memset(a,0,sizeof(a));
    memset(sum,0,sizeof(sum));
    m=0;
    for(int i=0;i<k;i++){
        scanf("%I64d",&a[i]);
        m+=a[i];
    }
    ans=m;
    for(int i=k;i<n;i++){
        scanf("%I64d",&a[i]);
        m=m+a[i]-a[i-k];
        ans+=m;
    }

   // for(int i=0;i<=n-k;i++){
 //       l+=sum[i];
  //  }
   // float m=(float)();
    printf("%.10f\n",ans*1.0/(n-k+1));
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

ll n,k;
ll a[100005];
ll sum[100005];
ll m,ans;

int main(){
    cin >> n>> k;
    m=0;
    for(int i=0;i<k;i++){
        scanf("%I64d",&a[i]);
        m+=a[i];
    }
    ans=m;
    for(int i=k;i<n;i++){
        scanf("%I64d",&a[i]);
        m=m+a[i]-a[i-k];
        ans+=m;
    }

   // for(int i=0;i<=n-k;i++){
 //       l+=sum[i];
  //  }
   // float m=(float)();
    printf("%.10f\n",ans*1.0/(n-k+1));
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

int n,k;
float a[100005];
float sum[100005];

int main(){
    cin >> n>> k;
    memset(a,0,sizeof(a));
    memset(sum,0,sizeof(sum));
    for(int i=0;i< n;i++){
        cin >> a[i];
    }
    for(int i=0;i<k;i++){
        sum[0]+=a[i];
    }
    for(int i=1;i<=n-k;i++){
        sum[i]=sum[i-1]-a[i-1]+a[i+k-1];
    }
    float l=0;
    for(int i=0;i<=n-k;i++){
        l+=sum[i];
    }
   // float m=(float)();
    printf("%.10f\n",l/(n-k+1));
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

ll n,k;
ll a[1000005];
ll sum[1000005];
ll m,ans;

int main(){
    cin >> n>> k;
    memset(a,0,sizeof(a));
    memset(sum,0,sizeof(sum));
    m=0;
    for(int i=0;i<k;i++){
        cin >> a[i];
        m+=a[i];
    }
    ans=m;
    for(int i=k;i<n;i++){
        cin>>a[i];
        m=m+a[i]-a[i-k];
        ans+=m;
    }

   // for(int i=0;i<=n-k;i++){
 //       l+=sum[i];
  //  }
   // float m=(float)();
    printf("%.10f\n",ans*1.0/(n-k+1));
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

int n,k;
float a[1000005];
float sum[1000005];

int main(){
    cin >> n>> k;
    memset(a,0,sizeof(a));
    memset(sum,0,sizeof(sum));
    for(int i=0;i< n;i++){
        cin >> a[i];
    }
    for(int i=0;i<k;i++){
        sum[0]+=a[i];
    }
    for(int i=1;i<=n-k;i++){
        sum[i]=sum[i-1]-a[i-1]+a[i+k-1];
    }
    float l=0;
    for(int i=0;i<=n-k;i++){
        l+=sum[i];
    }
   // float m=(float)();
    printf("%.10f\n",l/(n-k+1));
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

ll n,k;
ll a[200005];
ll sum[200005];
ll m,ans;

int main(){
    cin >> n>> k;
    m=0;
    for(int i=0;i<k;i++){
        scanf("%I64d",&a[i]);
        m+=a[i];
    }
    ans=m;
    for(int i=k;i<n;i++){
        scanf("%I64d",&a[i]);
        m=m+a[i]-a[i-k];
        ans+=m;
    }

   // for(int i=0;i<=n-k;i++){
 //       l+=sum[i];
  //  }
   // float m=(float)();
    printf("%.10f\n",ans*1.0/(n-k+1));
}


#include<iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<string.h>
#include<stdlib.h>
#include <string.h>
#include<queue>
#define ll long long
#define LL long long
using namespace std;
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <string.h>
#include <queue>
using namespace std;

int n,k;
int a[1000005];
int sum[1000005];
int m,ans;

int main(){
    cin >> n>> k;
    memset(a,0,sizeof(a));
    memset(sum,0,sizeof(sum));
    m=0;
    for(int i=0;i<k;i++){
        scanf("%d",a[i]);
        m+=a[i];
    }
    ans=m;
    for(int i=k;i<n;i++){
        scanf("%d",a[i]);
        m=m+a[i]-a[i-k];
        ans+=m;
    }

   // for(int i=0;i<=n-k;i++){
 //       l+=sum[i];
  //  }
   // float m=(float)();
    printf("%.10f\n",ans*1.0/(n-k+1));
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

double a[1000000];
int main()
{
   int n,k;
   double sum = 0;
   cin >> n>>k;
   for(int i = 0; i < n; i++)
       cin >>a[i];
   if(n == 1)
   {
       sum = a[0] / (n-k+1);
       printf("%.10f\n",sum);
       return 0;
   }
   int i;
   for( i = 0; i < n / 2; i++)
       if(i + 1 <= k)
       sum += ((a[i] + a[n-1-i]) * (i+1));
       else
       sum += ((a[i] + a[n-1-i]) * k);
   if(n % 2 == 1)
   sum += min (i+1,k) * a[n/2];
   sum /= (n-k+1);
   printf("%.10f\n",sum);
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

double a[10000000];
int main()
{
   int n,k;
   double sum = 0;
   cin >> n>>k;
   for(int i = 0; i < n; i++)
       cin >>a[i];
   int x = n-k+1;
   x *= k;
   int count = 0;
   int i = 0;
   int p,q;
   for(int l = n; x > 0; l-=2)
       x -= (l),i++;
   for(int j = 0; j < i - 1; j ++)
       for(int k = j;k < n - j; k++)
           sum += a[k],count ++;
   if(count != x)
   {
      if(n%2 == 1 )
         { sum+= a[n/2];
           p = n/2 -1,q = n/2 +1;
                   count++;
       }
       else
           p= n/2-1,q = n/2;
       while(count < x)
       {
           sum+= a[p]+a[q];
           count += 2;
       }
}
       sum /= (n-k+1);

  /* if(n <= 2*k)
   {
       for(int i = 0; i < n; i++)
           sum += a[i];
       sum = sum / (n-k+1);
       printf("%.10f\n",sum);
       return 0;
   }
   int i;
   for( i = 0; i < n / 2; i++)
      sum += ((a[i] + a[n-1-i]) * min((i+1),k));

   if(n % 2 == 1)
   sum += min (i+1,k) * a[n/2];
   sum /= (n-k+1);*/
   printf("%.10f\n",sum);
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;

typedef double ld;

double a[2000000];

int main()
{
    int n, k ;
    scanf("%d%d",&n,&k);
    ld sum = 0,tmp = 0;
    for(int i = 0; i < n; i++)
    {
       scanf("%lf",&a[i]);
        if(i < k)
            tmp += a[i];
    }
    sum = tmp;
    for (int i = 1; i < n- k + 1; i++)
    {
        tmp -= a[i-1];
        tmp += a[k+i-1];
        sum += tmp;
    }
    sum /= (n-k+1);
    printf("%.10f\n",sum);
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

double a[1000000];
int main()
{
   int n,k;
   double sum = 0;
   cin >> n>>k;
   for(int i = 0; i < n; i++)
       cin >>a[i];
   if(n == 1)
   {
       sum = a[0] / (n-k+1);
       printf("%.8f\n",sum);
       return 0;
   }
   for(int i = 0; i < n-1; i++)
       sum += ((a[i] + a[i+1]) /(n- k+1));
   printf("%.8f\n",sum);
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

double a[10000000];
int main()
{
   int n,k;
   double sum = 0;
   cin >> n>>k;
   for(int i = 0; i < n; i++)
       cin >>a[i];
   if(n == k)
   {
       for(int i = 0; i < n; i++)
           sum += a[i];
       sum = sum / (n-k+1);
       printf("%.10f\n",sum);
       return 0;
   }
   int i;
   for( i = 0; i < n / 2; i++)
      sum += ((a[i] + a[n-1-i]) * min((i+1),k));

   if(n % 2 == 1)
   sum += min (i+1,k) * a[n/2];
   sum /= (n-k+1);
   printf("%.10f\n",sum);
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;

typedef double ld;

double a[2000000];

int main()
{
    int n, k ;
    cin >> n >> k;
    ld sum = 0,tmp = 0;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        if(i < k)
            tmp += a[i];
    }
    sum = tmp;
    for (int i = 1; i < n- k + 1; i++)
    {
        tmp -= a[i-1];
        tmp += a[k+i-1];
        sum += tmp;
    }
    sum /= (n-k+1);
    printf("%.10f\n",sum);
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

double a[1000000];
int main()
{
   int n,k;
   double sum = 0;
   cin >> n>>k;
   for(int i = 0; i < n; i++)
       cin >>a[i];
   if(n == 1)
   {
       sum = a[0] / (n-k+1);
       printf("%.10f\n",sum);
       return 0;
   }
   for(int i = 0; i < n / 2; i++)
       if(i + 1 <= k)
       sum += ((a[i] + a[n-1-i]) * (i+1));
       else
       sum += ((a[i] + a[n-1-i]) * k);
   sum /= (n-k+1);
   printf("%.10f\n",sum);
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], f[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	f[0] = a[0];
	for(int i = 1; i < n; ++i) {
		f[i] = f[i - 1] + a[i];
	}
	sum = f[k - 1];
	for(int i = 1, j = i + k - 1; i + k - 1 < n && j < n; ++j, ++i) {
		sum += f[j] - f[i-1];
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum * 1.0 / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], f[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	f[0] = a[0];
	for(int i = 1; i < n; ++i) {
		f[i] = f[i - 1] + a[i];
	}
	sum = f[k - 1];
	for(int i = 1, j = i + k - 1; i + k - 1 < n && j < n; ++j, ++i) {
		sum += f[j] - f[i-1];
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << fixed << setprecision(8) << sum / x << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], f[200005];
double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	f[0] = a[0];
	for(int i = 1; i < n; ++i) {
		f[i] = f[i - 1] + a[i];
	}
	sum = f[k - 1];
	for(int i = 1, j = i + k - 1; i + k - 1 < n && j < n; ++j, ++i) {
		sum += f[j] - f[i-1];
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << fixed << setprecision(8) << sum / x << endl;
	return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int a[200002];
double f[200002];  //用f[i]存放到第i个位置是，前面数的和，预处理下即可
int main()
{
    int n,k;
    scanf("%d %d",&n,&k);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    f[0]=a[0];
    for(int i=1;i<n;i++){
        f[i]=f[i-1]+a[i];
    }
    double sum=f[k-1];
    for(int i=1,j=i+k-1;i+k-1<n&&j<n;i++,j++){
        sum+=f[j]-f[i-1];
    }
    printf("%lf\n",sum/(n-k+1));
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], f[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	f[0] = a[0];
	for(int i = 1; i < n; ++i) {
		f[i] = f[i - 1] + a[i];
	}
	sum = f[k - 1];
	for(int i = 1, j = i + k - 1; x < n && j < n; ++j, ++i) {
		sum += f[j] - f[i-1];
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum * 1.0 / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	if(n - k < k) j = x;
	else j = k;
	for(int i = 1; i <= n; ++i) {
		cin >> a[i];
		if(i < j) {
			sum += a[i] * i;
		}
		else if(n - i + 1 < j) {
			sum += a[i] * (n - i + 1);
		}
		else sum += a[i] * j;
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], s[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 1; i <= n; ++i) {
		cin >> a[i];
		if(i < k) {
			sum += a[i] * i;
		}
		else if(n - i < k - 1) {
			sum += a[i] * (n - i + 1);
		}
		else sum += a[i] * x;
	}
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], s[200005], co[200005];
long double sum;

int main() {
	cin >> n >> k;
	fill(co, co + n, k);
	for(int i = 1; i <= n; ++i) {
		cin >> a[i];
		s[j] += a[i];
		co[j]--;
		if(co[j] == 0 && i != n && k > 1) {
			j += 1;
			s[j] += a[i];
			co[j]--;
		}
		//cout << 1 << endl;
	}
	for(int i = 0; i <= j + 1; ++i) {
		//cout << s[i] << endl;
		sum += s[i];
		//cout << 1 << endl;
	}
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum / (n - k + 1) * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005];
double sum, f[200005];

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	f[0] = a[0];
	for(int i = 1; i < n; ++i) {
		f[i] = f[i - 1] + a[i];
	}
	sum = f[k - 1];
	for(int i = 1, j = i + k - 1; i + k - 1 < n && j < n; ++j, ++i) {
		sum += f[j] - f[i-1];
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << fixed << setprecision(8) << sum / x << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], f[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	f[0] = a[0];
	for(int i = 1; i < n; ++i) {
		f[i] = f[i - 1] + a[i];
	}
	sum = f[k - 1];
	for(int i = 1, j = i + k - 1; i + k - 1 < n && j < n; ++j, ++i) {
		sum += f[j] - f[i-1];
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << sum / x << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], s[200005];
long double sum;

int main() {
	cin >> n >> k;
	for(int i = 1, t = 1; i <= n; ++i) {
		cin >> a[i];
		s[j] += a[i];
		if((i + 1) - t == 2 && i != n) {
			j += 1;
			s[j] += a[i];
			t = i;
		}
		//cout << 1 << endl;
	}
	for(int i = 0; i <= j + 1; ++i) {
		//cout << s[i] << endl;
		sum += s[i];
		//cout << 1 << endl;
	}
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum / (n - k + 1) * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], s[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 1; i <= n; ++i) {
		cin >> a[i];
		if(i < k) {
			sum += a[i] * i;
		}
		else if(n - i < k - 1) {
			sum += a[i] * (n - i + 1);
		}
		else sum += a[i] * k;
	}
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	if(k + k - 1 <= n) j = k;
	else j = x;
	for(int i = 1; i <= n; ++i) {
		cin >> a[i];
		if(i < j) {
			sum += a[i] * i;
		}
		else if(n - i + 1 < j) {
			sum += a[i] * (n - i + 1);
		}
		else sum += a[i] * j;
	}
	//cout << j << endl;
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum * 1.0 / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], s[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	for(int i = 1; i <= n; ++i) {
		cin >> a[i];
		if(i < k) {
			sum += a[i] * i;
		}
		else if(n - i < k - 1) {
			sum += a[i] * (n - k + 1);
		}
		else sum += a[i] * k;
	}
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
using namespace std;

int n, k, j;
int a[200005], s[200005];
long double sum;

int main() {
	cin >> n >> k;
	int x = n - k + 1;
	j = min(k, x);
	for(int i = 1; i <= n; ++i) {
		cin >> a[i];
		if(i < k) {
			sum += a[i] * i;
		}
		else if(n - i < k - 1) {
			sum += a[i] * (n - i + 1);
		}
		else sum += a[i] * j;
	}
	//cout << sum << endl;
	cout << fixed << setprecision(10) << sum / x * 1.0 << endl;
	return 0;
}


#include <iostream>
#include <cstdlib>

using namespace std;

int main() {

  double n, k, a, temp;
  cin>> n >> k;

  a = 0;
  double weeks = n - k + 1;
  long long mmax = (k<n-k+1)?k:n-k+1;
  long long mult = 1;
  for(long long i = 0; i < n; i++) {
    cin >> temp;
    a += (mult/weeks) * temp;
    //cout<<mult<<",";
    if(i >=  n-mmax ) {
      mult--;
    } else if(mult != mmax) {
      mult++;
    }

  }

  /*double aa = 1;
  aa = double(a)/double(n-k+1);
  cout << aa << endl;*/
  printf("%.6f\n", a);
  return 0;
}


#include <iostream>
#include <cstdlib>

using namespace std;

int main() {

  double n, k, a, temp;
  cin>> n >> k;

  a = 0;
  double weeks = n - k + 1;
  long long mult = 1;
  for(long long i = 0; i < n; i++) {
    cin >> temp;
    a += (mult/weeks) * temp;

    if(i >= n - k) {
      mult--;
    } else if(mult != k) {
      mult++;
    }
  }

  /*double aa = 1;
  aa = double(a)/double(n-k+1);
  cout << aa << endl;*/
  printf("%.6f\n", a);
  return 0;
}


#include <iostream>
#include <cstdlib>

using namespace std;

int main() {

  double n, k, a, temp;
  cin>> n >> k;

  a = 0;
  double weeks = n - k + 1;
  long long mmax = (k<n-k+1)?k:n-k+1;
  long long mult = 1;
  for(long long i = 0; i < n; i++) {
    cin >> temp;
    a += (mult/weeks) * temp;
    //cout<<mult<<",";
    if(i > n - k) {
      mult--;
    } else if(mult != mmax) {
      mult++;
    }

  }

  /*double aa = 1;
  aa = double(a)/double(n-k+1);
  cout << aa << endl;*/
  printf("%.6f\n", a);
  return 0;
}


#include <iostream>
#include <cstdlib>

using namespace std;

int main() {

  double n, k, a, temp;
  cin>> n >> k;

  a = 0;
  double weeks = n - k + 1;
  long long mmax = (k<n-k+1)?k:n-k+1;
  long long mult = 1;
  for(long long i = 0; i < n; i++) {
    cin >> temp;
    a += (mult/weeks) * temp;
    //cout<<mult<<",";
    if(i >  n-mmax +1) {
      mult--;
    } else if(mult != mmax) {
      mult++;
    }

  }

  /*double aa = 1;
  aa = double(a)/double(n-k+1);
  cout << aa << endl;*/
  printf("%.6f\n", a);
  return 0;
}


#include <iostream>
#include <cstdlib>

using namespace std;

int main() {

  double n, k, a, temp;
  cin>> n >> k;

  a = 0;
  double weeks = n - k + 1;
  long long mult = 1;
  for(long long i = 0; i < n; i++) {
    cin >> temp;
    a += (mult/weeks) * temp;

    if(i >= n - k) {
      mult--;
    } else if(mult == k) {

    } else {
      mult++;
    }
  }

  /*double aa = 1;
  aa = double(a)/double(n-k+1);
  cout << aa << endl;*/
  printf("%.6f\n", a);
  return 0;
}


#include <iostream>
#include <cstdlib>

using namespace std;

int main() {

  double n, k, a, temp;
  cin>> n >> k;

  a = 0;
  double weeks = n - k + 1;
  long long mmax = (k<n-k+1)?k:n-k+1;
  long long mult = 1;
  for(long long i = 0; i < n; i++) {
    cin >> temp;
    a += (mult/weeks) * temp;
    //cout<<mult<<",";
    if(i >  n-mmax ) {
      mult--;
    } else if(mult != mmax) {
      mult++;
    }

  }

  /*double aa = 1;
  aa = double(a)/double(n-k+1);
  cout << aa << endl;*/
  printf("%.6f\n", a);
  return 0;
}


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j, ans = 0;
    double sum = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
    }
    printf("%.010lf\n",(double)sum/(double)((n-k)+1));

    return 0;
}
//10 7
//1 5 7 55 68 7 7 8 5 6


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j, ans = 0;
    long long sum = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
        ans+=sum/((n-k)+1);
        sum = sum%((n-k)+1);
    }
    printf("%.010lf\n",(double)sum/(double)((n-k)+1)+(double)ans);

    return 0;
}
//10 7
//1 5 7 55 68 7 7 8 5 6


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j;
    long long sum = 0;
    double ans = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
        ans += sum/(n-k+1);
        sum = sum%(n-k+1);
    }
    printf("%.010lf\n",(double)sum/(double)((n-k)+1)+ans);

    return 0;
}
//10 7
//1 5 7 55 68 7 7 8 5 6


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j;
    double sum = 0;
    double ans = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
    }
    printf("%.010lf\n",(double)sum/(double)((n-k)+1));

    return 0;
}
//10 7
//1 5 7 55 68 7 7 8 5 6


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j, ans = 0;
    int sum = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
        ans+=sum/((n-k)+1);
        sum = sum%((n-k)+1);
    }
    printf("%.010lf\n",(double)sum/(double)((n-k)+1)+(double)ans);

    return 0;
}
//10 7
//1 5 7 55 68 7 7 8 5 6


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<bits/stdc++.h>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j;
    long long sum = 0, ans = 0, ans3 = 0;
    double ans2 = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
    }
    ans = sum/(n-k+1);
    sum = sum%(n-k+1);
    ans2 = (double)sum/(double)((n-k)+1);
    ans3 = ans2*10000000000;
    cout << ans <<".";
    printf("%010lld\n", ans3);

    return 0;
}


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<bits/stdc++.h>

using namespace std;

long long a[200005], num[2000005];

int main()
{
    long long n, k, i, j;
    long long sum = 0, ans = 0, ans3 = 0;
    double ans2 = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        cin>>a[i];
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
    }
    ans = sum/(n-k+1);
    sum = sum%(n-k+1);
    ans2 = (double)sum/(double)((n-k)+1);
    ans3 = ans2*10000000000;
    cout << ans <<".";
    printf("%010lld\n", ans3);

    return 0;
}


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<bits/stdc++.h>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j;
    long double sum = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }

    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
    }
 //   printf("%.010lf\n",(long double)sum/((n-k)+1));
 cout <<fixed<<setprecision(10)<<sum/((n-k)+1)<<endl;

    return 0;
}
//10 7
//1 5 7 55 68 7 7 8 5 6


#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>

using namespace std;

int a[200005], num[2000005];

int main()
{
    int n, k, i, j, ans = 0;
    long long sum = 0;
    cin >> n >> k;
    for(i = 1; i <=n; i++)
        scanf("%d", &a[i]);
    for(i = 1; i <= n; i++)
    {
            num[i] = k;
    }
    for(i = 1; i < k;i++)
    {
            num[i] -= (k-i);
    }
    for(i = n, j = 1; i > n-k+1;i--)
    {
            num[i]-=(k-j);
            j++;
    }
    cout << n-k+1<<endl;
    for(i = 1; i <=n; i++)
        cout << num[i] <<" ";
    cout <<endl;
    for(i = 1; i <= n; i++)
    {
        sum+=a[i]*num[i];
        ans+=sum/((n-k)+1);
        sum = sum%((n-k)+1);
    }
    printf("%.010lf\n",(double)sum/(double)((n-k)+1)+(double)ans);

    return 0;
}
//10 7
//1 5 7 55 68 7 7 8 5 6


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{

   int n, k;
   int arr[200005], sum[200005];

   sum[0] = 0;
   //cin >> n >> k;
   scanf("%d %d", &n, &k);
   for( int i = 1; i <= n; i++ ){
        //cin >> arr[i];
        scanf("%d", &arr[i]);
        sum[i] = sum[i-1] + arr[i];
   }
   double answer = 0.0;
   for( int i = 1; i <= n-k+1; i++ ){
        answer += ((sum[i+k-1]-sum[i-1])*1.0);
   }
   printf("%.8lf\n", answer/(n-k+1));

   return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{

   int n, k;
   int arr[200005], sum[200005];

   sum[0] = 0;
   //cin >> n >> k;
   scanf("%d %d", &n, &k);
   for( int i = 1; i <= n; i++ ){
        //cin >> arr[i];
        scanf("%d", &arr[i]);
        sum[i] = sum[i-1] + arr[i];
   }
   int answer = 0;
   for( int i = 1; i <= n-k+1; i++ ){
        answer += (sum[i+k-1]-sum[i-1]);
   }
   printf("%.8lf\n", (answer*1.0)/(n-k+1));

   return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{

   ll n, k;
   ll arr[200005], sum[200005];

   sum[0] = 0;
   //cin >> n >> k;
   scanf("%I64d %I64d", &n, &k);
   for( int i = 1; i <= n; i++ ){
        //cin >> arr[i];
        scanf("%I64d", &arr[i]);
        sum[i] = sum[i-1] + arr[i];
   }
   double answer = 0.0;
   for( int i = 1; i <= n-k+1; i++ ){
        answer += ((sum[i+k-1]-sum[i-1])*1.0);
   }
   printf("%.10lf\n", answer/(n-k+1));

   return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{
   ll n, k, arr[100005];
   ll sum = 0;
   cin >> n >> k;
   for( int i = 1; i <= n; i++ ){
        cin >> arr[i];
        //sum += arr[i];
   }
   ll cnt = 0;
   ll x = 0;
   //cout << sum << endl;
   for( int i = 1; i <= n; i++ ){
      x++;
      sum += arr[i];
      //cout << "x = " << x << endl;
      if( x % k == 0 ){
        cnt++;
        sum += arr[i];
        //cout << "i " << i << endl;
        x = 1;
        if( i == n && n % 2 != 0 ){
            sum -= arr[i];
        }
      }
   }
   //cout  << cnt << endl;
   //cout << (sum*1.0) / (cnt) << endl;
   double ans = (sum*1.0) / (cnt*1.0);
   printf("%.8lf\n", ans);

   return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{
   ll n, k, arr[100005];
   ll sum = 0;
   cin >> n >> k;
   for( int i = 1; i <= n; i++ ){
        cin >> arr[i];
        sum += arr[i];
   }
   ll cnt = 1;
   ll x = 0;
   //cout << sum << endl;
   for( int i = 1; i < n; i++ ){
      x++;
      //cout << "x = " << x << endl;
      if( x % k == 0 && i != n ){
        sum += arr[i];
        //cout << "i " << i << endl;
        cnt++;
        x = 1;
      }
   }
   //cout  << cnt << endl;
   //cout << (sum*1.0) / (cnt) << endl;
   double ans = (sum*1.0) / (cnt*1.0);
   printf("%.8lf\n", ans);

   return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{

   int n, k;
   int arr[100005], sum[100005];

   sum[0] = 0;
   cin >> n >> k;
   for( int i = 1; i <= n; i++ ){
        cin >> arr[i];
        sum[i] = sum[i-1] + arr[i];
   }
   double answer = 0.0;
   for( int i = 1; i <= n-k+1; i++ ){
        answer += ((sum[i+k-1]-sum[i-1])*1.0);
   }
   printf("%.8lf\n", answer/(n-k+1));

   return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{
   ll n, k, arr[100005];
   ll sum = 0;
   cin >> n >> k;
   for( int i = 1; i <= n; i++ ){
        cin >> arr[i];
        sum += arr[i];
   }
   ll cnt = 1;
   ll x = 0;
   //cout << sum << endl;
   if( k == 1 ){
      double answer = (sum*1.0) / (n*1.0);
      printf("%.8lf\n", answer);
      return 0;
   }
   for( int i = 1; i < n; i++ ){
      x++;
      //cout << "x = " << x << endl;
      if( x % k == 0 && i != n ){
        sum += arr[i];
        //cout << "i " << i << endl;
        cnt++;
        x = 1;
      }
   }
   //cout  << cnt << endl;
   //cout << (sum*1.0) / (cnt) << endl;
   double ans = (sum*1.0) / (cnt*1.0);
   printf("%.8lf\n", ans);

   return 0;
}


#include <iostream>
#include <vector>
#include <cstdint>
#include <algorithm>
#include <climits>
#include <iomanip>
#include <sstream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>

int main() {
	uint_fast64_t N, K, v;
	uint_fast64_t R = 0;

	std::cin >> N >> K;

	for (uint_fast64_t i = 0; i < N; ++i) {
		std::cin >> v;

		R += std::min(std::min(std::min(i + 1, K), N - i), N - K + 1) * v;
	}

	std::cout << std::setprecision(10) << std::fixed << R / static_cast<long double>(N - K + 1) << std::endl;

	return 0;
}
// 1495222690781


#include <cstdio>
#include <vector>
#include <string>
#include <math.h>
#include <iostream>
#include <algorithm>

using namespace std;

int main( ) {
	double n, k, res, i, tmp;
	res = 0;
	scanf("%lf %lf", &n, &k);
	for (i = 0; i < n; i++) {
		scanf("%lf",&tmp);
		if(i+1 < k) {
			res += (i+1)*tmp;
		} else if (n-i < k) {
			res += (n-i)*tmp;
		} else {
			res += k*tmp;
		}
	}
	printf("%.7lf\n",res/(n-k+1));
}

// 1495216980019


#include <iostream>
#include <vector>
#include <cstdint>
#include <algorithm>
#include <climits>
#include <iomanip>
#include <sstream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>

int main() {
	uint_fast32_t N, K, v;
	uint_fast64_t R = 0;

	std::cin >> N >> K;

	for (uint_fast32_t i = 0; i < N; ++i) {
		std::cin >> v;

		R += std::min(std::min(i + 1, K), N - i) * v;
	}

	std::cout << std::setprecision(6) << std::fixed << R / (N - K + 1.0) << std::endl;

	return 0;
}
// 1495214198943