#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;

#define fi first
#define se second
#define endl '\n'
#define MOD(n,k) (((n % k) + k ) % k)

typedef complex<ld> cld;
typedef vector<cld> vc;

const ld PI = acos(-1.0);

const int M = 4e6;
int rev[M];
cld wpw[M];

void fft(vc &a, int n, bool f) {
    for (int i = 0; i < n; i++)
        if (i < rev[i])
            swap(a[i], a[rev[i]]);

    for (int len = 2; len <= n; len <<= 1) {
        ld ang = 2 * PI / len * (f ? -1 : 1);
        int l2 = len >> 1;

        cld w(cos(ang), sin(ang));
        wpw[0] = cld(1, 0);
        for (int i = 1; i < l2; i++)
            wpw[i] = wpw[i-1] * w;

        cld t;
        int l, r;
        for (int i = 0; i < n; i += len) {
            for (int j = 0; j < len / 2; j++) {
                l = i+j, r = i+j+len/2;
                t = a[r] * wpw[j];
                a[r] = a[l] - t;
                a[l] += t;
            }
        }
    }

    if (f)
        for (int i = 0; i < n; i++)
            a[i] /= n;
}

void obtRev (int n, int ln) {
    for (int i = 0; i < n; i++) {
        rev[i] = 0;
        for (int j = 0; j < ln; j++)
            if (i & (1 << j))
                rev[i] |= 1 << (ln - j - 1);
    }
}

cld pot (cld b, ll p) {
    cld res = 1;

    while (p) {
        if (p&1)
            res *= b;
        b *= b;
        p >>= 1;
    }

    return res;
}

void Multiplica (vc &a, int k) {
    fft (a, a.size(), 0);

    for (int i = 0; i < a.size(); i++)
        a[i] = pot(a[i], k);

    fft(a, a.size(), 1);
}

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);

    int n, k, x;

    cin >> n >> k;

    int tam = 1, lg = 0;
    while (tam < 1000*k)
        tam <<= 1, lg++;
    tam <<= 1, lg++;
    obtRev(tam, lg);

    vc a(tam);
    for (int i = 0; i < n; i++) {
        cin >> x;
        a[x] += 1;
    }

    Multiplica(a, k);

    for (int i = 0; i < tam; i++)
        if ((ll)round(a[i].real()) > 0)
            cout << i << " ";
    cout << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define D(x)    cout << #x " = " <<(x) << endl
#define MAX     1000
typedef long long int LL;

const double PI = acos(-1.0);
///Fast Fourier Transformation
typedef complex<double> base;

void fft (vector<base> & a, bool invert) {
	int n = (int) a.size();

	for (int i=1, j=0; i<n; ++i) {
		int bit = n >> 1;
		for (; j>=bit; bit>>=1)
			j -= bit;
		j += bit;
		if (i < j)
			swap (a[i], a[j]);
	}

	for (int len=2; len<=n; len<<=1) {
		double ang = 2*PI/len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for (int i=0; i<n; i+=len) {
			base w (1);
			for (int j=0; j<len/2; ++j) {
				base u = a[i+j],  v = a[i+j+len/2] * w;
				a[i+j] = u + v;
				a[i+j+len/2] = u - v;
				w *= wlen;
			}
		}
	}
	if (invert)
		for (int i=0; i<n; ++i)
			a[i] /= n;
}

void multiply (const vector<int> & a, const vector<int> & b, vector<int> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

	fft (fa, false),  fft (fb, false);
	for (size_t i=0; i<n; ++i)
		fa[i] *= fb[i];
	fft (fa, true);

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = int (fa[i].real() + 0.5);
}

void multiply_sqr (const vector<int> & a, const vector<int> & b, vector<int> & res) {
	vector<base> fa (a.begin(), a.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n);

	fft (fa, false);
	for (size_t i=0; i<n; ++i)
		fa[i] *= fa[i];
	fft (fa, true);

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = int (fa[i].real() + 0.5);
}

vector<int> poly, res, cur;

