#include <bits/stdc++.h>
using namespace std;
int a[101];
int main() {
  int t, n, n0, k, x;
  cin >> t;
  while (t--) {
    cin >> n >> k;
    bool d[101] = {0}, b = 1;
    int ans[k];
    for (int i = 0; i < k; i++) ans[i] = 1;
    for (int i = 0, j = 0; i < n; i++) {
      cin >> a[i];
      if (!d[a[i]] && b) {
        if (j >= k)
          b = 0;
        else
          ans[j++] = a[i];
      }
      d[a[i]] = 1;
    }
    if (!b)
      cout << -1;
    else {
      n0 = 0;
      for (int i = 0; i < n; n0++) {
        if (a[i] == ans[n0 % k]) i++;
      }
      cout << n0 << "\n";
      for (int i = 0; i < n0; i++) cout << ans[i % k] << " ";
    }
    cout << "\n";
  }
}
