#include <bits/stdc++.h>
using namespace std;
int A[1100000];
int B[1100];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &B[i]);
  sort(B + 1, B + 1 + n);
  for (int i = 2; i <= n; i++) B[i] -= B[1];
  memset(A, 50, sizeof(A));
  A[0] = 0;
  for (int i = 2; i <= n; i++)
    for (int j = B[i]; j <= 1000000; j++) A[j] = min(A[j], A[j - B[i]] + 1);
  for (int i = 0; i <= 1000000; i++)
    if (A[i] <= k) printf("%d ", i + B[1] * k);
}