int main()
{
    int i, n, k, v;
    poly.resize(MAX+1, 0);
    res = vector<int>(1,1);

    scanf("%d %d", &n, &k);
    for(i = 1; i <= n; i++){
        scanf("%d", &v);
        poly[v]++;
    }

    while(poly.size() && !poly.back()) poly.pop_back();
    cur = poly;

    while(k){
        if(k & 1) multiply(res, cur, res);
        multiply_sqr(cur, cur, cur);
        k = k / 2;
    }

    for(i = 0; i < (int) res.size(); i++)
        if(res[i] > 1e-9)    printf("%d ", i);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define D(x)    cout << #x " = " <<(x) << endl
#define MAX     1001
typedef long long int LL;

//Fast Fourier Transformation
#define PI     acos(-1.00)
typedef complex<double> base;

void fft (vector<base> & a, bool invert)
{
    int n = (int) a.size();
    if (n == 1)  return;

    vector<base> a0 (n/2),  a1 (n/2);
    for (int i=0, j=0; i<n; i+=2, ++j)
    {
        a0[j] = a[i];
        a1[j] = a[i+1];
    }
    fft (a0, invert);
    fft (a1, invert);

    double ang = 2*PI/n * (invert ? -1 : 1);
    base w (1),  wn (cos(ang), sin(ang));
    for (int i=0; i<n/2; ++i)
    {
        a[i] = a0[i] + w * a1[i];
        a[i+n/2] = a0[i] - w * a1[i];
        if (invert)
            a[i] /= 2,  a[i+n/2] /= 2;
        w *= wn;
    }
}

void multiply (const vector<int> & a, const vector<int> & b, vector<int> & res)
{
    vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
    size_t n = 1;
    while (n < max (a.size(), b.size()))  n <<= 1;
    n <<= 1;
    fa.resize (n),  fb.resize (n);

    fft (fa, false),  fft (fb, false);
    for (size_t i=0; i<n; ++i)
        fa[i] *= fb[i];
    fft (fa, true);

    res.resize (n);
    for (size_t i=0; i<n; ++i)
        res[i] = int (fa[i].real() + 0.5);

    /*int carry = 0;
    for (size_t i=0; i<n; ++i)
    {
        res[i] += carry;
        carry = res[i] / 10;
        res[i] %= 10;
    }*/
}

void ip(vector<int> &a, int p, vector<int> &res)
{
    if(!p){
        res = vector<int> (1, 1);
        return;
    }
    if(p & 1) {
        ip(a, p - 1, res);
        multiply(a, res, res);
        return;
    }
    ip(a, p/2, res);
    multiply(res, res, res);
    return;

}

int main()
{
    vector<int> result, init;
    init.resize(MAX+5);

    int i, n, k, v;
    scanf("%d %d", &n, &k);
    for(i = 1; i <= n; i++){
        scanf("%d", &v);
        init[v] = 1;
    }

    ip(init, k, result);
    for(i = 0; i < (int) result.size(); i++)
        if(result[i])
            printf("%d ", i);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define D(x)    cout << #x " = " <<(x) << endl
#define MAX     1000
typedef long long int LL;

const double PI = acos(-1.0);
///Fast Fourier Transformation
typedef complex<double> base;

void fft (vector<base> & a, bool invert) {
	int n = (int) a.size();

	for (int i=1, j=0; i<n; ++i) {
		int bit = n >> 1;
		for (; j>=bit; bit>>=1)
			j -= bit;
		j += bit;
		if (i < j)
			swap (a[i], a[j]);
	}

	for (int len=2; len<=n; len<<=1) {
		double ang = 2*PI/len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for (int i=0; i<n; i+=len) {
			base w (1);
			for (int j=0; j<len/2; ++j) {
				base u = a[i+j],  v = a[i+j+len/2] * w;
				a[i+j] = u + v;
				a[i+j+len/2] = u - v;
				w *= wlen;
			}
		}
	}
	if (invert)
		for (int i=0; i<n; ++i)
			a[i] /= n;
}

void multiply (const vector<int> & a, const vector<int> & b, vector<int> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

	fft (fa, false),  fft (fb, false);
	for (size_t i=0; i<n; ++i)
		fa[i] *= fb[i];
	fft (fa, true);

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = int (fa[i].real() + 0.5);
}

void multiply_sqr (const vector<int> & a, const vector<int> & b, vector<int> & res) {
	vector<base> fa (a.begin(), a.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n);

	fft (fa, false);
	for (size_t i=0; i<n; ++i)
		fa[i] *= fa[i];
	fft (fa, true);

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = min(1, int (fa[i].real() + 0.5));
}

vector<int> poly, res, cur;

int main()
{
    int i, n, k, v;
    poly.resize(MAX+1, 0);
    res = vector<int>(1,1);

    scanf("%d %d", &n, &k);
    for(i = 1; i <= n; i++){
        scanf("%d", &v);
        poly[v]++;
    }

    while(poly.size() && !poly.back()) poly.pop_back();
    cur = poly;

    while(k){
        if(k & 1) multiply(res, cur, res);
        multiply(cur, cur, cur);
        k = k / 2;
    }

    for(i = 0; i < (int) res.size(); i++)
        if(res[i] > 1e-9)    printf("%d ", i);

    return 0;
}


#include <bits/stdtr1c++.h>

#define MAX (1<<21) /// 2 * Smallest power of 2 greater than MAXN, 2^18 when MAXN = 10^5
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)
#define dbg(x) cout << #x << " = " << x << endl
#define ran(a, b) ((((rand() << 15) ^ rand()) % ((b) - (a) + 1)) + (a))

using namespace std;

typedef complex <double> complx; /// Replace double with long double if more precision is required

complx dp[MAX >> 1], P1[MAX], P2[MAX];

inline long long round_half_even(double x){
    long long res = abs(x) + 0.5;
    if (x < 0) res = -res;
    return res;
}

void FFT(complx *ar, int n, int inv){
    int i, j, l, len, len2;
    const double p = 4.0 * inv * acos(0.0);

    for (i = 1, j = 0; i < n; i++){
        for (l = n >> 1; j >= l; l >>= 1) j -= l;
        j += l;
        if (i < j) swap(ar[i], ar[j]);
    }

    for (len = 2; len <= n; len <<= 1){
        len2 = len >> 1;
        double theta = p / len;
        complx mul(cos(theta), sin(theta));

        dp[0] = complx(1, 0);
        for (i = 1; i < len2; i++) dp[i] = (dp[i - 1] * mul);

        for (i = 0; i < n; i += len){
            complx t, *pu = ar + i, *pv = ar + i + len2, *pend = ar + i + len2, *pw = dp;
            for (; pu != pend; pu++, pv++, pw++){
                t = (*pv) * (*pw);
                *pv = *pu - t;
                *pu += t;
            }
        }
    }

    if (inv == -1){
        for (i = 0; i < n; i++) ar[i] /= n;
    }
}

void convolution(int n, complx* A, complx* B){
    int i, m, d = 0;
    if (__builtin_popcount(n) != 1){
        for (i = 0; i < n; i++) B[i + n] = B[i], A[i + n] = complx(0);
        d = n, n *= 2;
    }

    m = 1 << (32 - __builtin_clz(n) - (__builtin_popcount(n) == 1));
    for (i = n; i < m; i++) A[i] = B[i] = complx(0);

    FFT(A, m, 1), FFT(B, m, 1);
    for (i = 0; i < m; i++) A[i] = A[i] * B[i];
    FFT(A, m, -1);
    for (i = 0; i < d && d; i++) A[i] = A[i + d];
}

int multiply(int a, complx* A, int b, complx* B){
    int i, n, m;
    n = a + b - 1;
    m = 1 << (32 - __builtin_clz(n) - (__builtin_popcount(n) == 1));

    for (i = a; i < m; i++) A[i] = 0;
    for (i = b; i < m; i++) B[i] = 0;
    FFT(A, m, 1), FFT(B, m, 1);
    for (i = 0; i < m; i++) A[i] = A[i] * B[i];
    FFT(A, m, -1);
    return m;
}

/***
    Computes the circular convolution of A and B, denoted A * B, in C
    A and B must be of equal size, if not normalize before calling function
    Example to demonstrate convolution for n = 5:

    c0 = a0b0 + a1b4 + a2b3 + a3b2 + a4b1
    c1 = a0b1 + a1b0 + a2b4 + a3b3 + a4b2
    ...
    c4 = a0b4 + a1b3 + a2b2 + a3b1 + a4b0

    Note: If linear convolution is required, pad with zeros appropriately, as in multiplication

***/

/// Returns the convolution of A and B in A

void convolution(int n, int* A, int* B){
    for (int i = 0; i < n; i++) P1[i] = complx(A[i], 0);
    for (int i = 0; i < n; i++) P2[i] = complx(B[i], 0);
    convolution(n, P1, P2);
    for (int i = 0; i < n; i++) A[i] = round_half_even(P1[i].real());
}

/// Multiplies two polynomials A and B and return the coefficients of their product in A
/// Function returns degree of the polynomial A * B

int multiply(int a, int* A, int b, int* B){
    for (int i = 0; i < a; i++) P1[i] = complx(A[i], 0);
    for (int i = 0; i < b; i++) P2[i] = complx(B[i], 0);
    int degree = multiply(a, P1, b, P2);
    for (int i = 0; i < degree; i++) A[i] = round_half_even(P1[i].real());
    return degree;
}

int counter[1111];
int poly[MAX];

int ip(int p)
{
    if(!p) return 1;
    if(p & 1){
        int d = ip(p - 1);
        return multiply(d, poly, 1001, counter);
    }
    else{
        int d = ip(p / 2);
        return multiply(d, poly, d, poly);
    }
}

int main(){
    int i, k, n, v, d;

    scanf("%d %d", &n, &k);
    for(i = 1; i <= n; i++){
        scanf("%d", &v);
        counter[v] = 1;
    }

    poly[0] = 1;
    d = ip(k);
    for(i = 1; i < d; i++)
        if(poly[i]) printf("%d ", i);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define D(x)    cout << #x " = " <<(x) << endl
#define MAX     1001
typedef long long int LL;

//Fast Fourier Transformation
#define PI     acos(-1.00)
typedef complex<double> base;

void fft (vector<base> & a, bool invert)
{
    int n = (int) a.size();
    if (n == 1)  return;

    vector<base> a0 (n/2),  a1 (n/2);
    for (int i=0, j=0; i<n; i+=2, ++j)
    {
        a0[j] = a[i];
        a1[j] = a[i+1];
    }
    fft (a0, invert);
    fft (a1, invert);

    double ang = 2*PI/n * (invert ? -1 : 1);
    base w (1),  wn (cos(ang), sin(ang));
    for (int i=0; i<n/2; ++i)
    {
        a[i] = a0[i] + w * a1[i];
        a[i+n/2] = a0[i] - w * a1[i];
        if (invert)
            a[i] /= 2,  a[i+n/2] /= 2;
        w *= wn;
    }
}

void multiply (const vector<int> & a, const vector<int> & b, vector<int> & res)
{
    vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
    size_t n = 1;
    while (n < max (a.size(), b.size()))  n <<= 1;
    n <<= 1;
    fa.resize (n),  fb.resize (n);

    fft (fa, false),  fft (fb, false);
    for (size_t i=0; i<n; ++i)
        fa[i] *= fb[i];
    fft (fa, true);

    res.resize (n);
    for (size_t i=0; i<n; ++i)
        res[i] = int (fa[i].real() + 0.5);

    /*int carry = 0;
    for (size_t i=0; i<n; ++i)
    {
        res[i] += carry;
        carry = res[i] / 10;
        res[i] %= 10;
    }*/
}

void ip(vector<int> a, int p, vector<int> &res)
{
    if(!p){
        res = vector<int> (1, 1);
        return;
    }
    if(p & 1) {
        ip(a, p - 1, res);
        multiply(a, res, res);
        return;
    }
    ip(a, p/2, res);
    multiply(res, res, res);
    return;

}

int main()
{
    vector<int> result, init;
    init.resize(MAX+5);

    int i, n, k, v;
    scanf("%d %d", &n, &k);
    for(i = 1; i <= n; i++){
        scanf("%d", &v);
        init[v] = 1;
    }

    ip(init, k, result);
    for(i = 0; i < (int) result.size(); i++)
        if(result[i])
            printf("%d ", i);

    return 0;
}


#include <bits/stdtr1c++.h>

#define MAX (1<<22) /// 2 * Smallest power of 2 greater than MAXN, 2^18 when MAXN = 10^5
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)
#define dbg(x) cout << #x << " = " << x << endl
#define ran(a, b) ((((rand() << 15) ^ rand()) % ((b) - (a) + 1)) + (a))

using namespace std;

typedef complex <double> complx; /// Replace double with long double if more precision is required

complx dp[MAX >> 1], P1[MAX], P2[MAX];

inline long long round_half_even(double x){
    long long res = abs(x) + 0.5;
    if (x < 0) res = -res;
    return res;
}

void FFT(complx *ar, int n, int inv){
    int i, j, l, len, len2;
    const double p = 4.0 * inv * acos(0.0);

    for (i = 1, j = 0; i < n; i++){
        for (l = n >> 1; j >= l; l >>= 1) j -= l;
        j += l;
        if (i < j) swap(ar[i], ar[j]);
    }

    for (len = 2; len <= n; len <<= 1){
        len2 = len >> 1;
        double theta = p / len;
        complx mul(cos(theta), sin(theta));

        dp[0] = complx(1, 0);
        for (i = 1; i < len2; i++) dp[i] = (dp[i - 1] * mul);

        for (i = 0; i < n; i += len){
            complx t, *pu = ar + i, *pv = ar + i + len2, *pend = ar + i + len2, *pw = dp;
            for (; pu != pend; pu++, pv++, pw++){
                t = (*pv) * (*pw);
                *pv = *pu - t;
                *pu += t;
            }
        }
    }

    if (inv == -1){
        for (i = 0; i < n; i++) ar[i] /= n;
    }
}

void convolution(int n, complx* A, complx* B){
    int i, m, d = 0;
    if (__builtin_popcount(n) != 1){
        for (i = 0; i < n; i++) B[i + n] = B[i], A[i + n] = complx(0);
        d = n, n *= 2;
    }

    m = 1 << (32 - __builtin_clz(n) - (__builtin_popcount(n) == 1));
    for (i = n; i < m; i++) A[i] = B[i] = complx(0);

    FFT(A, m, 1), FFT(B, m, 1);
    for (i = 0; i < m; i++) A[i] = A[i] * B[i];
    FFT(A, m, -1);
    for (i = 0; i < d && d; i++) A[i] = A[i + d];
}

int multiply(int a, complx* A, int b, complx* B){
    int i, n, m;
    n = a + b - 1;
    m = 1 << (32 - __builtin_clz(n) - (__builtin_popcount(n) == 1));

    for (i = a; i < m; i++) A[i] = 0;
    for (i = b; i < m; i++) B[i] = 0;
    FFT(A, m, 1), FFT(B, m, 1);
    for (i = 0; i < m; i++) A[i] = A[i] * B[i];
    FFT(A, m, -1);
    return m;
}

/***
    Computes the circular convolution of A and B, denoted A * B, in C
    A and B must be of equal size, if not normalize before calling function
    Example to demonstrate convolution for n = 5:

    c0 = a0b0 + a1b4 + a2b3 + a3b2 + a4b1
    c1 = a0b1 + a1b0 + a2b4 + a3b3 + a4b2
    ...
    c4 = a0b4 + a1b3 + a2b2 + a3b1 + a4b0

    Note: If linear convolution is required, pad with zeros appropriately, as in multiplication

***/

/// Returns the convolution of A and B in A

void convolution(int n, int* A, int* B){
    for (int i = 0; i < n; i++) P1[i] = complx(A[i], 0);
    for (int i = 0; i < n; i++) P2[i] = complx(B[i], 0);
    convolution(n, P1, P2);
    for (int i = 0; i < n; i++) A[i] = round_half_even(P1[i].real());
}

/// Multiplies two polynomials A and B and return the coefficients of their product in A
/// Function returns degree of the polynomial A * B

int multiply(int a, int* A, int b, int* B){
    for (int i = 0; i < a; i++) P1[i] = complx(A[i], 0);
    for (int i = 0; i < b; i++) P2[i] = complx(B[i], 0);
    int degree = multiply(a, P1, b, P2);
    for (int i = 0; i < degree; i++) A[i] = round_half_even(P1[i].real());
    return degree;
}

int counter[1111];
int poly[MAX], tmp[MAX];

int ip(int p)
{
    if(!p) return 1;
    if(p & 1){
        int d = ip(p - 1);
        return multiply(d, poly, 1001, counter);
    }
    else{
        int d = ip(p / 2);
        for(int i = 0; i < d; i++) tmp[i] = poly[i];
        return multiply(d, poly, d, tmp);
    }
}

int main(){
    //freopen("in.txt", "r", stdin);

    int i, k, n, v, d;

    scanf("%d %d", &n, &k);

    for(i = 1; i <= n; i++){
        scanf("%d", &v);
        counter[v] = 1;
    }

    poly[0] = 1;
    d = ip(k);
    for(i = 1; i < d; i++)
        if(poly[i]) printf("%d ", i);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define D(x)    cout << #x " = " <<(x) << endl
#define MAX     1000
typedef long long int LL;

const double PI = acos(-1.0);
///Fast Fourier Transformation
typedef complex<double> base;

void fft (vector<base> & a, bool invert) {
	int n = (int) a.size();

	for (int i=1, j=0; i<n; ++i) {
		int bit = n >> 1;
		for (; j>=bit; bit>>=1)
			j -= bit;
		j += bit;
		if (i < j)
			swap (a[i], a[j]);
	}

	for (int len=2; len<=n; len<<=1) {
		double ang = 2*PI/len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for (int i=0; i<n; i+=len) {
			base w (1);
			for (int j=0; j<len/2; ++j) {
				base u = a[i+j],  v = a[i+j+len/2] * w;
				a[i+j] = u + v;
				a[i+j+len/2] = u - v;
				w *= wlen;
			}
		}
	}
	if (invert)
		for (int i=0; i<n; ++i)
			a[i] /= n;
}

void multiply (const vector<int> & a, const vector<int> & b, vector<int> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

	fft (fa, false),  fft (fb, false);
	for (size_t i=0; i<n; ++i)
		fa[i] *= fb[i];
	fft (fa, true);

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = min(1, int (fa[i].real() + 0.5));
}

vector<int> poly, res, cur;

int main()
{
    int i, n, k, v;
    poly.resize(MAX+1, 0);
    res = vector<int>(1,1);

    scanf("%d %d", &n, &k);
    for(i = 1; i <= n; i++){
        scanf("%d", &v);
        poly[v]++;
    }

    while(poly.size() && !poly.back()) poly.pop_back();
    cur = poly;

    while(k){
        if(k & 1) multiply(res, cur, res);
        multiply(cur, cur, cur);
        k = k / 2;
    }

    for(i = 0; i < (int) res.size(); i++)
        if(res[i] > 1e-9)    printf("%d ", i);

    return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <=  2 * max(a.size(), b.size())) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <= 2 * max(a.size(), b.size())) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> b;
        b = a;
        while(m --){
                int sz = b.size();
                b = multiply(b, a);
                b.resize(a.size() + sz - 1);
        }

        return b;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k - 1);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <=  2 * max(a.size(), b.size())) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> b;
        vector<int> z(1, 1);
        b = a;
        while(m --){

                if(m & 1) z = multiply(z, b);
                b = multiply(b, a);
                m >>= 1;
        }

        return b;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <= 2 * max(a.size(), b.size())) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> b;
        b = a;
        while(m --) b = multiply(b, a);

        return b;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k - 1);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
                res[i] = min(res[i], 1);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <=  2 * max(a.size(), b.size())) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> b;
        b = a;
        while(m --){
                int sz = b.size();
                b = multiply(b, a);
                b.resize(a.size() + sz - 1);
        }

        return b;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k - 1);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <=  max(a.size(), b.size())) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> b;
        b = a;
        while(m --){
                int sz = b.size();
                b = multiply(b, a);
                b.resize(a.size() + sz - 1);
        }

        return b;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k - 1);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<double> base;
