#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
int singleprice[maxn], probablyprice[maxn * maxn];
int n, k;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> singleprice[i];
  sort(singleprice + 1, singleprice + n + 1);
  int m = unique(singleprice + 1, singleprice + n + 1) - (singleprice + 1);
  for (int i = 2; i <= m; i++) singleprice[i] -= singleprice[1];
  for (int i = 1; i <= singleprice[m] * k; i++) {
    probablyprice[i] = k + 1;
  }
  probablyprice[0] = 0;
  for (int i = 2; i <= m; i++) {
    for (int j = singleprice[i]; j <= singleprice[i] * k; j++) {
      probablyprice[j] =
          min(probablyprice[j], probablyprice[j - singleprice[i]] + 1);
    }
  }
  for (int i = 0; i <= singleprice[m] * k; i++) {
    if (probablyprice[i] <= k) cout << i + singleprice[1] * k << " ";
  }
  return 0;
}
