#include <bits/stdc++.h>
using namespace std;
int n, k, x, m, mi = 1000, a[1001], f[1001 * 1001];
vector<int> ans;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++)
    scanf("%d", &x), a[x] = 1, m = max(m, x), mi = min(mi, x);
  for (int i = 1; i < 1001 * 1001; i++) f[i] = k + 1;
  for (int i = 1; i <= m; i++)
    if (a[i])
      for (int j = i - mi; j <= m * k; j++) f[j] = min(f[j], f[j - i + mi] + 1);
  for (int i = 0; i <= m * k; i++)
    if (f[i] <= k) ans.push_back(i + mi * k);
  for (int i = 0; i < ans.size(); i++)
    printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
  return 0;
}
