#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 32, MX = N * N;
int A[N], w[N], dp[MX];
int n, k, x, cnt = 0;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    A[x] = 1;
  }
  for (int i = 1; i <= 1000; ++i)
    if (A[i]) w[++cnt] = i;
  int mn = w[1] * k, mx = w[cnt] * k;
  for (int i = 2; i <= cnt; ++i) w[i] -= w[1];
  for (int i = mn; i <= mx; ++i) dp[i] = 10001;
  dp[mn] = 0;
  for (int i = mn; i <= mx; ++i)
    for (int j = 2; j <= cnt && i - w[j] >= mn; ++j)
      dp[i] = min(dp[i], dp[i - w[j]] + 1);
  for (int i = mn; i <= mx; ++i)
    if (dp[i] <= k) printf("%d ", i);
  return 0;
}
