#include <stdio.h>
void sliding_window_sum(int arr[], int n, int k) {
int i;
int sum = 0;
if(k > n){
return;
}
for(i = 0; i < k; i++){
sum += arr[i];
}
printf("%d ", sum);
for(i = k; i < n; i++){
sum = sum + arr[i] - arr[i - k];
printf("%d ", sum);
}
}
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;
}