//=template===================================================================//
// include
#include <vector>
#include <list>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <map>

// namespace
using namespace std;

// define
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(i,n) FOR(i,0,n)
#define MIN_V(v) *min_element(v.begin(), v.end())
#define MAX_V(v) *max_element(v.begin(), v.end())

// typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef long long LL;
typedef unsigned long long ULL;
typedef struct {
  LL cost;
  bool done;
} node_t;

// conversion
inline int
toInt(string s)
{
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline int countChar(string s, char c) {int cnt,i; cnt=0; REP (i,s.size()) {if (s[i]==c) cnt++;} return cnt;}
template<class T> inline string toString(T x) {ostringstream sout; sout<<x; return sout.str();}
//============================================================================//

//=function prototype=========================================================//
double dice_expected_value(int dice_value);
void dijkstra(vector<node_t>& nodes, const VVL graph, const int start_idx, bool reverse);
//============================================================================//

//=variables==================================================================//

//============================================================================//
int main(void)
{
  // Scan begin.
  int n, k;
  cin >> n >> k;
  vector<double> p;
  REP (i, n)
  {
    int p_i;
    cin >> p_i;
    p.push_back(dice_expected_value(p_i));
  }
  // Scan done.

  // Code begin.
  double expected_value = 0.0;
  double max = 0.0;
  REP(i, k)
  {
    expected_value += p.at(i);
  }
  max = expected_value;
  FOR(i, k, n)
  {
    expected_value = expected_value - p.at(i-k) + p.at(i);
    if (expected_value > max)
    {
      max = expected_value;
    }
  }
  printf("%.12f\n", max);
  // Code done.

  return 0;
}

//=functions==================================================================//
double dice_expected_value(int dice_value) {
  return (dice_value + 1) / 2.0;
}
//============================================================================//

//=Useful Function============================================================//
void dijkstra(vector<node_t>& nodes, const VVL graph, const int start_idx, bool reverse) {
  nodes[start_idx].cost = 0;
  while (true)
  {
    int node_idx = -1;
    REP(i, nodes.size()) {
      // If the i_th node is already loaded or not yet loaded
      if (nodes[i].done || nodes[i].cost < 0) {
        continue;
      }
      // If no nodes selected
      if (node_idx == -1) {
        node_idx = i;
        continue;
      }
      // If i_th node is nearer than selected node
      if (nodes[i].cost < nodes[node_idx].cost) {
        node_idx = i;
      }
    }
    // If all paths done, then break
    if (node_idx == -1) {
      break;
    }
    // Set selected node as already loaded
    nodes[node_idx].done = true;
    // Path to all nodes
    REP(i, nodes.size()) {
      if (!reverse) {
        // Normal
        // If exists route.
        if (graph[node_idx][i] >= 0) {
          // If this route is not yet opened
          if (nodes[i].cost < 0) {
            // Set cost
            nodes[i].cost = nodes[node_idx].cost + graph[node_idx][i];
          }
          else {
            // If this route is nearer than now, update cost
            if (nodes[i].cost > (nodes[node_idx].cost + graph[node_idx][i])) {
              nodes[i].cost = nodes[node_idx].cost + graph[node_idx][i];
            }
          }
        }
      }
      else {
        // Reverse
        // If exists route.
        if (graph[i][node_idx] >= 0) {
          // If this route is not yet opened
          if (nodes[i].cost < 0) {
            // Set cost
            nodes[i].cost = nodes[node_idx].cost + graph[i][node_idx];
          }
          else {
            // If this route is nearer than now, update cost
            if (nodes[i].cost > (nodes[node_idx].cost + graph[i][node_idx])) {
              nodes[i].cost = nodes[node_idx].cost + graph[i][node_idx];
            }
          }
        }
      }
    }
  }
}
//============================================================================//

Measured memory_bytes: 2420