#include <bits/stdc++.h>
using i64 = long long;
void solve() {
int n, m;
std::cin >> n >> m;
std::vector<int> a(n), b(m);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
for (int i = 0; i < m; i++) {
std::cin >> b[i];
}
std::sort(a.begin(), a.end());
std::sort(b.begin(), b.end());
bool ok = true;
int dif = 0;
for (int i = n - 1, j = m - 1; j >= 0; j--, i--) {
ok &= (a[i] <= b[j]);
dif += b[j] - a[i];
}
if (!ok || dif > n - m) {
std::cout << -1 << "\n";
return;
}
int r = n - m - dif;
for (int i = 0; i < r; i++) {
ok &= (a[i] + 1 <= b[0]);
}
if (!ok) {
std::cout << -1 << "\n";
return;
}
std::vector<int> ans;
for (int i = 0; i < r; i++) {
ans.emplace_back(a[i]);
}
for (int j = 0, i = n - m; j < m; j++, i++) {
for (int v = a[i]; v < b[j]; v++) {
ans.emplace_back(v);
}
}
std::multiset<int> Sa(a.begin(), a.end()), Sb(b.begin(), b.end());
for (auto &x : ans) {
ok &= Sa.contains(x);
Sa.extract(x);
Sa.insert(x + 1);
Sa.erase(Sa.begin());
}
ok &= (Sa == Sb);
if (!ok) {
std::cout << -1 << "\n";
return;
}
std::cout << ans.size() << "\n";
for (int i = 0; i < ans.size(); i++) {
std::cout << ans[i] << " \n"[i == ans.size() - 1];
}
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}