#include <bits/stdc++.h>
using namespace std;
const long long inf = 1LL << 60;
const long long md = 1e9 + 7;
const long double eps = 1e-14;
const long double pi = acos(-1);
const int mil = 1e6;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> as(n);
  for (int &a : as) cin >> a;
  sort(as.begin(), as.end());
  int o = as[0];
  for (int &a : as) a -= o;
  vector<int> c(mil, k + 1);
  c[0] = 0;
  for (int &a : as) {
    for (int i = (a); i < int(mil); ++i) c[i] = min(c[i], 1 + c[i - a]);
  }
  for (int i = (0); i < int(mil); ++i)
    if (c[i] <= k) cout << i + k * o << ' ';
  cout << endl;
}
