#include <bits/stdc++.h>
using namespace std;
vector<int> dx = {-1, 0, 0, 1};
vector<int> dy = {0, -1, 1, 0};
int N = 1000000;
vector<int> dp(N + 1, 1001);
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  dp[a[0] * k] = 0;
  for (int i = a[0] * k; i < N; i++) {
    if (dp[i] <= k) {
      for (int j = 0; j < n; j++) {
        if (i + a[j] - a[0] <= N) {
          dp[i + a[j] - a[0]] = min(dp[i + a[j] - a[0]], dp[i] + 1);
        }
      }
    }
  }
  for (int i = a[0] * k; i <= N; i++) {
    if (dp[i] <= k) cout << i << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q = 1;
  for (int i = 1; i <= q; i++) {
    solve();
  }
}
