#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7, M = 1005;
int n, k, a[M], dp[N], mn = M;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), mn = min(mn, a[i]);
  for (int i = 1; i <= n; i++) a[i] -= mn;
  for (int i = 1; i <= N - 1; i++) dp[i] = N;
  for (int i = 1; i <= N - 1; i++)
    for (int j = 1; j <= n; j++)
      if (i - a[j] >= 0) dp[i] = min(dp[i], dp[i - a[j]] + 1);
  for (int i = 0; i <= N - 1; i++)
    if (dp[i] <= k) printf("%d ", i + mn * k);
}
