#include <bits/stdc++.h>
using namespace std;
short vis[1000010];
int a[1010];
int n, k;
int main() {
  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 base = a[1] * k;
  int top = base + a[n] * k;
  memset(vis, 0x3f, sizeof(vis));
  vis[base] = 0;
  for (register int i = base; i <= top; ++i) {
    for (register short j = 2; j <= n; ++j) {
      if (i - a[j] >= base) vis[i] = min(vis[i], (short)(vis[i - a[j]] + 1));
    }
  }
  for (register int i = base; i <= top; ++i)
    if (vis[i] <= k) printf("%d ", i);
  return 0;
}
