#include <bits/stdc++.h>
using namespace std;
int dp[1000010], a[1000010];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 2; i <= n; i++) a[i] -= a[1];
  int v = k * a[n];
  memset(dp, 0x7F, sizeof(dp));
  dp[0] = 0;
  for (int i = 2; i <= n; i++)
    for (int j = a[i]; j <= v; j++) dp[j] = min(dp[j], dp[j - a[i]] + 1);
  for (int i = 0; i <= v; i++)
    if (dp[i] <= k) printf("%d ", i + a[1] * k);
  printf("\n");
  return 0;
}
