import sys
from builtins import enumerate
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    # 数値取得サンプル
    #   1行1項目 n = int(input())
    #   1行2項目 x, y = map(int, input().split())
    #   1行N項目 x = list(map(int, input().split()))
    #   N行1項目 x = [int(input()) for i in range(n)]
    #   N行N項目 x = [list(map(int, input().split())) for i in range(n)]

    # 文字取得サンプル
    #   1行1項目 x = input()
    #   1行1項目(1文字ずつリストに入れる場合) x = list(input())
    n, k = map(int, input().split())
    p_s = [0] + list(map(int, input().split()))

    avr_s = [0]
    cumsum = 0
    for i in range(1, 1001):
        cumsum += i
        avr_s.append(cumsum / i)

    ans = 0
    val = 0
    for i in range(1, len(p_s)):
        val += avr_s[p_s[i]]
        if i < k:
            continue
        elif i == k:
            ans = val
        else:
            val -= avr_s[p_s[i - k]]
            ans = max(ans, val)

    print(ans)


# テストクラス


class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """5 3
1 2 2 4 5"""
        output = """7.000000000000"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """4 1
6 6 6 6"""
        output = """3.500000000000"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """10 4
17 13 13 12 15 20 10 13 17 11"""
        output = """32.000000000000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main() import sys sys from builtins import enumerate from io import StringIO import unittest unittest import os os sys.setrecursionlimit(999999999) sys.setrecursionlimit sys setrecursionlimit 999999999 def resolve(test_def_name=""):
    # 数値取得サンプル
    #   1行1項目 n = int(input())
    #   1行2項目 x, y = map(int, input().split())
    #   1行N項目 x = list(map(int, input().split()))
    #   N行1項目 x = [int(input()) for i in range(n)]
    #   N行N項目 x = [list(map(int, input().split())) for i in range(n)]

    # 文字取得サンプル
    #   1行1項目 x = input()
    #   1行1項目(1文字ずつリストに入れる場合) x = list(input())
    n, k = map(int, input().split())
    p_s = [0] + list(map(int, input().split()))

    avr_s = [0]
    cumsum = 0
    for i in range(1, 1001):
        cumsum += i
        avr_s.append(cumsum / i)

    ans = 0
    val = 0
    for i in range(1, len(p_s)):
        val += avr_s[p_s[i]]
        if i < k:
            continue
        elif i == k:
            ans = val
        else:
            val -= avr_s[p_s[i - k]]
            ans = max(ans, val)

    print(ans)


# テストクラス resolve n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k p_s = [0] + list(map(int, input().split())) p_s [0] + list(map(int, input().split())) [0] 0 list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split avr_s = [0] avr_s [0] 0 cumsum = 0 cumsum 0 for i in range(1, 1001):
        cumsum += i
        avr_s.append(cumsum / i)

     i range(1, 1001) range 1 1001 cumsum += i cumsum i avr_s.append(cumsum / i) avr_s.append avr_s append cumsum / i cumsum i ans = 0 ans 0 val = 0 val 0 for i in range(1, len(p_s)):
        val += avr_s[p_s[i]]
        if i < k:
            continue
        elif i == k:
            ans = val
        else:
            val -= avr_s[p_s[i - k]]
            ans = max(ans, val)

     i range(1, len(p_s)) range 1 len(p_s) len p_s val += avr_s[p_s[i]] val avr_s[p_s[i]] avr_s p_s[i] p_s i if i < k:
            continue
        elif i == k:
            ans = val
        else:
            val -= avr_s[p_s[i - k]]
            ans = max(ans, val)

     i < k i k continue elif i == k:
            ans = val
         i == k i k ans = val ans val val -= avr_s[p_s[i - k]] val avr_s[p_s[i - k]] avr_s p_s[i - k] p_s i - k i k ans = max(ans, val) ans max(ans, val) max ans val print(ans) print ans test_def_name="" test_def_name "" class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """5 3
1 2 2 4 5"""
        output = """7.000000000000"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """4 1
6 6 6 6"""
        output = """3.500000000000"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """10 4
17 13 13 12 15 20 10 13 17 11"""
        output = """32.000000000000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し TestClass def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

     assertIO stdout, sat_in = sys.stdout, sys.stdin stdout sys.stdout sys stdout sat_in sys.stdin sys stdin sys.stdout, sys.stdin = StringIO(), StringIO(assert_input) sys.stdout sys stdout StringIO() StringIO sys.stdin sys stdin StringIO(assert_input) StringIO assert_input resolve(sys._getframe().f_back.f_code.co_name) resolve sys._getframe().f_back.f_code.co_name sys._getframe().f_back.f_code sys._getframe().f_back sys._getframe() sys._getframe sys _getframe f_back f_code co_name sys.stdout.seek(0) sys.stdout.seek sys.stdout sys stdout seek 0 out = sys.stdout.read()[:-1] out sys.stdout.read()[:-1] sys.stdout.read() sys.stdout.read sys.stdout sys stdout read :-1 -1 sys.stdout, sys.stdin = stdout, sat_in sys.stdout sys stdout stdout sys.stdin sys stdin sat_in self.assertEqual(out, output) self.assertEqual self assertEqual out output self self assert_input assert_input output output def test_input_1(self):
        test_input = """5 3
1 2 2 4 5"""
        output = """7.000000000000"""
        self.assertIO(test_input, output)

     test_input_1 test_input = """5 3
1 2 2 4 5""" test_input """5 3
1 2 2 4 5""" output = """7.000000000000""" output """7.000000000000""" self.assertIO(test_input, output) self.assertIO self assertIO test_input output self self def test_input_2(self):
        test_input = """4 1
6 6 6 6"""
        output = """3.500000000000"""
        self.assertIO(test_input, output)

     test_input_2 test_input = """4 1
6 6 6 6""" test_input """4 1
6 6 6 6""" output = """3.500000000000""" output """3.500000000000""" self.assertIO(test_input, output) self.assertIO self assertIO test_input output self self def test_input_3(self):
        test_input = """10 4
17 13 13 12 15 20 10 13 17 11"""
        output = """32.000000000000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
     test_input_3 test_input = """10 4
