#include <stdio.h>
void sliding_window_sum(int arr[], int n, int k) {
int sum = arr[0];
for (int i = 1; i < k; i++) {
sum += arr[i];
}
printf("%d ", sum);
for (int i = k; i < n; i++) {
sum -= arr[i-k];
sum += arr[i];
printf("%d ", sum);
}
return;
}
int main() {
int n, k, arr[100];
scanf("%d %d", &n, &k);
for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
sliding_window_sum(arr, n, k);
return 0;
}