#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
const int N = 2e5 + 11, mod = 1e9 + 7, mod2 = 998244353;
const int MAX = 1e5 + 11;
const int INF1 = 2e9 + 11;
const ll INF2 = 6e18 + 11;
const double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-4;
const double PI = acos(-1.0);
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int te, a[11111], k, pref[11111], n;
bool us[111];
int main() {
  if (fopen("threesum"
            ".in",
            "r"))
    freopen(
        "threesum"
        ".in",
        "r", stdin),
        freopen(
            "threesum"
            ".out",
            "w", stdout);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> te;
  while (te--) {
    cin >> n >> k;
    bool flag = 0;
    set<int> st;
    for (int i = 1; i <= n; i += 1) {
      cin >> a[i];
      st.insert(a[i]);
    }
    if (st.size() > k) {
      cout << "-1\n";
      continue;
    }
    int cur = 1;
    for (auto it : st) {
      a[cur] = it;
      ++cur;
      if (cur == k + 1) break;
    }
    if (cur <= k) {
      for (int i = cur; i <= k; i += 1) a[i] = a[1];
    }
    for (int i = k + 1; i <= n * n; i += 1) {
      a[i] = a[i - k];
    }
    n *= n;
    cout << n << "\n";
    for (int i = 1; i <= n; i += 1) cout << a[i] << " ";
    cout << "\n";
  }
  return 0;
}
