#include <bits/stdc++.h>
const int oo = 2139063143;
const int N = 1010;
const int mod = 1000000007;
using namespace std;
inline void sc(int &x) {
  x = 0;
  static int p;
  p = 1;
  static char c;
  c = getchar();
  while (!isdigit(c)) {
    if (c == '-') p = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c - 48);
    c = getchar();
  }
  x *= p;
}
inline void pr(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) pr(x / 10);
  putchar(x % 10 + '0');
}
int a[N], f[N * N];
int main() {
  int n, k, ma;
  sc(n), sc(k);
  for (int i = 1; i <= n; i++) sc(a[i]);
  sort(a + 1, a + n + 1);
  ma = k * a[n];
  for (int i = 2; i <= n; i++) a[i] -= a[1];
  memset(f, 127, sizeof(f));
  f[0] = 0;
  for (int i = 2; i <= n; i++)
    for (int j = a[i]; j <= ma; j++) f[j] = min(f[j], f[j - a[i]] + 1);
  for (int i = 0; i <= ma; i++)
    if (f[i] <= k) pr(i + a[1] * k), putchar(' ');
  return 0;
}
