#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 + 3;
const int MAXV = MAXN * MAXN;
int N, k;
int M;
int A[MAXN];
int dp[MAXV];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> k;
  for (int i = 0; i < N; i++) cin >> A[i];
  sort(A, A + N);
  N = unique(A, A + N) - A;
  M = A[0];
  for (int i = 0; i < N; i++) A[i] -= M;
  fill(dp + 1, dp + MAXV, k + 1);
  dp[0] = 0;
  for (int i = 1; i < N; i++) {
    for (int j = A[i]; j <= A[i] * k; j++) {
      dp[j] = min(dp[j], dp[j - A[i]] + 1);
    }
  }
  for (int i = 0; i < MAXV; i++) {
    if (dp[i] <= k) cout << i + M * k << " ";
  }
  return 0;
}
