#include <bits/stdc++.h>
const int MAX_S = 1e6 + 5;
const int MAX_N = 1e3 + 5;
int n, k, f[MAX_S], base;
std::vector<int> vec;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    vec.push_back(x);
  }
  std::sort(vec.begin(), vec.end(), std::greater<int>());
  vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
  base = vec.back();
  vec.pop_back();
  for (int &j : vec) j -= base;
  std::fill(f + 1, f + MAX_S, k + 1);
  for (int i = 0; i < MAX_S; ++i) {
    for (int j : vec)
      if (i >= j) f[i] = std::min(f[i], f[i - j] + 1);
    if (f[i] <= k) printf("%d ", base * k + i);
  }
  printf("\n");
  return 0;
}