const double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        scanf("%d %d", &n, &k);

        FOR(i, 1, n) scanf("%d", &x), arr[x] = 1;
        FOR(i, 0, 1000){
                v.pb(arr[i]);
        }

        vector<int> ans = go(v, k);
        FORR(i, 0, ans.size()){
                if(ans[i]) printf("%d ", i);
        }
        printf("\n");

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<double> base;
const double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        scanf("%d %d", &n, &k);

        FOR(i, 1, n) scanf("%d", &x), arr[x] = 1;
        FOR(i, 0, 1000){
                v.pb(arr[i]);
        }

        vector<int> ans = go(v, k);
        FORR(i, 1, ans.size()){
                if(ans[i]) printf("%d ", i);
        }
        printf("\n");

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  (a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                if(arr[i]){
                        v.pb(1);
                }
                else v.pb(0);
        }

        vector<int> ans = go(v, k);
        FOR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<double> base;
const double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
                res[i] = min(res[i], 1);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        scanf("%d %d", &n, &k);

        FOR(i, 1, n) scanf("%d", &x), arr[x] = 1;
        FOR(i, 0, 1000){
                v.pb(arr[i]);
        }

        vector<int> ans = go(v, k);
        FORR(i, 1, ans.size()){
                if(ans[i]) printf("%d ", i);
        }
        printf("\n");

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<long double> base;
const long double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		long double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
                res[i] = min(res[i], 1);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        v.pb(0);
        FOR(i, 1, 1000){
                v.pb(arr[i]);
        }

        vector<int> ans = go(v, k);
        FORR(i, 1, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


//####################################################################
//#####In the Name Of Allah,the Most Gracious,the Most Merciful.######
//####################################################################
//############Created by Sazid Rahman Simanto on 3/20/17.#############
//#####Copyright © 2017 Sazid Rahman Simanto. All rights reserved.####
//####################################################################

#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <utility>
#include <bitset>
#include <list>
#include <algorithm>
#include <complex>

using namespace std;

#define MSET(a,x) memset(a,x,sizeof a)
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FORR(i,x,y) for(int i=(x);i<(y);i++)
#define ROF(i,x,y) for(int i=(y);i>=(x);i--)
#define SQ(x) ((x)*(x))
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define inf             1061109567
#define maxn            100010
#define esp             1e-8
#define mod             1000000007
#define ll              long long
#define ull             unsigned long long
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define read()          freopen("input.txt", "r", stdin)
#define write()         freopen("output.txt", "w", stdout)

typedef pair<ll, ll> ii;
typedef complex<double> base;
const double PI = acos(- 1);
typedef long double ld;

template <class T> inline T bigmod(T a, T b, T M) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = (ret * a) % M;
                a = (a * a) % M;
        }
        return (T)ret;
}