17 13 13 12 15 20 10 13 17 11""" test_input """10 4
17 13 13 12 15 20 10 13 17 11""" output = """32.000000000000""" output """32.000000000000""" self.assertIO(test_input, output) self.assertIO self assertIO test_input output self self def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し tes_t_1original_1 test_input = """データ""" test_input """データ""" output = """データ""" output """データ""" self.assertIO(test_input, output) self.assertIO self assertIO test_input output self self unittest.TestCase unittest TestCase if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main() __name__ == "__main__" __name__ "__main__" if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main() os.environ.get("USERNAME") is None os.environ.get("USERNAME") os.environ.get os.environ os environ get "USERNAME" None resolve() resolve unittest.main() unittest.main unittest main class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """5 3
1 2 2 4 5"""
        output = """7.000000000000"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """4 1
6 6 6 6"""
        output = """3.500000000000"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """10 4
17 13 13 12 15 20 10 13 17 11"""
        output = """32.000000000000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """5 3
1 2 2 4 5"""
        output = """7.000000000000"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """4 1
6 6 6 6"""
        output = """3.500000000000"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """10 4
17 13 13 12 15 20 10 13 17 11"""
        output = """32.000000000000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し TestClass def resolve(test_def_name=""):
    # 数値取得サンプル
    #   1行1項目 n = int(input())
    #   1行2項目 x, y = map(int, input().split())
    #   1行N項目 x = list(map(int, input().split()))
    #   N行1項目 x = [int(input()) for i in range(n)]
    #   N行N項目 x = [list(map(int, input().split())) for i in range(n)]

    # 文字取得サンプル
    #   1行1項目 x = input()
    #   1行1項目(1文字ずつリストに入れる場合) x = list(input())
    n, k = map(int, input().split())
    p_s = [0] + list(map(int, input().split()))

    avr_s = [0]
    cumsum = 0
    for i in range(1, 1001):
        cumsum += i
        avr_s.append(cumsum / i)

    ans = 0
    val = 0
    for i in range(1, len(p_s)):
        val += avr_s[p_s[i]]
        if i < k:
            continue
        elif i == k:
            ans = val
        else:
            val -= avr_s[p_s[i - k]]
            ans = max(ans, val)

    print(ans)


# テストクラス def resolve(test_def_name=""):
    # 数値取得サンプル
    #   1行1項目 n = int(input())
    #   1行2項目 x, y = map(int, input().split())
    #   1行N項目 x = list(map(int, input().split()))
    #   N行1項目 x = [int(input()) for i in range(n)]
    #   N行N項目 x = [list(map(int, input().split())) for i in range(n)]

    # 文字取得サンプル
    #   1行1項目 x = input()
    #   1行1項目(1文字ずつリストに入れる場合) x = list(input())
    n, k = map(int, input().split())
    p_s = [0] + list(map(int, input().split()))

    avr_s = [0]
    cumsum = 0
    for i in range(1, 1001):
        cumsum += i
        avr_s.append(cumsum / i)

    ans = 0
    val = 0
    for i in range(1, len(p_s)):
        val += avr_s[p_s[i]]
        if i < k:
            continue
        elif i == k:
            ans = val
        else:
            val -= avr_s[p_s[i - k]]
            ans = max(ans, val)

    print(ans)


# テストクラス resolve
import sys
from builtins import enumerate
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    # 数値取得サンプル
    #   1行1項目 n = int(input())
    #   1行2項目 x, y = map(int, input().split())
    #   1行N項目 x = list(map(int, input().split()))
    #   N行1項目 x = [int(input()) for i in range(n)]
    #   N行N項目 x = [list(map(int, input().split())) for i in range(n)]

    # 文字取得サンプル
    #   1行1項目 x = input()
    #   1行1項目(1文字ずつリストに入れる場合) x = list(input())
    n, k = map(int, input().split())
    p_s = [0] + list(map(int, input().split()))

    avr_s = [0]
    cumsum = 0
    for i in range(1, 1001):
        cumsum += i
        avr_s.append(cumsum / i)

    ans = 0
    val = 0
    for i in range(1, len(p_s)):
        val += avr_s[p_s[i]]
        if i < k:
            continue
        elif i == k:
            ans = val
        else:
            val -= avr_s[p_s[i - k]]
            ans = max(ans, val)

    print(ans)


# テストクラス


class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """5 3
1 2 2 4 5"""
        output = """7.000000000000"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """4 1
6 6 6 6"""
        output = """3.500000000000"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """10 4
17 13 13 12 15 20 10 13 17 11"""
        output = """32.000000000000"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()
