#include <bits/stdc++.h>
const int INF = 1000000000;
int main() {
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(0);
  int n, k;
  std::cin >> n >> k;
  std::vector<int> a(n);
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  std::sort(a.begin(), a.end());
  auto last = std::unique(a.begin(), a.end());
  a.erase(last, a.end());
  int add = a[0] * k;
  if (a.size() == 1) {
    std::cout << add;
    return 0;
  }
  int max = 0;
  for (int i = 1; i < (int)a.size(); i++) {
    a[i] -= a[0];
    max = std::max(max, a[i]);
  }
  int maxsz = max * k;
  std::vector<int> c(maxsz + 1, INF);
  c[0] = 0;
  for (int i = 1; i < (int)a.size(); i++) {
    for (int s = 0; s <= maxsz; s++) {
      if (c[s] >= k) continue;
      c[s + a[i]] = std::min(c[s + a[i]], c[s] + 1);
    }
  }
  for (int s = 0; s <= maxsz; s++) {
    if (c[s] > k) continue;
    std::cout << s + add << " ";
  }
}
