#include <bits/stdc++.h>
using namespace std;
int n, k;
int dp[1000010];
int a[1005];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  n = unique(a, a + n) - a;
  for (int i = 1; i < n; i++) {
    a[i] -= a[0];
  }
  int mx = a[n - 1] * k;
  for (int i = 1; i <= mx; i++) dp[i] = k + 1;
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j <= mx - a[i]; j++) {
      dp[j + a[i]] = min(dp[j + a[i]], dp[j] + 1);
    }
  }
  for (int j = 0; j <= mx; j++)
    if (dp[j] <= k) {
      printf("%d ", a[0] * k + j);
    }
  return 0;
}
