#include <bits/stdc++.h>
#pragma GCC optimize("fast-math")
using namespace std;
struct mycomplex {
  double re, im;
  mycomplex(double a, double b) { re = a, im = b; }
  mycomplex() {}
};
mycomplex operator*(const mycomplex& a, const mycomplex& b) {
  return {a.re * b.re - a.im * b.im, a.im * b.re + a.re * b.im};
}
mycomplex operator-(const mycomplex& a, const mycomplex& b) {
  return {a.re - b.re, a.im - b.im};
}
mycomplex operator+(const mycomplex& a, const mycomplex& b) {
  return {a.re + b.re, a.im + b.im};
}
const int inf = 1e9;
const long long INF = 1e18;
const long double PI = acos(-1);
const long double EPS = 1e-9;
const int MOD7 = 1000000007;
const int MOD9 = 1000000009;
mt19937 rnd(time(0) + 11239);
const int lgg = 20;
const int MAXN = (1 << lgg);
int n;
int rev[MAXN];
int tn;
mycomplex w[MAXN];
int tlgg;
void initFFT() {
  for (int i = 0; i < tn; ++i) {
    w[i] = mycomplex(cos(2 * PI * i / tn), sin(2 * PI * i / tn));
  }
  for (int i = 1; i < tn; ++i) {
    rev[i] = ((rev[i >> 1] >> 1) ^ ((i & 1) << (tlgg - 1)));
  }
}
void fft(mycomplex* A, bool invert) {
  for (int i = 0; i < tn; ++i)
    if (i < rev[i]) swap(A[i], A[rev[i]]);
  for (int l = 0; l < tlgg; ++l) {
    int len = (1 << l);
    for (int i = 0; i < tn; i += (len << 1)) {
      for (int x = 0; x < len; ++x) {
        mycomplex xx = A[i + x], yy = A[i + len + x] * w[x << (tlgg - 1 - l)];
        A[i + x] = xx + yy;
        A[i + x + len] = xx - yy;
      }
    }
  }
  if (invert) {
    reverse(A + 1, A + tn);
    for (int i = 0; i < tn; ++i) A[i].im /= tn;
  }
}
mycomplex fs[MAXN];
vector<int> mult(vector<int> a, vector<int> b) {
  tlgg = 0;
  while ((1 << tlgg) < a.size() + b.size()) ++tlgg;
  tn = (1 << tlgg);
  initFFT();
  for (int i = 0; i < tn; ++i) {
    fs[i] = mycomplex(0, 0);
    if (i < a.size()) fs[i].re = a[i];
    if (i < b.size()) fs[i].im = b[i];
  }
  fft(fs, 0);
  for (int i = 0; i < tn; ++i) fs[i] = fs[i] * fs[i];
  fft(fs, 1);
  vector<int> ans(tn);
  for (int i = 0; i < tn; ++i) ans[i] = (long long)(fs[i].im / (2) + 0.5);
  return ans;
}
vector<int> binpow(vector<int> a, int b) {
  vector<int> res = {1};
  while (b) {
    if (b & 1) {
      res = mult(res, a);
      for (int& i : res)
        if (i) i = 1;
    }
    a = mult(a, a);
    for (int& i : a)
      if (i) i = 1;
    b >>= 1;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  srand(time(NULL));
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (long long i = 0; i < a.size(); ++i) cin >> a[i];
  ;
  vector<int> poly(1001);
  for (int i : a) poly[i]++;
  auto xx = binpow(poly, k);
  for (int i = 1; i < xx.size(); ++i) {
    if (xx[i]) cout << i << ' ';
  }
}

### Prompt

Generate a CPP solution to the following problem:

A thief made his way to a shop.

As usual he has his lucky knapsack with him. The knapsack can contain k objects. There are n kinds of products in the shop and an infinite number of products of each kind. The cost of one product of kind i is ai.

The thief is greedy, so he will take exactly k products (it's possible for some kinds to take several products of that kind).

Find all the possible total costs of products the thief can nick into his knapsack.

Input

The first line contains two integers n and k (1 ≤ n, k ≤ 1000) — the number of kinds of products and the number of products the thief will take.

The second line contains n integers ai (1 ≤ ai ≤ 1000) — the costs of products for kinds from 1 to n.

Output

Print the only line with all the possible total costs of stolen products, separated by a space. The numbers should be printed in the ascending order.

Examples

Input

3 2
1 2 3


Output

2 3 4 5 6


Input

5 5
1 1 1 1 1


Output

5


Input

3 3
3 5 11


Output

9 11 13 15 17 19 21 25 27 33

### Response

```cpp
#include <bits/stdc++.h>
#pragma GCC optimize("fast-math")
using namespace std;
struct mycomplex {
  double re, im;
  mycomplex(double a, double b) { re = a, im = b; }
  mycomplex() {}
};
mycomplex operator*(const mycomplex& a, const mycomplex& b) {
  return {a.re * b.re - a.im * b.im, a.im * b.re + a.re * b.im};
}
mycomplex operator-(const mycomplex& a, const mycomplex& b) {
  return {a.re - b.re, a.im - b.im};
}
mycomplex operator+(const mycomplex& a, const mycomplex& b) {
  return {a.re + b.re, a.im + b.im};
}
const int inf = 1e9;
const long long INF = 1e18;
const long double PI = acos(-1);
const long double EPS = 1e-9;
const int MOD7 = 1000000007;
const int MOD9 = 1000000009;
mt19937 rnd(time(0) + 11239);
const int lgg = 20;
const int MAXN = (1 << lgg);
int n;
int rev[MAXN];
int tn;
mycomplex w[MAXN];
int tlgg;
void initFFT() {
  for (int i = 0; i < tn; ++i) {
    w[i] = mycomplex(cos(2 * PI * i / tn), sin(2 * PI * i / tn));
  }
  for (int i = 1; i < tn; ++i) {
    rev[i] = ((rev[i >> 1] >> 1) ^ ((i & 1) << (tlgg - 1)));
  }
}
void fft(mycomplex* A, bool invert) {
  for (int i = 0; i < tn; ++i)
    if (i < rev[i]) swap(A[i], A[rev[i]]);
  for (int l = 0; l < tlgg; ++l) {
    int len = (1 << l);
    for (int i = 0; i < tn; i += (len << 1)) {
      for (int x = 0; x < len; ++x) {
        mycomplex xx = A[i + x], yy = A[i + len + x] * w[x << (tlgg - 1 - l)];
        A[i + x] = xx + yy;
        A[i + x + len] = xx - yy;
      }
    }
  }
  if (invert) {
    reverse(A + 1, A + tn);
    for (int i = 0; i < tn; ++i) A[i].im /= tn;
  }
}
mycomplex fs[MAXN];
vector<int> mult(vector<int> a, vector<int> b) {
  tlgg = 0;
  while ((1 << tlgg) < a.size() + b.size()) ++tlgg;
  tn = (1 << tlgg);
  initFFT();
  for (int i = 0; i < tn; ++i) {
    fs[i] = mycomplex(0, 0);
    if (i < a.size()) fs[i].re = a[i];
    if (i < b.size()) fs[i].im = b[i];
  }
  fft(fs, 0);
  for (int i = 0; i < tn; ++i) fs[i] = fs[i] * fs[i];
  fft(fs, 1);
  vector<int> ans(tn);
  for (int i = 0; i < tn; ++i) ans[i] = (long long)(fs[i].im / (2) + 0.5);
  return ans;
}
vector<int> binpow(vector<int> a, int b) {
  vector<int> res = {1};
  while (b) {
    if (b & 1) {
      res = mult(res, a);
      for (int& i : res)
        if (i) i = 1;
    }
    a = mult(a, a);
    for (int& i : a)
      if (i) i = 1;
    b >>= 1;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  srand(time(NULL));
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (long long i = 0; i < a.size(); ++i) cin >> a[i];
  ;
  vector<int> poly(1001);
  for (int i : a) poly[i]++;
  auto xx = binpow(poly, k);
  for (int i = 1; i < xx.size(); ++i) {
    if (xx[i]) cout << i << ' ';
  }
}

```