template <class T> inline T gcd(T a,T b){

        while (a && b)a > b ? a %= b : b %= a;
        return a + b;
}

template <class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }

template <class T> inline T poww(T a, T b) {
        ll ret = 1;
        for(; b > 0; b >>= 1) {
                if(b & 1) ret = ret * a;
                a = a * a;
        }
        return (T)ret;
}

pii exEuclid(int a, int b) {
        if(b == 0) return pii(1, 0);
        else {
                pii r = exEuclid(b, a%b);
                return pii(r.ss, r.ff-r.ss*(a/b));
        }
}

int modInv(int a, int m) { pii ret = exEuclid(a, m); return ((ret.ff % m) + m ) % m; }

int Set(int N, int pos) {return N = N | (1 << pos);}
int reset(int N, int pos) {return N = N & ~ (1 << pos);}
bool check(int N, int pos) {return (bool) (N & (1 << pos));}

//####################################################################
//##################Template Ends Here################################
//####################################################################
int arr[1024], x;
vector<int> v;

void fft (vector<base>& a, bool invert) {
	int n = a.size();

	for(int i = 1, j = 0; i < n ; i ++) {
		int bit = n >> 1;
		for (; j >= bit; bit >>= 1)
			j -= bit;
		j += bit;
		if(i < j)
			swap (a[i], a[j]);
	}

	for(int len = 2; len <= n; len <<= 1) {
		double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen (cos(ang), sin(ang));
		for(int i = 0; i < n; i += len) {
			base w (1);
			for(int j = 0; j < len / 2; j ++) {
				base u = a[i + j],  v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if(invert)
		for(int i = 0; i < n; i ++)
			a[i] /= n;
}

vector<int> multiply(const vector<int>& a, const vector<int>& b)
{
        int n = 1;
        while(n <  a.size() + b.size()) n <<= 1;

        vector<base> fa(ALL(a)), fb(ALL(b));
        fa.resize(n);
        fb.resize(n);

        fft(fa, false);
        fft(fb, false);

        FORR(i, 0, n) fa[i] *= fb[i];

        fft(fa, true);
        vector<int> res(n);
        FORR(i, 0, n){
                res[i] = (int)(fa[i].real() + 0.5);
                res[i] = min(res[i], 1);
        }
        while(res.back() == 0 && res.size() > 1) res.pop_back();
        return res;
}

vector<int> go(vector<int> a, int m)
{
        vector<int> z(1, 1);
        while(m){

                if(m & 1) z = multiply(z, a);
                a = multiply(a, a);
                m >>= 1;
        }

        return z;
}

int main() {

        //read();
        //ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
        //write();
        int n, k;
        cin >> n >> k;

        FOR(i, 1, n) cin >> x, arr[x] = 1;
        FOR(i, 0, 1000){
                v.pb(arr[i]);
        }

        vector<int> ans = go(v, k);
        FORR(i, 0, ans.size()){
                if(ans[i]) cout << i << " ";
        }
        cout << endl;

        return 0;
}


#include <bits\stdc++.h>

using namespace std;
struct comp
{
	double x,y;
};
inline comp operator *(comp a,comp b)
{
	comp z;
	z.x=a.x*b.x-a.y*b.y;
	z.y=a.x*b.y+a.y*b.x;
	return z;
}
inline comp operator +(comp a,comp b)
{
	comp z;
	z.x=a.x+b.x;
	z.y=a.y+b.y;
	return z;
}
inline comp operator -(comp a,comp b)
{
	comp z;
	z.x=a.x-b.x;
	z.y=a.y-b.y;
	return z;
}
inline comp polarcomp(double r,double ang)
{
	comp z;
	//cout<<r<<" "<<ang<<" "<<cos(ang)<<" "<<sin(ang)<<endl;
	z.x=r*cos(ang);
	z.y=r*sin(ang);
	return z;
}
inline comp compinverse(comp w)
{
	comp z;
	z.x=(w.x)/(w.x*w.x+w.y*w.y);
	z.y=(-w.y)/(w.x*w.x+w.y*w.y);
	return z;
}
const int mm=2097152;
int sl;
const double dd=1/2097152;
double epsilon=1e-9;
int n,k;
//comp pr[1048576];
//comp w;
double PI;
int a[1005];
bool d[5000005];
bool p[5000005];
//comp t[mm];
//comp e[mm];
//comp o[mm];

vector<comp> t;
int reverse(int i,int m)
{
	int j=0;
	int l1=1;
	int l2=m>>1;
	while(l1<l2)
	{
		if((i&l1)>0) j+=l2;
		if((i&l2)>0) j+=l1;
		l1=l1<<1;
		l2=l2>>1;
	}
	if(l1==l2)
	{
		if((i&l1)) j+=l1;
	}
	return j;
}
inline vector<comp > FFT(vector<comp > &p,int m,bool nin)
{
	vector<comp > ef,of,e,o,t;
	if(m==1) return p;
	for(int i=0;i<m;i++)
	{
		int j=reverse(i,m);
		if(i<j) swap(p[i],p[j]);
	}
	comp x,y;
	comp w;
	comp d;
	d.x=1.0;
	d.y=0.0;
	for(int l=2;l<=m;l=l<<1)
	{
		w=polarcomp(1.0,2.0*PI/double(l));
		if(!nin) w=compinverse(w);
		for(int j=0;j<m;j=j+l)
		{
			d.x=1.0;
			d.y=0.0;
			//cout<<j<<" "<<l<<" "<<m<<endl;
			for(int i=j;i<j+(l>>1);i++)
			{
				x=p[i];
				y=p[i+(l>>1)]*d;
				p[i]=x+y;
				p[i+(l>>1)]=x-y;
				d=d*w;
			}
		}
	}
	return p;
}
void Multiply(bool*x,bool*y)
{
	int m=0;
	for(int i=0;i<1000000;i++)
	{
		if(x[i] || y[i]) m=i;
	}
	m=m+10;
	double t=m;
	t=log(t)/log(2.0);
	m=t;
	m=pow(2,m+1);
	m=(m<<1);
	t=m;
	t=1.0/t;
	vector<comp > pr,u,v,r;
	pr.resize(m);
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(x[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	u.clear();
	u=FFT(pr,m,true);
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(y[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	v.clear();
	v=FFT(pr,m,true);
	for(int i=0;i<m;i++) pr[i]=u[i]*v[i];
	r.clear();
	r=FFT(pr,m,false);
	for(int i=0;i<m;i++)
	{
		if(r[i].x>epsilon) x[i]=true;
		else x[i]=false;
	}
}
void Solve()
{
	int l=1;
	for(int i=0;i<n;i++) p[a[i]]=true;
	bool e=true;
	while(l<=k)
	{
		if((k&l)>0)
		{
			if(!e) Multiply(d,p);
			else
			{
				for(int i=0;i<=mm;i++) d[i]=p[i];
				e=false;
			}
		}
		Multiply(p,p);
		l=(l<<1);
	}
}
int main()
{
	t.resize(mm);
	PI=acos(-1);
	scanf("%d %d",&n,&k);
	for(int i=0;i<n;i++) scanf("%d",&a[i]);
	Solve();
	for(int i=1;i<=1000000;i++) if(d[i]) printf("%d ",i);
	return 0;
}


#include <bits\stdc++.h>

using namespace std;
struct comp
{
	double x,y;
};
inline comp operator *(comp a,comp b)
{
	comp z;
	z.x=a.x*b.x-a.y*b.y;
	z.y=a.x*b.y+a.y*b.x;
	return z;
}
inline comp operator +(comp a,comp b)
{
	comp z;
	z.x=a.x+b.x;
	z.y=a.y+b.y;
	return z;
}
inline comp operator -(comp a,comp b)
{
	comp z;
	z.x=a.x-b.x;
	z.y=a.y-b.y;
	return z;
}
inline comp polarcomp(double r,double ang)
{
	comp z;
	//cout<<r<<" "<<ang<<" "<<cos(ang)<<" "<<sin(ang)<<endl;
	z.x=r*cos(ang);
	z.y=r*sin(ang);
	return z;
}
inline comp compinverse(comp w)
{
	comp z;
	z.x=(w.x)/(w.x*w.x+w.y*w.y);
	z.y=(-w.y)/(w.x*w.x+w.y*w.y);
	return z;
}
const int mm=1048576;
int sl;
const double dd=1/1048576;
double epsilon=1e-9;
int n,k;
//comp pr[1048576];
comp w;
double PI;
int a[1005];
bool d[2000005];
bool p[2000005];
//comp t[mm];
//comp e[mm];
//comp o[mm];

/*vector<comp > t;
vector<comp > ef;
vector<comp > of;
vector<comp > e;
vector<comp > o;*/
inline vector<comp > FFT(vector<comp > p,int m,comp r)
{
	vector<comp > ef,of,e,o,t;
	//cout<<m<<" = "<<p.size()<<endl;
	if(m==1) return p;
	//e.clear();
	//o.clear();
	for(int i=0;i<m/2;i++)
	{
		e.push_back(p[i*2]);
		o.push_back(p[i*2+1]);
	}
	//cout<<e.size()<<" "<<o.size()<<endl;
	//cout<<"?"<<endl;
	//ef.clear();
	//of.clear();
	ef=FFT(e,m/2,r*r);
	//cout<<"? "<<ef.size()<<endl;
	of=FFT(o,m/2,r*r);
	comp x;
	x.x=1.0;
	x.y=0.0;
	//t.clear();
	t.resize(m);
	for(int i=0;i<m/2;i++)
	{
		t[i]=ef[i]+x*of[i];
		t[i+m/2]=ef[i]-x*of[i];
		//cout<<r<<" "<<x<<" "<<x*r<<endl;
		x=x*r;
	}
	//sl+=5*m;
	return t;
}
void Multiply(bool*x,bool*y)
{
	int m=0;
	for(int i=0;i<1000000;i++)
	{
		if(x[i] || y[i]) m=i;
	}
	m=m+1000;
	//cout<<m<<endl;
	m=log(m);
	m=pow(2,m+1);
	//m=m+2;
	//cout<<m<<endl;
	m=(m<<1);
	double t;
	t=m;
	t=1.0/t;
	w=polarcomp(1.0,2.0*PI*t);
	vector<comp > pr,u,v,r;
	pr.resize(m);
	//cout<<t<<endl;
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(x[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	u.clear();
	//sl=0;
	//cout<<"?"<<endl;
	u=FFT(pr,m,w);
	//cout<<sl<<endl;
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(y[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	v.clear();
	v=FFT(pr,m,w);
	for(int i=0;i<m;i++) pr[i]=u[i]*v[i];
	/*for(int i=0;i<mm;i++) cout<<u[i]<<" ";
	cout<<endl;
	for(int i=0;i<mm;i++) cout<<v[i]<<" ";
	cout<<endl;*/
	r.clear();
	comp inw;
	inw=w;
	inw=compinverse(w);
	//cout<<inw<<endl;
	r=FFT(pr,m,inw);
	for(int i=0;i<m;i++)
	{
		//cout<<r[i]<<" ";
		if(r[i].x>epsilon) x[i]=true;
		else x[i]=false;
	}
	//cout<<endl<<endl<<endl;
}
void Solve()
{
	int l=1;
	for(int i=0;i<n;i++) p[a[i]]=true;
	//p[0]=true;
	//d[0]=true;
	bool e=true;
	while(l<=k)
	{
		if((k&l)>0)
		{
			if(!e) Multiply(d,p);
			else
			{
				for(int i=0;i<=mm;i++) d[i]=p[i];
				e=false;
			}
		}
		Multiply(p,p);
		//cout<<l<<endl;
		//for(int i=1;i<=1000000;i++) if(p[i]) printf("%d ",i);
		l=(l<<1);
	}
}
int main()
{
	PI=acos(-1);
	scanf("%d %d",&n,&k);
	//w=polarcomp(1.0,2.0*PI*dd);
	//cout<<w.x<<" "<<w.y<<endl;
	for(int i=0;i<n;i++) scanf("%d",&a[i]);
	Solve(); //Pronaci sve polinome koje treba pomnoziti
	for(int i=1;i<=1000000;i++) if(d[i]) printf("%d ",i);
	return 0;
}


#include <bits\stdc++.h>

using namespace std;
struct comp
{
	double x,y;
};
inline comp operator *(comp a,comp b)
{
	comp z;
	z.x=a.x*b.x-a.y*b.y;
	z.y=a.x*b.y+a.y*b.x;
	return z;
}
inline comp operator +(comp a,comp b)
{
	comp z;
	z.x=a.x+b.x;
	z.y=a.y+b.y;
	return z;
}
inline comp operator -(comp a,comp b)
{
	comp z;
	z.x=a.x-b.x;
	z.y=a.y-b.y;
	return z;
}
inline comp polarcomp(double r,double ang)
{
	comp z;
	//cout<<r<<" "<<ang<<" "<<cos(ang)<<" "<<sin(ang)<<endl;
	z.x=r*cos(ang);
	z.y=r*sin(ang);
	return z;
}
inline comp compinverse(comp w)
{
	comp z;
	z.x=(w.x)/(w.x*w.x+w.y*w.y);
	z.y=(-w.y)/(w.x*w.x+w.y*w.y);
	return z;
}
const int mm=1048576;
int sl;
const double dd=1/1048576;
double epsilon=1e-9;
int n,k;
//comp pr[1048576];
//comp w;
double PI;
int a[1005];
bool d[2000005];
bool p[2000005];
//comp t[mm];
//comp e[mm];
//comp o[mm];

/*vector<comp > t;
vector<comp > ef;
vector<comp > of;
vector<comp > e;
vector<comp > o;*/
int reverse(int i,int m)
{
	int j=0;
	int l1=1;
	int l2=m>>1;
	while(l1<l2)
	{
		if((i&l1)>0) j+=l2;
		if((i&l2)>0) j+=l1;
		l1=l1<<1;
		l2=l2>>1;
	}
	if(l1==l2)
	{
		if((i&l1)) j+=l1;
	}
	return j;
}
inline vector<comp > FFT(vector<comp > &p,int m,bool nin)
{
	vector<comp > ef,of,e,o,t;
	if(m==1) return p;
	for(int i=0;i<m;i++)
	{
		int j=reverse(i,m);
		if(i<j) swap(p[i],p[j]);
	}
	comp x,y;
	comp w;
	comp d;
	d.x=1.0;
	d.y=0.0;
	for(int l=2;l<=m;l=l<<1)
	{
		w=polarcomp(1.0,2.0*PI/double(l));
		if(!nin) w=compinverse(w);
		for(int j=0;j<m;j=j+l)
		{
			d.x=1.0;
			d.y=0.0;
			//cout<<j<<" "<<l<<" "<<m<<endl;
			for(int i=j;i<j+(l>>1);i++)
			{
				x=p[i];
				y=p[i+(l>>1)]*d;
				p[i]=x+y;
				p[i+(l>>1)]=x-y;
				d=d*w;
			}
		}
	}
	return p;
}
void Multiply(bool*x,bool*y)
{
	int m=0;
	for(int i=0;i<1000000;i++)
	{
		if(x[i] || y[i]) m=i;
	}
	m=m+10;
	double t=m;
	t=log(t)/log(2.0);
	m=t;
	m=pow(2,m+1);
	m=(m<<1);
	t=m;
	t=1.0/t;
	vector<comp > pr,u,v,r;
	pr.resize(m);
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(x[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	u.clear();
	u=FFT(pr,m,true);
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(y[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	v.clear();
	v=FFT(pr,m,true);
	for(int i=0;i<m;i++) pr[i]=u[i]*v[i];
	r.clear();
	r=FFT(pr,m,false);
	for(int i=0;i<m;i++)
	{
		if(r[i].x>epsilon) x[i]=true;
		else x[i]=false;
	}
}
void Solve()
{
	int l=1;
	for(int i=0;i<n;i++) p[a[i]]=true;
	bool e=true;
	while(l<=k)
	{
		if((k&l)>0)
		{
			if(!e) Multiply(d,p);
			else
			{
				for(int i=0;i<=mm;i++) d[i]=p[i];
				e=false;
			}
		}
		Multiply(p,p);
		l=(l<<1);
	}
}
int main()
{
	PI=acos(-1);
	scanf("%d %d",&n,&k);
	/*for(int i=0;i<4;i++)
	{
		cout<<reverse(i,4)<<" ";
	}*/
	//cout<<endl;
	//w=polarcomp(1.0,2.0*PI*dd);
	//cout<<w.x<<" "<<w.y<<endl;
	for(int i=0;i<n;i++) scanf("%d",&a[i]);
	Solve(); //Pronaci sve polinome koje treba pomnoziti
	for(int i=1;i<=1000000;i++) if(d[i]) printf("%d ",i);
	return 0;
}


#include <bits\stdc++.h>

using namespace std;
struct comp
{
	double x,y;
};
inline comp operator *(comp a,comp b)
{
	comp z;
	z.x=a.x*b.x-a.y*b.y;
	z.y=a.x*b.y+a.y*b.x;
	return z;
}
inline comp operator +(comp a,comp b)
{
	comp z;
	z.x=a.x+b.x;
	z.y=a.y+b.y;
	return z;
}
inline comp operator -(comp a,comp b)
{
	comp z;
	z.x=a.x-b.x;
	z.y=a.y-b.y;
	return z;
}
inline comp polarcomp(double r,double ang)
{
	comp z;
	//cout<<r<<" "<<ang<<" "<<cos(ang)<<" "<<sin(ang)<<endl;
	z.x=r*cos(ang);
	z.y=r*sin(ang);
	return z;
}
inline comp compinverse(comp w)
{
	comp z;
	z.x=(w.x)/(w.x*w.x+w.y*w.y);
	z.y=(-w.y)/(w.x*w.x+w.y*w.y);
	return z;
}
const int mm=1048576;
int sl;
const double dd=1/1048576;
double epsilon=1e-9;
int n,k;
//comp pr[1048576];
//comp w;
double PI;
int a[1005];
bool d[5000005];
bool p[5000005];
//comp t[mm];
//comp e[mm];
//comp o[mm];

vector<comp> t;
int reverse(int i,int m)
{
	int j=0;
	int l1=1;
	int l2=m>>1;
	while(l1<l2)
	{
		if((i&l1)>0) j+=l2;
		if((i&l2)>0) j+=l1;
		l1=l1<<1;
		l2=l2>>1;
	}
	if(l1==l2)
	{
		if((i&l1)) j+=l1;
	}
	return j;
}
inline vector<comp > FFT(vector<comp > &p,int m,bool nin)
{
	vector<comp > ef,of,e,o,t;
	if(m==1) return p;
	for(int i=0;i<m;i++)
	{
		int j=reverse(i,m);
		if(i<j) swap(p[i],p[j]);
	}
	comp x,y;
	comp w;
	comp d;
	d.x=1.0;
	d.y=0.0;
	for(int l=2;l<=m;l=l<<1)
	{
		w=polarcomp(1.0,2.0*PI/double(l));
		if(!nin) w=compinverse(w);
		for(int j=0;j<m;j=j+l)
		{
			d.x=1.0;
			d.y=0.0;
			//cout<<j<<" "<<l<<" "<<m<<endl;
			for(int i=j;i<j+(l>>1);i++)
			{
				x=p[i];
				y=p[i+(l>>1)]*d;
				p[i]=x+y;
				p[i+(l>>1)]=x-y;
				d=d*w;
			}
		}
	}
	return p;
}
void Multiply(bool*x,bool*y,bool nec)
{
	int m=0;
	for(int i=0;i<1000000;i++)
	{
		if(x[i] || y[i]) m=i;
	}
	m=m+10;
	double t=m;
	t=log(t)/log(2.0);
	m=t;
	m=pow(2,m+1);
	m=(m<<1);
	if(m>=2000000 && nec)
	{
		//return;
		while(true)
		{
			m++;
		}
	}
	vector<comp > pr,u,v,r;
	pr.resize(m);
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(x[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	u.clear();
	u=FFT(pr,m,true);
	for(int i=0;i<m;i++)
	{
		pr[i].y=0.0;
		if(y[i]) pr[i].x=1.0;
		else pr[i].x=0.0;
	}
	v.clear();
	v=FFT(pr,m,true);
	for(int i=0;i<m;i++) pr[i]=u[i]*v[i];
	r.clear();
	r=FFT(pr,m,false);
	for(int i=0;i<m;i++)
	{
		if(r[i].x>epsilon) x[i]=true;
		else x[i]=false;
	}
}
void Solve()
{
	int l=1;
	for(int i=0;i<n;i++) p[a[i]]=true;
	bool e=true;
	while(l<=k)
	{
		if((k&l)>0)
		{
			if(!e) Multiply(d,p,true);
			else
			{
				for(int i=0;i<=mm;i++) d[i]=p[i];
				e=false;
			}
		}
		Multiply(p,p,false);
		l=(l<<1);
	}
}
int main()
{
	t.resize(mm);
	PI=acos(-1);
	scanf("%d %d",&n,&k);
	for(int i=0;i<n;i++) scanf("%d",&a[i]);
	Solve();
	for(int i=1;i<=1000000;i++) if(d[i]) printf("%d ",i);
	return 0;
}