#include <bits/stdc++.h>
using namespace std;
int dp[1005 * 1005], a[1005];
int main() {
  int n, m, i, j, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    sort(a + 1, a + 1 + n);
    int t = a[1];
    for (i = 1; i <= n; i++) {
      a[i] -= t;
    }
    for (i = 0; i <= 1000000; i++) dp[i] = 99999999;
    dp[0] = 0;
    for (j = 0; j <= 1000000; j++) {
      for (i = 1; i <= n; i++) {
        if (j >= a[i]) {
          dp[j] = min(dp[j], dp[j - a[i]] + 1);
        }
      }
    }
    int flag = 1;
    for (j = 0; j <= 1000000; j++) {
      if (dp[j] <= k) {
        printf("%d ", j + t * k);
      }
    }
    printf("\n");
  }
  return 0;
}
