#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int (i)=0; (i)<(n) ;++(i)) #define REPN(i,a,n) FOR((i),(a),(a)+(n)) #define FOR(i,a,b) for(int (i)=(a); (i)<(b) ;++(i)) #define PB push_back #define MP make_pair #define SE second #define FI first #define DBG(a) cerr<<(a)< PLL; typedef vector VLL; typedef pairPI; typedef vector VI; const LL LINF=334ll<<53; const int INF=15<<26; const LL MOD=1E9+7; const double eps=1e-12; typedef vector> Matrix; int main(){ cin.tie(0); ios::sync_with_stdio(false); cout <> n >> m; vector p(n),c(n); FOR(i,1,n-1){ cin >> c[i]; } for(int i=n-2-m;i>=0;--i){ FOR(j,i+1,i+m+1){ p[i]+=p[j]+c[j]; } p[i]/=m; } cout << p[0]<