#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 10;
const double PI = 3.141592653589793238;
long long int FFT_N = 0;
vector<complex<double> > omega;
void init_fft(long long int n) {
  FFT_N = n;
  omega.resize(n);
  double angle = 2 * PI / n;
  for (long long int i = 0; i < n; i++) {
    omega[i] = complex<double>(cos(i * angle), sin(i * angle));
  }
}
void fft(vector<complex<double> > &a) {
  long long int n = a.size();
  if (n == 1) return;
  long long int half = n >> 1;
  vector<complex<double> > even(half), odd(half);
  for (long long int i = 0, j = 0; i < n; i += 2, j++) {
    even[j] = a[i];
    odd[j] = a[i + 1];
  }
  fft(even);
  fft(odd);
  long long int denominator = FFT_N / n;
  for (long long int i = 0; i < half; i++) {
    complex<double> cur = odd[i] * omega[i * denominator];
    a[i] = even[i] + cur;
    a[i + half] = even[i] - cur;
  }
}
void multiply(vector<long long int> &a, vector<long long int> &b,
              vector<long long int> &res) {
  vector<complex<double> > fa(a.begin(), a.end());
  vector<complex<double> > fb(b.begin(), b.end());
  long long int n = 1;
  while (n < 2 * max(a.size(), b.size())) n <<= 1;
  fa.resize(n);
  fb.resize(n);
  init_fft(n);
  fft(fa);
  fft(fb);
  for (long long int i = 0; i < n; i++) fa[i] = conj(fa[i] * fb[i]);
  fft(fa);
  res.resize(n);
  for (long long int i = 0; i < n; i++) {
    res[i] = (long long)(fa[i].real() / n + 0.5);
    res[i] = min(res[i], 1ll);
  }
}
long long int k, q, curlen, idx = 0;
long long int a[N], f[N];
vector<long long int> poly(1001, 0);
vector<long long int> poly_expo(vector<long long int> &p, long long int n) {
  vector<long long int> res = p;
  n--;
  while (n > 0) {
    if (n % 2) {
      vector<long long int> temp;
      multiply(res, p, temp);
      res = temp;
    }
    vector<long long int> temp;
    multiply(p, p, temp);
    p = temp;
    n /= 2;
  }
  return res;
}
long long int n;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    f[a[i]]++;
  }
  for (long long int i = 1; i <= 1000; i++) {
    if (f[i]) {
      poly[i] = 1;
    }
  }
  vector<long long int> ans = poly_expo(poly, k);
  for (long long int i = 0; i < ans.size(); i++)
    if (ans[i] > 0 && i > 0) cout << i << " ";
}

### Prompt

Your challenge is to write 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>
using namespace std;
const long long int N = 1e5 + 10;
const double PI = 3.141592653589793238;
long long int FFT_N = 0;
vector<complex<double> > omega;
void init_fft(long long int n) {
  FFT_N = n;
  omega.resize(n);
  double angle = 2 * PI / n;
  for (long long int i = 0; i < n; i++) {
    omega[i] = complex<double>(cos(i * angle), sin(i * angle));
  }
}
void fft(vector<complex<double> > &a) {
  long long int n = a.size();
  if (n == 1) return;
  long long int half = n >> 1;
  vector<complex<double> > even(half), odd(half);
  for (long long int i = 0, j = 0; i < n; i += 2, j++) {
    even[j] = a[i];
    odd[j] = a[i + 1];
  }
  fft(even);
  fft(odd);
  long long int denominator = FFT_N / n;
  for (long long int i = 0; i < half; i++) {
    complex<double> cur = odd[i] * omega[i * denominator];
    a[i] = even[i] + cur;
    a[i + half] = even[i] - cur;
  }
}
void multiply(vector<long long int> &a, vector<long long int> &b,
              vector<long long int> &res) {
  vector<complex<double> > fa(a.begin(), a.end());
  vector<complex<double> > fb(b.begin(), b.end());
  long long int n = 1;
  while (n < 2 * max(a.size(), b.size())) n <<= 1;
  fa.resize(n);
  fb.resize(n);
  init_fft(n);
  fft(fa);
  fft(fb);
  for (long long int i = 0; i < n; i++) fa[i] = conj(fa[i] * fb[i]);
  fft(fa);
  res.resize(n);
  for (long long int i = 0; i < n; i++) {
    res[i] = (long long)(fa[i].real() / n + 0.5);
    res[i] = min(res[i], 1ll);
  }
}
long long int k, q, curlen, idx = 0;
long long int a[N], f[N];
vector<long long int> poly(1001, 0);
vector<long long int> poly_expo(vector<long long int> &p, long long int n) {
  vector<long long int> res = p;
  n--;
  while (n > 0) {
    if (n % 2) {
      vector<long long int> temp;
      multiply(res, p, temp);
      res = temp;
    }
    vector<long long int> temp;
    multiply(p, p, temp);
    p = temp;
    n /= 2;
  }
  return res;
}
long long int n;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    f[a[i]]++;
  }
  for (long long int i = 1; i <= 1000; i++) {
    if (f[i]) {
      poly[i] = 1;
    }
  }
  vector<long long int> ans = poly_expo(poly, k);
  for (long long int i = 0; i < ans.size(); i++)
    if (ans[i] > 0 && i > 0) cout << i << " ";
}

```