Phoenix loves beautiful arrays. An array is beautiful if all its subarrays of length $k$ have the same sum. A subarray of an array is any sequence of consecutive elements.

Phoenix currently has an array $a$ of length $n$. He wants to insert some number of integers, possibly zero, into his array such that it becomes beautiful. The inserted integers must be between $1$ and $n$ inclusive. Integers may be inserted anywhere (even before the first or after the last element), and he is not trying to minimize the number of inserted integers.


-----Input-----

The input consists of multiple test cases. The first line contains an integer $t$ ($1 \le t \le 50$) — the number of test cases.

The first line of each test case contains two integers $n$ and $k$ ($1 \le k \le n \le 100$).

The second line of each test case contains $n$ space-separated integers ($1 \le a_i \le n$) — the array that Phoenix currently has. This array may or may not be already beautiful.


-----Output-----

For each test case, if it is impossible to create a beautiful array, print -1. Otherwise, print two lines.

The first line should contain the length of the beautiful array $m$ ($n \le m \le 10^4$). You don't need to minimize $m$.

The second line should contain $m$ space-separated integers ($1 \le b_i \le n$) — a beautiful array that Phoenix can obtain after inserting some, possibly zero, integers into his array $a$. You may print integers that weren't originally in array $a$.

If there are multiple solutions, print any. It's guaranteed that if we can make array $a$ beautiful, we can always make it with resulting length no more than $10^4$.


-----Example-----
Input
4
4 2
1 2 2 1
4 3
1 2 2 1
3 2
1 2 3
4 4
4 3 4 2

Output
5
1 2 1 2 1
4
1 2 2 1
-1
7
4 3 2 1 4 3 2


-----Note-----

In the first test case, we can make array $a$ beautiful by inserting the integer $1$ at index $3$ (in between the two existing $2$s). Now, all subarrays of length $k=2$ have the same sum $3$. There exists many other possible solutions, for example:   $2, 1, 2, 1, 2, 1$  $1, 2, 1, 2, 1, 2$ 

In the second test case, the array is already beautiful: all subarrays of length $k=3$ have the same sum $5$.

In the third test case, it can be shown that we cannot insert numbers to make array $a$ beautiful.

In the fourth test case, the array $b$ shown is beautiful and all subarrays of length $k=4$ have the same sum $10$. There exist other solutions also.

Difficulty: MEDIUM
Tags: Greedy algorithms

Sorting

Data structures

Constructive algorithms
Skill types: Sorting

Data structures

Greedy algorithms

Starter code:

Solutions:
def pho(n, k, a):
	aset = set(a)
	if len(aset) > k:
		print(-1)
	elif len(aset) == k:
		print(n * k)
		aset = list(aset)
		for i in range(n):
			for j in range(k):
				print(aset[j], end=' ')
		print()
	else:
		ns = []
		for x in range(1, k + 1):
			ns.append(x)
		q = 0
		while len(aset) != k:
			aset.add(ns[q])
			q += 1
		aset = list(aset)
		print(n * k)
		for i in range(n):
			for j in range(k):
				print(aset[j], end=' ')
		print()
t = int(input())
l = []
for i in range(t):
	(n, k) = list(map(int, input().split()))
	l1 = list(map(int, input().split()))
	l.append([n, k, l1])
for j in l:
	pho(j[0], j[1], j[2])


t = int(input())
for w in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		u = []
		for i in range(len(l)):
			for j in range(len(s)):
				u.append(str(s[j]))
			for j in range(k - len(s)):
				u.append(str(1))
		lg = len(u)
		f = ' '.join(u)
		print(lg)
		print(f)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	x = sorted(list(set(a)))
	s = len(x)
	if k < s:
		print(-1)
	else:
		print(k * n)
		diff = k - s
		x.extend([i for i in range(1, min(1 + diff, x[0]))])
		diff -= x[0] - 1
		for i in range(s - 1):
			if diff <= 0:
				break
			if x[i + 1] - x[i] - 1 > 0:
				x.extend([i for i in range(x[i] + 1, x[i] + 1 + min(x[i + 1] - x[i] - 1, diff))])
				diff -= x[i + 1] - x[i] - 1
		if diff > 0:
			x.extend([i + x[s - 1] for i in range(1, diff + 1)])
		x.sort()
		temp = [str(i) for i in x]
		st = ' '.join(temp) + ' '
		print(st * n)


for i in range(int(input())):
	(n, k) = [int(i) for i in input().split(' ')]
	arr = [int(i) for i in input().split(' ')]
	s = set(arr)
	if len(s) > k:
		print(-1)
	else:
		temp = ' '.join([str(i) for i in s] + ['1'] * (k - len(s)))
		result = ''
		print(n * k)
		for i in range(n):
			result += temp + ' '
		print(result)


T = int(input())
for t in range(T):
	(N, K) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	dic = {}
	for i in range(N):
		if a[i] in dic:
			dic[a[i]] += 1
		else:
			dic[a[i]] = 1
	keys = list(dic.keys())
	keys = keys + [1] * (K - len(keys))
	if len(keys) > K:
		print(-1)
		continue
	print(100 * K)
	for i in range(100):
		for key in keys:
			print(key, end=' ')
	print()


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	set_arr = set(arr)
	arr_unique = list(set_arr)
	if len(set_arr) > k:
		print(-1, end=' ')
	elif len(set_arr) == k:
		print(k * len(arr))
		for elm in arr:
			print(' '.join(map(str, arr_unique)), end=' ')
	else:
		print(k * len(arr))
		for elm in arr:
			print(' '.join(map(str, arr_unique)) + (k - len(arr_unique)) * (' ' + str(arr_unique[0])), end=' ')
	print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	a = set(arr)
	if n == k:
		print(n)
		print(*arr)
	elif len(a) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for x in a:
				print(x, end=' ')
			for j in range(k - len(a)):
				print(1, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	sl = len(set(a))
	if n == 1:
		print(1)
		print(*a)
	elif k == 1:
		if len(set(a)) == 1:
			print(n)
			print(*a)
		else:
			print(-1)
	elif n == k:
		print(n)
		print(*a)
	elif k < sl:
		print(-1)
	else:
		d = k - sl
		b = list(set(a))
		le = len(b)
		if d == 0:
			b = b * n
			print(len(b))
			print(*b)
		else:
			c = 0
			for i in range(1, n + 1):
				if i not in b:
					b.append(i)
					c += 1
				if c == d:
					break
			b = b * n
			print(len(b))
			print(*b)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	L = [int(x) for x in input().split()]
	l = set(L)
	if len(l) > k:
		print(-1)
	else:
		val = k - len(l)
		print(n * k)
		for j in range(n):
			for i in l:
				print(i, end=' ')
			for k in range(val):
				print('1', end=' ')
		print('')


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
MAX_LEN = 10000
for case in range(itg()):
	(n, k) = mpint()
	arr = list(mpint())
	if n == k:
		print(n)
		print(*arr)
		continue
	kind = set(arr)
	if len(kind) <= k:
		arr = list(kind)
		if len(arr) != k:
			for i in range(1, n + 1):
				if i not in kind:
					arr.append(i)
				if len(arr) == k:
					break
		arr *= MAX_LEN // len(arr) + 1
		arr = arr[:MAX_LEN]
		print(MAX_LEN)
		print(*arr)
	else:
		print(-1)


for T in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	diff = []
	for i in range(n):
		if a[i] not in diff:
			diff.append(a[i])
	if len(diff) > k:
		print(-1)
	elif n == k or len(diff) == 1:
		print(n)
		print(' '.join([str(i) for i in a]))
	else:
		if len(diff) < k:
			for i in range(1, n + 1):
				if i not in diff:
					diff.append(i)
				if len(diff) == k:
					break
		diff.sort()
		ans = [str(diff[i]) for i in range(len(diff))]
		finalAns = [ans * n]
		print(len(finalAns[0]))
		print(' '.join(finalAns[0]))


import sys
sys.setrecursionlimit(2000)
from collections import Counter
from functools import reduce
t = [int(val) for val in sys.stdin.readline().split()][0]
for test in range(t):
	(n, k) = [int(val) for val in sys.stdin.readline().split()]
	a = [int(val) for val in sys.stdin.readline().split()]
	if len(set(a)) > k:
		print(-1)
		continue
	c = 1
	u = set(a)
	while len(u) < k:
		u.add(c)
		c += 1
	u = sorted(list(u))
	print(len(a) * k)
	for i in range(len(a)):
		for val in u:
			print(val, end=' ')
	print('')


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(n, k) = int_array()
	a = int_array()
	unique = len(set(a))
	if unique > k:
		print(-1)
	else:
		tset = list(set(a))
		rem = {i for i in range(1, 101)}.difference(set(tset))
		tset = tset + list(rem)[:k - len(tset)]
		maxcount = 10000 // len(tset)
		ans = maxcount * tset
		print(len(ans))
		print(*ans)


def solve(n, k, arr):
	arr_set_list = list(set(arr))
	if k < len(arr_set_list):
		return '-1'
	while k - len(arr_set_list) > 0:
		for i in range(1, n + 1):
			if i not in arr_set_list:
				arr_set_list.append(i)
				break
	arr_set_list.sort()
	result = []
	for _ in range(n):
		result += arr_set_list
	return '{}\n{}'.format(len(result), ' '.join(map(str, result)))
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	result = solve(n, k, arr)
	print(result)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(set(map(int, input().split())))
	if len(a) > k:
		print('-1')
	else:
		print(n * k)
		print(*(a + [1] * (k - len(a))) * n)


q = int(input())

def cant(s, n, k):
	u = [True] * n
	c = 0
	for i in range(n):
		if u[s[i] - 1]:
			c += 1
			u[s[i] - 1] = False
	if c > k:
		return True
	return False
for _ in range(q):
	(n, k) = map(int, input().split())
	s = [int(i) for i in input().split()]
	if cant(s, n, k):
		print(-1)
		continue
	u = [True] * n
	us = []
	for i in range(n):
		if u[s[i] - 1]:
			u[s[i] - 1] = False
			us.append(s[i])
	while len(us) < k:
		us.append(1)
	print(n * k)
	for j in range(n):
		for i in range(k):
			print(us[i], end=' ')
	print()


import math as mt
import sys, string, bisect
input = sys.stdin.readline
print = sys.stdout.write
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
t = I()
ans = 0
for j in range(t):
	(n, k) = M()
	l = L()
	x = len(set(l))
	if x > k:
		print(str(-1))
		print('\n')
	else:
		w = set(l)
		i = 1
		while len(w) != k:
			w.add(i)
			i += 1
		print(str(n * k) + '\n')
		for i in range(n):
			for j in w:
				print(str(j) + ' ')
		print('\n')


def prob(l, k):
	s1 = set(l)
	if len(s1) > k:
		return '-1'
	newl = []
	l1 = list(s1)
	i = 0
	while len(l1) < k:
		l1.append(l1[i])
		i += 1
	bigl = l1 * len(l)
	return f"{len(bigl)}\n{' '.join([str(i) for i in bigl])}"
n = int(input())
for i in range(n):
	(n, k) = input().split()
	l = input().split()
	l = [int(i) for i in l]
	k = int(k)
	print(prob(l, k))


from collections import Counter
for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	if k < len(Counter(arr)):
		print(-1)
		continue
	ans = []
	posl = list(Counter(arr).keys())
	if len(posl) < k:
		posl += [1] * (k - len(posl))
	for _ in range(len(arr)):
		ans += posl
	print(len(ans))
	print(' '.join(map(str, ans)))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	st = input()
	arr = []
	for x in st.split():
		arr.append(int(x))
	dist = set(arr)
	if len(dist) > k:
		print('-1')
	else:
		temp = 1
		while len(dist) != k:
			temp -= 1
			temp += 1
			if temp not in dist:
				dist.add(temp)
			temp += 1
		req = list(reversed(sorted(list(dist))))
		req = list(reversed(req))
		ind = 0
		ans = []
		i = 0
		while i < n:
			if arr[i] == req[ind]:
				i += 1
			ans.append(str(req[ind]))
			ind = (ind + 1) % len(req)
		ans_final = ''
		for x in ans:
			ans_final += str(x) + ' '
		print(len(ans))
		print(' '.join(ans))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(set(a))
	b_len = len(b)
	if b_len > k:
		print(-1)
	else:
		b += [1 for i in range(k - b_len)]
		b = b[:] * n
		print(len(b))
		print(*b, sep=' ')


t = int(input())
for i in range(t):
	l = list()
	x = set()
	flag = 0
	s = ''
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	for i in range(0, n):
		x.add(a[i])
	if len(x) > k:
		print('-1')
	elif len(x) == k:
		print(n * k)
		for i in x:
			s = s + str(i) + ' '
		print(s * n)
	else:
		print(n * k)
		for i in range(k - len(x)):
			s += '1 '
		for i in x:
			s = s + str(i) + ' '
		print(s * n)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def sieve_of_eratosthenes(n):
	ans = []
	arr = [1] * (n + 1)
	(arr[0], arr[1], i) = (0, 0, 2)
	while i * i <= n:
		if arr[i] == 1:
			j = i + i
			while j <= n:
				arr[j] = 0
				j += i
		i += 1
	for k in range(n):
		if arr[k] == 1:
			ans.append(k)
	return ans

def nc2(x):
	if x == 1:
		return 0
	else:
		return x * (x - 1) // 2
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	check = set(map(int, input().split()))
	if len(check) > k:
		print(-1)
	else:
		check = list(check)
		print(n * k)
		for i in range(n):
			print(*check, end=' ')
			for j in range(k - len(check)):
				print(1, end=' ')
		print('')


import sys
from collections import defaultdict
from copy import copy
R = lambda t=int: t(input())
RL = lambda t=int: [t(x) for x in input().split()]
RLL = lambda n, t=int: [RL(t) for _ in range(n)]

def solve():
	(n, k) = RL()
	A = RL()
	x = sorted(set(A))
	if len(x) > k:
		print(-1)
		return
	x += [1] * (k - len(x))
	x = sorted(x) * n
	print(len(x))
	print(' '.join(map(str, x)))
T = R()
for _ in range(T):
	solve()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = len(a)
	a = list(set(a))
	unique = len(a)
	if unique > k:
		print(-1)
	else:
		print(k * l)
		res = ' '.join(map(str, (a + [1] * (k - unique)) * l))
		print(res)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	a = []
	for i in range(n + 1):
		a.append(0)
	for i in range(n):
		a[l[i]] = 1
	c = a.count(1)
	if c > k:
		print(-1)
	else:
		if c != k:
			for i in range(1, n + 1):
				if a[i] == 0:
					a[i] = 1
					c += 1
				if c == k:
					break
		print(k * n)
		for j in range(n):
			for i in range(1, n + 1):
				if a[i] == 1:
					print(i, end=' ')
		print()


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = set(a)
	z = k - len(b)
	x = []
	for i in b:
		x.append(i)
	for i in range(1, n + 1):
		if z == 0:
			break
		if i not in x:
			x.append(i)
			z -= 1
	x.sort()
	if k >= len(b):
		print(k * n)
		x *= n
		print(*x)
	else:
		print(-1)


t = int(input())
for frfr in range(t):
	k = True
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	s = list()
	c = False
	for i in range(n):
		if n % m != 0 or a[i] != a[i % m]:
			k = False
		if a[i] not in s:
			if len(s) == m:
				print(-1)
				c = True
				break
			s.append(a[i])
	if not k:
		for e in s:
			if e > n:
				print(-1)
				c = True
		if c:
			continue
		else:
			print(n * m)
			for jkjk in range(n):
				for e in s:
					print(e, end=' ')
				if m - len(s) > 0:
					for o in range(m - len(s)):
						print(s[0], end=' ')
	else:
		print(n)
		for e in a:
			print(e, end=' ')
	print()


t = int(input())
while t > 0:
	t = t - 1
	(n, k) = map(int, input().split())
	a = input()
	A = list(map(int, list(a.split())))
	d = {}
	e = []
	c = 0
	for i in A:
		if i not in d:
			d[i] = 1
			e.append(i)
			c = c + 1
	if c > k:
		print(-1)
	else:
		print(n * k)
		for i in range(1, n + 1):
			for j in e:
				print(j, end=' ')
			for i in range(c, k):
				print(1, end=' ')
		print()


from collections import *
from bisect import *
from math import *
import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	r = []
	flag = 0
	s = set()
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	setsum = sum(s)
	r = list(s)
	for i in range(1, n + 1):
		if i not in s:
			if len(s) == k:
				break
			s.add(i)
			r.append(i)
	r.sort()
	check = sum(r)
	p = len(r)
	cc = 0
	while len(r) != n * k:
		r.append(r[cc])
		cc += 1
	print(len(r))
	print(*r)


n = int(input())
for i in range(n):
	(m, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr_template = list(set(arr))
	if len(arr_template) > k:
		print(-1)
		continue
	arr_template += [1] * (k - len(arr_template))
	ans = arr_template * len(arr)
	print(len(ans))
	print(' '.join(map(str, ans)))


t = int(input())
for __ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ass = list(set(a))
	if len(ass) > k:
		print(-1)
		continue
	for i in range(k - len(ass)):
		ass.append(1)
	ass = ass * n
	print(len(ass))
	print(*ass)


R = lambda : map(int, input().split())
(t,) = R()
exec(t * 'n,k=R();a=*{*R()},;print(*([n*k,*(a*k)[:k]*n],[-1])[len(a)>k]);')


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		p = list(s)
		while len(p) < k:
			p.append(1)
		print(n * k)
		for i in a:
			for j in p:
				print(j, end=' ')
		print()


T = int(input())
for _ in range(T):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	Dict = {}
	for i in arr:
		if i not in Dict:
			Dict[i] = 1
		else:
			Dict[i] += 1
	if len(Dict) < k:
		for i in range(1, n + 1):
			if len(Dict) == k:
				break
			if i not in Dict:
				Dict[i] = 1
	if len(Dict) <= k:
		Str = ''
		for i in Dict:
			Str += str(i) + ' '
		A = 10000 // k
		Str = Str * A
		print(A * k)
		print(Str)
	else:
		print(-1)


test = int(input())
for i in range(test):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	have = set()
	for j in arr:
		have.add(j)
	if len(have) > k:
		print(-1)
	else:
		s = 1
		while len(have) < k:
			have.add(s)
			s += 1
		print(n * k)
		for i in range(n):
			for j in have:
				print(j, end=' ')


import os
from collections import Counter

def f(arr, k):
	c = Counter(arr)
	if len(c) > k:
		return -1
	items = list(c) + [1] * (k - len(c))
	return items * len(arr)

def pp(input):
	n_test = int(input())
	for i in range(n_test):
		(n, k) = map(int, input().split())
		arr = list(map(int, input().split()))
		r = f(arr, k)
		if r == -1:
			print(r)
		else:
			print(len(r))
			print(' '.join(map(str, r)))
if 'paalto' in os.getcwd():
	from string_source import string_source
	s1 = string_source('4\n4 2\n1 2 2 1\n4 3\n1 2 2 1\n3 2\n1 2 3\n4 4\n4 3 4 2')
	pp(s1)
else:
	pp(input)


from collections import Counter
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = Counter(a)
	if len(b) > k:
		print(-1)
	else:
		print(k * len(a))
		print(*(list(b.keys()) + [a[0]] * (k - len(b))) * len(a))


for i in range(0, int(input())):
	(n, k) = [int(t) for t in input().split()]
	temp = [int(t) for t in input().split()]
	arr = []
	for i in temp:
		if i not in arr:
			arr.append(i)
	if len(arr) > k:
		print(-1)
		continue
	print(n * k)
	for i in range(0, n):
		for a in arr:
			print(a, end=' ')
		for j in range(0, k - len(arr)):
			print('1', end=' ')
	print('')


import sys
stdin = sys.stdin
ns = lambda : stdin.readline().rstrip()
ni = lambda : int(stdin.readline().rstrip())
nm = lambda : list(map(int, stdin.readline().split()))
nl = lambda : list(map(int, stdin.readline().split()))

def solve():
	(n, k) = nm()
	a = nl()
	if k < len(set(a)):
		print(-1)
		return
	f = list(set(a))
	f += [1] * (k - len(f))
	f *= n
	print(len(f))
	print(*f)
	return
t = ni()
for _ in range(t):
	solve()


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(N, K) = MAP()
	A = LIST()
	S = set(A)
	M = len(S)
	if M > K:
		print(-1)
		continue
	seg = list(S) + [1] * (K - M)
	ans = seg * N
	print(len(ans))
	print(*ans)


I = input
t = int(I())
for _ in range(t):
	(n, k) = map(int, I().split())
	a = list(set(map(int, I().split())))
	if len(a) > k:
		print(-1)
		continue
	if len(a) < k:
		a += [1] * (k - len(a))
	print(len(a * n))
	print(*a * n, sep=' ')


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	v = [0] * n
	p = 0
	a = list(map(int, input().split()))
	for i in a:
		if not v[i - 1]:
			p += 1
		v[i - 1] += 1
	if p > k:
		print(-1)
	elif p == 1:
		print(n)
		print(*a)
	else:
		s = list(set(a))
		m = s * (k // p) + s[:k % p]
		print(len(m) * n)
		print(*m * n)


t = int(input())
while t > 0:
	t -= 1
	nk = input().split()
	n = int(nk[0])
	k = int(nk[1])
	list1 = []
	dict1 = {}
	num = input().split()
	for i in range(0, n):
		list1.append(int(num[i]))
		p = num[i]
		if p in dict1:
			dict1[p] += 1
		else:
			dict1[p] = 1
	ans = []
	for i in dict1:
		ans.append(i)
	x = len(dict1)
	if x > k:
		print(-1)
	else:
		for i in range(1, n + 1):
			if k == x:
				break
			if i not in dict1:
				ans.append(i)
				x += 1
		print(k * n)
		for i in range(0, n):
			for j in range(0, len(ans)):
				print(ans[j], end=' ')
		print('', end='\n')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		d = {}
		ans = []
		for i in range(n):
			if a[i] not in d:
				d[a[i]] = 1
				ans.append(a[i])
			else:
				break
		for el in s:
			if el not in d:
				ans.append(el)
		ans += [1] * (k - len(ans))
		ind = 0
		while i < n:
			if a[i] == ans[ind]:
				ans.append(a[i])
				i += 1
				ind += 1
			else:
				ans.append(ans[ind])
				ind += 1
		print(len(ans))
		print(*ans)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set()
	l = []
	for x in a:
		if x in s:
			continue
		s.add(x)
		l.append(x)
	if len(l) > k:
		print(-1)
		continue
	l += [1] * (k - len(l))
	print(k * n)
	print(*l * n)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	for i in range(ip()):
		(n, k) = ei()
		li = ai()
		d = Counter(li)
		val = d.values()
		z = list(d.keys())
		if len(z) > k:
			print(-1)
			continue
		while len(z) != k:
			z.append(1)
		ans = z * n
		print(len(ans))
		print(*ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
ip = lambda : int(sys.stdin.readline().rstrip('\r\n'))
ai = lambda : list(map(int, sys.stdin.readline().split()))
ei = lambda : map(int, sys.stdin.readline().split())
main()


from sys import stdin, stdout
Pi = lambda x: stdout.write(str(x) + '\n')
Ps = lambda x: stdout.write(str(x))
S = lambda x: x * (x + 1) // 2
I = lambda x: 1 + 2 * x
R = lambda : stdin.readline()
Ri = lambda x: map(int, x.split())
Rs = lambda x: map(str, x.split())
Rf = lambda x: map(float, x.split())
MaxN = int(1000.0) + 5

def f(dp, n):
	mn = 1
	while 1:
		k = 1
		good = 1
		while n - 2 * k >= 0 and good:
			if mn == 2 * dp[n - k] - dp[n - 2 * k]:
				good = 0
			k += 1
		if good:
			return mn
		mn += 1

def main():
	t = int(R())
	for i in range(t):
		(n, k) = Ri(R())
		A = list(Ri(R()))
		C = set(A)
		if len(C) <= k:
			for i in range(1, n + 1):
				if len(C) == k:
					break
				if i not in C:
					C.add(i)
			B = []
			for i in range(n * k):
				for x in C:
					B.append(x)
			pos = 0
			for i in range(n * k):
				if A[pos] == B[i]:
					pos += 1
				if pos == n:
					pos = i + 1
					break
			B = B[:pos]
			Pi(len(B))
			for x in B:
				Ps(str(x) + ' ')
			Ps('\n')
		else:
			Pi(-1)
main()


from sys import exit, stdin, stdout
import math
from collections import Counter

def main():
	T = int(input())
	for _ in range(T):
		(n, k) = [int(i) for i in input().split()]
		a = [int(i) for i in input().split()]
		raz = Counter(a)
		if len(raz.keys()) > k:
			print(-1)
			continue
		kek = list(raz.keys())
		while len(kek) < k:
			kek.append(1)
		arr = n * kek
		print(len(arr))
		print(' '.join([str(i) for i in arr]))
main()


num_test = int(input())
for i in range(num_test):
	(n, k) = [int(x) for x in input().split()]
	inp_arr_set = set(input().split())
	nunique = len(inp_arr_set)
	if k < nunique:
		print(-1)
	else:
		print(k * n)
		sub_str = ' '.join(inp_arr_set)
		sub_str = f"{sub_str}{' 1' * (k - nunique)}"
		print(f'{sub_str} ' * n)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	pre = [0] * n
	dist = 0
	m = 0
	toprint = []
	for i in arr:
		pre[i - 1] += 1
	for i in range(n):
		m = max(pre[i], m)
		if pre[i] != 0:
			toprint.append(i + 1)
			dist += 1
	if k < dist:
		print(-1)
		continue
	for i in range(k - dist):
		toprint.append(1)
	print(k * n)
	for i in range(n):
		for j in toprint:
			print(j, end=' ')
	print()


T = int(input())
for case in range(T):
	(n, k) = [int(x) for x in input().split()]
	ls = [int(x) for x in input().split()]
	s = set(ls)
	while len(s) < k:
		for i in range(1, 101):
			if i not in s:
				s.add(i)
				break
	s = list(s)
	if len(s) > k:
		print(-1)
		continue
	else:
		out = ''
		i = 0
		for _ in range(k * 100):
			out += str(s[i])
			out += ' '
			i += 1
			if i == k:
				i = 0
		out = out[:-1]
		print(len(out.split(' ')))
		print(out)


t = int(input())
for i in range(0, t):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	l = list(map(int, input().strip().split()))
	s = set(l)
	if len(s) > k:
		print('-1')
	else:
		l1 = list(s)
		z = len(l1)
		while z < k:
			l1.append(1)
			z += 1
		print(n * k)
		print(*l1 * n)


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	lst = input().split()
	st = list({key: 1 for key in lst})
	if len(st) > k:
		print(-1)
	else:
		st += [st[0]] * (k - len(st))
		print(n * k)
		print(' '.join(st * n))


(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, dgraphs, mod) = (lambda : sorted(zz()), {}, 10 ** 9 + 7)
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	(n, m) = zz()
	l = list(set(zz()))
	if len(l) > m:
		print(-1)
		continue
	print(n * m)
	print(*(l + [n] * (m - len(l))) * n)


import collections
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = collections.defaultdict(int)
	v = collections.defaultdict(int)
	left = 0
	l = []
	p = []
	s = 0
	c = 0
	m = 0
	f = 0
	for i in range(n):
		if a[i] not in v:
			v[a[i]] += 1
			f += 1
			p.append(a[i])
	if f > k:
		print(-1)
	else:
		arr = p + a
		for i in range(n + f):
			if i < k:
				d[arr[i]] += 1
				l.append(arr[i])
			elif arr[i] in d:
				if l[left] == arr[i]:
					l.append(arr[i])
					left += 1
				else:
					while l[left] != arr[i]:
						l.append(l[left])
						left += 1
					l.append(arr[i])
					left += 1
			else:
				c = 1
				break
		if c == 1:
			print(-1)
		else:
			print(len(l))
			print(*l)


def to_list(s):
	return list(map(lambda x: int(x), s.split(' ')))

def solve(a, k):
	if len(set(a)) <= k:
		distinct_numbers = list(set(a))
		while len(distinct_numbers) < k:
			distinct_numbers.append(1)
		result_array = distinct_numbers * len(a)
		print(len(result_array))
		print(' '.join(list(map(lambda x: str(x), result_array))))
	else:
		print(-1)
t = int(input())
for i in range(t):
	(n, k) = to_list(input())
	a = to_list(input())
	solve(a, k)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = set(l)
	if len(l1) > k:
		print(-1)
	else:
		l1 = list(l1)
		l2 = []
		for i in range(k):
			l2.append(l1[i % len(l1)])
		print(len(l2) * n)
		for i in range(n):
			for i in range(len(l2)):
				print(l2[i], end=' ')
		print()


def solve(n, k, a):
	diff = list(set(a))
	if len(diff) > k:
		print(-1)
	else:
		while len(diff) < k:
			diff.append(1)
		print(n * k)
		print(*diff * n)
test_cases = int(input())
for _ in range(test_cases):
	((n, k), a) = (map(int, input().split()), list(map(int, input().split())))
	solve(n, k, a)


import sys
import math
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	x = set({})
	xx = []
	for i in a:
		if not i in x:
			x.add(i)
			xx.append(i)
	if len(x) > k:
		print(-1)
		continue
	arr = []
	j = 0
	for i in xx:
		if a[j] == i:
			j += 1
		arr.append(i)
	while len(arr) < k:
		arr.append(a[j])
		j += 1
	while j < n and len(arr) <= 10000:
		arr.append(arr[-k])
		if arr[-1] == a[j]:
			j += 1
	if len(arr) <= 10000:
		print(len(arr))
		for i in arr:
			print(i, end=' ')
		print()
	else:
		print(-1)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		ans = []
		for i in l:
			for j in s:
				ans.append(j)
			for j in range(k - len(s)):
				ans.append(1)
		print(len(ans))
		print(*ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

def main():
	for _ in range(N()):
		(n, k) = RL()
		arr = RLL()
		li = list(set(arr))
		if len(li) > k:
			print(-1)
		else:
			while len(li) < k:
				li += li
			res = li[:k] * n
			print(len(res))
			print(*res)
main()


t = int(input())
for test in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	u = len(set(a))
	if u > k:
		print(-1)
	else:
		s = list(set(a))
		while len(s) < k:
			s.append(s[-1])
		arr = []
		for i in range(n):
			arr.extend(s)
		print(len(arr))
		print(*arr)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split(' '))
	arr = list(map(int, input().split()))
	x = list(set(arr))
	if len(x) <= k:
		if len(x) != k:
			q = k - len(x)
			a = [1] * q
			x = x + a
		ans = x * n
		print(len(ans))
		print(*ans)
	else:
		print(-1)


for v in range(int(input())):
	(n, k) = map(int, input().split())
	x = [int(w) for w in input().split()]
	c = list(set(x))
	if len(c) > k:
		print(-1)
	else:
		while len(c) < k:
			c.append(c[0])
		ans = c * n
		print(len(ans))
		print(*ans)


from sys import stdin, stdout
from math import *
for __ in range(int(input())):
	(n, m) = map(int, input().split())
	ar = list(map(int, input().split()))
	dif = 0
	d = {}
	a = []
	for i in range(n):
		if d.get(ar[i]) == None:
			dif += 1
			d[ar[i]] = 1
			a.append(ar[i])
	if dif > m:
		print(-1)
	else:
		for i in range(dif, m):
			a.append(i)
		print(10000)
		for i in range(10000):
			print(a[i % m], end=' ')


t = int(input())
for i in range(t):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	a = input().split()
	if len(set(a)) > k:
		print('-1')
	else:
		a = list(set(a))
		strin = ''
		for el in a:
			strin = strin + el + ' '
		for j in range(k - len(a)):
			strin = strin + a[0] + ' '
		print(k * n)
		print(strin * n)


t = int(input(''))
while t:
	t -= 1
	[n, k] = list(map(int, input().split()))
	arr = set(list(map(int, input().split())))
	if len(arr) > k:
		print(-1)
		continue
	for i in range(1, n + 2):
		if len(arr) < k:
			arr.add(i)
	print(n * k)
	sol = []
	for i in range(n):
		for j in arr:
			sol.append(j)
	print(*sol)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		M = set(a)
		for i in range(1, n + 1):
			if len(M) == k:
				break
			if i not in M:
				M.add(i)
		d = list(M)
		d *= 100
		print(len(d))
		print(*d)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		while len(s) < k:
			s.append(s[0])
		p = s * n
		print(len(p))
		print(*p)


def main():
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		print_l = []
		unique = set()
		order = []
		for i in range(n):
			if a[i] in unique:
				continue
			unique.add(a[i])
			order.append(a[i])
		lu = len(unique)
		if lu > k:
			print(-1)
			continue
		for i in range(n):
			for j in range(lu):
				print_l.append(str(order[j]))
			for kk in range(1, k - lu + 1):
				print_l.append(str(kk))
		print(len(print_l))
		print(' '.join(print_l))
main()


def mult_input():
	return map(int, input().split())

def list_input():
	return list(map(int, input().split()))
for nt in range(int(input())):
	(n, k) = mult_input()
	l = list_input()
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		d = {}
		ans = []
		for i in range(n):
			if l[i] not in d:
				ans.append(l[i])
				d[l[i]] = 1
			if len(ans) == k:
				break
		while len(ans) != k:
			ans.append(1)
		print(k * 100)
		print(*ans * 100)


def phoenix(n, k, a):
	aset = set(a)
	if len(aset) > k:
		print(-1)
		return
	elif len(aset) == k:
		print(n * k)
		ans = list(aset)
		for j in range(n):
			for i in range(k):
				print(ans[i], end=' ')
		print()
		return
	else:
		newset = []
		for x in range(1, k + 1):
			newset.append(x)
		i = 0
		while len(aset) != k:
			aset.add(newset[i])
			i += 1
		print(n * k)
		aset = list(aset)
		for j in range(n):
			for i in range(k):
				print(aset[i], end=' ')
		print()
		return
t = int(input())
array = []
for i in range(t):
	(n, k) = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	array.append([n, k, a])
for x in array:
	phoenix(*x)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	nums = list(set(a))
	if len(nums) > k:
		print(-1)
	else:
		nums = nums + [1] * (k - len(nums))
		print(len(nums) * len(a))
		print(' '.join(map(str, nums * len(a))))


from collections import defaultdict
from math import ceil
from operator import itemgetter

def main():
	t = int(input())
	for _ in range(1, t + 1):
		(n, k) = [int(i) for i in input().split(' ')]
		a = [int(i) for i in input().split(' ')]
		d = defaultdict(lambda : 0)
		for i in a:
			d[i] += 1
		if len(d) > k:
			print(-1)
			continue
		md = max(d.items(), key=itemgetter(1))[1]
		v = [0] * k
		j = 0
		for i in d.keys():
			v[j] = i
			j += 1
		i = 1
		while j < k and i <= n:
			if i not in d:
				v[j] = i
				j += 1
			i += 1
		l = n * k
		s = [0] * l
		for i in range(l):
			s[i] = v[i % k]
		print(l)
		print(*s)
main()


I = input
for _ in range(int(I())):
	(n, m) = map(int, I().split())
	s = set(map(int, I().split()))
	if len(s) > m:
		print(-1)
	else:
		print(n * m)
		print(*(list(s) + [1] * (m - len(s))) * n)


def solve(n, k, arr):
	block = []
	for i in range(n):
		if arr[i] not in block:
			block.append(arr[i])
	if len(block) > k:
		print(-1)
		return
	elif len(block) < k:
		for i in range(k - len(block)):
			block.append(1)
	ans = block * n
	print(len(ans))
	print(*ans)
numcases = int(input())
for i in range(numcases):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	solve(n, k, arr)


for _ in range(int(input())):
	(n, k) = [int(s) for s in input().split()]
	arr = [int(s) for s in input().split()]
	freq = {}
	temp = []
	for i in range(n):
		if arr[i] not in freq:
			freq[arr[i]] = 1
			temp.append(arr[i])
	if len(temp) > k:
		print(-1)
		continue
	add = 1
	count = len(temp)
	while count < k:
		if add in freq:
			add += 1
		else:
			temp.append(add)
			add += 1
			count += 1
	s = ''
	for i in temp:
		s += str(i) + ' '
	print(k * n)
	print(s * n)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	a = list(set(a))
	if len(a) > k:
		print(-1)
		continue
	b = []
	for i in range(n):
		b = b + a + (k - len(a)) * [1]
	print(len(b))
	print(*b)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = set(map(int, input().split()))
	if len(a) > k:
		print(-1)
	else:
		print(n * k)
		for j in n * (list(a) + [1] * (k - len(a))):
			print(j, end=' ')


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))[:N]
	s = set(A)
	if len(s) > K:
		print(-1)
	else:
		print(N * K)
		for i in range(N):
			print(*s, end=' ')
			for j in range(K - len(s)):
				print(1, end=' ')
		print('')


from collections import OrderedDict
t = int(input())
for _ in range(t):
	z = input().split()
	n = int(z[0])
	k = int(z[1])
	z = input().split()
	arr = [int(a) for a in z]
	dict1 = OrderedDict()
	for i in range(len(arr)):
		if arr[i] not in dict1:
			dict1[arr[i]] = 1
	if len(dict1.keys()) > k:
		print(-1)
	else:
		m = len(dict1.keys())
		i = 1
		while m != k:
			if i not in dict1:
				dict1[i] = 1
				m += 1
			i += 1
		dict2 = {}
		for i in range(len(arr)):
			if arr[i] not in dict2:
				dict2[arr[i]] = 1
			else:
				dict2[arr[i]] += 1
		x = max(dict2.values())
		print(n * len(dict1.keys()))
		s = ''
		for i in range(n):
			for j in list(dict1.keys()):
				s += str(j) + ' '
		print(s)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	se = set(ar.copy())
	l1 = len(ar)
	l2 = len(se)
	if l2 > k:
		print(-1)
	elif l2 < k:
		li = []
		for i in se:
			li.append(i)
		xx = k - l2
		for i in range(xx):
			li.append(ar[0])
		li = li * l1
		print(k * l1)
		print(*li)
	else:
		li = []
		for i in se:
			li.append(i)
		li = li * l1
		print(l1 * l2)
		print(*li)


for i in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	data = list(set([int(x) for x in input().split()]))
	if len(data) > k:
		print(-1)
	else:
		print(k * n)
		data += [1] * (k - len(data))
		print(*data * n)


t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	reg = [0] * n
	bucket = [0] * n
	for i in range(n):
		bucket[a[i] - 1] = 1
	total = sum(bucket)
	if total > k:
		print(-1)
		continue
	elif k == n:
		print(n)
		for x in a:
			print(x, end=' ')
		print()
		continue
	for i in range(n):
		if bucket[i] == 1:
			continue
		elif total > k:
			bucket[i] = 1
			total += 1
	i = 0
	while i < k:
		if reg[a[i] - 1] == 0:
			reg[a[i] - 1] = 1
		else:
			for j in range(n):
				if bucket[j] != reg[j]:
					a.insert(i, j + 1)
					i += 1
			break
		i += 1
	j = 0
	i = k
	while i < len(a):
		if a[j] != a[i]:
			a.insert(i, a[j])
		i += 1
		j += 1
	print(len(a))
	for x in a:
		print(x, end=' ')
	print()


from collections import Counter
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	arr = list(dict.fromkeys(arr))
	nu = len(arr)
	if nu > k:
		print(-1)
	else:
		print(int(10000.0))
		co = nu
		for j in range(1, n + 1):
			if co == k:
				break
			if j in arr:
				pass
			else:
				arr.append(j)
				co += 1
		for j in range(int(10000.0)):
			print(arr[j % k], end=' ')
		print()


(z, zz) = (input, lambda : list(map(int, z().split())))
fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	(n, k) = zz()
	arr = zzz()
	t = list(set(arr))
	if len(t) > k:
		print(-1)
		continue
	d = t * 100
	print(n * k, '\n', *d[:k] * n)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = list(set(a))
	if len(s) > k:
		print(-1)
		continue
	j = 0
	i = k
	a = s + a
	while 1:
		while a[i] != a[j]:
			a.insert(i, a[j])
			j = j + 1
			i = i + 1
		i = i + 1
		j = j + 1
		if i == len(a):
			break
	print(len(a))
	print(*a, sep=' ')


import sys, os
from math import sqrt, gcd, ceil, log, floor, sin, pi
from math import factorial as fact
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
from itertools import permutations
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def main():
	ans_ = []
	for _ in range(int(input())):
		(n, k) = read()
		arr = read()
		c = Counter(arr)
		arr = list(c.keys()) + [1] * (k - len(c))
		if len(c) > k:
			ans_.append(-1)
		else:
			ans_.append(n * k)
			ans_.append(' '.join((' '.join(map(str, j)) for j in [arr for i in range(n)])))
	for i in ans_:
		print(i)
main()


def main():
	for i in range(int(input())):
		(arrayLength, subArrayLength) = map(int, input().split())
		array = input().split()
		elements = set(array)
		print(createBeautifulArray(arrayLength, subArrayLength, elements))

def createBeautifulArray(arrayLength, subArrayLength, elements):
	nElements = len(elements)
	if nElements > subArrayLength:
		return -1
	subArray = ' '.join(elements) + ' 1' * (subArrayLength - nElements)
	return f"{arrayLength * subArrayLength}\n{' '.join((subArray,) * arrayLength)}"
main()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		vals = set(a)
		for i in range(1, n + 1):
			if len(vals) < k:
				vals.add(i)
		vals = list(vals)
		ans = []
		for i in range(n):
			for j in range(k):
				ans.append(vals[j])
		print(len(ans))
		print(*ans)


import sys, math, cmath, time
start_time = time.time()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def solve():
	(n, k) = invr()
	a = inlt()
	qw = []
	if len(set(a)) > k:
		print(-1)
	else:
		q = 0
		w = 0
		for i in range(len(a) - 1):
			if a[i] > a[i + 1]:
				q = q + 1
			else:
				w = w + 1
		qq = list(set(a))
		qq.append(n + 1)
		qq.sort()
		qqww = len(qq)
		if k > qqww - 1:
			cc = k - qqww + 1
			c = 0
			i = 0
			j = 0
			while i < n + 1 and j < qqww + 1:
				if c >= cc:
					break
				if qq[j] > i + 1:
					qqwwqqww = 0
					while i + 1 < qq[j]:
						if c >= cc:
							qqwwqqww = 1
							break
						qq.append(i + 1)
						c = c + 1
						i = i + 1
					if qqwwqqww == 1:
						break
				j = j + 1
				i = qq[j - 1]
		qq.pop(qqww - 1)
		qq.sort()
		qqww = len(qq)
		qw = []
		if q < w:
			for i in range(10000 // qqww):
				qw += qq
		else:
			qq.reverse()
			for i in range(10000 // qqww):
				qw += qq
		qq = counter(a)
		ww = counter(qw)
		qwqw = 0
		for i in range(min(len(qq), len(ww))):
			if qq[i] > ww[i]:
				qwqw = 1
				print(-1)
				break
		if qwqw == 0:
			print(len(qw))
			print(*qw)

def main():
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
	sys.stdout.close()

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	base = list(set(arr))
	if len(base) > k:
		print(-1)
		continue
	base.extend((k - len(base)) * [1])
	ans = list()
	idx = 0
	rot_idx = 0
	while idx < len(arr):
		ans.append(base[rot_idx])
		if base[rot_idx] == arr[idx]:
			idx += 1
		rot_idx = (rot_idx + 1) % len(base)
	print(len(ans))
	print(*ans)


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = defaultdict()
	for x in a:
		d[x] = 1
	t = len(d)
	if t > k:
		print(-1)
	else:
		c = list(d.keys()) + [1] * (k - t)
		print(len(c) * n)
		print(*c * n)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	j = 0
	for i in range(n):
		if len(set(arr)) > k:
			print(-1)
			j += 1
			break
	if j != 1:
		a = set(arr)
		arr1 = list(a)
		x = 1
		arr1.extend([x] * (k - len(arr1)))
		print(n * k)
		for z in range(n):
			for j in range(len(arr1)):
				print(arr1[j], end=' ')


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	fl = [0] * k
	s = sum(l[:k])
	f = list(set(l))
	ls = len(f)
	oa = f
	flag = 0
	if ls > k:
		print('-1')
	else:
		g = [f[0]] * (k - ls)
		if len(g) != 0:
			oa = oa + g
		for i in range(0, n - k + 1):
			if s != sum(l[i:i + k]):
				flag = 1
		if flag == 0:
			print(n)
			print(*l)
		else:
			c = 1
			for i in range(n - 1):
				if l[i + 1] <= l[i]:
					c += 1
			oa = oa * 100
			print(len(oa))
			print(*oa)


a = int(input())
for i in range(0, a):
	(n, k) = map(int, input().split())
	b = list(map(int, input().split()))
	c = []
	d = []
	mx = 0
	for j in range(0, n):
		if j + 1 in b:
			c.append(j + 1)
		if b[j] not in d:
			d.append(b[j])
	for j in range(0, n):
		if mx < b.count(j + 1):
			mx = b.count(j + 1)
	if len(c) > k:
		print(-1)
	else:
		e = []
		for jj in range(0, k):
			e.append(d[jj % len(d)])
		print(n * len(e))
		for jjj in range(0, n):
			for kkk in range(0, len(e)):
				print(e[kkk], end=' ')
		print()


R = lambda : map(int, input().rstrip().split())
from collections import Counter
for _ in range(int(input())):
	(n, k) = R()
	a = list(R())
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		i = 1
		while len(s) < k:
			while i < 1000:
				if i not in s:
					s.add(i)
					break
				i += 1
		s.remove(a[0])
		ans = [a[0]] + list(s)
		flag = 0
		if len(s) == 0 and n > 1:
			i = 1
			while i < n:
				ans.append(a[0])
				i += 1
			flag = 1
		i = 0
		j = 1
		while i < n - 1 and flag == 0:
			if ans[j] == a[i + 1]:
				i += 1
			ans.append(ans[j - 1])
			j += 1
		print(len(ans))
		print(*ans)


import math
t = int(input())
for i in range(t):
	l1 = list(map(int, input().split()))
	n = l1[0]
	k = l1[1]
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		print(*(s + [1] * (k - len(s))) * n)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	flag = 0
	c = list(set(a))
	if len(c) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for elem in c:
				print(elem, end=' ')
			for j in range(k - len(c)):
				print(1, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = map(int, input().split())
	seta = set(a)
	if len(seta) > k:
		print(-1)
	else:
		print(k * n)
		a = []
		for i in range(n):
			for j in range(k - len(seta)):
				a += [1]
			a += list(seta)
		print(' '.join((str(t) for t in a)))


_IS_DEBUG_MODE = False

def Problem():
	if _IS_DEBUG_MODE == True:
		testcaseList = []
		testcaseList.append([4, 2, [1, 2, 2, 1]])
		testcaseList.append([4, 3, [1, 2, 2, 1]])
		testcaseList.append([3, 2, [1, 2, 3]])
		testcaseList.append([4, 4, [4, 3, 4, 2]])
	else:
		t = int(input())
		testcaseList = []
		for testcaseIndex in range(t):
			(n, k) = list(map(int, input().split()))
			a = list(map(int, input().split()))
			testcaseList.append([n, k, a])
	return testcaseList

def Solver(testcaseList):
	for (n, k, a) in testcaseList:
		if _IS_DEBUG_MODE == True:
			print('testcase', n, k, a)
		elementList = list(set(a))
		if _IS_DEBUG_MODE == True:
			print('unique elements', elementList)
		if len(elementList) > k:
			print(-1)
		else:
			for i in range(k - len(elementList)):
				elementList.append(elementList[-1])
			if _IS_DEBUG_MODE == True:
				print('elementList', elementList)
			m = []
			nextElementIndex = 0
			while len(a) > 0:
				m.append(elementList[nextElementIndex])
				if m[-1] == a[0]:
					del a[0]
				nextElementIndex += 1
				if nextElementIndex >= len(elementList):
					nextElementIndex = 0
			print(len(m))
			print(' '.join(list(map(str, m))))
if _IS_DEBUG_MODE == True:
	import time
	startTime = time.time()
testcaseList = Problem()
Solver(testcaseList)
if _IS_DEBUG_MODE == True:
	endTime = time.time()
	print('time', endTime - startTime)


z = int(input())
for h in range(z):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	cnt = 1
	b = a.copy()
	b.sort()
	m = [b[0]]
	for i in range(1, n):
		if b[i] != b[i - 1]:
			cnt += 1
			m.append(b[i])
	if cnt > k:
		print(-1)
	else:
		print(n * k)
		x = k - cnt
		ans = []
		for i in range(x):
			m.append(1)
		for i in range(n):
			for j in range(k):
				print(m[j], end=' ')
		print()


t = int(int(input()))
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	l = []
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		d = {}
		for i in s:
			d[i] = 0
		for i in range(len(a)):
			d[a[i]] = d[a[i]] + 1
		for i in range(len(a)):
			if d[a[i]] >= 1:
				l.append(a[i])
				d[a[i]] = 0
		for i in range(k - len(l)):
			l.append(1)
		print(n * k)
		for i in range(n - 1):
			for i in range(k):
				print(l[i], end=' ')
		for i in range(k - 1):
			print(l[i], end=' ')
		print(l[k - 1])


for _ in ' ' * int(input()):
	(a, b) = map(int, input().split())
	z = list(map(int, input().split()))
	k = set(z)
	if len(k) > b:
		print(-1)
		continue
	print(a * b)
	k = list(k) + [1] * (b - len(k))
	print(*k * a)


import sys
from math import gcd, sqrt
from typing import DefaultDict
sys.setrecursionlimit(10 ** 5)
inf = float('inf')
en = lambda x: list(enumerate(x))
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())

def solve():
	(n, k) = r()
	a = rr()
	arr = list(set(a))
	if len(arr) > k:
		print(-1)
		return
	ok = DefaultDict(lambda : 0)
	for i in arr:
		ok[i] = 1
	k -= len(arr)
	for i in range(1, n + 1):
		if not k:
			break
		if not ok[i]:
			k -= 1
			arr += (i,)
	print(n * len(arr))
	print(*arr * n)
for _ in range(ii()):
	solve()


t = int(input())
for tt in range(t):
	(n, k) = map(int, input().split())
	l = set((int(x) for x in input().split()))
	if len(l) > k:
		print(-1)
	else:
		print(n * k)
		l = list(l)
		for i in range(k - len(l)):
			l.append(1)
		l = l * n
		print(*l)


for i in range(int(input())):
	(n, k) = input().split()
	(n, k) = (int(n), int(k))
	l = set(map(int, input().split()))
	if len(l) > k:
		print(-1)
	else:
		print(n * k)
		print(*(list(l) + [1] * (k - len(l))) * n)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
from io import BytesIO
for t in range(int(input())):
	(n, k) = map(int, input().split())
	arrayB = input().split()
	setValue = set()
	for i in range(len(arrayB)):
		arrayB[i] = int(arrayB[i])
		setValue.add(arrayB[i])
	if len(setValue) > k:
		print(-1)
	else:
		arraValue = []
		for i in setValue:
			arraValue.append(i)
		print(n * k)
		for i in range(n):
			for j in range(k):
				if j < len(arraValue):
					print(arraValue[j], end=' ')
				else:
					print(arraValue[0], end=' ')
		print('\n', end='')


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cases = int(input())
for t in range(cases):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	a1 = set(a)
	la1 = len(a1)
	if la1 > k:
		print(-1)
	else:
		a1 = list(a1)
		if la1 < k:
			app = k - la1
			v = [a1[-1]] * app
			a1 = a1 + v
			la1 += app
		b = a1 * n
		print(la1 * n)
		print(*b)


import sys
from collections import defaultdict
input = sys.stdin.readline

def print_result(l):
	return print(' '.join(map(str, l)))

def is_beautiful(arr, k):
	flag = True
	s = sum(arr[:k])
	for i in range(len(arr) - k + 1):
		temp = 0
		for j in range(k):
			temp += arr[i + j]
		if temp != s:
			flag = False
			break
	return flag

def timer(function):
	import time

	def wrapper(*args, **kwargs):
		t1 = time.time()
		val = function()
		t2 = time.time()
		print('Executed \\{}\\ in {:.2f} seconds.'.format(function.__name__, t2 - t1))
		return val
	return wrapper
MAX = int(10000.0)
MAX = int(10000.0)

def solve():
	(n, k) = map(int, input().split(' '))
	arr = [int(x) for x in input().split(' ')]
	d = defaultdict(int)
	for ele in arr:
		d[ele] += 1
	if len(d.keys()) > k:
		print(-1)
	else:
		l = list(d.keys())
		length_of_list = len(l)
		l *= k // length_of_list
		if k % length_of_list != 0:
			l += l[:k % length_of_list]
		res = l * (MAX // len(l))
		print(len(res))
		print(*res)
t = int(input())
for _ in range(t):
	solve()


def solve():
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print('-1')
		return
	base = list(set(a))
	while len(base) < k:
		base.append(1)
	f = base * n
	print(len(f))
	print(' '.join(map(str, f)))
T = int(input())
for _ in range(T):
	solve()


from collections import Counter
import math
mod = 10 ** 9 + 7
for i in range(int(input())):
	(n, k) = map(int, input().split())
	arr = [int(i) for i in input().split()]
	x = sorted(list(set(arr)))
	if len(x) > k:
		print(-1)
	else:
		if len(x) < k:
			i = 1
			while len(x) != k:
				if i not in x:
					x.append(i)
				i += 1
			x.sort()
		print(k * 100)
		print(*x * 100)


import sys
import math
from functools import reduce
import bisect

def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def input():
	return sys.stdin.readline().rstrip()

def index(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	return False
for _ in range(int(input())):
	(n, k) = getNM()
	arr = getList()
	s = set()
	l = []
	for x in arr:
		if x in s:
			continue
		s.add(x)
		l.append(x)
	if len(l) > k:
		print(-1)
		continue
	l += [1] * (k - len(l))
	print(k * n)
	print(*l * n)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set(l)
	if len(s) > k:
		print(-1)
	else:
		l = list(s)
		if len(l) < k:
			l.extend([l[-1]] * (k - len(l)))
		l = l * n
		print(len(l))
		for i in l:
			print(i, end=' ')
		print()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	S = list(set(a))
	S.sort()
	comp = {i: e for (e, i) in enumerate(S)}
	distinct = max((comp[i] for i in comp))
	if distinct < k:
		res = [[-1 for i in range(k)] for j in range(100)]
		id = [0 for i in range(distinct + 1)]
		for i in range(n):
			ID = comp[a[i]]
			res[id[ID]][ID] = a[i]
			id[ID] += 1
		for i in range(k):
			if res[0][i] == -1:
				res[0][i] = n
		for i in range(k):
			for j in range(1, 100):
				res[j][i] = res[j - 1][i]
		ans = []
		for i in range(100):
			ans += res[i]
		print(len(ans))
		print(*ans)
	else:
		print(-1)


def beauty(n, k, array):
	s = set(array)
	if len(s) > k:
		print(-1)
		return
	L = list(s)
	L.extend([array[0]] * (k - len(s)))
	L *= n
	print(len(L))
	print(*L)
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	array = list(map(int, input().split()))
	beauty(n, k, array)


I = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(n, k) = I()
	l = I()
	x = set(l)
	if len(x) > k:
		print(-1)
	else:
		a = list(x)
		for i in range(k - len(x)):
			a.append(1)
		print(n * len(a))
		for i in range(n):
			print(*a, end=' ')
		print('')


t = int(input())
for i in range(t):
	(n, k) = input().split()
	(n, k) = (int(n), int(k))
	a = input().split()
	b = set(a)
	if len(b) > k:
		print(-1)
	else:
		x = list(b)
		for j in range(k - len(b)):
			x.append(1)
		x = x * n
		print(len(x))
		print(*x)


import sys
import math
from collections import defaultdict

def solve(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = set(a)
	res = []
	if len(b) > k:
		print(-1)
		return
	elif len(b) == k:
		res = list(b) * n
	else:
		mn = min(a)
		mx = max(a)
		l = k - len(b)
		res = list(b)
		for i in range(1, n + 1):
			if l == 0:
				break
			elif i in b:
				continue
			res.append(i)
			l -= 1
		res *= n
	print(len(res))
	res = list(map(str, res))
	print(' '.join(res))
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


test = int(input())
while test:
	test -= 1
	(n, k) = [int(i) for i in input().split()]
	v = list(map(int, input().strip().split()))
	t = []
	m = {}
	for i in range(0, n):
		if v[i] in m:
			m[v[i]] += 1
		else:
			m[v[i]] = 0
	if len(m) > k:
		print(-1, end=' ')
	else:
		for i in m:
			t.append(i)
		x = len(m)
		print(n * k)
		for i in range(0, n):
			for j in range(0, k):
				print(t[j % x], end=' ')
	print()


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	lis = list(map(int, input().split()))
	ses = list(set(lis))
	ses.sort()
	a = len(ses)
	ans = []
	if len(ses) > k:
		print(-1)
	else:
		for i in range(k - a):
			ses.append(2)
		for i in range(n):
			ans = ans + ses
		print(len(ans))
		print(' '.join(list(map(str, ans))))


from sys import stdin, stdout
import math
import heapq
t = 1

def aint():
	return int(input().strip())

def lint():
	return list(map(int, input().split()))

def fint():
	return list(map(int, stdin.readline().split()))

def main():
	(n, k) = lint()
	l = lint()
	s = set(l)
	sl = list(s)
	if len(s) > k:
		print('-1')
		return
	print(n * k)
	for i in range(n):
		for i in range(k):
			print(sl[i % len(sl)], end=' ')
	print('')
	return
t = int(input())
for i in range(t):
	main()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	D = list()
	X = set()
	M = list(map(int, input().split()))
	for j in range(n):
		if M[j] not in X:
			D.append(M[j])
			X.add(M[j])
	if len(D) > k:
		print(-1)
		continue
	else:
		print(k * n)
		for i in range(k - len(D)):
			D.append(1)
		print(' '.join([str(i) for i in D] * n))


import sys
import collections
sys.setrecursionlimit(10 ** 8)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def solve(n, k, a):
	ca = collections.Counter(a)
	if len(ca) > k:
		print(-1)
		return
	nextid = 1
	seen = set()
	uniq = []
	for (i, x) in enumerate(a):
		if x not in seen:
			uniq.append(x)
			seen.add(x)
			if len(seen) == len(ca):
				break
	assert len(uniq) == len(ca)
	while len(uniq) < k:
		while nextid in seen:
			nextid += 1
		uniq.append(nextid)
		seen.add(nextid)
	j = 0
	b = []
	while j < n:
		for x in uniq:
			b.append(x)
			if x == a[j]:
				j += 1
				if j == n:
					break
	print(len(b))
	print(*b)

def main():
	T = int(readline())
	for i in range(T):
		(n, k) = map(int, readline().split())
		assert 1 <= k <= n <= 100
		a = list(map(int, readline().split()))
		assert len(a) == n
		solve(n, k, a)
main()


import sys
import math as mt
input = sys.stdin.buffer.readline

def bin(n):
	l = [0] * 40
	ind = 39
	while n:
		l[ind] = n & 1
		n = n >> 1
		ind -= 1
	return l
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	(ch, ch1) = (0, 0)
	suma = sum(l[:k])
	for i in range(1, n - k + 1):
		if suma != sum(l[i:k + i]):
			ch = 1
	s = list(set(l))
	if len(s) > k:
		ch1 = 1
	if len(s) < k:
		for ____ in range(k - len(s)):
			s.append(1)
	if ch == 1:
		if ch1 == 0:
			print(n * len(s))
			for i in range(n):
				for j in s:
					print(j, end=' ')
			print()
		else:
			print(-1)
	else:
		print(n)
		for i in range(n):
			print(l[i], end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split(' ')))
	li = list(map(int, input().split(' ')))
	dic = {}
	for x in li:
		dic[x] = 0
	st = ''
	for x in dic.keys():
		st += str(x) + ' '
	size = len(dic)
	if size > k:
		print(-1)
	else:
		print(n * k)
		for x in range(n):
			print(st, '1 ' * (k - size), end='', sep='')
	print('')


for tc in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = []
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		m = n * k
		b = list(s)
		while len(b) < k:
			b.append(1)
		print(m)
		while n > 0:
			for i in b:
				print(i, end=' ')
			n = n - 1
		print('')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
t = ip()
for _ in range(t):
	(n, k) = inp()
	arr = list(inp())
	if len(set(arr)) > k:
		print(-1)
	else:
		sam = sorted(list(set(arr)))
		k -= len(sam)
		for i in range(1, n + 1):
			if k == 0:
				break
			if i not in sam:
				sam.append(i)
				k -= 1
		sam.sort()
		ans = sam * n
		print(len(ans))
		print(*ans)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = set(a)
	if len(b) > k:
		print(-1)
	else:
		b = list(b)
		if len(b) < k:
			m = k - len(b)
			b += [a[0]] * m
		print(n * k)
		print(*list(b) * n)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	p = set(l)
	if k < len(p):
		print(-1)
		continue
	else:
		print(n * k)
		p = list(p)
		p.sort()
		p.extend([1] * (k - len(p)))
		s = ' '.join(map(str, p))
		print((s + ' ') * n)


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		(n, k) = map(int, input().split())
		aa = [int(a) for a in input().split()]
		aar = list(set(aa))
		if len(aar) > k:
			print(-1)
			return
		aar += [1] * (k - len(aar))
		print(len(aar) * n)
		print(' '.join(map(str, aar * n)))
	q = int(input())
	for _ in range(q):
		solve()
main()


def make_beautiful(lst, k):
	counter = {}
	for elem in lst:
		counter[elem] = counter.get(elem, 0) + 1
	c = len(counter)
	if c > k:
		return None
	ans = list(counter.keys()) + [1] * (k - c)
	return ans * len(lst)
t = int(input())
for i in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	b = make_beautiful(a, k)
	if b is None:
		print(-1)
	else:
		print(len(b))
		print(*b, sep=' ')


t = int(input())
for i in range(t):
	(n, k) = [int(s) for s in input().split()]
	a = [int(s) for s in input().split()]
	b = []
	for i in range(n):
		if a[i] not in b:
			b.append(a[i])
	if len(b) > k:
		print(-1)
	else:
		while len(b) < k:
			b.append(b[0])
		print(k * n)
		print((' '.join(list(map(str, b))) + ' ') * n)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	table = [0 for _ in range(n + 1)]
	for aa in a:
		table[aa] += 1
	elements = [x for x in range(1, n + 1) if table[x] != 0]
	num = len(elements)
	if num > k:
		print(-1)
	else:
		print(k * n)
		for i in range(k - num):
			elements.append(1)
		t = ' '.join(map(str, sorted(elements)))
		ans = ''
		for i in range(n):
			ans += t
			if i != n - 1:
				ans += ' '
		print(ans)


import sys
t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		sb = list(set(a))
		if len(sb) == k:
			print(n * k)
			temp = sb * n
			print(*temp, sep=' ')
		else:
			ned = k - len(sb)
			while ned:
				ned -= 1
				sb.append(1)
			print(n * k)
			temp = sb * n
			print(*temp, sep=' ')


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	s = sorted(list(set(a)))
	l = []
	if len(s) > k:
		print(-1)
	else:
		if k == 1:
			print(n)
			print(*a)
			continue
		for i in range(1, k + 1):
			if len(s) == k:
				break
			if i not in s:
				s.append(i)
		s = sorted(s)
		for i in range(n):
			l.extend(s)
		print(len(l))
		print(*l)


def solve(n, k, a):
	items = []
	for ai in a:
		if ai not in items:
			items.append(ai)
	if len(items) > k:
		return -1
	if len(items) < k:
		for i in range(len(items), k):
			items.append(i)
	return items * n
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	beauty = solve(n, k, a)
	if beauty is -1:
		print(beauty)
	else:
		print(len(beauty))
		for b in beauty:
			print(b, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().strip().split())
	arr = list(map(int, input().strip().split()))
	s = set(arr)
	if k < len(s):
		print(-1)
		continue
	if k == len(s):
		ar1 = list(s)
	else:
		ar1 = list(s)
		m = len(ar1)
		i = 1
		while m != k:
			if i not in s:
				ar1.append(i)
				m += 1
			i += 1
	rep = k * n
	print(rep)
	for i in range(rep):
		print(ar1[i % k], end=' ')
	print()


t = int(input())
for g in range(0, t):
	nk = list(map(int, input().split()))
	n = nk[0]
	k = nk[1]
	a = list(map(int, input().split()))
	seta = set(a)
	if len(set(a)) > k:
		print(-1)
	else:
		seta = list(seta)
		for i in range(0, k - len(seta)):
			seta.append(1)
		print(k * n)
		for i in range(0, n):
			for j in range(0, k):
				print(seta[j], end=' ')
		print('')


def answer(n, k, A):
	r = set(A)
	if len(r) < k:
		x = k - len(r)
		i = 1
		while x > 0:
			if i not in r:
				r.add(i)
				x -= 1
			i += 1
	l = []
	index = 0
	d = {i: 0 for i in r}
	for i in range(k):
		if A[i] in l:
			index = i
			break
		else:
			l.append(A[i])
			d[A[i]] = 1
	if len(l) < k:
		y = k - len(l)
		for i in d.keys():
			if y == 0:
				break
			if d[i] == 0:
				l.append(i)
				y -= 1
	last = 0
	while index < n and last < len(l):
		if l[last] == A[index]:
			l.append(A[index])
			index += 1
			last += 1
		else:
			l.append(l[last])
			last += 1
	print(len(l))
	print(*l)
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if len(set(arr)) > m:
		print(-1)
	else:
		answer(n, m, arr)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	sa = list(set(a))
	if len(sa) > k:
		print(-1)
		continue
	print(n * k)
	ans = n * ([1] * (k - len(sa)) + [i for i in sa])
	print(' '.join(map(str, ans)))


test_case = int(input())
my_list = []
my_array = []
for i in range(test_case):
	my_list.append([int(j) for j in input().split()])
	my_array.append([int(k) for k in input().split()])
for x in range(test_case):
	arr = []
	a = 0
	for y in range(my_list[x][0]):
		if my_array[x][y] not in arr:
			a += 1
			arr.append(my_array[x][y])
	if a > my_list[x][1]:
		print(-1)
	else:
		for z in range(my_list[x][1] - a):
			a += 1
			arr.append(arr[z])
		print(a * my_list[x][0])
		for m in range(my_list[x][0]):
			for n in range(a):
				print(arr[n], end=' ')
		print()


a = int(input())
for j in range(a):
	(b, c) = map(int, input().split())
	d = list(map(int, input().split()))
	e = list(set(d))
	f = len(e)
	if f > c:
		print(-1)
		continue
	if b == c:
		print(b)
		print(*d)
	elif f < c:
		for j in range(c - f):
			e.append(1)
		print(b * c)
		print(*e * b)
	else:
		print(b * c)
		print(*e * b)


from collections import Counter
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	array = [int(x) for x in input().split()]
	unique = Counter(array)
	if len(unique) > k:
		print(-1)
	elif len(unique) == k:
		print(k * n)
		for i in range(n):
			for num in unique.keys():
				print(num, end=' ')
	else:
		print(k * n)
		list1 = [array[0]] * (k - len(unique)) + list(unique.keys())
		for i in range(n):
			for num in list1:
				print(num, end=' ')


import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	(n, k) = sep()
	a = lis()
	f = 0
	s = set(a)
	incl = [0] * (max(a) + 1)
	tamp = []
	for i in range(0, n):
		if incl[a[i]] == 0 and a[i] in s:
			tamp.append(a[i])
			incl[a[i]] = 1
	if len(s) > k:
		out(-1)
		nextline()
	elif len(tamp) == k:
		out(len(tamp * n))
		nextline()
		printlist(tamp * n)
		nextline()
	else:
		sexy = k // len(tamp) + 1
		tamp = (tamp * sexy)[:k]
		out(len(tamp * n))
		nextline()
		printlist(tamp * n)
		nextline()
testcase(int(inp()))


for _ in range(int(input())):
	X = list(map(int, input().split()))
	Numbers = list(map(int, input().split()))
	Temp = X[1]
	Sequence = []
	MyDict = {}
	MySet = list(sorted(set(Numbers), reverse=True))
	Size = len(MySet)
	Index = 0
	while Temp != 0:
		if Index == Size:
			MyDict[1] = 1
			Sequence.append(str(1))
		else:
			Sequence.append(str(MySet[Index]))
			MyDict[MySet[Index]] = 1
			Index += 1
		Temp -= 1
	Countinue = False
	for i in Numbers:
		if MyDict.get(i) == None:
			Countinue = True
			break
	if Countinue:
		print(-1)
		continue
	print(X[1] * X[0])
	print((' '.join(Sequence) + ' ') * X[0])


def solution():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set(l)
	if len(s) > k:
		print(-1)
		return
	d = {}
	a = []
	for i in range(n):
		if d.get(l[i], 0) == 0:
			a.append(l[i])
			d[l[i]] = 1
	j = 0
	while len(a) != k:
		a.append(1)
	j = 0
	a = a * n
	print(len(a))
	print(*a)
for _ in range(int(input())):
	solution()


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = defaultdict(int)
	for i in range(n):
		d[l[i]] += 1
	dl = len(d)
	if dl > k:
		print(-1)
	else:
		rl = list(d.keys())
		b = rl[len(rl) - 1]
		if dl < k:
			for i in range(k - dl):
				rl.append(b)
		rl = rl * n
		v = len(rl)
		print(v)
		for i in range(v):
			print(rl[i], end=' ')
		print()


t = int(input())
for test in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	distinct_nums = {}
	for i in range(len(a)):
		if a[i] in distinct_nums:
			distinct_nums[a[i]] += 1
		else:
			distinct_nums[a[i]] = 1
	x = len(list(distinct_nums.keys()))
	if x > k:
		print(-1)
		continue
	else:
		key_list = list(distinct_nums.keys())
		ans_arr = key_list + a
		start = 0
		end = k
		while end < len(ans_arr):
			if ans_arr[start] != ans_arr[end]:
				ans_arr.insert(end, ans_arr[start])
			start += 1
			end += 1
		print(len(ans_arr))
		for i in range(len(ans_arr)):
			print(ans_arr[i], end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	flag = n
	arr = list(map(int, input().split()))
	s = set(arr)
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		print(*(list(s) + [1] * (k - len(s))) * n)


t = int(input())
while t:
	(n, k) = map(int, input().split())
	l1 = list(map(int, input().split()))
	l2 = []
	x = set(l1)
	l = len(x)
	if l > k:
		print(-1)
	else:
		while x:
			l2.append(x.pop())
		if l == 100:
			temp = l2[-1]
			l2[-1] = l2[-2]
			l2[-2] = temp
		iterl1 = 0
		iterl2 = l
		while iterl1 < n:
			if iterl2 >= k:
				if l1[iterl1] == l2[iterl2 - k]:
					l2.append(l1[iterl1])
					iterl1 = iterl1 + 1
					iterl2 = iterl2 + 1
				else:
					l2.append(l2[iterl2 - k])
					iterl2 = iterl2 + 1
			else:
				l2.append(l1[iterl1])
				iterl1 = iterl1 + 1
				iterl2 = iterl2 + 1
		print(len(l2))
		print(*l2)
	t = t - 1


for t in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(set(list(map(int, input().split()))))
	ln = len(l)
	if ln > k:
		print(-1)
	else:
		l.extend((k - ln) * [1])
		print(n * k)
		for j in range(n):
			print(*l, end=' ')
		print()


import sys, collections
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	temp = list(set(arr))
	if len(temp) > k:
		print(-1)
		continue
	else:
		if len(temp) < k:
			temp += [1] * (k - len(temp))
		temp = temp * n
		print(len(temp))
		print(*temp)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	hh = [*map(int, input().split())]
	tt = 1
	if len(set(hh)) > k:
		print(-1)
	else:
		temp = list(set(hh))
		s = len(temp)
		anss = [temp[i % s] for i in range(k)] * n
		print(len(anss))
		print(*anss)


t = int(input())
for i in range(0, t, 1):
	(n, k) = [int(x) for x in input().split(' ')]
	list1 = list(map(int, input().split(' ')))
	maxi = set(list1)
	list1 = list(maxi)
	a = []
	if len(maxi) > k:
		print(-1)
	else:
		for i in range(0, len(list1), 1):
			a.append(list1[i])
		if len(list1) != k:
			for i in range(0, k - len(list1), 1):
				a.append(list1[0])
		print(k * n)
		for j in range(0, n, 1):
			for m in range(0, k, 1):
				print(a[m], end=' ')
		print()


import math
lol = math.sqrt(7)
num_test = int(input())
for i in range(num_test):
	(n, k) = [int(x) for x in input().split()]
	inp_arr_set = set(input().split())
	nunique = len(inp_arr_set)
	if k < nunique:
		print(-1)
	else:
		print(k * n)
		sub_str = ' '.join(inp_arr_set)
		sub_str = f"{sub_str}{' 1' * (k - nunique)}"
		print(f'{sub_str} ' * n)


for _ in ' ' * int(input()):
	(a, b) = map(int, input().split())
	c = list(set(map(int, input().split())))
	if len(c) > b:
		print(-1)
	else:
		print(a * b)
		print(*(c + [1] * (b - len(c))) * a)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(i) for i in input().rstrip()]
for _ in range(val()):
	(n, k) = li()
	arr = li()
	b = []
	ans = []
	d = Counter(arr)
	if k < len(d):
		print(-1)
		continue
	for i in range(n):
		if d[arr[i]]:
			b.append(arr[i])
			d[arr[i]] = 0
	while len(b) < k:
		b.append(1)
	curr = 0
	for i in range(n):
		while arr[i] != b[curr]:
			ans.append(b[curr])
			curr = (curr + 1) % k
		ans.append(arr[i])
		curr = (curr + 1) % k
	print(len(ans))
	print(*ans)


import sys
input = sys.stdin.readline
case = int(input())
for tt in range(case):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = set(a)
	if len(b) > k:
		print(-1)
		continue
	if len(b) < k:
		for i in range(1, n + 1):
			b.add(i)
			if len(b) == k:
				break
	print(len(b) * n)
	for c in range(n):
		print(*b, end=' ')
	print(end='\n')


t = int(input())
for ca in range(t):
	(n, m) = map(int, input().split())
	numbers = [int(i) for i in input().split()]
	numbers = list(set(numbers))
	if len(numbers) > m:
		print(-1)
	else:
		print(n * m)
		while len(numbers) < m:
			numbers.append(numbers[0])
		for i in n * numbers:
			print(i, end=' ')
		print('')


def uniq(input):
	output = []
	for x in input:
		if x not in output:
			output.append(x)
	return output
Q = int(input())
for i in range(Q):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	AA = uniq(A)
	if len(set(A)) > k:
		print(-1)
	else:
		ans = (AA + [1] * (k - len(AA))) * n
		print(len(ans))
		print(*ans)


def beautiful(arr, k):
	s = sum(arr[:k])
	bool = True
	for i in range(len(arr) - k + 1):
		if sum(arr[i:i + k]) != s:
			bool = False
			return False
	return True
for t in range(int(input())):
	(n, k) = map(int, input().split())
	array = list(map(int, input().split()))
	if beautiful(array, k):
		print(len(array))
		print(*array)
	elif k < len(set(array)):
		print(-1)
	else:
		answer = []
		subarray = []
		for i in set(array):
			subarray.append(i)
		for i in range(len(subarray), k):
			subarray.append(array[0])
		answer += subarray * n
		if len(answer) > 10000:
			print(-1)
		else:
			print(len(answer))
			print(*answer)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	s = [str(i) for i in s]
	s += [s[0]] * (k - len(s))
	print(k * n)
	res = (' '.join(s) + ' ') * n
	print(res[:-1])


t = int(input())
for _ in range(t):
	n_k = input()
	(n, k) = [int(s) for s in n_k.split()]
	a_str = input()
	a = [int(s) for s in a_str.split()]
	unique = set(a)
	if k < len(unique):
		print(-1)
		continue
	b = list(unique)
	a_i = 0
	while len(b) < k:
		b.append(a[a_i])
		a_i += 1
	b_i = k
	while a_i < n:
		if b[b_i - k] == a[a_i]:
			b.append(a[a_i])
			a_i += 1
			b_i += 1
		else:
			b.append(b[b_i - k])
			b_i += 1
	print(len(b))
	print(' '.join([str(b_el) for b_el in b]))


import sys
from collections import defaultdict, deque
import math
import heapq
t = int(sys.stdin.readline())
for _ in range(t):
	(n, k) = map(int, sys.stdin.readline().split())
	arr = list(map(int, sys.stdin.readline().split()))
	a = set()
	for i in range(n):
		a.add(arr[i])
	if len(a) > k:
		print(-1)
		continue
	l = []
	count = 0
	while count < k:
		for i in a:
			l.append(i)
			count += 1
	ind = 0
	m = len(a)
	ans = [0 for _ in range(k * n)]
	for i in range(n):
		for j in range(k):
			ans[ind] = l[j]
			ind += 1
	print(n * k)
	print(*ans)


t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	ab = set()
	for i in arr:
		ab.add(i)
	if len(ab) > k:
		print(-1)
	else:
		for i in range(1, n + 1):
			if len(ab) == k:
				break
			else:
				ab.add(i)
		string = ''
		for i in ab:
			string += str(i) + ' '
		string = string[:len(string) - 1]
		string2 = string
		for i in range(n - 1):
			string2 += ' ' + string
		print(n * k)
		print(string2)


for tc in range(int(input())):
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	if len(set(a)) > k:
		print(-1)
	else:
		l = []
		s = list(set(a))
		s += (k - len(s)) * [1]
		s.sort()
		for i in range(n):
			l += s
		print(len(l))
		print(*l)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = set(a)
	if k < len(b):
		print(-1)
	else:
		print(n * k)
		out = []
		for i in range(n):
			for e in b:
				out.append(str(e))
			for j in range(k - len(b)):
				out.append(str(1))
		print(' '.join(out))


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	d = {}
	k = 0
	for i in a:
		if d.get(i) is None:
			k += 1
			d[i] = 0
	if k > m:
		print(-1)
	else:
		ans = []
		for i in d:
			ans.append(i)
		if len(ans) < m:
			for i in range(1, n + 1):
				if len(ans) == m:
					break
				if d.get(i) is None:
					ans.append(i)
		print(m * n)
		print(*ans * n)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	distinct_arr = set(arr)
	ans = []
	if len(distinct_arr) > k:
		print(-1)
	elif len(distinct_arr) <= k:
		if len(distinct_arr) == k:
			for i in range(n):
				for s in distinct_arr:
					ans.append(s)
		else:
			distinct_arr = list(distinct_arr)
			while len(distinct_arr) < k:
				distinct_arr.append(1)
			for i in range(n):
				for s in distinct_arr:
					ans.append(s)
	if len(ans) != 0:
		print(len(ans))
		for i in ans:
			print(i, end=' ')
		print('')


I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n, k) = I()
	l = I()
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		if len(s) != k:
			d = abs(len(s) - k)
			s = s + [1] * d
		print(n * len(s))
		for i in range(n):
			print(*s, end=' ') if i != n - 1 else print(*s)


from functools import lru_cache
from collections import defaultdict, deque
from heapq import heappush, heappop

def solution():
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		arr = list(map(int, input().split()))
		syms = list(set(arr))
		if len(syms) > k:
			print('-1')
			continue
		syms += [1] * (k - len(syms))
		res = (' '.join(map(str, syms)) + ' ') * n
		print(n * k)
		print(res)
solution()


def m():
	return map(int, input().split())
for _ in range(int(input())):
	(n, k) = m()
	arr = set(m())
	l = len(arr)
	if l > k:
		print(-1)
	else:
		print(n * k)
		print(*(list(arr) + [1] * (k - l)) * n)


import sys
input = sys.stdin.readline
f = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(n, k) = f()
	inp = f()
	cnt = [0] * 111
	num = 0
	out = []
	for i in inp:
		if cnt[i] == 0:
			num += 1
			out.append(str(i))
		cnt[i] += 1
	if num > k:
		print(-1)
	else:
		for i in range(1, 101):
			if num == k:
				break
			if cnt[i] == 0:
				out.append(str(i))
				num += 1
		out *= n
		print(num * n)
		print(' '.join(out))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	net = len(set(a))
	if net > k:
		print(-1)
		continue
	else:
		print(k * n)
		for i in range(n):
			lola = ''
			for i in set(a):
				lola = lola + str(i) + ' '
			for i in range(k - net):
				lola = lola + str(a[0]) + ' '
			print(lola, end='')
	print()


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def from_file(f):
	return f.readline

def solve(n, k, A):
	elts = set(A)
	if len(elts) > k:
		return (-1, None)
	i = 1
	while len(elts) < k:
		if i not in elts:
			elts.add(i)
		i += 1
	res = list(elts) * len(A)
	return (len(res), res)
t = inp()
for _ in range(t):
	(n, k) = invr()
	A = inlt()
	(l, res) = solve(n, k, A)
	if l == -1:
		print('-1')
	else:
		print(l)
		print(' '.join(map(str, res)))


for nt in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		ans = []
		for i in range(n):
			if l[i] not in ans:
				ans.append(l[i])
			if len(ans) == k:
				break
		while len(ans) != k:
			ans.append(1)
		print(k * len(l))
		print(*ans * len(l))


t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	sa = set(a)
	if len(sa) > k:
		print(-1)
	else:
		print(n * k)
		cnt = k - len(sa)
		for i in range(1, n + 1):
			if cnt > 0:
				if i not in sa:
					sa.add(i)
					cnt -= 1
			else:
				break
		anew = list(sa)
		for i in range(n):
			for j in anew:
				print(j, end=' ')
		print()


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()

def unique(sequence):
	seen = set()
	return [x for x in sequence if not (x in seen or seen.add(x))]
for _ in range(int(I1())):
	(n, k) = I()
	a = list(I())
	if n == k:
		print(n)
		print(*a)
		continue
	elif len(set(a)) > k:
		print(-1)
		continue
	l = unique(a)
	n1 = len(l)
	for i in range(k - n1):
		l.append(1)
	ans = []
	for i in range(n):
		ans.extend(l)
	print(len(ans))
	print(*ans)


from random import randint
t = int(input())
for i in range(0, t):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	arr = input().split()
	distinct = 0
	distc = []
	for j in range(0, n):
		arr[j] = int(arr[j])
		if arr[j] not in distc:
			distc.append(arr[j])
			distinct += 1
	if distinct > k:
		print(-1)
	else:
		while len(distc) < k:
			x = randint(1, n)
			if x not in distc:
				distc.append(x)
		print(len(distc) * n)
		for ii in range(0, n):
			for jj in range(0, len(distc)):
				print(distc[jj], end=' ')
		print('')


def cal():
	ans = ''
	for _ in range(n):
		for i in val:
			ans += str(i) + ' '
		for j in range(k - len(val)):
			ans += '1 '
	print(k * n)
	print(ans)
t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	val = set()
	for i in a:
		val.add(i)
	if len(val) > k:
		print(-1)
	elif k == n:
		print(n)
		print(*a)
	else:
		cal()


n = int(input())
for i in range(int(n) * 2):
	a = input().split()
	a = [int(x) for x in a]
	if i % 2 == 0:
		(n, k) = (a[0], a[1])
	if i % 2 == 1:
		my_set = set(a)
		if len(my_set) > k:
			print(-1)
		else:
			a.sort()
			if len(my_set) < k:
				for j in range(1, 101):
					if j not in a:
						my_set.add(j)
					if len(my_set) == k:
						break
			l = list(my_set)
			l.sort()
			print(n * len(l))
			l = l * n
			l = [str(x) for x in l]
			print(' '.join(l))


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	all_unique = list(set(a))
	if len(all_unique) > k:
		sys.stdout.write(str(-1) + '\n')
	else:
		sys.stdout.write(str(n * k) + '\n')
		seg_list = all_unique + [a[0]] * (k - len(all_unique))
		seg = ' '.join([str(item) for item in seg_list])
		for i in range(n):
			sys.stdout.write(seg + ' ')
		sys.stdout.write('\n')


import sys
input = sys.stdin.readline
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k == n:
		print(n)
		print(*a)
		continue
	u = set(a)
	f = len(u)
	if f > k:
		print(-1)
		continue
	l = list(u)
	l.sort()
	d = [l[0]] * max(0, k - len(l))
	print(len((l + d) * n))
	print(*(l + d) * n)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	diff = 0
	rep = []
	for i in range(n):
		if a[i] not in rep:
			diff += 1
			rep.append(a[i])
	if diff > k:
		print(-1)
		continue
	if len(rep) == k:
		rep *= n
		print(len(rep))
		print(*rep)
	elif len(rep) < k:
		rep.extend([1] * (k - len(rep)))
		rep *= n
		print(len(rep))
		print(*rep)


from sys import stdin
from collections import Counter
input = stdin.buffer.readline
T = int(input())
for _ in range(T):
	(n, k) = map(int, input().split())
	ls = list(map(int, input().split()))
	cc = list(Counter(ls).keys())
	if len(cc) > k:
		print(-1)
		continue
	cc += [cc[-1]] * (k - len(cc))
	cc = cc * n
	print(len(cc))
	print(*cc)


def solve(t):
	for i in range(t):
		nk = input().split()
		(n, k) = (int(nk[0]), int(nk[1]))
		a = [int(x) for x in input().split()]
		s = set(a)
		if len(s) > k:
			print(-1)
		else:
			c = 1
			for i in range(1, len(a)):
				if a[i - 1] <= a[i]:
					c += 1
			s = list(sorted(s, reverse=True))
			s += [s[-1]] * (k - len(s))
			s *= c
			print(len(s))
			print(*s)
solve(int(input()))


for j in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	a1 = [min(a)]
	for x in sorted(a):
		if x != a1[-1]:
			a1.append(x)
	if len(a1) > k:
		print(-1)
	else:
		m = len(a1)
		for i in range(k - m):
			a1.append(1)
		i = 0
		j = 0
		count = 0
		ans = ''
		while i < n:
			count += 1
			ans += str(a1[j]) + ' '
			if a1[j] == a[i]:
				i += 1
			j = (j + 1) % k
		print(count)
		print(ans)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from itertools import accumulate

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	for _ in range(Int()):
		(n, m) = Mint()
		a = List()
		l = list(set(a))
		if len(l) > m:
			print(-1)
		else:
			temp = m - len(l)
			l = (l + [1] * temp) * n
			print(len(l))
			print(*l)
solution()


def beautifulArray(n, k, li):
	if n == k:
		print(n)
		print(*li)
	else:
		temp = []
		[temp.append(i) for i in li if i not in temp]
		if len(temp) > k:
			print(-1)
		else:
			ele = abs(len(temp) - k)
			for i in range(ele):
				temp.append(1)
			print(n * k)
			print(*temp * n)
for i in range(int(input())):
	(n, k) = input().split()
	li = [int(x) for x in input().split()]
	beautifulArray(int(n), int(k), li)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	ans = (list(s) + (k - len(s)) * [1]) * n
	print(len(ans))
	print(*ans)


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	lis = []
	l = list(map(int, input().split()))
	for x in l:
		if x not in lis:
			lis.append(x)
	if len(lis) > k:
		print('-1')
	elif len(lis) == k:
		lis = lis * n
		print(len(lis))
		for i in lis:
			print(i, end=' ')
		print()
	else:
		while len(lis) < k:
			lis.append(1)
		lis = lis * n
		print(len(lis))
		for i in lis:
			print(i, end=' ')
		print()
	t -= 1


t = int(input())
for i in range(0, t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	f = set(l)
	f = list(f)
	if len(f) > k:
		print(-1)
	else:
		c = k - len(f)
		for i in range(0, c):
			f.append(1)
		a = []
		a = f * n
		print(k * n)
		print(*a)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(set(l)) > k:
		print(-1)
	else:
		a = len(set(l))
		ng = [i for i in range(1, n + 1) if i not in set(l)]
		ll = list(set(l)) + ng[:k - a]
		sol = [i for i in ll * 100]
		print(len(sol))
		print(' '.join([str(i) for i in sol]))


t = int(input())
for tc in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = set(arr)
	num = set(range(1, n + 1))
	if len(s) > k:
		print(-1)
	else:
		rem = list(num - s)[:k - len(s)]
		rep = list(s) + rem
		sol = rep * n
		print(len(sol))
		print(*sol)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	List = list(map(int, input().split()))
	x = list(set(List))
	if len(x) > k:
		print(-1)
	else:
		i = 0
		print(n * k)
		for i in range(n):
			for j in x:
				print(j, end=' ')
			for l in range(0, k - len(x)):
				print(1, end=' ')
		print(' ')


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().strip().split()))
	a = list(map(int, input().strip().split()))
	different = list(set(a))
	if len(different) > k:
		print(-1)
		continue
	if len(different) <= k:
		different = different + [1] * (k - len(different))
	diff_index = 0
	a_index = 0
	output = []
	while a_index < len(a):
		output.append(different[diff_index])
		if a[a_index] == different[diff_index]:
			a_index += 1
		diff_index = (diff_index + 1) % k
	print(len(output))
	print(' '.join(map(str, output)))


t = int(input())
for T in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	unique = list(set(a))
	if len(unique) > k:
		print(-1)
	else:
		if len(unique) != k:
			unique.extend([1 for x in range(len(unique), k)])
		ans = []
		for y in range(n):
			ans.extend(unique)
		print(len(ans))
		print(*ans)


def solve():
	(n, k) = map(int, input().split())
	l = [int(x) for x in input().split()]
	s = list(set(l))
	distinct = len(s)
	if distinct > k:
		print(-1)
	elif distinct == k:
		ans = s * n
		print(len(ans))
		print(*ans)
	else:
		for i in range(k - distinct):
			s.append(1)
		ans = s * n
		print(len(ans))
		print(*ans)
try:
	for _ in range(int(input())):
		solve()
except:
	pass


from collections import defaultdict, deque, Counter, OrderedDict
import math

def main():
	t = int(input())
	ans = ''
	for _ in range(0, t):
		(n, k) = [int(i) for i in input().split()]
		arr = [int(i) for i in input().split()]
		st = set(arr)
		le = len(st)
		if le > k:
			ans += '-1\n'
		else:
			st = list(st)
			d = {k: 0 for k in st}
			mx = 0
			for i in arr:
				d[i] += 1
				if d[i] > mx:
					mx = d[i]
			base = []
			f = 0
			while f < k:
				base.append(st[f % le])
				f += 1
			basel = len(base)
			mx = 10000
			rem = int(mx / basel)
			base = base * rem
			total = len(base)
			ans += str(total) + '\n'
			ans += ' '.join((str(x) for x in base)) + '\n'
	print(ans[:-1])
main()


t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().strip().split(' '))
	arr = list(map(int, input().strip().split(' ')))
	ss = []
	for i in arr:
		if i not in ss:
			ss.append(i)
	if len(ss) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(0, n):
			for j in ss:
				print(j, end=' ')
			for i in range(0, k - len(ss)):
				print(1, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	z = list(set(map(int, input().split())))
	if len(z) > k:
		print(-1)
	else:
		m = 10000
		while len(z) < k:
			z.append(z[-1])
		print(m)
		for i in range(0, m):
			print(z[i % k], end=' ')
		print()


def task(n, k, a):
	table = {}
	for value in a:
		table[value] = True
	if len(table.keys()) > k:
		print(-1)
		return
	result = []
	keys = list(table.keys())
	keys_len = len(keys)
	if keys_len < k:
		for i in range(0, k - keys_len):
			keys.append(1)
	for value in a:
		for key in keys:
			result.append(key)
	print(len(result))
	print(' '.join(map(str, result)))
t = int(input())
for i in range(0, t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	task(n, k, a)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set()
	for i in l:
		s.add(i)
	if len(s) > k:
		print()
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for j in s:
				print(j, end=' ')
			for j in range(k - len(s)):
				print(1, end=' ')


import math
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	b = list(map(int, input().split()))
	if len(set(b)) > k:
		print(-1)
	else:
		s = list(set(b))
		while len(s) < k:
			s.append(s[0])
		print(n * k)
		for i in range(n * k):
			print(s[i % k], end=' ')
		print()


t = int(input())

def solve(n, k, arr):
	ans = []
	segment = []
	seen = set()
	for v in arr:
		seen.add(v)
	if len(seen) > k:
		print(-1)
		return
	idx = 1
	while idx <= n and len(seen) < k:
		seen.add(idx)
		idx += 1
	if len(seen) != k:
		print(-1)
		return
	for v in seen:
		segment.append(v)
	for v in arr:
		ans.extend(segment)
	print(len(ans))
	print(' '.join(list(map(str, ans))))
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	solve(n, k, arr)


def main():
	(n, k) = map(int, input().split())
	lst = list(map(int, input().split()))
	dct = dict()
	line = ''
	items = ''
	len_items = 0
	for i in lst:
		dct[i] = True
	for i in dct:
		items += str(i) + ' '
		len_items += 1
	if len(dct) > k:
		print(-1)
		return
	while len_items < k:
		items += '1 '
		dct[1] = True
		len_items += 1
	for i in range(n):
		line += items
	print(k * n)
	print(line)
t = int(input())
for i in range(t):
	main()


from collections import defaultdict
from itertools import cycle
t = int(input())
for _ in range(0, t):
	(n, k) = list(map(lambda x: int(x), input().split()))
	a = list(map(lambda x: int(x), input().split()))
	hashmap = defaultdict(int)
	for i in range(0, n):
		hashmap[a[i]] += 1
	if len(hashmap) > k:
		print(-1)
	elif k == n:
		print(n)
		for i in a:
			print(i, end=' ')
		print()
	else:
		keys = list(hashmap.keys())
		keys = keys + [1] * (k - len(keys))
		counter = 0
		ans = []
		keys = keys * 100
		print(len(keys))
		for i in range(len(keys)):
			print(keys[i], end=' ')
		print()


T = int(input())
for t in range(T):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if len(set(arr)) > k:
		print(-1)
	else:
		seq = list(set(arr))
		while len(seq) < k:
			seq.append(arr[0])
		print(k * 100)
		result = seq * 100
		for x in result[:-1]:
			print(x, end=' ')
		print(result[-1])


for testcase in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	x = list(set(a))
	if len(x) > k:
		print(-1)
		continue
	x.extend(range(1, 1 + k - len(x)))
	print(k * n)
	print(*x * n)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = set(a)
	if len(b) > k:
		print(-1)
		continue
	c = list(b)
	c += [1] * (k - len(b))
	ans = []
	ind = 0
	for j in range(len(a)):
		while c[ind % len(c)] != a[j]:
			ans.append(c[ind % len(c)])
			ind += 1
		ans.append(a[j])
		ind += 1
	print(len(ans))
	print(*ans)


def solve(n, k):
	s = set()
	for elem in input().split(' '):
		s.add(int(elem))
	if k < len(s):
		return print(-1)
	print(n * k)
	for i in range(n):
		for elem in s:
			print(elem, end=' ')
		for j in range(k - len(s)):
			print('1', end=' ')
	print()
t = int(input())
for i in range(t):
	(n, k) = [int(ch) for ch in input().split(' ')]
	solve(n, k)


import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	nms = list(map(int, input().split()))
	mark = [0 for i in range(101)]
	nos = set()
	difno = 0
	for i in range(n):
		if mark[nms[i]] == 0:
			difno += 1
		mark[nms[i]] += 1
		nos.add(nms[i])
	if difno > k:
		print(-1)
	else:
		ans = []
		print(n * k)
		for i in range(n):
			for c in nos:
				ans.append(str(c))
			for v in range(k - len(nos)):
				ans.append('1')
		print(' '.join(ans))


t = int(input())
ans = []
for i in range(t):
	(n, k) = map(int, input().split())
	nums = list(map(int, input().split()))
	checker = []
	for j in nums:
		if j not in checker:
			checker.append(j)
	len1 = len(checker)
	if len1 > k:
		ans.append([-1])
	else:
		nums_new = []
		now_num = 0
		for j in range(len1):
			nums_new.append(checker[j])
			if checker[j] == nums[now_num]:
				now_num += 1
		for j in range(k - len1):
			nums_new.append(1)
			if 1 == nums[now_num]:
				now_num += 1
		while now_num < n:
			for j in range(k):
				if nums[now_num] == nums_new[j]:
					now_num += 1
				nums_new.append(nums_new[j])
				if now_num == n:
					break
		ans.append(nums_new)
for i in ans:
	if i != [-1]:
		print(len(i))
	print(*i)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	s = list(map(int, input().split()))
	s = set(s)
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		for j in range(n):
			for num in s:
				print(num, end=' ')
			x = 0
			while x < k - len(s):
				print(1, end=' ')
				x = x + 1


t = int(input())
while t:
	t = t - 1
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = {}
	for w in l:
		if w in d:
			d[w] += 1
		else:
			d[w] = 1
	if len(d) > k:
		print(-1)
	else:
		sub = []
		for w in d:
			sub.append(w)
		while len(sub) != k:
			sub.append(1)
		print(n * k)
		for w in range(n):
			for i in range(k):
				print(sub[i], end=' ')
		print()


import sys

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output2.txt', 'w')
t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	if len(set(a)) > k:
		print(-1)
		continue
	s = list(set(a))
	for i in range(k - len(s)):
		s.insert(0, 1)
	print(n * len(s))
	for i in range(n):
		print(*s, end=' ')
	print()


from collections import defaultdict
a = int(input())
for i in range(a):
	(n, k) = map(int, input().split())
	z = list(map(int, input().split()))
	m = len(set(z))
	if m > k:
		print(-1)
	else:
		t = list(set(z))
		while len(t) != k:
			t.append(1)
		t = t * n
		print(len(t))
		print(' '.join(map(str, t)))


from collections import Counter
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	ans = []
	temp = Counter(arr)
	if len(temp) > k:
		print(-1)
		continue
	else:
		for i in temp:
			ans.append(i)
		if len(ans) < k:
			temp2 = [1] * (k - len(ans))
			ans += temp2
		print(len(ans) * n)
		print(*ans * n)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = {}
	for x in a:
		d[x] = 1
	t = len(d)
	if t > k:
		print(-1)
	else:
		c = list(d.keys()) + [1] * (k - t)
		print(len(c) * n)
		print(*c * n)


from collections import defaultdict as dd
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = list(map(int, input().split()))
	d = dd(lambda : 0)
	for i in c:
		d[i] += 1
	v = list(d.keys())
	if len(v) > b:
		print(-1)
	else:
		print(a * b)
		for i in range(1, b - len(v) + 1):
			v.append(i)
		print(*v * a)


from collections import defaultdict as dc
from heapq import *
import math
import bisect
import sys
from collections import deque as dq
from heapq import heapify, heappush, heappop
mod = 10 ** 9 + 7

def inp():
	p = int(input())
	return p

def line():
	p = list(map(int, input().split()))
	return p

def read_mat():
	n = inp()
	a = []
	for i in range(n):
		a.append(line())
	return a

def digit(n):
	s = str(n)
	p = 0
	for i in s:
		p += int(i) ** 2
	return p

def solve(a, n, k):
	q = set(a)
	if len(q) > k:
		return (-1, -1)
	else:
		p = dc(int)
		z = []
		for i in range(n):
			if p[a[i]] == 0:
				z.append(a[i])
				p[a[i]] += 1
		z += [1] * (k - len(z))
		ans = []
		while len(ans) < n * k:
			ans += z
		return (len(ans), ans)
for test in range(inp()):
	(n, k) = line()
	a = line()
	(l, r) = solve(a, n, k)
	print(l)
	if l != -1:
		print(*r)


import sys
from collections import defaultdict

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(n, k) = get_ints()
	a = get_array()
	arr = []
	d = defaultdict(int)
	if len(set(a)) > k:
		print(-1)
	else:
		for i in a:
			if d[i] == 0:
				d[i] = 1
				arr.append(i)
		if len(arr) < k:
			op = arr[len(arr) - 1]
			diff = k - len(arr)
			for i in range(diff):
				arr.append(op)
			m = len(arr) * n
			print(m)
			for i in range(n):
				for j in arr:
					print(j, end=' ')
			print()
		elif len(arr) == k:
			m = len(arr) * n
			print(m)
			for i in range(n):
				for j in arr:
					print(j, end=' ')
			print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if k < len(s):
		print(-1)
		continue
	index = 1
	while len(s) < k:
		s.add(index)
		index += 1
	beautiful = []
	for i in range(n):
		for elem in s:
			beautiful.append(str(elem))
	print(len(beautiful))
	print(' '.join(beautiful))


t = int(input())
for x in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set()
	for i in a:
		s.add(i)
	siz = len(s)
	if siz > k:
		print(-1)
		continue
	elif siz < k:
		count = k - siz
		i = 1
		while count:
			if i not in s:
				s.add(i)
				count -= 1
			i += 1
	print(k * n)
	for i in range(n):
		for l in s:
			print(l, end=' ')
	print('')


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	mi = min(a)
	ma = max(a)
	if n == k:
		print(n)
		print(' '.join(map(str, a)))
		continue
	b = list(set(a))
	if len(b) < k:
		b = b + [i for i in range(1, k - len(b) + 1)]
	k_ = len(b)
	for i in range(k_, 10 ** 4):
		b.append(b[i - k_])
	m = len(b)
	if k_ <= k:
		print(m)
		print(' '.join(map(str, b)))
	else:
		print(-1)


T = int(input())
for t in range(T):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	numbers = set(a)
	if len(numbers) > k:
		print(-1)
	else:
		numbers = list(numbers)
		numbers_set = set(numbers)
		missing_number = 1
		while len(numbers) != k:
			numbers.append(missing_number)
		res = numbers * n
		print(len(res))
		print(' '.join(list(map(str, res))))


def solve():
	(n, k) = map(int, input().split(' '))
	arr = list(map(int, input().split(' ')))
	dist = set(arr)
	result = []
	if len(dist) > k:
		print(-1)
		return
	for i in range(n):
		result += list(dist)
		for i in range(k - len(dist)):
			result.append(1)
	print(len(result))
	print(' '.join(list(map(str, result))))
t = int(input())
for i in range(t):
	solve()


import math
t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	bb = list(set(a))
	bb.sort()
	if len(bb) > k:
		print(-1)
		continue
	if n <= k:
		print(n)
		print(*a)
		continue
	bb = [1] * (k - len(bb)) + bb
	print(n * len(bb))
	print(*bb * n)
1


t = int(input())
for t1 in range(t):
	(n, k) = map(int, input().split())
	l1 = list(map(int, input().split()))
	if len(set(l1)) > k:
		print(-1)
		continue
	if n == k:
		print(n)
		print(*l1)
		continue
	l2 = set()
	for i in range(1, k + 1):
		l2.add(l1.count(i))
	c = max(l2)
	l4 = []
	for i in set(l1):
		l4.append(i)
	while len(l4) != k:
		l4.append(1)
	l3 = []
	print(k * n)
	for i in range(n):
		print(*l4, end=' ')
	print('')


t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	dic = {}
	for i in a:
		dic[i] = 1
	if len(dic.keys()) > k:
		print(-1)
		continue
	cnt = 1
	while len(dic.keys()) < k:
		dic[cnt] = 1
		cnt += 1
	print(n * k)
	for i in range(n):
		for j in dic.keys():
			print(j, end=' ')
	print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	dict = {}
	o = []
	save = 0
	for e in l:
		if e not in dict:
			dict[e] = 1
			o.append(e)
		else:
			dict[e] += 1
			if dict[e] >= save:
				save = dict[e]
	if save == 0:
		save = 2
	if len(dict) > k:
		print(-1)
	elif len(o) == k:
		o = o * 100
		print(len(o))
		print(*o)
	else:
		u = k - len(o)
		for i in range(u):
			o.append(n)
		o = o * 100
		print(len(o))
		print(*o)


test = int(input())
for _ in range(test):
	(n, m) = map(int, input().split())
	s = set(map(int, input().split()))
	if len(s) > m:
		print(-1)
	else:
		print(n * m)
		ans = list(s) + [1] * (m - len(s))
		ans = ans * n
		for i in ans:
			print(i, end=' ')


import sys
import bisect
from collections import Counter, defaultdict as dd

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def l():
	return list(sp())

def strl():
	return list(strsp())

def sp():
	return map(int, data().split())

def strsp():
	return map(str, data().split())
for _ in range(int(data())):
	(n, k) = sp()
	a = l()
	c = [0] * (n - k + 1)
	for i in range(n - k + 1):
		for j in range(k):
			c[i] += a[i + j]
	if len(set(c)) == 1 and k != n:
		print(n)
		print(*a)
	elif len(set(a)) > k:
		print(-1)
	else:
		b = set(a)
		(i, j) = (1, k - len(b))
		while j > 0:
			if i not in b:
				j -= 1
				b.add(i)
			i += 1
		f = [list(b)] * n
		print(len(b) * n)
		for i in range(n):
			print(*f[i], end=' ')
		print()


q = int(input())
while q:
	q -= 1
	(n, k) = map(int, input().strip().split(' '))
	a = list(map(int, input().strip().split(' ')))
	s = list(set(a))
	if len(s) <= k:
		print(k * n)
		s = s + [1] * (k - len(s))
		for i in range(n):
			for j in s:
				print(j, end=' ')
		print()
	else:
		print(-1)


t = int(input())
while t != 0:
	t -= 1
	(n, k) = input().split()
	(n, k) = (int(n), int(k))
	lt = [int(x) for x in input().split()]
	s = set(lt)
	if len(s) > k:
		print('-1')
	else:
		aux = [1] * (k - len(s))
		ans = list(s) + aux
		ans = ans * n
		print(len(ans))
		print(*ans)


for t in range(int(input())):
	(n, k) = list(map(int, input().split()))
	integers = set(map(int, input().split()))
	seperate_numbers = []
	count = 0
	for i in integers:
		count += 1
		seperate_numbers.append(i)
	if k < count:
		print(-1)
	else:
		for i in range(1, n + 1):
			if count == k:
				break
			if i not in integers:
				count += 1
				seperate_numbers.append(i)
		print(count * n)
		for i in range(n):
			print(*seperate_numbers, end=' ')
		print()


import math
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		ans = []
		s = list(s)
		while len(s) < k:
			s.append(1)
		index = 0
		cnt = 0
		while index < len(a):
			if a[index] == s[cnt % k]:
				ans.append(s[cnt % k])
				index += 1
			else:
				ans.append(s[cnt % k])
			cnt += 1
		print(len(ans))
		print(*ans)


from sys import stdin
for _ in range(int(input())):
	(n, k) = map(int, stdin.readline().rstrip().split(' '))
	l = list(map(int, stdin.readline().rstrip().split(' ')))
	if k == 1:
		x = set(l)
		if len(x) > k:
			print(-1)
		else:
			print(len(l))
			print(*l)
	elif n == k:
		print(n)
		print(*l)
	else:
		x = list(set(l))
		if k < len(x):
			print(-1)
		else:
			t = len(x)
			if t == k:
				print(len(x) * n)
				print(*sorted(x) * n)
			else:
				j = 1
				while len(x) != k:
					if j not in x:
						x.append(j)
					j += 1
				print(len(x) * n)
				print(*sorted(x) * n)


import sys
input = sys.stdin.readline
Q = int(input())
Query = []
for _ in range(Q):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	Query.append((N, K, A))
for (N, K, A) in Query:
	B = set(A)
	if len(B) > K:
		print(-1)
	else:
		n = 1
		while len(B) < K:
			if not n in B:
				B.add(n)
			n += 1
		T = list(B)
		ans = T * N
		print(len(ans))
		print(*ans)


for __ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	ar = list(map(int, input().split()))
	kek = set()
	for elem in ar:
		kek.add(elem)
	if len(kek) > k:
		print(-1)
	else:
		ans = []
		uh = list(kek)
		for j in range(k - len(kek)):
			uh.append(1)
		num = 0
		while 10 ** 4 - num - len(uh) > 0:
			for elem in uh:
				ans.append(elem)
			num += len(uh)
		print(len(ans))
		print(*ans)


cases = int(input())
for _ in range(cases):
	(n, q) = [int(s) for s in input().split()]
	array = [int(s) for s in input().split()]
	n_dist = list(set(array))
	diff = q - len(n_dist)
	if len(n_dist) > q:
		print('-1')
	else:
		for _ in range(diff):
			n_dist.append(1)
		print(len(n_dist) * n)
		l_out = n_dist * n
		print(' '.join(map(str, l_out)))


for _ in range(int(input())):
	(x, sub) = map(int, input().split())
	a = list(set(list(map(int, input().split()))))
	if sub < len(a):
		print(-1)
	else:
		a = [*a, *[x for x in range(1, sub + 1) if x not in a][:sub - len(a)]]
		print(len(a) * x)
		print(*a * x)


def solve(n, k, arr):
	unique = set(arr)
	if len(unique) > k:
		return []
	unique_list = list(unique)
	part = [unique_list[i % len(unique)] for i in range(k)]
	return part * n

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		arr = map(int, input().split())
		answer = solve(n, k, arr)
		if answer:
			print(len(answer))
			print(' '.join(map(str, answer)))
		else:
			print(-1)
main()


ntest = int(input())
for i in range(ntest):
	(k, n) = list(map(int, input().split(' ')))
	T = list(map(int, input().split(' ')))
	if len(set(T)) > n:
		print(-1)
	else:
		newT = list(set(T))
		i = 1
		while len(newT) < n:
			if not i in newT:
				newT.append(i)
			i += 1
		finalT = newT * k
		print(len(finalT))
		finalT = list(map(str, finalT))
		print(' '.join(finalT))


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
for _ in range(int(cin())):
	(n, k) = map(int, cin().split())
	lst = list(map(int, cin().split()))
	s = set(lst)
	if len(s) > k:
		cout('-1\n')
	else:
		temp = list(s)
		while len(temp) < k:
			temp.append(temp[-1])
		cout(str(n * k) + '\n')
		for i in range(n):
			for val in temp:
				cout(str(val) + ' ')
		cout('\n')


t = int(input())
while t:
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	diff = set(a)
	if len(diff) <= k:
		m = k * n
		print(m)
		arr = list(diff)
		for i in range(n):
			for j in range(k):
				print(arr[j % len(diff)], end=' ')
		print()
	else:
		print(-1)
	t -= 1


import collections
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if len(collections.Counter(arr)) > k:
		print(-1)
	else:
		cand = list(collections.Counter(arr).keys())
		cnt = len(cand)
		for i in range(1, n + 1):
			if cnt >= k:
				break
			elif i not in cand:
				cand.append(i)
				cnt += 1
		print(cnt * n)
		print(*cand * n)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	dc = 1
	a.sort()
	b = [a[0]]
	for i in range(n - 1):
		if a[i] != a[i + 1]:
			b.append(a[i + 1])
			dc += 1
	if dc > k:
		print('-1')
	else:
		for i in range(k - dc):
			b.append(a[0])
		print(n * len(b))
		b = b * n
		print(*b)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	print(k * n)
	run = list(s)
	for i in range(k - len(s)):
		run.append(a[0])
	for i in range(n):
		print(*run, end=' ')
	print()


t = int(input())
for T in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	if len(set(a)) > k:
		print(-1)
		continue
	s = set(a)
	s = [str(i) for i in s]
	s += [s[0]] * (k - len(s))
	print(n * k)
	res = (' '.join(s) + ' ') * n
	print(res[:-1])


from sys import stdin, stdout
for testcases in range(int(stdin.readline())):
	(n, k) = map(int, stdin.readline().split())
	arr = list(map(int, stdin.readline().split()))
	distinct = set(arr)
	distinct = list(distinct)
	if len(distinct) > k:
		print(-1)
	else:
		x = []
		for i in range(k):
			x.append(distinct[i % len(distinct)])
		print(n * len(x))
		for i in range(n):
			print(*x, end=' ')
		print()


cases = int(input())
while cases:
	cases -= 1
	(n, k) = list(map(int, input().strip(' ').split(' ')))
	ls = list(map(int, input().strip(' ').split(' ')))
	dis = set(ls)
	c = len(dis)
	if c > k:
		print(-1)
		continue
	print(k * n)
	while n != 0:
		temp = k
		while temp != 0:
			for i in dis:
				if temp == 0:
					break
				print(i, end=' ')
				temp -= 1
		n -= 1
	print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	sa = set(a)
	if len(set(a)) > k:
		print(-1)
	else:
		used = set()
		ret = []
		if len(sa) < k:
			num = 1
			while len(sa) < k:
				sa.add(num)
				num += 1
		for i in range(n):
			if len(ret) < k:
				if a[i] in used:
					for num in sa:
						if num in used:
							continue
						ret.append(num)
						used.add(num)
				else:
					ret.append(a[i])
					used.add(a[i])
					continue
			if ret[len(ret) % len(used)] == a[i]:
				ret.append(a[i])
			else:
				for _ in range(len(used)):
					ret.append(ret[len(ret) % len(used)])
					if ret[-1] == a[i]:
						break
		print(len(ret))
		print(*ret)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	lst = list(map(int, input().split()))
	sl = set(lst)
	l = len(sl)
	if l > k:
		print(-1)
	else:
		ans = []
		for i in sl:
			ans.append(i)
		if l < k:
			for i in range(k - l):
				ans.append(lst[i])
		ans *= n
		print(n * k)
		for i in ans:
			print(i, end=' ')
		print()


t = int(input())
for x in range(t):
	(n, k) = map(int, input().split(' '))
	arr = map(int, input().split(' '))
	build_arr = []
	ref = list(set(arr))
	if len(ref) > k:
		print(-1)
	else:
		while len(ref) < k:
			ref.append(1)
		print(n * k)
		print('%s ' % ' '.join((str(i) for i in ref)) * n)


def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	(n, k) = rl()
	A = rl()
	unique_set = set()
	unique_list = []
	for a in A:
		if a not in unique_set:
			unique_set.add(a)
			unique_list.append(a)
	if len(unique_set) > k:
		print(-1)
		return
	else:
		for i in range(1, n + 1):
			if len(unique_list) == k:
				break
			if i not in unique_set:
				unique_list.append(i)
		print(k * n)
		print(*unique_list * n)
t = ri()
for i in range(t):
	solve()


def sol():
	(x, y) = map(int, input().split())
	s = list(map(int, input().split()))
	v = []
	for n in s:
		if n not in v:
			v.append(n)
	if len(v) > y:
		print(-1)
		return
	v.sort()
	j = y - len(v)
	print(x * y)
	for n in range(x):
		print(*v, '1 ' * j, end=' ')
	print()
for n in range(int(input())):
	sol()


def main_function():
	from sys import stdin
	input = stdin.readline
	t = int(input())
	for _ in range(t):
		(n, k) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		if len(set(a)) > k:
			print(-1)
			continue
		tmp_list = list(set(a))
		tmp_list = tmp_list + [tmp_list[-1]] * (k - len(set(a)))
		b = tmp_list * n
		b = list(map(str, b))
		print(k * n)
		print(' '.join(b))
main_function()


import sys, collections
import io, os
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	temp = list(set(arr))
	if len(temp) > k:
		print(-1)
		continue
	else:
		if len(temp) < k:
			temp += [1] * (k - len(temp))
		temp = temp * n
		print(len(temp))
		print(*temp)


for i in range(int(input())):
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	if m < len(set(A)):
		print(-1)
	else:
		print(m * max(n, m))
		A2 = sorted(list(set(A)))
		if len(A2) < m:
			for i in range(m - len(A2)):
				A2.append(1)
		for j in range(max(n, m)):
			print(*A2, end=' ')
		print('')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = [int(x) for x in input().split()]
	s = set(l)
	if len(s) > k:
		print(-1)
	else:
		a = list(s) + [1] * (k - len(s))
		print(len(a) * n)
		print(*a * n)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().strip().split())
	a = list(map(int, input().strip().split()))
	s = []
	for i in a:
		if i not in s:
			s.append(i)
	if len(s) > k:
		print(-1)
		continue
	while len(s) != k:
		s.append(1)
	print(len(s * n))
	print(*s * n)


from collections import Counter

def soln(arr, k):
	ctr = Counter(arr)
	if len(ctr) > k:
		return None
	period = list(ctr.keys())
	while len(period) < k:
		period.append(period[-1])
	result = period * len(arr)
	return result

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = [int(x) for x in input().split()]
		arr = [int(x) for x in input().split()]
		result = soln(arr, k)
		if result is None:
			print(-1)
		else:
			print(len(result))
			print(' '.join((str(x) for x in result)))
main()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		a = list(set(a))
		l = len(a)
		a += [1 for i in range(k - l)]
		print(10 ** 4)
		for i in range(10 ** 4):
			print(a[i % k], end=' ')
		print()


from collections import Counter

def solution(arr, n, k):
	dct = Counter(arr)
	if len(dct) > k:
		return -1
	res = []
	while len(res) < k:
		for i in dct:
			if len(res) >= k:
				break
			else:
				res.append(i)
				dct[i] -= 1
	i = 0
	j = 0
	while j < n:
		if res[i] == arr[j]:
			res.append(arr[j])
			i += 1
			j += 1
		else:
			res.append(res[i])
			i += 1
	return res
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().strip().split())
	arr = list(map(int, input().strip().split()))
	ans = solution(arr, n, k)
	if ans == -1:
		print(-1)
	else:
		print(len(ans))
		print(*ans)


from collections import Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = list(set(arr))
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		print(*(s + [1] * (k - len(s))) * n)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	myset = set(a)
	if len(myset) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for x in myset:
				print(x, end=' ')
			for _ in range(0, k - len(myset)):
				print(1, end=' ')


import sys
from os import path
if path.exists('C:/Users/prana/Desktop/sublime/input.txt'):
	sys.stdin = open('C:/Users/prana/Desktop/sublime/input.txt', 'r')
	sys.stdout = open('C:/Users/prana/Desktop/sublime/output.txt', 'w')
from collections import Counter

def solve():
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	a = list(map(int, input().split()))
	ca = Counter(a).keys()
	count = len(ca)
	print(ca, file=sys.stderr)
	ma = max(ca)
	c = []
	for i in range(1, ma + 1):
		c.append(i)
	print(c, file=sys.stderr)
	if count > k:
		print(-1)
	else:
		check = n % k
		check = n + check
		temp = check // k
		ca = list(ca)
		for i in range(1, k - count + 1):
			ca.append(ca[0])
		print(ca, file=sys.stderr)
		ans = n * ca
		ans = list(ans)
		print(len(ans))
		for i in ans:
			print(i, end=' ')
		print(end='\n')
T = 1
T = int(input())
for _ in range(1, T + 1):
	print('Case #', _, file=sys.stderr)
	solve()


import sys
I = sys.stdin.readline
pr = sys.stdout.write

def main():
	for _ in range(int(I())):
		(n, k) = map(int, I().split())
		ar = list(map(int, I().split()))
		st = set(ar)
		s = sum(ar)
		if len(st) > k:
			pr('-1\n')
			continue
		if len(st) < k:
			st = list(st) + list(set(range(1, n + 1)) - st)[:k - len(st)]
		else:
			st = list(st)
		pr(f'{len(st) * n}\n')
		for _ in range(n - 1):
			print(*st, end=' ')
		print(*st, end='')
		pr('\n')
main()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	m = max(a)
	d = []
	for i in range(101):
		d.append(0)
	for i in range(n):
		temp = a[i]
		d[temp] = 1
	e = []
	for i in range(1, 101):
		if d[i] == 1:
			e.append(i)
	if len(e) > k:
		print(-1)
	else:
		z = len(e)
		if k != z:
			count = k - z
			while count > 0:
				for i in range(1, n + 1):
					if d[i] == 0:
						d[i] = 1
						e.append(i)
						break
				count = count - 1
		print(n * len(e))
		for i in range(n):
			for j in e:
				print(j, end=' ')
		print()


import collections
t = int(input())
for test_case in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	cnt = collections.Counter(arr)
	if len(cnt.keys()) > k:
		print(-1)
	else:
		ans = list(cnt.keys()) + arr[:k - len(cnt.keys())]
		i = 0
		while i < len(arr):
			ans.append(ans[-k])
			if ans[-k] == arr[i]:
				i += 1
		print(len(ans))
		print(*ans)


t = int(input())
while t:
	t = t - 1
	(n, k) = map(int, input().split())
	li = list(map(int, input().split()))
	li = list(set(li))
	if len(li) > k:
		print(-1)
	else:
		if len(li) < k:
			li.extend([1] * (k - len(li)))
		print(len(li) * n)
		for i in li * n:
			print(i, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	sa = set(a)
	if len(sa) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for j in sa:
				print(j, end=' ')
			for m in range(k - len(sa)):
				print(1, end=' ')
		print()


from sys import stdin, stdout
T = int(stdin.readline().strip())
for caso in range(T):
	(n, k) = map(int, stdin.readline().strip().split())
	s = list(set(list(map(int, stdin.readline().strip().split()))))
	if len(s) > k:
		print(-1)
		continue
	while len(s) < k:
		s.append(s[-1])
	ans = []
	x = 0
	for i in range(k * n):
		ans.append(s[x % k])
		x += 1
	print(len(ans))
	print(*ans)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	s = map(int, input().split())
	sets = set(s)
	if len(sets) <= k:
		c = 1
		while len(sets) < k:
			sets.add(c)
			c += 1
		print(n * k)
		print(*[a for a in sets] * n)
	else:
		print(-1)


import sys, math
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	c = k
	b = list(map(int, input().split()))
	ans = True
	a = []
	for i in b:
		if i not in a:
			a.append(i)
			k -= 1
			if k < 0:
				ans = False
				break
	if k < 0:
		ans = False
	if ans:
		for i in range(k):
			a.append(1)
		print(n * len(a))
		for _ in range(n):
			print(*a, end=' ')
		print()
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr_set = set(arr)
	arr_set = list(arr_set)
	if len(arr_set) > k:
		print(-1)
	else:
		for i in range(k - len(arr_set)):
			arr_set.append(arr_set[0])
		print(n * k)
		for i in range(n):
			for j in range(k):
				print(arr_set[j], end=' ')
		print('')


from sys import stdin, stdout, setrecursionlimit

class Tail_Recursion_Optimization:

	def __init__(self, RECURSION_LIMIT, STACK_SIZE):
		setrecursionlimit(RECURSION_LIMIT)
		threading.stack_size(STACK_SIZE)
		return None

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for i in range(int(R())):
			(n, k) = [int(x) for x in R().split()]
			a = [int(x) for x in R().split()]
			unique = set(a)
			if len(unique) > k:
				ans.append('-1')
				continue
			ans.append(str(100 * k))
			s = ''
			for j in range(100):
				for val in unique:
					s += str(val) + ' '
				m = k - len(unique)
				while m:
					for val in unique:
						if not m:
							break
						s += str(val) + ' '
						m -= 1
			ans.append(s)
		W('\n'.join(ans))
		return 0

def main():
	s = SOLVE()
	s.solve()
main()


t = int(input())
for i in range(t):
	(n, k) = [int(j) for j in input().split()]
	a = [int(j) for j in input().split()]
	d = {}
	for j in a:
		d[str(j)] = 1
	if len(d) > k:
		print(-1)
	else:
		print(n * k)
		b = list(d)
		b = b + [b[0]] * (k - len(d))
		print(' '.join(b * n))


for i in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	l = list(set(a))
	if len(l) > k:
		print(-1)
	else:
		h = 1
		while h <= n:
			if k - len(l) > 0:
				if h not in l:
					l.append(h)
				else:
					h += 1
			else:
				break
		print(n * len(l))
		for g in range(n):
			print(*l, end=' ')
		print('')


import math
from collections import Counter, deque
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()
mod = 10 ** 9 + 7

def s(a):
	print(' '.join(list(map(str, a))))
for _ in range(I()):
	(n, k) = M()
	a = L()
	s = set(a)
	x = k - len(s)
	l = []
	for i in s:
		l.append(i)
	for i in range(1, n + 1):
		if x == 0:
			break
		if i not in l:
			l.append(i)
			x -= 1
	l.sort()
	if k >= len(s):
		print(k * n)
		l *= n
		print(*l)
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set()
	b = [0] * 101
	f = 0
	for (i, x) in enumerate(a):
		b[x] += 1
		s.add(x)
		if i:
			if x <= a[i - 1]:
				f += 1
	if len(s) > k:
		print(-1)
	else:
		i = 1
		while len(s) < k:
			s.add(i)
			i += 1
		c = list(s)
		print(n * k)
		for i in range(n * k):
			print(c[i % k], end=' ')
		print()


def solve(array, length, k):
	distinct_elements = set(array)
	window = list(distinct_elements)
	while len(window) <= k:
		window.append(window[0])
	ans = []
	i = 0
	j = 0
	counter = 0
	while i < length and counter < k:
		if array[i] == window[j % k]:
			ans.append(array[i])
			i += 1
			j += 1
			counter = 0
		else:
			ans.append(window[j % k])
			j += 1
			counter += 1
	if counter == k:
		print('-1', end=' ')
	else:
		print(len(ans))
		for num in ans:
			print(num, end=' ')
	print()
testCases = int(input())
while testCases:
	(N, K) = map(int, input().split())
	A = [int(x) for x in input().split()]
	solve(A, N, K)
	testCases -= 1


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	unique = set(arr)
	if len(unique) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for j in unique:
				print(j, end=' ')
			for j in range(k - len(unique)):
				print('1', end=' ')
		print()
	t -= 1


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline().rstrip()
res = ['YES', 'NO']
test_case = ii()
while test_case:
	test_case -= 1
	(n, k) = mi()
	s = set()
	a = li()
	for i in a:
		s.add(i)
	if len(s) > k:
		print(-1)
		continue
	d = k // len(s)
	r = k % len(s)
	ss = list(s)
	ss *= d
	ss += ss[:r]
	ss *= n
	print(len(ss))
	print(*ss)


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = list(map(int, input().split()))
	if len(set(arr)) > k:
		print(-1)
	else:
		print(n * k)
		l = list(set(arr))
		p = k - len(l)
		l
		for i in range(p):
			l.append(1)
		for i in range(n):
			print(*l, end=' ')
		print()


for lo in range(int(input())):
	(n, k) = map(int, input().split())
	ls = [int(x) for x in input().split()]
	ls1 = [0 for i in range(n + 1)]
	c = 0
	for i in ls:
		if ls1[i] == 0:
			c += 1
			ls1[i] = 1
	if c > k:
		print(-1)
		continue
	ans = []
	j = 0
	for i in range(1, n + 1):
		if ls1[i] == 1:
			ans.append(i)
	while c < k and j < n:
		ans.append(ls[j])
		j += 1
		c += 1
	i = k
	while j < n:
		ans.append(ans[i - k])
		if ans[i - k] == ls[j]:
			j += 1
		i += 1
	print(i)
	print(*ans)


from collections import OrderedDict, Counter
t = int(input())

def solve(arr, k):
	d = OrderedDict()
	for x in arr:
		if x not in d:
			d[x] = 1
		else:
			d[x] += 1
	if len(d) > k:
		return 0
	ans = []
	for x in d:
		if len(ans) < k:
			ans.append(x)
		else:
			break
	if len(ans) < k:
		ans.extend([arr[0]] * (k - len(ans)))
	res = ans * len(arr)
	return res
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	ans = solve(a, k)
	if ans:
		print(len(ans))
		print(' '.join(list(map(str, ans))))
	else:
		print(-1)


import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = list(set(a))
	s.sort()
	if len(s) <= k:
		cnt = [0] * 100
		for i in range(n):
			cnt[a[i] - 1] += 1
		ans = []
		for i in range(len(cnt)):
			if cnt[i] != 0:
				ans.append(i + 1)
		rest = k - len(s)
		for i in range(100):
			if rest == 0:
				break
			elif cnt[i] == 0:
				ans.append(i + 1)
				rest -= 1
		for i in range(len(ans), 10 ** 4):
			ans.append(ans[i % k])
		print(len(ans))
		print(*ans)
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	li = [int(x) for x in input().split()]
	if k == n:
		print(len(li))
		print(*li)
		continue
	d = set()
	for i in range(len(li)):
		d.add(li[i])
	if len(d) > k:
		print(-1)
		continue
	d = list(d)
	d.sort()
	o = []
	if len(d) < k:
		k = k - len(d)
		for i in range(1, n + 1):
			if i not in d:
				o += [i]
				k -= 1
			if k == 0:
				break
	d = d + o
	d.sort()
	p = []
	for i in range(len(li)):
		p += d
	print(len(p))
	print(*p)


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
	return [float(v) for v in sys.stdin.readline().split()]
t = read_int()
for i in range(t):
	(n, k) = read_int_line()
	a = read_int_line()
	b = []
	d = {}
	for i in a:
		if i in d:
			continue
		else:
			d[i] = i
			b.append(i)
	if len(b) > k:
		print(-1)
	else:
		ans = list(b)
		if len(b) < k:
			ans = list(b) + [1] * (k - len(b))
		ans = ans * n
		print(len(ans))
		print(*ans)


import math, sys
from collections import defaultdict, Counter, deque
from functools import reduce
INF = float('inf')
MOD = int(1000000000.0) + 7

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = defaultdict(int)
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors[i] += 1
			n //= i
		i += 1
	if n > 1:
		factors[n] += 1
	return factors

def main():
	(n, k) = vars()
	arr = array()
	m = Counter(arr)
	if len(m) > k:
		print(-1)
		return
	num = list(m.keys())
	while len(num) < k:
		num.append(1)
	print(len(num) * n)
	print(*num * n)

class DSU:

	def __init__(self, n):
		self.p = [i for i in range(n + 1)]
		self.size = [1 for i in range(n + 1)]
		self.minmax = [[i, i] for i in range(n + 1)]
		self.n = n

	def find(self, node):
		if self.p[node] != node:
			self.p[node] = self.find(self.p[node])
		return self.p[node]

	def union(self, source, dest):
		source = self.find(source)
		dest = self.find(dest)
		if source != dest:
			if self.size[source] < self.size[dest]:
				(source, dest) = (dest, source)
			self.p[dest] = source
			self.size[source] += self.size[dest]
			mini = min(self.minmax[source][0], self.minmax[dest][0])
			maxi = max(self.minmax[source][1], self.minmax[dest][1])
			self.minmax[source] = [mini, maxi]

def input():
	return sys.stdin.readline().rstrip('\n')

def print(*args, sep=' ', end='\n'):
	first = True
	for arg in args:
		if not first:
			sys.stdout.write(sep)
		sys.stdout.write(str(arg))
		first = False
	sys.stdout.write(end)

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))
t = 1
t = int(input())
for _ in range(t):
	main()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	d = {}
	mx = 1
	for i in a:
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
			if d[i] > mx:
				mx = d[i]
	m = len(d.keys())
	if m > k:
		print(-1)
		continue
	if m == 1 or n == k:
		ans = a
	else:
		ans = []
		for i in d.keys():
			ans.append(i)
		if m < k:
			for i in range(k - m):
				ans.append(ans[m - 1])
		x = 10000 // k
		for i in range(x - 1):
			for j in range(k):
				ans.append(ans[j])
	print(len(ans))
	for i in ans:
		print(i, end=' ')
	print()


def solve(n, k, arr):
	s = set(arr)
	l = len(set(arr))
	if l > k:
		return -1
	if l == k:
		r = ' '.join(s)
		out = r
		for _ in range(n - 1):
			out = out + ' ' + r
		return out
	if l < k:
		l_r = abs(l - k)
		r = ' '.join(s)
		for _ in range(l_r):
			r = r + ' ' + arr[0]
		out = r
		for _ in range(n - 1):
			out = out + ' ' + r
		return out
t = int(input())
while t > 0:
	(n, k) = [int(x) for x in input().split()]
	arr = input().split()
	s = solve(n, k, arr)
	if s != -1:
		print(len(s.split()))
		print(s)
	else:
		print(s)
	t -= 1


t = int(input())
for i1 in range(t):
	(n, k) = list(map(int, input().split(' ')))
	l = list(map(int, input().split(' ')))
	flag = True
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		ans = []
		for i in range(1, n + 1):
			if len(s) < k:
				if i not in s:
					s.append(i)
		s.sort()
		temp = s
		for i in range(n):
			ans.append(temp)
		print(len(ans) * len(temp))
		s = ''
		for i in range(len(ans)):
			for j in range(len(temp)):
				s += str(ans[i][j]) + ' '
		print(s)


def Check(a, k):
	Equ = sum(a[0:k])
	i = 1
	while i + k <= n:
		if sum(a[i:i + k]) != Equ:
			return False
		i += 1
	return True

def Solve(n, k, a):
	A = set(a)
	d = len(A)
	if d > k:
		return -1
	if Check(a, k):
		print(n)
		s = ''
		for num in a:
			s += str(num) + ' '
		return s
	if d < k:
		i = 1
		while d < k:
			if i not in A:
				A.add(i)
				d += 1
			i += 1
	i = 0
	while i + k <= n:
		B = set()
		for j in range(i, i + k):
			if a[j] in B:
				for num in A:
					if num not in B:
						a.insert(j, num)
						n += 1
						B.add(num)
			else:
				B.add(a[j])
		i += 1
	print(len(a))
	s = ''
	for num in a:
		s += str(num) + ' '
	return s
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(Solve(n, m, arr))


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict
con = 10 ** 9 + 7

def getlist():
	return list(map(int, input().split()))

def main():
	T = int(input())
	for i in range(T):
		(N, K) = getlist()
		A = getlist()
		D = defaultdict(int)
		for j in A:
			D[j] += 1
		M = len(D)
		if M > K:
			print(-1)
		else:
			ans = []
			for j in D:
				ans.append(str(j))
			for j in range(K - M):
				ans.append('1')
			var = 100 * K
			print(var)
			print(' '.join(ans * 100))
main()


import math
import atexit
import io
import sys
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def array_to_string(a):
	s = ''
	for i in a:
		s += str(i) + ' '
	return s[0:len(s) - 1]

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
while t > 0:
	t = t - 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = dict()
	for i in a:
		if d.get(i):
			d[i] += 1
		else:
			d[i] = 1
	if len(d) > k:
		print(-1)
		continue
	l = []
	for (key, v) in d.items():
		l.append(key)
	rem = k - len(l)
	for i in range(rem):
		l.append(a[0])
	s = array_to_string(l) + ' '
	print(k * n)
	print(s * n)


t = int(input())
for j in range(t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	if len(list(set(a))) > k:
		print(-1)
	else:
		x = len(list(set(a)))
		c = [int(i) for i in list(set(a))]
		while x < k:
			c.append(1)
			x += 1
		b = c * n
		print(x * n)
		for i in range(x * n - 1):
			print(b[i], end=' ')
		print(b[x * n - 1])


t = int(input())
for test in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	values = []
	for i in range(n):
		if values.count(arr[i]) == 0:
			values.append(arr[i])
	if len(values) > k:
		print(-1)
	else:
		i = 1
		while len(values) < k:
			if values.count(i) == 0:
				values.append(i)
			i += 1
		ans = []
		for i in range(n):
			for j in range(k):
				ans.append(values[j])
		print(len(ans))
		print(*ans)


import collections
import bisect
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	t = len(list(set(l)))
	if t > k:
		print(-1)
	else:
		x = min(l)
		y = max(l)
		l2 = [0] * 101
		l1 = list(set(l))
		for i in range(n):
			l2[l[i]] = 1
		temp = len(l1)
		for i in range(1, 101):
			if l2[i] == 0:
				if temp < k:
					l1.append(i)
					temp += 1
		print(n * len(l1))
		for i in range(n):
			for j in range(len(l1)):
				print(l1[j], end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	checker = [0] * (n + 1)
	for i in arr:
		checker[i] = 1
	if sum(checker) > k:
		print(-1)
	else:
		dist = []
		for i in range(len(checker)):
			if checker[i] == 1:
				dist.append(i)
		while len(dist) < k:
			dist.append(dist[-1])
		dist *= n
		print(len(dist))
		print(*dist)


from collections import deque
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
		continue
	ans = []
	for i in set(a):
		ans.append(str(i))
	for i in range(k - len(set(a))):
		ans.append(str(a[i]))
	realans = []
	for i in range(n):
		realans += ans
	print(len(realans))
	print(' '.join(realans))


import math, sys
import heapq
from fractions import Fraction
from collections import Counter, defaultdict

def li():
	return list(map(int, sys.stdin.readline().split()))

def ls():
	return list(map(int, list(input())))

def la():
	return list(input())

def ii():
	return int(input())

def dic(x):
	return defaultdict(lambda : x)

def isPrime(n):
	i = 2
	if n == 1:
		return False
	while i <= int(math.sqrt(n)):
		if n % i == 0:
			return False
		i = i + 1
	return True

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def LCM(a, b):
	return a * b / gcd(a, b)
t = ii()
for _ in range(t):
	(n, k) = li()
	a = li()
	if len(set(a)) > k:
		print(-1)
	elif len(set(a)) == k:
		print(k * n)
		print(*list(set(a)) * n)
	elif len(set(a)) < k:
		maxm = max(a)
		for i in range(1, n + 1):
			if len(set(a)) < k:
				if i not in set(a):
					a.append(i)
		print(k * n)
		print(*list(set(a)) * n)


import collections

def inp():
	return int(input())

def linp():
	return [int(i) for i in input().split()]
T = inp()
ans = []
for t in range(T):
	(n, k) = linp()
	a = linp()
	d = collections.Counter(a)
	del d[' ']
	if len(d) > k:
		ans.append(-1)
	else:
		(d, b) = ([str(i) for i in d.keys()], '')
		for i in range(len(d)):
			b += d[i] + ' '
		b += '1 ' * (k - len(d))
		b = b * n
		b = b[:-1]
		ans.append((b, n * k))
for a in ans:
	if a == -1:
		print(a)
	else:
		print(a[1])
		print(a[0])


for T in range(int(input())):
	(n, m) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	s = set(arr)
	if len(s) > m:
		print(-1)
		continue
	l = (list(s) + [1] * (m - len(s))) * n
	print(n * m)
	print(*l)


import random
import math
LI = lambda : list(map(int, input().split()))
MI = lambda : map(int, input().split())
yes = lambda : print('Yes')
no = lambda : print('No')
I = lambda : list(input())
J = lambda x: ''.join(x)
II = lambda : int(input())
SI = lambda : input()
t = II()
for q in range(t):
	(n, k) = MI()
	a = LI()
	if len(set(a)) > k:
		print(-1)
	else:
		print(k * n)
		ans = list(set(a))
		mm = k - len(list(set(a)))
		for i in range(1, 101):
			if mm == 0:
				break
			if i not in a:
				ans.append(i)
				mm -= 1
		ans *= n
		print(*ans)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
for _ in range(ii()):
	(n, k) = mi()
	arr = li()
	sa = set(arr)
	lesa = len(sa)
	if lesa > k:
		print(-1)
	else:
		for i in range(1, n + 1):
			if lesa == k:
				break
			if i not in sa:
				sa.add(i)
				lesa += 1
		lisa = list(sa) * n
		print(len(lisa))
		print(*lisa)


def solve():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(set(l)) > k:
		return -1
	else:
		s = set(l)
		i = 1
		while len(s) < k:
			s.add(i)
			i += 1
		l = list(s) * n
		return (len(l), list(map(str, l)))
t = int(input())
for i in range(t):
	ans = solve()
	if ans == -1:
		print(ans)
	else:
		print(ans[0])
		print(' '.join(ans[1]))


import sys
input = sys.stdin.readline
from collections import Counter
inf = 100000000000000000
mod = 998244353
for CASES in range(int(input())):
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	num = len(set(A))
	NUM = list(set(A))
	while len(NUM) < m:
		NUM.append(NUM[-1])
	if num > m:
		print(-1)
		continue
	print(m * n)
	for i in range(n):
		for j in NUM:
			print(j, end=' ')
	print()


t = int(input())
for case in range(t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	b = []
	p = []
	unique = 0
	for i in a:
		if i > n:
			unique = k + 1
			break
		if i not in p:
			p.append(i)
			unique += 1
	if unique > k:
		print(-1)
	else:
		p2 = [i for i in list(range(1, n + 1)) if i not in p]
		while unique < k:
			p.append(p2.pop(0))
			unique += 1
		for i in range(n):
			b.extend(p)
		print(len(b))
		print(' '.join([str(i) for i in b]))


t = int(input())
res = []
for tc in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	temp = set(arr[:k])
	for i in range(1, n - k + 1):
		temp = temp.union(set(arr[i:i + k]))
	temp = list(temp)
	if len(temp) > k:
		res.append(-1)
	else:
		res.append((temp + [1] * (k - len(temp))) * n)
for r in res:
	if r == -1:
		print(r)
	else:
		print(len(r))
		print(' '.join([str(i) for i in r]))


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))

def solve():
	(n, k) = read_ints()
	nums = list(read_ints())
	unique = set(nums)
	if len(unique) > k:
		print(-1)
		return
	print(k * n)
	for i in range(n):
		for d in unique:
			print(d, end=' ')
		for j in range(k - len(unique)):
			print(1, end=' ')
	print()
t = read_int()
for case_num in range(t):
	solve()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	uniq = set(a)
	if len(uniq) > k:
		print(-1)
	else:
		for i in range(1, k + 1):
			if len(uniq) < k:
				uniq.add(i)
		print(n * k)
		print(*list(uniq) * n, sep=' ')


def inpint():
	return int(input())

def inpilist():
	return list(map(int, input().split()))

def inpimap():
	return map(int, input().split())

def inplist():
	return input().split()

def inpstr():
	return list(input())

def main():
	t = inpint()
	for _ in range(t):
		(n, k) = inpimap()
		a = inpilist()
		lsa = list(set(a))
		les = len(lsa)
		if les > k:
			print(-1)
		else:
			t = lsa * (k // les)
			t += lsa[:k - len(t)]
			t *= n
			print(len(t))
			print(*t)
main()


T = int(input())
for t in range(T):
	(N, K) = [int(_) for _ in input().split()]
	A = [int(_) for _ in input().split()]
	unique_nums = list(set(A))
	if len(unique_nums) > K:
		print(-1)
		continue
	sequence = unique_nums + [1] * (K - len(unique_nums))
	M = sequence * len(A)
	print(len(M))
	print(' '.join(map(str, M)))


T = int(input())

def solve():
	[N, K] = list(map(int, input().split()))
	A = list(map(int, input().split()))
	uq = set(A)
	if len(uq) > K:
		print(-1)
		return
	ad = 1
	while len(uq) != K:
		while ad in uq:
			ad += 1
		uq.add(ad)
	uq = list(uq)
	ans = uq * len(A)
	print(len(ans))
	print(' '.join([str(x) for x in ans]))
for _ in range(T):
	solve()


for t in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	count = 0
	dicti = {}
	for i in range(len(arr)):
		if arr[i] not in dicti:
			dicti[arr[i]] = True
			count += 1
	if count > k:
		print(-1)
	else:
		ans = []
		for keys in dicti:
			ans.append(keys)
		pos = 0
		while len(ans) != k:
			ans.append(arr[pos])
			pos += 1
		i = 0
		while pos < n:
			if ans[i] != arr[pos]:
				ans.append(ans[i])
			else:
				ans.append(arr[pos])
				pos += 1
			i += 1
		print(len(ans))
		print(*ans)


t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = {}
	temp = []
	flag = 0
	count = 0
	for i in l:
		if i not in d:
			d[i] = 1
			count += 1
			temp.append(i)
			if count > k:
				flag = 1
				break
		else:
			d[i] += 1
	temp.sort()
	if len(temp) != k:
		for i in range(1, n + 1):
			if i not in temp:
				temp.append(i)
				if len(temp) == k:
					break
	st = ''
	for i in range(len(temp)):
		st += str(temp[i]) + ' '
	if flag == 1:
		print(-1)
	else:
		print(10000 // k * k)
		for i in range(10000 // k):
			print(st, end='')
		print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(set(l)) > k:
		print(-1)
		continue
	else:
		set_ = list(set(l))
		for _ in range(k - len(set_)):
			set_.append(1)
		set_ *= 100
		print(len(set_))
		print(*set_)


read_input = lambda : map(int, input().split())
t = int(input())
for _ in range(t):
	(n, k) = read_input()
	a = list(read_input())
	if len(set(a)) > k:
		print(-1)
		continue
	seen = set()
	unique_elem = [x for x in a if not (x in seen or seen.add(x))]
	unique_elem += [1] * (k - len(unique_elem))
	print(k * n)
	print(*unique_elem * n)


t = int(input())

def solve(a, k):
	uniq = set(a)
	if len(uniq) > k:
		return None
	ans = []
	for x in uniq:
		ans.append(x)
	for _ in range(len(ans), k):
		ans.append(x)
	return ans * len(a)
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = solve(a, k)
	if ans:
		print(len(ans))
		print(' '.join(map(str, ans)))
	else:
		print(-1)


from sys import *
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
for _ in range(int(input())):
	(n, k) = get_int()
	arr = int_arr()
	s = set()
	for i in arr:
		s.add(i)
	l = len(s)
	if l > k:
		print(-1)
	else:
		print(n * k)
		print(*(list(s) + [1] * (k - l)) * n)


arr = [0]
for i in range(1, 32 + 1):
	arr.append(2 ** i)
for t in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = sorted(list(set(l)))
	if len(l1) > k:
		print(-1)
	else:
		for i in range(1, n + 1):
			if len(l1) == k:
				break
			if i not in l1:
				l1.append(i)
		l1.sort()
		ans1 = l1 * n
		print(len(ans1))
		print(*ans1)


from collections import defaultdict
for _ in range(int(input())):
	(a, k) = map(int, input().split())
	l = list(map(int, input().split()))
	arr = []
	d = defaultdict(lambda : 0)
	for i in range(a):
		if l[i] not in d.keys():
			d[l[i]] += 1
			if d[l[i]] == 1:
				arr.append(l[i])
	if len(arr) > k:
		print(-1)
	else:
		while len(arr) < k:
			arr.append(1)
		x = len(arr)
		print(a * k)
		for i in range(a):
			print(*arr, end=' ')
		print()


for i in range(int(input())):
	(a, b) = map(int, input().split())
	l = list(map(int, input().split()))
	r = max(l)
	c = list(set(l))
	if a == b:
		print(len(l))
		print(*l)
	elif len(set(l)) <= b:
		for i in range(b - len(c)):
			c.append(1)
		e = c * 100
		print(len(e))
		print(*e)
	else:
		print(-1)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		(n, k) = LI()
		a = LI()
		c = collections.Counter(a)
		if len(c) > k:
			rr.append(-1)
			continue
		for i in range(1, k + 1):
			if len(c) == k:
				break
			c[i] = 1
		t = list(c.keys())
		r = []
		ti = 0
		for u in a:
			while t[ti % k] != u:
				r.append(t[ti % k])
				ti += 1
			r.append(t[ti % k])
			ti += 1
		rr.append(len(r))
		rr.append(JA(r, ' '))
	return JA(rr, '\n')
print(main())


t = int(input())
for tt in range(t):
	(n, k) = map(int, input().split(' '))
	listn = list(map(int, input().split(' ')))
	unique = []
	for i in listn:
		if i not in unique:
			unique.append(i)
	if len(unique) > k:
		print('-1')
	else:
		ans = ''
		if len(unique) == k:
			print(k * len(listn))
			for u in unique:
				ans = ans + str(u) + ' '
			ans = len(listn) * ans
			print(ans)
		else:
			print(k * len(listn))
			dif = k - len(unique)
			for u in unique:
				ans = ans + str(u) + ' '
			ans = ans + dif * '1 '
			ans = len(listn) * ans
			print(ans)


import math
MOD = 1000003

def solve(a, n, k):
	myset = set()
	result = 0
	for i in range(0, n):
		myset.add(a[i])
	if len(myset) > k:
		print(-1)
	else:
		result = n * k
		print(result)
		ans = []
		for i in range(0, n):
			for s in myset:
				ans.append(s)
			for i in range(0, k - len(myset)):
				ans.append(1)
		print(*ans, sep=' ')
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	solve(a, n, k)


a = int(input())
for _ in range(a):
	(n, k) = map(int, input().split())
	ary = list(map(int, input().split()))
	z = set(ary)
	p = 0
	i = 0
	u = 0
	z = sorted(z)
	v = len(z)
	g = []
	if v > k:
		print('-1')
	else:
		if v < k:
			while len(z) != k:
				u += 1
				if u not in z:
					z.append(u)
			z = sorted(z)
			v = len(z)
		while i < len(ary) or len(g) < k:
			if i != len(ary) and ary[i] == z[p]:
				g.append(ary[i])
				p += 1
				i += 1
				if p == v:
					p = 0
			else:
				g.append(z[p])
				p += 1
				if p == v:
					p = 0
		print(len(g))
		for i in range(len(g)):
			print(g[i], end=' ')
		print()


t = int(input())
for jh in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = len(set(l))
	if k < s:
		print(-1)
		continue
	print(k * n)
	l1 = list(set(l))
	for i in range(k - s):
		l1.append(l1[i])
	l1 = l1 * n
	for i in l1[:-1]:
		print(i, end=' ')
	print(l1[-1])


for t in range(int(input())):
	(n, k) = map(int, input().split())
	Set = set(map(int, input().split()))
	q = len(Set)
	if q > k:
		print(-1)
	else:
		li = list(Set)
		st = ''
		for i in li:
			st = st + str(i) + ' '
		st = st + '1 ' * (k - q)
		st = st.rstrip()
		print(k * n)
		for i in range(n):
			print(st, end=' ')
		print()


from collections import defaultdict, Counter
from functools import lru_cache
from heapq import heappush, heappop
from math import gcd, floor, ceil
from sys import stdin, stdout

def ilist():
	return [int(x) for x in stdin.readline().strip().split(' ')]

def iint():
	return int(stdin.readline().strip())

def istr():
	return stdin.readline().strip()

def solve(a, k):
	n = len(a)
	s = list(set(a))
	if len(s) > k:
		print('-1')
		return
	c = k - len(s)
	for _ in range(c):
		s.append(1)
	s = [str(i) for i in s]
	print(n * k)
	for _ in range(n):
		print(' '.join(s), end=' ')
	print()
t = iint()
for _ in range(t):
	(n, k) = ilist()
	a = ilist()
	solve(a, k)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = list(set(a))
	if len(l) > k:
		print('-1')
	else:
		ans = []
		l.sort()
		for i in range(1, n + 1):
			if len(l) == k:
				break
			if i in l:
				continue
			else:
				l.insert(i - 1, i)
		for i in range(1, 10001, k):
			for j in range(1, k + 1):
				ans.append(l[j - 1])
		print('10000')
		for i in range(10000):
			print(ans[i], end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	distinct = set(arr)
	if k < len(distinct):
		print(-1)
	else:
		windowNums = list(distinct)
		for i in range(1, n + 1):
			if len(windowNums) == k:
				break
			if i not in distinct:
				windowNums.append(i)
		ans = windowNums * n
		print(len(ans))
		print(' '.join([str(x) for x in ans]))


def merge(arr, l, r, m):
	n1 = m - l + 1
	n2 = r - m
	L = [0] * n1
	R = [0] * n2
	for i in range(n1):
		L[i] = arr[i + l]
	for j in range(n2):
		R[j] = arr[j + m + 1]
	i = 0
	j = 0
	k = l
	while i < n1 and j < n2:
		if L[i] <= R[j]:
			arr[k] = L[i]
			i += 1
		else:
			arr[k] = R[j]
			j += 1
		k += 1
	while i < n1:
		arr[k] = L[i]
		i += 1
		k += 1
	while j < n2:
		arr[k] = R[j]
		j += 1
		k += 1

def mergeSort(arr, l, r):
	if l < r:
		m = (l + r) // 2
		mergeSort(arr, l, m)
		mergeSort(arr, m + 1, r)
		merge(arr, l, m, r)
t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split()))
	num1 = list(map(int, input().split()))
	count = [0] * n
	for j in range(n):
		count[num1[j] - 1] += 1
	s = 0
	lis = []
	for j in range(n):
		if count[j] != 0:
			s += 1
			lis.append(j + 1)
	if s > k:
		print(-1)
	else:
		arr = []
		for j in range(n - k + 1):
			arr.append(sum(num1[j:k + j]))
		if min(arr) == max(arr):
			print(n)
			print(' '.join((str(x) for x in num1)))
		elif s == k:
			l = num1[0] - 1
			a = lis[l % k]
			arr = []
			for j in range(k):
				a = lis[l % k]
				arr.append(a)
				l += 1
			array = n * arr
			print(len(array))
			print(' '.join((str(x) for x in array)))
		else:
			j = 1
			while s < k:
				if j not in lis:
					lis.append(j)
					s += 1
				j += 1
			mergeSort(lis, 0, k - 1)
			l = num1[0] - 1
			a = lis[l % k]
			arr = []
			for j in range(k):
				a = lis[l % k]
				arr.append(a)
				l += 1
			array = n * arr
			print(len(array))
			print(' '.join((str(x) for x in array)))


import io
import os
import sys
from atexit import register
import random
import math
import itertools
DEBUG = False
STRESSTEST = False
if not DEBUG:
	input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
sys.stdout = io.BytesIO()
register(lambda : os.write(1, sys.stdout.getvalue()))
tokens = []
tokens_next = 0

def nextStr():
	global tokens, tokens_next
	while tokens_next >= len(tokens):
		tokens = input().split()
		tokens_next = 0
	tokens_next += 1
	if type(tokens[tokens_next - 1]) == str:
		return tokens[tokens_next - 1]
	return tokens[tokens_next - 1].decode()

def nextInt():
	return int(nextStr())

def nextIntArr(n):
	return [nextInt() for i in range(n)]

def print(*argv, end='\n'):
	for arg in argv:
		sys.stdout.write((str(arg) + ' ').encode())
	sys.stdout.write(end.encode())

def genTestCase():
	n = random.randint(1, 10)
	k = random.randint(1, n)
	a = [random.randint(1, n) for _ in range(n)]
	return (a, k)

def bruteforce(a, k):
	raise NotImplementedError

def doStressTest():
	while True:
		curTest = genTestCase()
		mySoln = solve(*curTest)
		bruteforceSoln = bruteforce(*curTest)
		if mySoln != bruteforceSoln:
			print('### Found case ###')
			print(curTest)
			print(f'{mySoln} should have been: {bruteforceSoln}')
			return

def solve(a, k):
	nums = list(set(a))
	if k < len(nums):
		return -1
	nums = nums + [nums[-1]] * (k - len(nums))
	nums = nums * (10 ** 4 // len(nums))
	if DEBUG:
		nums = nums[:10]
	return nums
if not DEBUG and STRESSTEST:
	raise Exception('Wrong flags!')
if STRESSTEST:
	doStressTest()
else:
	t = nextInt()
	for _ in range(t):
		n = nextInt()
		k = nextInt()
		a = nextIntArr(n)
		res = solve(a, k)
		if res == -1:
			print(-1)
		else:
			print(len(res))
			print(' '.join(map(str, res)))
sys.stdout.flush()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	elem = []
	for el in a:
		if el not in elem:
			elem.append(el)
	if len(elem) > k:
		print(-1)
	else:
		if len(elem) < k:
			for per in range(1, n + 1):
				if per not in elem:
					elem.append(per)
					if len(elem) == k:
						break
		ans = []
		j = 0
		now = 0
		while j < n:
			if a[0] == elem[now]:
				j += 1
			ans.append(elem[now])
			now += 1
			if now == len(elem):
				now = 0
		if now != 0:
			while now < len(elem):
				ans.append(elem[now])
				now += 1
		print(len(ans))
		print(' '.join(list(map(str, ans))))


for f in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	used = [0] * (n + 1)
	useds = []
	for i in range(n):
		if used[a[i]] == 0:
			used[a[i]] = 1
			useds.append(a[i])
	if len(useds) > k:
		print(-1)
	else:
		while len(useds) < k:
			useds.append(1)
		sol = useds * n
		print(len(sol))
		print(*sol)


def prob1348B():
	t = int(input())
	while t:
		(n, k) = [int(x) for x in input().split()]
		arr = [i for i in input().split()]
		t -= 1
		s = set(arr)
		l = len(s)
		if l > k:
			print(-1)
		else:
			print(n * k)
			for i in range(n):
				for j in s:
					print(j + ' ', end='')
				for j in range(k - l):
					print('1 ', end='')
			print('')
prob1348B()


tc = int(input())
while tc > 0:
	(n, k) = map(int, input().split())
	if k == n:
		print(n)
		print(input())
	else:
		a = list(map(int, input().split()))
		s = set(a[:k])
		summa = sum(a[:k])
		good = True
		ok = True
		for i in range(k, n):
			if ok and a[i] != a[i - k]:
				ok = False
			s.add(a[i])
			if len(s) > k:
				good = False
				break
		if ok:
			print(len(a))
			print(' '.join(map(str, a)))
		elif not good:
			print(-1)
		else:
			period = ' '.join(map(str, sorted(s))) + ' 1' * (k - len(s)) + ' '
			print(k * len(a))
			print(period * len(a))
	tc -= 1


from itertools import *
from collections import *
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = [*map(int, input().split())]
	s = set(l)
	if len(s) > k:
		print(-1)
	else:
		ans = deque()
		arr = []
		for i in s:
			arr.append(i)
			ans.append(i)
		for i in range(k - len(s)):
			arr.append(l[i])
			ans.append(l[i])
		j = k - len(s)
		while j < n:
			if ans[0] == l[j]:
				ans.popleft()
				ans.append(l[j])
				arr.append(l[j])
				j += 1
				continue
			arr.append(ans[0])
			ans.append(ans[0])
			ans.popleft()
		print(len(arr))
		print(*arr)


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for tt in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(set(l)) > k:
		print(-1)
		continue
	d = {}
	for i in l:
		if i not in d:
			d[i] = i
	for i in range(1, k + 1):
		if len(d) == k:
			break
		if i not in d:
			d[i] = i
	s = list(d)
	size = len(s)
	i = 0
	ans = []
	while len(l) != 0:
		ind = i % size
		if s[ind] == l[0]:
			ans.append(l.pop(0))
		else:
			ans.append(s[ind])
		i += 1
	print(len(ans))
	print(*ans, sep=' ')


from sys import stdin

def list_int():
	s = stdin.readline()[:-1]
	return list(map(int, s.split()))

def list_float():
	s = stdin.readline()[:-1]
	return list(map(float, s.split()))

def list_str():
	s = stdin.readline()[:-1]
	return list(s.split())

def space_int():
	s = stdin.readline()[:-1]
	return map(int, s.split())

def space_float():
	s = stdin.readline()[:-1]
	return map(float, s.split())

def space_str():
	s = stdin.readline()[:-1]
	return s.split()

def _int():
	s = stdin.readline()[:-1]
	return int(s)

def _str():
	s = stdin.readline()[:-1]
	return s

def _float():
	s = stdin.readline()[:-1]
	return float(s)

def _gcd(a, b):
	if a == 0:
		return b
	return _gcd(b % a, a)

def _sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	return prime
alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
maxi = -2 ** 32
mini = 2 ** 32
mod = 10 ** 9 + 7
for _ in range(_int()):
	(n, k) = space_int()
	l = list_int()
	s = list(set(l))
	if len(s) > k:
		print(-1)
		continue
	a = s[:]
	for i in range(1, n + 1):
		if len(a) == k:
			break
		else:
			a.append(i)
	a.sort()
	ans = []
	for i in range(n):
		for j in range(len(a)):
			ans.append(a[j])
	print(len(ans))
	print(*ans)


import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())
for _ in range(int(input())):
	(n, k) = num_input()
	arr = list_input()
	ans = []
	count = 0
	if n == k:
		print(len(arr))
		for i in arr:
			print(i, end=' ')
		print()
	else:
		distinct = {}
		for i in arr:
			try:
				distinct[i] += 1
			except KeyError:
				distinct[i] = 1
		value = list(distinct.keys())
		value.sort()
		if len(value) > k:
			print(-1)
		elif len(value) == k:
			print(n * k)
			for i in range(n):
				for j in value:
					print(j, end=' ')
			print()
		else:
			for i in range(1, n + 1):
				if not i in value:
					value.append(i)
				if len(value) == k:
					break
			value.sort()
			print(n * k)
			for i in range(n):
				for j in value:
					print(j, end=' ')
			print()


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	(n, k) = map(int, input().split())
	dat = list(map(int, input().split()))
	dat = set(dat)
	if len(dat) > k:
		print(-1)
	else:
		dat = list(dat)
		dat.sort()
		fusoku = k - len(dat)
		cnt = 1
		while fusoku > 0:
			if cnt not in dat:
				dat.append(cnt)
				fusoku -= 1
			cnt += 1
		ll = 10000
		print(ll)
		res = []
		for i in range(0, ll):
			res.append(dat[i % len(dat)])
		print(' '.join(list(map(str, res))))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	c = set(a)
	b = list(c)
	if len(b) > k:
		print(-1)
	else:
		if len(b) < k:
			c = k - len(b)
			for i in range(1, n + 1):
				if c == 0:
					break
				if i not in b:
					b.append(i)
					c -= 1
		print(len(b) * n)
		for i in range(n):
			print(*b, sep=' ', end=' ')
		print()


for jj in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = set()
	ans = []
	for i in arr:
		if i not in s:
			s.add(i)
			ans.append(i)
	if len(s) > k:
		print(-1)
		continue
	for i in range(k - len(s)):
		ans.append(1)
	fin = []
	for i in range(n):
		fin.extend(ans)
	print(n * k)
	print(*fin)


import os
import sys
from io import BytesIO, IOBase

def solution(arr, n, k):
	if n == k:
		write(n)
		write(*arr)
		return
	st = sorted((x for x in set(arr)))
	if len(st) > k:
		write(-1)
		return
	if k == 1:
		write(len(arr))
		write(*arr)
		return
	res = []
	l = len(st)
	for i in range(k):
		res.append(st[i % l])
	const = sum(res)
	for _ in range(n * n - n):
		res.append(const - sum(res[-(k - 1):]))
	write(len(res))
	write(*res)

def main():
	for _ in range(r_int()):
		(n, k) = r_array()
		arr = r_array()
		solution(arr, n, k)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


for _ in range(int(input())):
	(z, n) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(set(l)) > n:
		print(-1)
	else:
		nl = list(set(l))
		out = nl[:]
		if len(out) != n:
			for i in range(n - len(out)):
				out.append(1)
		temp = out[:]
		for i in range(z - 1):
			out.extend(temp)
		print(len(out))
		for i in range(len(out)):
			print(out[i], end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = set(a)
	s = ''
	r = len(b)
	for x in b:
		s += str(x) + ' '
	if len(b) > k:
		print(-1)
	else:
		for i in range(k - len(b)):
			s = s + '1' + ' '
			r += 1
		print(r * n)
		print(s * n)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	v = list(map(int, input().split()))
	fv = [0] * (n + 1)
	dist = 0
	for i in range(n):
		fv[v[i]] += 1
		dist += fv[v[i]] == 1
	if dist > k:
		print(-1)
	else:
		u = []
		for i in range(n):
			if fv[v[i]] > 0:
				u.append(v[i])
				fv[v[i]] = 0
		for i in range(k - len(u)):
			u.append(1)
		u = u * n
		print(len(u))
		for x in u:
			print(x, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		for i in range(1, n + 1):
			if len(s) < k and i not in s:
				s.add(i)
		a = [i for i in s]
		res = [a[i % k] for i in range(n * k)]
		print(len(res))
		print(*res)


from sys import stdin, stdout
t = int(stdin.readline().strip())
for _ in range(t):
	(n, k) = stdin.readline().strip().split(' ')
	(n, k) = (int(n), int(k))
	arr = list(map(int, stdin.readline().strip().split(' ')))
	uq = set(arr)
	if len(uq) > k:
		stdout.write('-1\n')
	elif k == n:
		stdout.write(str(n) + '\n')
		for i in arr:
			stdout.write(str(i) + ' ')
		stdout.write('\n')
	elif k > n:
		stdout.write(str(k) + '\n')
		for i in arr:
			stdout.write(str(i) + ' ')
		for i in range(k - n):
			stdout.write('1 ')
		stdout.write('\n')
	else:
		tarr = list(uq) + [1 for x in range(k - len(uq))]
		stdout.write(str(n * len(tarr)) + '\n')
		for j in range(n):
			for i in tarr:
				stdout.write(str(i) + ' ')
		stdout.write('\n')


from collections import Counter

def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	(n, k) = read_ints()
	a = list(read_ints())
	cnt = Counter(a)
	distinct = len(cnt)
	if distinct > k:
		print(-1)
	else:
		print(n * k)
		s = set(cnt)
		for i in range(1, n + 1):
			if len(s) < k and (not i in s):
				s.add(i)
		ans = list(s) * n
		print(' '.join(map(str, ans)))


for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	s = set([int(x) for x in input().split()])
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for b in s:
				print(b, end=' ')
			for j in range(k - len(s)):
				print(1, end=' ')
		print()


from collections import Counter
nrew = int(input())
for wew in range(nrew):
	(n, k) = list(map(int, input().split(' ')))
	temp = list(map(int, input().split(' ')))
	dis = len(Counter(temp).keys())
	if dis > k:
		print('-1')
	else:
		li = []
		arr = [0] * 1000
		for i in temp:
			if arr[i] == 0:
				li.append(i)
				arr[i] = 1
		li.sort()
		ans = ''
		j = int(k / len(li))
		for kl in range(j):
			for i in li:
				ans += str(i) + ' '
		j = k % len(li)
		for i in range(j):
			ans += str(li[i]) + ' '
		fi = ''
		for i in range(n):
			fi += ans
		print(k * n)
		print(fi)


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	m = []
	d = {}
	cnt = 0
	for i in range(n):
		if d.get(l[i]) == None:
			m.append(l[i])
			d[l[i]] = 1
			cnt += 1
	if cnt > k:
		print(-1)
		continue
	while len(m) != k:
		m.append(m[-1])
	i = 0
	ind = 0
	while i < n:
		if m[ind] == l[i]:
			i += 1
		m.append(m[ind])
		ind += 1
	m = m[:-k]
	print(len(m))
	print(*m, sep=' ')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	orgarr = list(map(int, input().split()))
	mostarr = [0] * n
	distinctnrs = []
	for number in orgarr:
		if not mostarr[number - 1]:
			mostarr[number - 1] = 1
			distinctnrs.append(number)
	if len(distinctnrs) < k:
		for i in range(k - len(distinctnrs)):
			distinctnrs.append(1)
	if len(distinctnrs) > k:
		print(-1)
	else:
		print(len(distinctnrs) * n)
		print(*distinctnrs * n)


for j in range(int(input())):
	(n, k) = map(int, input().split(' '))
	flag = 0
	arr = list(map(int, input().split(' ')))
	set_ = set(arr)
	distinct = len(set_)
	if distinct > k:
		print('-1')
	elif distinct <= k:
		fx = ''
		max_ = max(set_)
		if len(set_) < k:
			set_ = list(set_)
			while len(set_) != k:
				set_.append(set_[-1])
		for i in set_:
			fx += str(i) + ' '
		print(n * k)
		print(n * fx)


def main():
	t = 1
	l = 0
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		p = set()
		for i in a:
			p.add(i)
		if len(p) > k:
			print(-1)
		else:
			p = list(p)
			while len(p) < k:
				p = p + [p[0]]
			c = []
			for i in range(n):
				c = c + p
			print(len(c))
			print(*c)
	return
main()


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set()
	for i in range(n):
		if a[i] not in s:
			s.add(a[i])
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		ans = []
		for i in range(n):
			for j in s:
				ans.append(j)
			for j in range(k - len(s)):
				ans.append(1)
		print(*ans)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_str():
	return input().decode().strip()

def rint():
	return map(int, input().split())

def oint():
	return int(input())
t = oint()
for _ in range(t):
	(n, k) = rint()
	a = list(set(rint()))
	if len(a) > k:
		print(-1)
		continue
	a = a[:] + [n] * (k - len(a))
	ans = []
	ll = 0
	for i in range(1, 10 ** 4):
		ans += a
		if k * (i + 1) >= 10 ** 4:
			ll = k * i
			break
	print(ll)
	print(*ans)


import random
import math
from collections import defaultdict
import itertools
from sys import stdin, stdout
import sys
import operator
from decimal import Decimal
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

def MI():
	return map(int, sys.stdin.buffer.readline().split())

def LI():
	return list(map(int, sys.stdin.buffer.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()

def main():
	for _ in range(int(input())):
		(n, m) = [int(i) for i in input().split()]
		a = list(map(int, input().split()))
		b = list(set(a))
		p = len(b)
		if p > m:
			print(-1)
		else:
			if p < m:
				for i in range(1, n + 1):
					if i not in b:
						b.append(i)
						p += 1
					if p == m:
						break
			b.sort()
			tmp = ''
			for bi in b:
				tmp += str(bi) + ' '
			ans = ''
			for _ in range(len(a)):
				ans += tmp
			print(len(b) * n)
			print(ans)
main()


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = [int(x) for x in input().split()]
	s = set(l)
	s = list(s)
	if len(s) > k:
		print('-1')
	else:
		a = k - len(s)
		if a > 0:
			s = s + [1] * a
		print(n * k)
		for h in range(n * k):
			print(s[h % k], end=' ')


def func(a, n, k):
	dig = []
	m = n
	for i in range(n):
		if a[i] not in dig:
			dig.append(a[i])
		if len(dig) > k:
			return (-1, [])
	tail = k - len(dig)
	dig = dig + [dig[0]] * tail
	a1 = dig * n
	return (len(dig) * n, a1)

def prnt(arr):
	for i in arr:
		print(i, end=' ')
	print()
t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = func(a, n, k)
	if ans[0] == -1:
		print(-1)
	else:
		print(ans[0])
		prnt(ans[1])


import math
import collections
from sys import stdin, stdout
T = int(stdin.readline())
for _ in range(T):
	(n, k) = list(map(int, stdin.readline().split()))
	a = list(map(int, stdin.readline().split()))
	d = {}
	for i in range(n):
		d[a[i]] = True
	if len(d) > k:
		print(-1)
		continue
	ex = k - len(d)
	ad = list(d.keys())
	ans = []
	for i in range(n):
		ans = ans + ad + ex * [1]
	print(len(ans))
	for an in ans:
		print(an, end=' ')
	print('')


def list_int():
	return list(map(int, input().split()))

def int_in():
	return int(input())

def map_in():
	return map(int, input().split())
t = int_in()
for _ in range(t):
	(n, k) = map_in()
	l = list_int()
	if n == k:
		print(n)
		print(' '.join([str(x) for x in l]))
	elif len(set(l)) > k:
		print(-1)
	else:
		l2 = []
		for i in l:
			if i not in l2:
				l2.append(i)
		while len(l2) < k:
			l2.append(1)
		print(k * n)
		for i in range(n):
			print(' '.join([str(x) for x in l2]), end=' ')
		print()


t = int(input())
for w in range(t):
	(n, k) = (int(i) for i in input().split())
	l = [int(i) for i in input().split()]
	s = set(l)
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		l1 = []
		for i in range(n):
			l1 += list(s) + [1] * max(0, k - len(s))
		print(*l1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(set(map(int, input().split())))
	l = len(arr)
	if l > k:
		print(-1)
	else:
		if l < k:
			t = k - l
			arr += [1] * t
		print(n * k)
		print(' '.join(map(str, arr * n)))


from sys import stdin

def input():
	return stdin.readline()
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ba = []
	if n == k:
		ba = a[0:]
		ba.append(a[0])
	else:
		se = set(a)
		l = list(se)
		l.sort()
		if len(l) < k:
			for i in range(1, n + 1):
				if i not in l:
					l.append(i)
				if len(l) == k:
					break
		if len(se) > k:
			print(-1)
			continue
		d = {}
		for i in a:
			d[i] = d.get(i, 0) + 1
		i = 0
		p = 0
		while i < n:
			if l[p] == a[i]:
				i += 1
			ba.append(l[p])
			p = (p + 1) % len(l)
	print(len(ba))
	for i in ba:
		print(i, end=' ')
	print()


def checker(a, n):
	a.sort()
	x = 1
	y = 1
	z = 1
	zz = [a[n - 1]]
	for i in range(0, n - 1):
		if a[i] == a[i + 1]:
			x += 1
		else:
			z += 1
			zz.append(a[i])
			if y <= x:
				y = x
				x = 1
			else:
				x = 1
	if y <= x:
		y = x
	return (y, z, zz)
t = int(input())
for i in range(0, t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	(x, z, zz) = checker(a, n)
	if z <= k:
		print(n * k)
		for j in range(0, n):
			for l in range(0, len(zz)):
				print(zz[l], end=' ')
			if z < k:
				for m in range(z, k):
					print(max(zz), end=' ')
			else:
				continue
		print()
	else:
		print('-1')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	distinct = len(set(arr))
	if distinct > k:
		print(-1)
	else:
		filler_copies = k - distinct
		l = list(set(arr)) + [1] * filler_copies
		total = l * n
		print(n * k)
		print(' '.join((str(x) for x in total)))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	array = list(map(int, input().split()))
	unicos = set(array)
	if len(unicos) > k:
		print(-1)
	else:
		print(k * n)
		unicos = list(unicos)
		while len(unicos) < k:
			unicos.append(unicos[0])
		for _ in range(n):
			print(*unicos, end=' ')
		print()


T = int(input())
for _ in range(0, T):
	(n, k) = map(int, input().split())
	s = [int(x) for x in input().split()]
	if len(set(s)) > k:
		print(-1)
	else:
		arr = list(set(s))
		arr = arr + [1] * (k - len(arr))
		arr = arr * n
		print(len(arr))
		print(*arr)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if len(set(arr)) > k:
		print(-1)
	else:
		result = []
		temp = list(set(arr))
		for i in range(1, n + 1):
			if len(temp) == k:
				break
			if i not in temp:
				temp.append(i)
		for i in range(len(arr)):
			result.extend(temp)
		print(len(result))
		print(*result)


ref = [x for x in range(1, 101)]
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	z = k
	dummy = list(set(a))
	if len(dummy) > k:
		print(-1)
		continue
	j = 0
	print(n * k)
	while len(dummy) < k:
		if ref[j] not in dummy:
			dummy.append(ref[j])
		j += 1
	for i in range(n * k):
		print(dummy[i % k], end=' ')
	print()


t = int(input())
for i in range(t):
	(n, k) = map(lambda x: int(x), input().split(' '))
	number = set(map(int, input().split()))
	j = 1
	while j <= n and k > len(number):
		if j not in number:
			number.add(j)
		j += 1
	if len(number) != k:
		print('-1')
	else:
		print(n * k)
		print(' '.join(list(map(lambda x: str(x), number)) * n))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	myset = set(a)
	if len(myset) > k:
		print(-1)
	elif len(myset) == k:
		print(n * k)
		for i in range(n):
			for x in myset:
				print(x, end=' ')
	else:
		for i in range(1, n + 1):
			if i not in myset:
				myset.add(i)
			if len(myset) == k:
				break
		print(n * k)
		for i in range(n):
			for x in myset:
				print(x, end=' ')


def solve():
	hm = {}
	for ai in a:
		if not str(ai) in hm:
			hm[str(ai)] = 1
	if len(hm.keys()) > k:
		print(-1)
	else:
		vals = [int(ke) for ke in hm.keys()]
		for i in range(k - len(vals)):
			vals.append(1)
		vals = vals * n
		print(len(vals))
		for val in vals:
			print(val, end=' ')
		print()
	return
t = int(input())
for i in range(1, t + 1):
	(n, k) = [int(s) for s in input().split(' ')]
	a = [int(s) for s in input().split(' ')]
	solve()


def solve():
	(N, K) = [int(el) for el in input().split()]
	arr = set([int(el) for el in input().split()])
	if len(arr) > K:
		return -1
	for i in range(1, N + 1):
		if i not in arr and len(arr) < K:
			arr.add(i)
	arr = sorted(arr)
	res = []
	for i in range(N):
		res.extend(arr)
	return res
for t in range(1, int(input()) + 1):
	res = solve()
	if type(res) == type(list()):
		print(len(res))
		print(' '.join(map(str, res)))
	else:
		print(res)


T = int(input())
for _ in range(T):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = list(set(a))
	m = len(b)
	q = [b[i % m] for i in range(k)]
	l = len(q)
	if m > k:
		print(-1)
		continue
	i = 0
	j = 0
	ans = []
	while i < n:
		if a[i] == q[j]:
			ans.append(q[j])
			i += 1
			j = (j + 1) % l
		else:
			ans.append(q[j])
			j = (j + 1) % l
	print(len(ans))
	print(' '.join(list(map(str, ans))))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set(l)
	l = list(s)
	if len(s) > k:
		print(-1)
		continue
	if k > len(s):
		for i in range(k - len(s)):
			l.append(1)
	y = l * n
	print(len(y))
	print(*y)


import collections
t = int(input())
for q in range(0, t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	d = collections.Counter(a)
	b = []
	if len(d) > k:
		print(-1)
	else:
		c = sorted(a)
		c = list(set(c))
		d = []
		for i in range(0, k - len(c)):
			d.append(1)
		for i in range(0, len(c)):
			d.append(c[i])
		print(n * k)
		for i in range(0, n):
			for j in range(0, k):
				b.append(d[j])
		print(*b, sep=' ')


t = int(input())
i = 0
while i < t:
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	r = set()
	for x in range(n):
		r.add(arr[x])
	if len(r) <= k:
		r = list(r)
		r.sort()
		if len(r) < k:
			m = len(r)
			for x in range(k - m):
				r.append(r[-1])
		ans = []
		j = 0
		z = 0
		while j < n:
			if r[z] == arr[j]:
				ans.append(arr[j])
				j = j + 1
				z = z + 1
			else:
				ans.append(r[z])
				z = z + 1
			if z == k:
				z = 0
		print(len(ans))
		for x in ans:
			print(x, end=' ')
		print()
	else:
		print(-1)
	i = i + 1


import os
import sys
from io import BytesIO, IOBase

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		L = list(map(int, input().split()))
		count = set()
		for num in L:
			count.add(num)
		if len(count) > k:
			print(-1)
		else:
			pattern = list()
			m = 0
			for elem in count:
				pattern.append(elem)
			for i in range(k - len(count)):
				pattern.append(1)
			print(n * k)
			for i in range(n):
				for x in pattern:
					print(x, end=' ')
			print()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = lambda s: self.buffer.write(s.encode()) if self.writable else None

	def read(self):
		if self.buffer.tell():
			return self.buffer.read().decode('ascii')
		return os.read(self._fd, os.fstat(self._fd).st_size).decode('ascii')

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline().decode('ascii')

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

def print(*args, sep=' ', end='\n', file=sys.stdout, flush=False):
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(end)
	if flush:
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
sys.setrecursionlimit(10000)
main()


def get_subarrays(k, a):
	return list(zip(*[a[x:] for x in range(k)]))

def is_beautiful(l):
	return all([sum(x) == sum(l[0]) for x in l])

def get_sums(l):
	return [sum(x) for x in l]

def solve(n, k, a):
	diff = sorted(list(set(a)))
	if len(diff) > k:
		print(-1)
	else:
		while len(diff) < k:
			diff.append(1)
		diff = list(diff) * n
		print(n * k)
		print(*diff)
test_cases = int(input())
for _ in range(test_cases):
	((n, k), a) = (map(int, input().split()), list(map(int, input().split())))
	solve(n, k, a)


import sys
import math

def IO():
	sys.stdin = open('pyinput.txt', 'r')
	sys.stdout = open('pyoutput.txt', 'w')

def scan(TYPE_1, TYPE_2=0):
	if TYPE_1 == int:
		return map(int, sys.stdin.readline().strip().split())
	elif TYPE_1 == float:
		return map(float, sys.stdin.readline().strip().split())
	elif TYPE_1 == list and TYPE_2 == float:
		return list(map(float, sys.stdin.readline().strip().split()))
	elif TYPE_1 == list and TYPE_2 == int:
		return list(map(int, sys.stdin.readline().strip().split()))
	elif TYPE_1 == str:
		return sys.stdin.readline().strip()
	else:
		print('ERROR!!!!')

def main():
	t = int(scan(str))
	while t > 0:
		t -= 1
		(n, k) = scan(int)
		a = scan(list, int)
		mp = {}
		for i in a:
			mp[i] = 1
		if len(mp) > k:
			print(-1)
			continue
		a = []
		for x in mp:
			a.append(x)
		for i in range(len(a), k):
			a.append(1)
		a = a * n
		print(len(a))
		print(*a)
main()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	array = [int(i) for i in input().split()]
	counter = 0
	result = set(array)
	unums = [int(i) for i in result]
	unumb = []
	if len(result) == 1:
		print(len(array))
		print(' '.join((str(i) for i in array)))
	elif len(result) > k:
		print(-1)
	elif len(result) == k:
		for d in range(n):
			unumb.extend(result)
		print(len(unumb))
		print(' '.join((str(i) for i in unumb)))
	else:
		for f in range(k - len(result)):
			unums.append(1)
		for d in range(n):
			unumb.extend(unums)
		print(len(unumb))
		print(' '.join((str(i) for i in unumb)))


def beauty(n, m):
	n = n.split()
	m = m.split()
	m = [int(m[i]) for i in range(len(m))]
	substr = int(n[1])
	differ = []
	if substr == int(n[0]):
		return [len(m), ' '.join([str(m[i]) for i in range(len(m))])]
	else:
		mass = set()
		for j in range(len(m)):
			mass.add(m[j])
		mass = list(mass)
		if len(mass) > substr:
			return [-1]
		else:
			ISSHORTER = False
			bonus = []
			if len(mass) < substr:
				for i in range(substr - len(mass)):
					mass.append(mass[i])
			t = []
			mass = list(mass)
			for i in range(100):
				t.append(' '.join([str(mass[j]) for j in range(len(mass))]))
			return [len(mass) * 100, ' '.join(t)]
t = []
for i in range(int(input().strip())):
	n = input().strip()
	m = input().strip()
	t.append(beauty(n, m))
for i in range(len(t)):
	if len(t[i]) == 1:
		print(t[i][0])
	else:
		print(t[i][0])
		print(t[i][1])


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(n, k) = map(int, input().split())
		lst = list(map(int, input().split()))
		dic = {}
		for ele in lst:
			freq = dic.get(ele, 0)
			dic[ele] = freq + 1
		dlen = len(dic)
		if dlen > k:
			yield (-1)
		else:
			temps = list(dic.keys())
			tempa = k // dlen * temps + temps[:k % dlen]
			tempa.sort()
			ans = tempa * n
			yield len(ans)
			yield ' '.join((str(x) for x in ans))
t = int(input())
ans = gift()
print(*ans, sep='\n')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k or n < k:
		print(-1)
		continue
	available = set(range(1, n + 1))
	ans = set(set(a))
	available = list(available - ans)
	ans = list(ans)
	while len(ans) != k and len(available) != 0:
		e = available.pop(0)
		ans.append(e)
	ans.sort()
	if len(ans) != k:
		print(-1)
		continue
	print(len(ans) * n)
	print(*ans * n, sep=' ')


input = __import__('sys').stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	inputted = input()
	ll = list(set(inputted.split()))
	if n == k:
		print(n)
		print(inputted)
		continue
	if len(ll) > k:
		print('-1')
	else:
		print(n * k)
		lll = k - len(ll)
		for i in range(lll):
			ll.append(ll[i])
		print(' '.join([' '.join(ll) for _ in range(n)]))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	dist = []
	for i in arr:
		if i not in dist:
			dist.append(i)
	if len(dist) > k:
		print(-1)
	else:
		while len(dist) != k:
			dist.append(1)
		print(n * len(dist))
		for i in range(n):
			print(*dist, end=' ')


test = int(input())
for tes in range(test):
	(n, k) = list(map(int, input().split()))
	ls = list(map(int, input().split()))
	setls = set(ls)
	if len(setls) > k:
		print(-1)
		continue
	if len(setls) < k:
		for i in range(1, n + 1):
			if i not in setls:
				setls.add(i)
				if len(setls) == k:
					break
	l = list(setls)
	print(n * k)
	print(*l * n)


N = int(input())
for _ in range(N):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print('-1')
	else:
		result = []
		n = len(a)
		dif = set(a)
		other = set(range(1, n + 1))
		while len(dif) < k:
			dif.add(other.pop())
		print(n * k)
		resdif = list(dif)
		for i in range(n):
			for j in resdif:
				result.append(str(j))
		print(' '.join(result))


for i in range(int(input())):
	(n, k) = input().split(' ')
	(n, k) = (int(n), int(k))
	A = set(input().split(' '))
	if len(A) > k:
		print(-1)
	else:
		print(k * n)
		B = []
		for i in A:
			B += [i]
		while len(B) < k:
			B += ['1']
		t = ''
		for i in B:
			t = t + i + ' '
		print(t * n)


n = int(input())
while n > 0:
	n = n - 1
	(m, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	print(m * k)
	for i in range(m):
		for b in s:
			print(b, end=' ')
		for j in range(k - len(s)):
			print(1, end=' ')
	print()


import math
t = int(input())
while t:
	line = input().split()
	(n, k) = (int(line[0]), int(line[1]))
	a = input().split()
	a = [int(x) for x in a]
	s = set(a)
	if len(s) > k:
		print('-1')
	else:
		tmp = list(s)
		x = len(tmp)
		for i in range(x, k):
			tmp.append(a[i])
		j = 0
		i = 0
		ans = []
		while i < n:
			if tmp[j] == a[i]:
				i += 1
			ans.append(tmp[j])
			j = (j + 1) % k
		print(len(ans))
		for x in ans:
			print(x, end=' ')
		print()
	t -= 1


from collections import Counter
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	if len(set(A)) > k:
		print(-1)
	else:
		Ans = []
		for i in A:
			if i not in Ans:
				Ans.append(i)
		Ans += Ans * (k // len(Ans) - 1)
		Ans += Ans[:k - len(Ans)]
		Ans = Ans * n
		print(len(Ans))
		print(*Ans)


import io
import os

def solve(N, K, A):
	s = list(set(A))
	if len(s) > K:
		return -1
	while len(s) < K:
		s.append(s[0])
	assert len(s) == K
	ans = s * N
	return str(len(ans)) + '\n' + ' '.join(map(str, ans))
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N, K) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, K, A)
	print(ans)


from collections import Counter
cases = int(input())
for v in range(cases):
	(n, k) = map(int, input().split())
	c = list(map(int, input().split()))
	mm = list(set(c))
	l1 = min(c)
	l2 = max(c)
	t = list(range(l1, l2 + 1))
	if len(mm) > k:
		print(-1)
	else:
		g = len(mm)
		h = k - g
		l = list(set([i for i in range(1, n + 1)]).difference(set(mm)))
		for i in range(h):
			mm.append(l[i])
		rc = []
		for i in range(n):
			for j in range(len(mm)):
				rc.append(mm[j])
		print(len(rc))
		print(*rc)


t = int(input())
for uu in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	ans = set(arr)
	if len(ans) > k:
		print(-1)
		continue
	anns = []
	ans = list(ans)
	for i in range(k):
		anns.append(ans[i % len(ans)])
	print(n * k)
	print(*anns * n)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	c = inp()
	for i in range(c):
		(n, k) = inlt()
		data = inlt()
		res = [data[0]]
		for v in data:
			if v not in res:
				res.append(v)
		for j in range(len(res), k):
			res.append(res[j % len(res)])
		i = 0
		c = 0
		j = 0
		if len(set(data)) <= k:
			while i < n:
				if res[j % k] == data[i]:
					res.append(data[i])
					i += 1
					j += 1
				else:
					res.append(res[j % k])
					j += 1
					c += 1
			print(len(res))
			print(' '.join([str(v) for v in res]))
		else:
			print(-1)
main()


t = int(input())
for _ in range(t):
	(n, k) = tuple([int(i) for i in input().split()])
	array = [int(i) for i in input().split()]
	a = {}
	for i in array:
		if i not in a.keys():
			a[i] = 1
		else:
			a[i] += 1
	if len(a) > k:
		print(-1)
	else:
		w = 2
		out = list(a.keys())
		while len(out) < k:
			out.append(1)
		out = out * len(array)
		outf = ''
		for k in out:
			outf += str(k) + ' '
		print(len(out))
		print(outf)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	distinct = len(set(arr))
	if k < distinct:
		print(-1)
	else:
		arr = list(set(arr))
		x = []
		i = 0
		while len(x) < k:
			x.append(arr[i])
			if i < len(arr) - 1:
				i += 1
			else:
				i = 0
		ans = []
		for i in range(n):
			for j in x:
				ans.append(j)
		print(len(ans))
		for i in ans:
			print(i, end=' ')
		print()


n = int(input())
for _ in range(n):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	cur = set()
	ans = 0
	for i in range(n):
		cur = cur.union(set(A[i:i + k]))
		if len(cur) > k:
			ans = -1
	cur = list(cur)
	if len(cur) != k:
		cur += [n for __ in range(k - len(cur))]
	final = cur * n
	if ans == 0:
		print(len(final))
		print(' '.join(map(str, final)))
	else:
		print(ans)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = []
	flag = 0
	for j in range(len(l)):
		if l[j] not in d:
			d.append(l[j])
	d.sort()
	if len(d) > k:
		print(-1)
	else:
		v = k - len(d)
		if v == 0:
			print(len(d) * n)
			print(*d * n)
		else:
			while v > 0:
				d.append(1)
				v -= 1
			print(len(d) * n)
			print(*d * n)


from math import *
for zz in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	i = 0
	s = list(sorted(set(a)))
	while len(s) < k:
		s.append(1)
	if len(s) > k:
		print(-1)
	else:
		x = [i for i in s] * n
		print(len(x))
		print(*x)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	ns = list(map(int, input().split()))
	ons = list(map(str, set(ns)))
	if len(ons) > k:
		print(-1)
		continue
	for _ in range(len(ons), k):
		ons.append('1')
	print(n * k)
	print(' '.join(n * ons))


t = int(input())
for i in range(t):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	arr_set = set(arr)
	arr_set = list(arr_set)
	if len(arr_set) > k:
		print(-1)
	else:
		while len(arr_set) != k:
			arr_set.append(1)
		arr2 = arr_set * n
		print(len(arr2))
		print(*arr2)


from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
for _ in range(vary(1)):
	(n, m) = vary(2)
	num = array_int()
	z = set(num)
	pt = list(z)
	if m < len(set(num)):
		print(-1)
		continue
	elif m == len(set(num)):
		print(m * n)
		print(*pt * n)
	else:
		print(m * n)
		for i in range(m - len(z)):
			pt.append(1)
		print(*pt * n)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k == n:
		print(len(a))
		print(' '.join(map(str, a)))
	else:
		fs = set(a)
		if len(fs) > k:
			print(-1)
		else:
			na = []
			na += list(fs)
			for e in a:
				while not len(na) < k and na[-k] != e:
					na.append(na[-k])
				na.append(e)
			print(len(na))
			print(' '.join(map(str, na)))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	s = set()
	for i in range(n):
		s.add(A[i])
	if len(s) > k:
		print(-1)
		continue
	m = k * n
	s = list(s)
	if len(s) < k:
		s += [1] * (k - len(s))
	print(m)
	ans = []
	for i in range(n):
		ans += s
	print(*ans)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(set(a))
	if len(b) > k:
		print(-1)
		continue
	if len(b) < k:
		for j in range(1, n + 1):
			if len(b) == k:
				break
			if j not in b:
				b.append(j)
	print(len(b) * n)
	print(*b * n)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	unique = set(a)
	if len(unique) > k:
		print(-1)
		continue
	sol = sorted(list(unique))
	sol = [1] * (k - len(sol)) + sol
	out = n * sol
	print(len(out))
	print(*out)


def handle(a, n, k):
	s = set(a)
	if len(s) > k:
		return None
	c = list(s) + [1] * (k - len(s))
	return c * n
cases = int(input())
for t in range(cases):
	(n, k) = map(int, input().split())
	a = map(int, input().split())
	h = handle(a, n, k)
	if h is None:
		print('-1')
	else:
		m = list(map(str, h))
		print(len(m))
		print(' '.join(m))


from sys import stdin, stdout

def main():
	for _ in range(int(input())):
		(n, k) = map(int, input().split())
		arr = [int(k) for k in input().split()]
		lis = set(arr)
		if len(lis) > k:
			print(-1)
		else:
			temp = list(lis)
			if len(temp) != k:
				for i in range(k - len(temp)):
					temp.append(1)
			print(k * n)
			print(*temp * n)
main()


t = int(input())
rez = []
for i in range(t):
	A = input().split(' ')
	n = int(A[0])
	k = int(A[1])
	a = input().split(' ')
	r = ''
	nom = 0
	l = [0]
	l1 = []
	for j in range(n):
		a[j] = int(a[j])
	for j in range(max(max(a), n)):
		l.append(0)
	for j in range(n):
		l[a[j]] += 1
		if l[a[j]] == 1:
			nom += 1
			l1.append(a[j])
	if nom > k:
		rez.append(-1)
		continue
	elif nom < k:
		ind = 1
		for j in range(nom, k):
			for f in range(ind, len(l)):
				if l[f] == 0:
					l1.append(f)
					ind = f + 1
					break
	m = n * k
	for j in range(n):
		for f in range(k):
			r += str(l1[f]) + ' '
	rez.append(m)
	rez.append(r)
for i in range(len(rez)):
	print(rez[i])


t = int(input())
while t:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = []
	c = 0
	d = {}
	f = 0
	for i in range(1, 101):
		d[i] = 0
	for i in range(n):
		if a[i] not in b:
			b.append(a[i])
			d[a[i]] = 1
			c += 1
		if c > k:
			f = 1
			break
	if f:
		print(-1)
		t -= 1
		continue
	if len(b) != k:
		for i in range(1, 101):
			if d[i] == 0:
				b.append(i)
			if len(b) == k:
				break
	b.sort()
	print(n * k)
	for i in range(n):
		for j in range(0, k):
			if i == n - 1 and j == k - 1:
				print(b[j])
			else:
				print(b[j], end=' ')
	t -= 1


def sol():
	(n, k) = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	c = []
	f = 0
	for x in a:
		if x not in c:
			c.append(x)
	if len(c) > k:
		f = -1
		print(f)
	else:
		while len(c) < k:
			c.append(c[0])
	d = []
	for i in range(0, n):
		d.extend(c)
	if f != -1:
		print(len(d))
		print(*d, sep=' ')
case = int(input())
for i in range(1, case + 1):
	sol()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	elemExist = [0] * n
	for mem in a:
		elemExist[mem - 1] = 1
	numberElem = sum(elemExist)
	if numberElem > k:
		print('-1')
	else:
		result = []
		oneNumber = -1
		for i in range(n):
			if elemExist[i] == 1:
				result.append(i + 1)
				oneNumber = i + 1
		result = result + [oneNumber] * (k - numberElem)
		result = result * n
		print(len(result))
		print(' '.join(list(map(str, result))))


t = int(input())
for _ in range(t):
	[n, k] = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	mn = set(a)
	if len(mn) > k:
		print(-1)
	else:
		print(k * n)
		if k > len(mn):
			dl = len(mn)
			for i in range(1, n + 1):
				if i in mn:
					continue
				else:
					mn.add(i)
					dl = dl + 1
					if dl == k:
						break
		out = []
		v_mn = list(mn)
		for i in range(n):
			out = out + v_mn
		print(*out)


testCases = int(input())
for i in range(0, testCases):
	inputElements = input().split()
	arLen = int(inputElements[0])
	sarLen = int(inputElements[1])
	beauAr = input().split()
	impChk = list(set(beauAr))
	if len(impChk) > sarLen:
		print(-1)
	else:
		perAr = list(set(beauAr))
		for a in range(0, sarLen - len(impChk)):
			perAr.append('1')
		perAr = perAr * 100
		print(len(perAr))
		for p in perAr:
			print(p, end=' ')
		print('')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	sA = set(A)
	if len(sA) > k:
		print(-1)
	else:
		to_use = list(sA)
		if len(to_use) < k:
			for i in range(1, n + 1):
				if i not in sA:
					to_use.append(i)
					if len(to_use) == k:
						break
		print(k * n)
		print(*to_use * n)


import sys
input = sys.stdin.readline
t = int(input())
from collections import Counter
from math import ceil

def rep(lst, length):
	new = []
	seen = set()
	for item in lst:
		if item in seen:
			continue
		else:
			new.append(item)
			seen.add(item)
	while len(new) < length:
		new.append(new[-1])
	return new
for _ in range(t):
	(n, k) = map(int, input().split())
	nums = list(map(int, input().split()))
	counts = Counter(nums)
	if len(counts.keys()) > k:
		print(-1)
	else:
		new = rep(nums, length=k) * n
		print(len(new))
		print(*new)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = []
	s = set(map(int, input().split()))
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		for j in range(n):
			for p in s:
				arr.append(p)
			for p in range(k - len(s)):
				arr.append(1)
		print(*arr, sep=' ')


from bisect import bisect_left as bl
for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	s = list(s)
	s.sort()
	if len(s) < k:
		for i in range(k - len(s)):
			s.append(s[0])
		s.sort()
	ans = []
	for i in range(n):
		left = bl(s, a[i])
		for w in range(left):
			ans.append(s[w])
		ans.append(a[i])
		for w in range(left + 1, len(s)):
			ans.append(s[w])
	print(len(ans))
	print(*ans)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		c = {}
		i = 0
		while i < k and a[i] not in c:
			c[a[i]] = 1
			i += 1
		v = a[:i] + list(set(a) - set(a[:i]))
		for x in a:
			while len(v) >= k and v[-k] != x:
				v += (v[-k],)
			v += (x,)
		print(len(v))
		print(*v)


from functools import reduce
from collections import Counter
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(delimiter=' '):
		return input().split(delimiter)

	@staticmethod
	def list_int(delimiter=' '):
		return list(map(int, input().split(delimiter)))

def main():
	t = Read.int()
	for _ in range(t):
		(n, k) = Read.list_int()
		a = Read.list_int()
		b = set(a)
		if len(b) > k:
			print(-1)
		else:
			res = list(b)
			if len(res) < k:
				res = res + [res[-1]] * (k - len(res))
			res = res * n
			print(len(res))
			print(*res)
main()


n_cases = int(input())
for case_num in range(n_cases):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	els = list(set(arr))
	if len(els) > k:
		print(-1)
	else:
		els = els + [1] * (k - len(els))
		print(n * k)
		print(' '.join([str(x) for x in els * n]))


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split(' ')]
	z = [int(x) for x in input().split(' ')]
	ans = []
	(a, b, c, d) = (0, 0, 1, 0)
	for i in range(n):
		if z[i] not in ans:
			ans.append(z[i])
	a = len(ans)
	if a > k:
		print(-1)
	elif a == k:
		ans = n * ans
		print(n * k)
		print(*ans)
	else:
		q = [1]
		ans = ans + (k - a) * q
		ans = n * ans
		print(n * k)
		print(*ans)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	s = list(set(a))
	if k < len(s):
		print(-1)
		continue
	b = []
	for x in range(k - len(s)):
		s.append(1)
	for x in range(n):
		for y in s:
			b.append(y)
	print(len(b))
	for x in b:
		print(x, end=' ')
	print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = {}
	for i in a:
		if i not in d:
			d[i] = 0
		d[i] += 1
	if len(d) > k:
		print(-1)
		continue
	print(n * k)
	for i in range(0, n):
		for j in d:
			print(j, end=' ')
		for l in range(0, k - len(d)):
			print(1, end=' ')
	print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	c = sum(a[:k])
	l = [c]
	li = []
	dic = {}
	for i in a:
		if i not in dic.keys():
			li.append(i)
			dic[i] = 0
	table = li
	if len(list(set(a))) > k:
		print(-1)
		continue
	x = len(table)
	count = 1
	while x < k:
		if count not in dic.keys():
			x += 1
			table.append(count)
		count += 1
	i = 1
	cur = li[0]
	j = 1
	while i < len(a):
		if a[i] == cur:
			li.append(a[i])
			i += 1
		else:
			li.append(cur)
		cur = table[j % k]
		j += 1
	print(len(li))
	print(*li)


import functools
import heapq as hp
import collections
import bisect
import math

def unpack(func=int):
	return map(func, input().split())

def l_unpack(func=int):
	return list(map(func, input().split()))

def s_unpack(func=int):
	return sorted(map(func, input().split()))

def ml_unpack(n):
	return [int(input()) for i in range(n)]

def range_n():
	return range(int(input()))

def getint():
	return int(input())

def counter(a):
	d = {}
	for x in a:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	return d

def main():
	for _ in range_n():
		(n, k) = unpack()
		a = l_unpack()
		s = set(a)
		if len(s) > k:
			print(-1)
			continue
		s = list(s)
		ans = ((s * k)[:k] if len(s) != k else s) * n
		print(len(ans))
		print(*ans)
main()


t = int(input())
while t:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ls = [0 for i in range(n + 1)]
	for i in range(n):
		ls[a[i]] += 1
	if len(set(a)) <= k:
		temp = [1 for i in range(k - len(set(a)))]
		temp += list(set(a))
		temp *= n
		print(len(temp))
		print(*temp)
	else:
		print(-1)
	t -= 1


t = int(input())
for _ in range(t):
	s = input().split()
	n = int(s[0])
	k = int(s[1])
	a = [int(i) for i in input().split()]
	pattern = set()
	for i in range(len(a)):
		pattern.add(a[i])
	if len(pattern) > k:
		print(-1)
	else:
		int_pattern = []
		for i in range(len(pattern)):
			int_pattern.append(pattern.pop())
		for i in range(len(int_pattern), k):
			int_pattern.append(int_pattern[0])
		print(10000)
		for i in range(10000 // len(int_pattern)):
			for j in range(len(int_pattern)):
				print(int_pattern[j], end=' ')
		for j in range(10000 % len(int_pattern)):
			print(int_pattern[j], end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().strip().split())
	s = set(map(int, input().strip().split()))
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		l = list(s) + [1] * (k - len(s))
		print(*l * n)


from collections import Counter
t = int(input())
while t > 0:
	t = t - 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = []
	if k < len(Counter(a).keys()):
		print(-1)
	else:
		a.sort()
		b = [a[0]]
		for i in range(1, n):
			if a[i] != b[-1]:
				b.append(a[i])
		while len(b) < k:
			for i in range(1, k + 1):
				if i not in b:
					b.append(i)
					break
		b = b * n
		print(len(b))
		for i in b:
			print(i, end=' ')
		print()


t = int(input())
for test in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	b = []
	for i in range(k):
		b.append(a[i])
	if n == k:
		print(n)
		print(*a)
	elif len(list(s)) > k:
		print(-1)
	else:
		temp = []
		x = list(s)
		y = x.copy()
		if len(x) < k:
			j = 0
			while len(x) != k:
				x.append(y[j])
				if j == len(y) - 1:
					j = 0
		for i in range(n):
			temp += x
		print(len(temp))
		print(*temp)


t = int(input())
for i in range(t):
	(n, k) = [int(v) for v in input().split()]
	w = [int(v) for v in input().split()]
	c = set(w)
	if len(list(c)) > k:
		print(-1)
	else:
		a = list(c)
		res = []
		y = len(a)
		a += (k - y) * '1'
		for j in range(n):
			res.extend(a)
		print(k * n)
		print(' '.join([str(v) for v in res]))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	a = set(l)
	if k < len(a):
		print(-1)
	else:
		print(n * k)
		b = k - len(a)
		a = list(a)
		for i in range(b):
			a.append(1)
		a = n * a
		print(*a)


a = int(input())
for x in range(a):
	(b, c) = map(int, input().split())
	d = list(map(int, input().split()))
	if b == c:
		print(b)
		print(*d)
	elif c == 1 and len(list(set(d))) != 1:
		print(-1)
	elif len(list(set(d))) == 1:
		print(b)
		print(*d)
	else:
		j = list(set(d))
		h = len(j)
		if h > c:
			print(-1)
		elif h < c:
			for y in range(c - h):
				j.append(1)
			j = j * b
			print(len(j))
			print(*j)
		else:
			j = j * b
			print(len(j))
			print(*j)


for i in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = set(a)
	b = list(b)
	c = len(b)
	if c > k:
		print(-1)
	else:
		while c < k:
			b.append(1)
			c += 1
		b = b * n
		b = ' '.join((str(i) for i in b))
		print(n * k)
		print(b)


t = int(input())
data_sets = [(tuple(map(int, input().split())), list(map(int, input().split()))) for i in range(t)]
for d_set in data_sets:
	(n, k) = (d_set[0][0], d_set[0][1])
	arr = d_set[1]
	numbers = list(set(arr))
	if k < len(numbers):
		print(-1)
	else:
		print(k * n)
		end_arr = numbers + [numbers[-1]] * (k - len(numbers))
		print(*end_arr * n)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	if len(set(a)) > k:
		print(-1)
	else:
		i = 1
		ans = list(set(a))
		ans = ans + [1] * (k - len(ans))
		count = len(a)
		k = 0
		while i != len(a):
			if a[i] != ans[k]:
				ans.append(ans[k])
				count += 1
				k += 1
			else:
				i += 1
				ans.append(ans[k])
				k += 1
		print(len(ans))
		print(*ans)


tc = int(input())
for _ in range(tc):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	unique = list(set(arr))
	if len(unique) > k:
		print(-1)
	else:
		rem = k - len(unique)
		for l in range(rem):
			unique.append(1)
		b = []
		for i in range(0, n):
			b.extend(unique)
		c = [str(q) for q in b]
		print(n * k)
		print(' '.join(c))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	st = set()
	for el in arr:
		st.add(el)
	if len(st) > k:
		print(-1)
	else:
		if n <= k:
			b = arr.copy()
			while len(arr) < k:
				arr.append(1)
		else:
			b = []
			for el in st:
				b.append(el)
			while len(b) < k:
				b.append(1)
		b *= 100
		print(len(b))
		print(*b)


for _ in range(int(input())):
	(N, K) = map(int, input().split())
	L = list(map(int, input().split()))
	S = set()
	for i in L:
		S.add(i)
	if len(S) > K:
		print(-1)
		continue
	print(N * K)
	for i in range(N):
		for j in S:
			print(j, end=' ')
		for k in range(0, K - len(S)):
			print(1, end=' ')
	print()


import sys
input = sys.stdin.readline
from collections import defaultdict as dd, deque as dq
import bisect
t = int(input())
while t:
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = dd(lambda : -1)
	res = []
	for i in range(n):
		if d[l[i]] == -1:
			res.append(l[i])
			d[l[i]] = i
	lol = 0
	if len(res) > k:
		lol = 1
	else:
		if len(res) < k:
			for j in range(k - len(res)):
				res.append(l[j])
		j = 0
		for i in range(n):
			while res[j] != l[i]:
				res.append(res[j])
				j += 1
			res.append(l[i])
			j += 1
	if lol:
		print(-1)
	else:
		print(len(res))
		print(*res)
	t -= 1


t = int(input())
while t:
	(n, k) = map(int, input().split())
	l = list(set(map(int, input().split())))
	if len(l) > k:
		print(-1)
	else:
		if len(l) < k:
			for i in range(n):
				if i + 1 not in l:
					l.append(i + 1)
				if len(l) == k:
					break
		count = 0
		ans = []
		for i in range(n):
			for j in range(len(l)):
				ans.append(l[j])
				count += 1
		print(count)
		print(*ans)
	t -= 1


testcases = int(input())
for test in range(0, testcases):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr = set(arr)
	if len(arr) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for j in arr:
				print(j, end=' ')
			for x in range(0, k - len(arr)):
				print(1, end=' ')
		print()


def checkbeauty(n, k, arr):
	s = sum(arr[:k])
	for i in range(n - k + 1):
		if sum(arr[i:i + k]) != s:
			return False
	return True

def beauty(n, k, arr):
	d = set(arr)
	if len(d) > k:
		print(-1)
	elif checkbeauty(n, k, arr):
		print(n)
		print(*arr)
	elif len(d) == k:
		s = list(d) * n
		print(len(s))
		print(*s)
	else:
		s = list(d)
		for i in range(k - len(s)):
			s.append(1)
		s = s * n
		print(len(s))
		print(*s)
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	out = beauty(n, k, arr)


import sys, random
from bisect import bisect_left, bisect_right
input = sys.stdin.readline

def main():
	inf = 10 ** 20
	t = int(input())
	for _ in range(1, t + 1):
		(n, k) = map(int, input().split())
		a = [int(x) for x in input().split()]
		diff = set(a)
		if len(diff) > k:
			print(-1)
			continue
		for i in range(1, n + 1):
			if len(diff) == k:
				break
			diff.add(i)
		ans = []
		now = diff
		i = 0
		while i < n:
			if len(ans) >= k:
				now.add(ans[-k])
			if a[i] in now:
				now.discard(a[i])
				ans.append(a[i])
				i += 1
				continue
			else:
				ans.append(now.pop())
		print(len(ans))
		for x in ans:
			print(x, end=' ')
		print()
main()


ts = int(input())
for _ in range(ts):
	(n, k) = tuple([int(x) for x in input().split(' ')])
	a = [int(x) for x in input().split(' ')]
	sa = list(dict.fromkeys(a))
	if len(sa) > k:
		print(-1)
		continue
	if len(sa) < k:
		nr = k - len(sa)
		sa.extend([1] * nr)
	print(len(sa) * n)
	print(str(sa * n)[1:-1].replace(',', ''))


t = int(input())
for i in range(t):
	(n, k) = map(lambda x: int(x), input().split(' '))
	array = list(map(lambda x: int(x), input().split(' ')))
	numbers = set(array)
	sum_numbers = sum(numbers)
	j = 1
	while len(numbers) < k and j <= n:
		if j not in numbers:
			numbers.add(j)
		j += 1
	if len(numbers) != k:
		print(-1)
		continue
	sequence = set(numbers)
	print(n * k)
	for j in range(n):
		for item in sequence:
			print(item, end=' ')
	print()


import copy
t = int(input())
for i in range(0, t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	s = set(a)
	ans = []
	if len(s) <= k:
		idx = 0
		c = 0
		a1 = list(s)
		while len(a1) < k:
			a1.append(a1[idx])
			idx += 1
		while n > 0:
			ans.extend(a1)
			idx += k
			n = n - 1
		print(len(ans))
		for i in ans:
			print(i, end=' ')
		print()
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	z = list(set(a))
	mn = min(a)
	mx = max(a)
	l = z[:]
	for i in range(1, n + 1):
		if len(l) != k and i not in l:
			l.append(i)
	if len(l) != k:
		print(-1)
		continue
	l.sort()
	ans = []
	for i in range(n):
		ans += l
	print(len(ans))
	print(*ans)


t = int(input())
for i in range(t):
	l = []
	(n, k) = [int(i) for i in input().split()]
	l = [int(i) for i in input().split()]
	di = {}
	maxn = 0
	for j in l:
		di[j] = 1
		maxn = max(maxn, j)
	if len(di) > k:
		print(-1)
	else:
		ll = list(di.keys())
		while len(ll) < k:
			ll.append(1)
		print(n * k)
		oder = ' '.join([str(i) for i in ll]) + ' '
		print(oder * n)


import sys
from collections import Counter
input = sys.stdin.buffer.readline
INF = 2 ** 62 - 1

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def slv(N, K, A):
	c = Counter(A)
	if len(c) > K:
		print(-1)
		return
	k = set(c.keys())
	i = 1
	while len(k) != K:
		if i not in k:
			k.add(i)
		i += 1
	k = list(k)
	k.sort()
	b = k * len(A)
	print(len(b))
	print(*b)
	return

def main():
	T = read_int()
	for _ in range(T):
		(N, K) = read_int_n()
		A = read_int_n()
		slv(N, K, A)
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	kind = set(a)
	if len(kind) > k:
		print(-1)
	else:
		li = list(kind)
		while len(li) < k:
			li.append(li[-1])
		print(n * len(li))
		print(*n * li)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	if len(set(a)) > k:
		print(-1)
	else:
		b = []
		r = set(a)
		j = 1
		while len(r) < k:
			r.add(j)
			j += 1
		for elem in r:
			b.append(elem)
		b *= n
		print(len(b))
		print(*b)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = list(set(a))
	if k == 1 and len(s) == 1:
		print(n)
		print(*a)
	else:
		distinct = len(s)
		if distinct > k:
			print(-1)
		else:
			temp = list(s)
			if distinct < k:
				temp = [s[0]] * (k - distinct + 1) + s[1:]
			ans = temp * n
			print(len(ans))
			print(*ans)


for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	r = list(set(a))
	if len(r) > k:
		print(-1)
	else:
		ans = sorted(r)
		if len(ans) < k:
			ans = [1] * (k - len(ans)) + ans
		ans = ans * n
		print(len(ans))
		for x in ans:
			print(x, end=' ')
		print()


from sys import stdin, stdout

def find(arr, N, K):
	if len(set(arr)) > K:
		return -1
	Z = list(set(arr))
	while len(Z) < K:
		Z.append(arr[0])
	R = Z * len(arr)
	return str(len(R)) + '\n' + ' '.join(map(str, R))

def main():
	for _ in range(int(stdin.readline())):
		(N, K) = list(map(int, stdin.readline().split()))
		arr = list(map(int, stdin.readline().split()))
		print(find(arr, N, K))
main()


from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline
sqrt = math.sqrt

def LI():
	return list(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def LI_():
	return list(map(lambda x: int(x) - 1, input().split()))

def II():
	return int(input())

def IF():
	return float(input())

def S():
	return input().rstrip()

def LS():
	return S().split()

def IR(n):
	return [II() for _ in range(n)]

def LIR(n):
	return [LI() for _ in range(n)]

def FR(n):
	return [IF() for _ in range(n)]

def LFR(n):
	return [LI() for _ in range(n)]

def LIR_(n):
	return [LI_() for _ in range(n)]

def SR(n):
	return [S() for _ in range(n)]

def LSR(n):
	return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

def solve():
	for _ in range(II()):
		(n, k) = LI()
		a = LI()
		if n == k:
			print(n)
			print(*a)
		else:
			seta = set(a)
			if len(seta) > k:
				print(-1)
				continue
			i = 0
			tmp = [i for i in seta]
			while len(tmp) < k:
				tmp.append(n)
			while i < n:
				if tmp[-k] == a[i]:
					i += 1
				tmp.append(tmp[-k])
			else:
				print(len(tmp))
				print(*tmp)
	return
solve()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	ls = list(set(ar))
	x = len(ls)
	if x > k:
		print(-1)
	else:
		li = k // x * ls + ls[:k % x]
		y = 10 ** 4 // k
		print(y * k)
		print(*li * y)


kl = int(input())
for l in range(kl):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	b = set(a)
	if len(b) > m:
		print(-1)
	else:
		dl = len(b)
		c = list(b)
		dp = 1
		while dl < m:
			while dp in c:
				dp += 1
			c = c + [dp]
			dl += 1
		print(len(c) * len(a))
		print(*c * len(a))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().strip().split())
	arr = list(map(int, input().strip().split()))
	andro = list(set(arr))
	if len(andro) > k:
		print(-1)
	else:
		ans = []
		for i in range(len(andro)):
			ans.append(andro[i])
		ptr = 0
		for i in range(k - len(ans)):
			ans.append(andro[ptr])
			ptr = (ptr + 1) % len(andro)
		print(len(ans) * n)
		print(*ans * n)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	s = list(set(a))
	p = len(s)
	if p > k:
		print(-1)
	else:
		print(n * k)
		ans = s
		ans += [1] * (k - p)
		print(*ans * n)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	setA = list(set(a))
	if len(setA) > k:
		print(-1)
	else:
		for _ in range(abs(len(setA) - k)):
			setA.append(1)
		print(len(setA) * n)
		print(*setA * n)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set()
	for i in range(n):
		s.add(l[i])
	if len(s) > k:
		print(-1)
	else:
		print(n * k)
		z = []
		c = []
		for i in s:
			z.append(i)
		for j in range(k - len(s)):
			z.append(1)
		for i in range(n):
			c.extend(z)
		print(*c)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	d = {}
	for i in a:
		try:
			d[i]
		except:
			d[i] = 0
	orig = len(d.keys())
	if orig > k:
		print(-1)
	else:
		c = []
		for i in d.keys():
			c.append(i)
		b = c * (k // orig)
		for i in range(k % orig):
			b.append(a[i])
		b = b * n
		print(len(b))
		for i in range(len(b)):
			print(b[i], end=' ')
		print('\n')


from sys import stdin, stdout
from sys import maxsize
input = stdin.readline

def solve():
	pass
test = 1
test = int(input().strip())
for t in range(0, test):
	(n, k) = list(map(int, input().strip().split()))
	a = [int(x) for x in input().strip().split()]
	x = set(a)
	if len(x) > k:
		print(-1)
	else:
		ans = list(x)
		while len(ans) < k:
			ans.append(1)

		def onedarr(a):
			print(len(a))
			for el in a:
				print(el, end=' ')
			print()
		onedarr(ans * n)
	ans = solve()


def solve(a, k):
	n = len(a)
	distinct = set(a)
	if len(distinct) > k:
		return None
	D = len(distinct)
	cur = 1
	for i in range(k - D):
		while cur in distinct:
			cur += 1
		distinct.add(cur)
	ref = sorted(list(distinct))
	ref_p = 0
	a_p = 0
	b = []
	while a_p < len(a):
		if ref[ref_p] == a[a_p]:
			a_p += 1
		b.append(ref[ref_p])
		ref_p = (ref_p + 1) % len(ref)
	return b

def main():
	T = int(input().strip())
	for _ in range(T):
		(n, k) = list(map(int, input().strip().split()))
		a = list(map(int, input().strip().split()))
		b = solve(a, k)
		if b is None:
			print(-1)
		else:
			print(len(b))
			print(' '.join([str(num) for num in b]))
main()


from sys import stdin, stdout

def f(a, n, k):
	if len(set(a)) > k:
		print(-1)
		return
	print(k * n)
	x = []
	b = list(set(a))
	c = len(b)
	for i in range(1, n + 1):
		if c == k:
			break
		if i not in b:
			x.append(i)
			c += 1
	x = x + b
	x.sort()
	for i in range(n - 1):
		print(*x, end=' ')
	print(*x)
t = int(stdin.readline())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	f(a, n, k)


t = int(input())

def fn():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print('-1')
		return
	ans = list(s)
	while len(ans) < k:
		for val in s:
			ans.append(val)
			break
	print(n * k)
	print(*ans * n)
while t:
	t -= 1
	fn()


for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	a = set((int(x) for x in input().split()))
	if len(a) > k:
		print(-1)
		continue
	print(n * k)
	a = list(a)
	for _ in range(k - len(a)):
		a.append(1)
	a = a * n
	print(*a)


T = int(input())
for t in range(T):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	mp = {}
	lis = []
	for a in A:
		if a not in mp:
			mp[a] = 0
			lis.append(a)
	if len(lis) > K:
		print(-1)
	else:
		print(K * len(A))
		for i in range(1, N + 1):
			if len(lis) >= K:
				break
			if i not in mp:
				mp[i] = 0
				lis.append(i)
		for i in range(len(A)):
			for l in lis:
				print(l, end=' ')
			for j in range(K - len(lis)):
				print
		print('')


t = int(input())
while t > 0:
	t = t - 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	a = set(a)
	if len(a) > k:
		print('-1')
	else:
		print(n * k)
		print(*(list(a) + [1] * (k - len(a))) * n)


t = int(input())
for test in range(t):
	(n, k) = list(map(int, input().split()))
	numbers = set(input().split())
	length = len(numbers)
	if length > k:
		print('-1', end='')
	else:
		print(n * k)
		for _ in range(n):
			for x in numbers:
				print(x, end=' ')
			counter = 0
			while counter < k - length:
				print('1', end=' ')
				counter += 1
	print()


for x in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		d = set(a)
		d = list(d)
		l = len(d)
		if l < k:
			for i in range(k - l):
				d.append(d[-1])
		d *= n
		print(len(d))
		print(*d)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split(' ')))
	ll = list(map(int, input().split(' ')))
	ll_set = set(ll)
	if k < len(ll_set):
		print(-1)
	else:
		possible_k = ll_set
		xrange = list(range(1, 101))
		while k % len(possible_k) != 0:
			possible_k.add(xrange.pop(0))
		seqx = []
		max_seqx = []
		for i in ll:
			if i in seqx:
				if len(seqx) > len(max_seqx):
					max_seqx = [*seqx]
				else:
					seqx = []
			else:
				seqx.append(i)
		seqx = max_seqx
		for i in possible_k:
			if i not in seqx:
				seqx.append(i)
		new_list = []
		cycler = 0
		for i in ll:
			while seqx[cycler % len(seqx)] != i:
				new_list.append(seqx[cycler % len(seqx)])
				cycler += 1
			new_list.append(seqx[cycler % len(seqx)])
			cycler += 1
		if len(new_list) > 10000:
			raise False
			print(-1)
		else:
			print(len(new_list))
			print(' '.join(map(str, new_list)))


def solve():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = {}
	for i in a:
		if i not in b.keys():
			b[i] = 1
	a = list(b.keys())
	del b
	if len(a) > k:
		print(-1)
		return
	a += [1] * (k - len(a))
	print(k * n)
	for _ in range(n):
		for i in range(k):
			print(a[i], end=' ')
t = int(input())
while t:
	solve()
	t -= 1


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(list(set(l))) > k:
		print(-1)
	else:
		t = len(list(set(l)))
		if t == k:
			l.sort()
			p = list(set(l))
			print(len(p * n))
			s = ''
			for i in p * n:
				s = s + str(i) + ' '
			print(s)
		else:
			t = len(list(set(l)))
			l.sort()
			p = list(set(l))
			for i in range(1, k - t + 1):
				p.append(i)
			p.sort()
			print(len(p) * n)
			s = ''
			for i in p * n:
				s = s + str(i) + ' '
			print(s)


import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = list(set(arr))
	if len(s) > k:
		print(-1)
		continue
	print(n * k)
	for i in range(n):
		for j in s:
			print(j, end=' ')
		for j in range(len(s), k):
			print(1, end=' ')
	print()


tt = int(input())
while tt:
	tt += -1
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		for i in range(k - len(s)):
			s.append(1)
		print(n * k)
		for i in range(n):
			print(*s, end=' ')
		print()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	a = set()
	for elem in arr:
		a.add(elem)
	if len(a) > k:
		print(-1)
		continue
	i = 0
	while len(a) < k:
		i += 1
		a.add(i)
	arr2 = []
	for j in range(k):
		arr2.append(a.pop())
	print(n * k)
	print(*arr2 * n)


for t in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if len(set(arr)) > m:
		print(-1)
	else:
		unique = list(set(arr))
		while len(unique) < m:
			unique.append(1)
		print(len(unique) * n)
		print(*unique * n)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	di = {}
	for i in a:
		if i in di:
			di[i] += 1
		else:
			di[i] = 1
	if len(di) > k:
		print(-1)
		continue
	ans = []
	for i in di:
		ans.append(i)
	for _ in range(k - len(di)):
		ans.append(a[0])
	print(10000)
	for i in range(10000):
		print(ans[i % k], end=' ')
	print()


T = int(input().strip())
for t in range(T):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))[:n]
	dn = set(arr)
	if len(dn) > k:
		print(-1)
	else:
		ak = list(dn)
		while len(ak) < k:
			ak.append(ak[0])
		ans = ak * n
		print(len(ans))
		print(*ans)


for i in range(int(input())):
	(n, k) = (int(j) for j in input().split())
	a = [int(j) for j in input().split()]
	mm = set(a)
	if len(mm) > k:
		print('-1', end=' ')
	else:
		if len(mm) < k:
			for j in range(1, 101):
				if j not in mm:
					mm.add(j)
				if len(mm) == k:
					break
		print(n * len(mm))
		for j in range(n):
			print(' '.join((str(x) for x in mm)), end=' ')
	print()


count = int(input())
for _ in range(count):
	(n, k) = [int(num) for num in input().split()]
	array = [int(num) for num in input().split()]
	unique = list(set(array))
	if len(unique) > k:
		print(-1)
	else:
		unique += [1] * (k - len(unique))
		print(len(unique) * n)
		for key in (unique * n)[:-1]:
			print(key, end=' ')
		print(unique[-1])


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = set(arr)
	if len(s) > k:
		print(-1, end=' ')
	else:
		print(n * k)
		for i in range(n):
			for r in s:
				print(r, end=' ')
			for j in range(k - len(s)):
				print(1, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = {}
	cnt = 0
	for i in l:
		if i not in d.keys():
			d[i] = 0
			cnt += 1
	if len(d) < k:
		for i in range(1, n + 1):
			if i not in d.keys():
				d[i] = 0
				if len(d) == k:
					break
	if cnt > k:
		print(-1)
	else:
		l1 = []
		for i in range(n):
			for j in d:
				l1.append(j)
		print(n * k)
		print(*l1)


t = int(input())
for i in range(1, t + 1):
	(n, k) = list(map(int, input().split()))
	es = list(map(int, input().split()))
	uni = list(set(es))
	if len(uni) > k:
		print(-1)
	else:
		sz = len(uni)
		for _ in range(k - sz):
			uni.append(1)
		res = []
		ui = 0
		es_i = 0
		while es_i < len(es):
			res.append(str(uni[ui]))
			if uni[ui] == es[es_i]:
				es_i += 1
			ui = (ui + 1) % k
		print(len(res))
		if len(res) != 0:
			print(' '.join(res))


def solve(n, k, a):
	d = set(a)
	if len(d) > k:
		return (-1, None)
	pattern = list(d)
	if len(pattern) < k:
		pattern += [pattern[0]] * (k - len(pattern))
	return (k * n, pattern * n)
tests = int(input())
for test in range(tests):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	(m, ans) = solve(n, k, a)
	print(m)
	if m != -1:
		print(*ans)


from sys import stdin, stdout, setrecursionlimit

class Tail_Recursion_Optimization:

	def __init__(self, RECURSION_LIMIT, STACK_SIZE):
		setrecursionlimit(RECURSION_LIMIT)
		threading.stack_size(STACK_SIZE)
		return None

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		for i in range(int(R())):
			(n, k) = [int(x) for x in R().split()]
			a = [int(x) for x in R().split()]
			unique = set(a)
			if len(unique) > k:
				print(-1)
				continue
			print(n * k)
			print(*n * (list(unique) + (k - len(unique)) * [1]))
		return 0

def main():
	s = SOLVE()
	s.solve()
main()


t = int(input())
out = ''
while t > 0:
	t -= 1
	(n, k) = [int(i) for i in input().split(' ')]
	a = [int(i) for i in input().split(' ')]
	s = set(a)
	if len(s) > k:
		out += '-1\n'
		continue
	x = ''
	for c in s:
		x += f'{c} '
	for i in range(k - len(s)):
		x += f'1 '
	out += f'{k * n}\n'
	out += f'{(x * n).strip()}\n'
print(out)


import sys, bisect
from math import gcd
input = sys.stdin.readline

def inp():
	return int(input().rstrip())

def inlt():
	return list(map(int, input().rstrip().split()))

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
times = 60
t = inp()
for _ in range(t):
	(n, k) = invr()
	nums = inlt()
	num_set = set(nums)
	if len(num_set) > k:
		print(-1)
	else:
		ans = []
		for i in num_set:
			ans.append(i)
		while len(ans) < k:
			ans.append(nums[0])
		f_in = 0
		for i in range(n):
			while nums[i] != ans[f_in]:
				ans.append(ans[f_in])
				f_in += 1
			ans.append(nums[i])
			f_in += 1
		print(len(ans))
		print(*ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	vals = list(map(int, input().split()))
	n = vals[0]
	k = vals[1]
	arr = list(map(str, input().split()))
	outy = []
	set1 = set(arr)
	if len(set1) > k:
		print(-1)
	else:
		sorts = sorted(list(set1))
		for s in range(k - len(sorts)):
			sorts.append(sorts[-1])
		list1 = sorts * n
		print(len(list1))
		print(' '.join(list1))


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict
import math

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()
t = int(input())
while t > 0:
	t -= 1
	(n, k) = listIn()
	arr = listIn()
	if k == 1 and len(set(arr)) != 1:
		print(-1)
	elif k == n:
		print(n)
		print(*arr)
	else:
		li = [0] * n
		li[0] = arr[0]
		for i in range(1, n):
			li[i] = li[i - 1] + arr[i]
		li2 = []
		for i in range(k - 1, n):
			if i == k - 1:
				s = li[i]
			else:
				s = li[i] - li[i - k]
			li2.append(s)
		if len(set(li2)) == 1:
			print(n)
			print(*arr)
		else:
			l = len(set(arr))
			if l > k:
				print(-1)
			elif l <= k:
				s1 = set(arr)
				order = list(s1)
				if l < k:
					s2 = set(list(range(1, n + 1))) - s1
					diff = k - l
					order += list(s2)[:diff]
				ans = order * n
				print(len(ans))
				print(*ans)


t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	s = set()
	for i in a:
		s.add(i)
	if len(s) > k:
		print(-1)
		continue
	i = 1
	while len(s) < k:
		s.add(i)
		i += 1
	s = sorted(s)
	a = s * n
	print(len(a))
	print(*a)


import sys
from math import log2, floor, ceil, sqrt
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(int(ri())):
	(n, k) = Ri()
	a = Ri()
	ans = []
	presum = -1
	flag = True
	for i in range(n - k + 1):
		summ = 0
		for j in range(i, i + k):
			summ += a[j]
		if presum == -1:
			presum = summ
		elif presum != summ:
			flag = False
			break
		if not flag:
			break
	if flag:
		print(n)
		print(*a)
	else:
		s = set(a)
		s1 = set([i for i in range(1, n + 1)])
		s1 = s1 - s
		if len(s) > k:
			print(-1)
		else:
			if len(s) == k:
				for i in range(n):
					for j in s:
						ans.append(j)
			else:
				for i in range(n):
					ite = 0
					for j in s:
						ans.append(j)
						ite += 1
					for j in s1:
						if ite < k:
							ans.append(j)
							ite += 1
						else:
							break
			print(len(ans))
			print(*ans)


from sys import stdin
import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = set(a)
	m = len(b)
	if m > k:
		print(-1)
	else:
		b = list(b)
		for i in range(k - m):
			b.append(b[0])
		print(n * k)
		for i in range(n):
			print(*b, end=' ')
		print('')


from collections import Counter
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	c = Counter(a)
	q = set(a)
	if k < len(q):
		print(-1)
	elif n == k:
		print(n * 2)
		print(' '.join(map(str, a * 2)))
	else:
		ar = list(set(a))
		i = 0
		while len(ar) != k:
			ar.append(ar[i])
			i += 1
		ar = ar * n
		print(len(ar))
		print(' '.join(map(str, ar)))


t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	nums = set(arr)
	if len(nums) > k:
		print(-1)
	else:
		nums = list(nums)
		while len(nums) < k:
			nums.append(1)
		print(n * k)
		print((' '.join((str(x) for x in nums)) + ' ') * n)


from itertools import repeat
for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	q = list(set(a))
	b = []
	ans = []
	if len(q) > k:
		print(-1)
	else:
		ans.extend(q)
		if len(ans) < k:
			b = [1] * (k - len(ans))
			ans.extend(b)
		print(n * len(ans))
		print(*ans * n, sep=' ')


T = int(input())
k = [0] * T
ls = [0] * T
for t in range(T):
	(j, k[t]) = [int(i) for i in input().split(' ')]
	ls[t] = [int(i) for i in input().split(' ')]

def desl(sl, k, l):
	if len(sl) == k:
		return [i for i in sl] * len(l)
	else:
		j = [i for i in sl] + [l[0]] * (k - len(sl))
		return j * len(l)
for t in range(T):
	uniques = {ls[t][0]}
	for i in ls[t]:
		uniques.add(i)
	if len(uniques) > k[t]:
		print('-1')
	else:
		print(len(desl(uniques, k[t], ls[t])))
		for i in desl(uniques, k[t], ls[t]):
			print(i, end=' ')
		print('')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = []
	for i in range(len(a)):
		if a[i] not in l:
			l.append(a[i])
	if k < len(l):
		print(-1)
	else:
		while k > len(l):
			l.append(l[0])
		print(len(l) * n)
		for i in range(n):
			print(*l, end=' ')
		print()


import sys
cases = int(sys.stdin.readline())
for _ in range(cases):
	(n, k) = map(int, sys.stdin.readline().split())
	nums = map(int, sys.stdin.readline().split())
	unique = set(nums)
	if len(unique) > k:
		print(-1)
		continue
	out = list(unique)
	out += [out[0]] * (k - len(out))
	out *= n
	print(len(out))
	print(' '.join(map(str, out)))


from sys import stdin, stdout
for query in range(int(stdin.readline())):
	nk = stdin.readline().split()
	n = int(nk[0])
	k = int(nk[1])
	mylist = [0 for x in range(n)]
	a = [int(x) for x in stdin.readline().split()]
	for x in a:
		mylist[x - 1] = 1
	if sum(mylist) > k:
		stdout.write('-1')
		stdout.write('\n')
		continue
	e = []
	for x in range(n):
		if mylist[x] == 1:
			e.append(x + 1)
	while len(e) < k:
		e.append(1)
	x = []
	x = [y for y in e]
	x = x * n
	stdout.write(str(len(x)) + '\n')
	for y in x:
		stdout.write(str(y) + ' ')
	stdout.write('\n')


MOD = 10 ** 9 + 7

def main():
	for _ in inputt():
		(n, k) = inputi()
		A = inputl()
		l = len(set(A))
		if l > k:
			print(-1)
			continue
		l = list(set(A)) + [A[0]] * (k - l)
		l *= len(A)
		print(len(l))
		print(*l)
from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(1000)
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(io.IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	if args:
		sys.stdout.write(str(args[0]))
		split = kwargs.pop('split', ' ')
		for arg in args[1:]:
			sys.stdout.write(split)
			sys.stdout.write(str(arg))
	sys.stdout.write(kwargs.pop('end', '\n'))

def debug(*args, **kwargs):
	print('debug', *args, **kwargs)
	sys.stdout.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip()
inputt = lambda t=0: range(t) if t else range(int(input()))
inputs = lambda : input().split()
inputi = lambda k=int: map(k, inputs())
inputl = lambda t=0, k=lambda : list(inputi()): [k() for _ in range(t)] if t else list(k())

def len(a):
	if isinstance(a, range):
		return -((a.start - a.stop) // a.step)
	return builtins.len(a)

def bisect_left(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if key(a[mid]) < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def bisect_right(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if x < key(a[mid]):
			hi = mid
		else:
			lo = mid + 1
	return lo

def insort_left(a, x, key=None, lo=0, hi=None):
	lo = bisect_left(a, x, key, lo, hi)
	a.insert(lo, x)

def insort_right(a, x, key=None, lo=0, hi=None):
	lo = bisect_right(a, x, key, lo, hi)
	a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right

def index(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi and key(a[i]) == x:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_lt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_le(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_gt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_ge(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

class Tree:

	def __init__(n):
		self._n = n
		self._conn = [[] for _ in range(n)]
		self._list = [0] * n

	def connect(a, b):
		pass

class Sieve:

	def __init__(self):
		self._n = 6
		self._list = [2, 3, 5, 7, 11, 13]

	def extend(self, n):
		if n <= self._list[-1]:
			return
		maxbase = int(n ** 0.5) + 1
		self.extend(maxbase)
		begin = self._list[-1] + 1
		newsieve = [i for i in range(begin, n + 1)]
		for p in self.primerange(2, maxbase):
			for i in range(-begin % p, len(newsieve), p):
				newsieve[i] = 0
		self._list.extend([x for x in newsieve if x])

	def extend_to_no(self, i):
		while len(self._list) < i:
			self.extend(int(self._list[-1] * 1.5))

	def primerange(self, a, b):
		a = max(2, a)
		if a >= b:
			return
		self.extend(b)
		i = self.search(a)[1]
		maxi = len(self._list) + 1
		while i < maxi:
			p = self._list[i - 1]
			if p < b:
				yield p
				i += 1
			else:
				return

	def search(self, n):
		if n < 2:
			raise ValueError
		if n > self._list[-1]:
			self.extend(n)
		b = bisect(self._list, n)
		if self._list[b - 1] == n:
			return (b, b)
		else:
			return (b, b + 1)

	def __contains__(self, n):
		if n < 2:
			raise ValueError
		if not n % 2:
			return n == 2
		(a, b) = self.search(n)
		return a == b

	def __getitem__(self, n):
		if isinstance(n, slice):
			self.extend_to_no(n.stop + 1)
			return self._list[n.start:n.stop:n.step]
		else:
			self.extend_to_no(n + 1)
			return self._list[n]
sieve = Sieve()

def isprime(n):
	if n <= sieve._list[-1]:
		return n in sieve
	for i in sieve:
		if not n % i:
			return False
		if n < i * i:
			return True
prime = sieve.__getitem__
primerange = lambda a, b=0: sieve.primerange(a, b) if b else sieve.primerange(2, a)

def factorint(n):
	factors = []
	for i in sieve:
		if n < i * i:
			break
		while not n % i:
			factors.append(i)
			n //= i
	if n != 1:
		factors.append(n)
	return factors
factordict = lambda n: Counter(factorint(n))
main()


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	SET = set(A)
	if len(SET) > k:
		print(-1)
	else:
		B = list(SET)
		while len(B) < k:
			B.append(1)
		print(len(B) * 100)
		print(*B * 100)


import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		(n, k) = MI()
		aa = LI()
		sa = set(aa)
		cnt = 0
		bb = []
		while 1:
			for a in sa:
				bb.append(a)
				cnt += 1
				if cnt == k:
					break
			if cnt == k:
				break
		if len(sa) > k:
			print(-1)
			continue
		print(k * n)
		print(*bb * n)
main()


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(N, K) = [int(x) for x in input().split()]
		A = [int(x) for x in input().split()]
		if len(set(A)) > K:
			print(-1)
			continue
		AA = list(set(A))
		AAA = [0] * N
		for aa in AA:
			AAA[aa - 1] = 1
		sa = K - len(set(A))
		for i in range(N):
			if sa == 0:
				break
			if AAA[i] == 0:
				AAA[i] = 1
				sa -= 1
		cnt = 0
		ans = []
		for i in range(N):
			for j in range(N):
				if AAA[j] == 1:
					ans.append(j + 1)
		print(len(ans))
		print(*ans)
main()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = list(set(a))
	if len(s) > k:
		print(-1)
	else:
		ar = [0] * k
		for i in range(k):
			ar[i] = s[min(len(s), i) - 1]
		b = []
		for i in range(n):
			b += ar
		print(n * k)
		print(' '.join(map(str, b)))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	li = list(map(int, input().split()))
	z = set(li)
	if k == n:
		print(n)
		print(*li)
	elif k == 1:
		if li.count(li[0]) == n:
			print(n)
			print(*li)
		else:
			print(-1)
	elif len(z) > k:
		print(-1)
	else:
		lt = list(z)
		pp = len(z)
		kt = [i for i in lt]
		for i in range(k - pp):
			kt.append(1)
		print(k * n)
		for i in range(n - 1):
			print(*kt, end=' ')
		print(*kt)


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	arrS = set(arr)
	if len(arrS) > k:
		print(-1)
	else:
		req = list(arrS)
		the = -1
		for i in range(1, n + 1):
			if i not in req:
				the = i
				break
		for _ in range(len(req), k):
			req.append(the)
		req.sort()
		newArr = req * n
		print(len(newArr))
		print(' '.join([str(x) for x in newArr]))


import math
t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	distinct_l = []
	subl = []
	ans = []
	for i in l:
		if i not in distinct_l:
			distinct_l.append(i)
	if len(distinct_l) > k:
		print(-1)
	else:
		ans = subl = distinct_l * (k // len(distinct_l)) + distinct_l[0:k % len(distinct_l)]
		ans = subl * len(l)
		print(len(ans))
		for a in ans:
			print(a, end=' ')
		print()
	t -= 1


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(set(a))
	if len(b) > k:
		print('-1')
	else:
		if len(b) < k:
			x = k - len(b)
			b.extend([1] * x)
		c = []
		for j in range(n):
			c.extend(b)
		print(len(c))
		c = list(map(str, c))
		print(' '.join(c))


from collections import Counter

def rn():
	a = int(input())
	return a

def rl():
	a = list(map(int, input().split()))
	return a
for _ in range(int(input())):
	[n, k] = rl()
	a = rl()
	al = len(a)
	au = list(dict.fromkeys(a))
	aul = len(au)
	if aul > k:
		print(-1)
		continue
	dal = 1
	while aul < k:
		if dal not in au:
			au.append(dal)
			aul += 1
		dal += 1
	print(al * aul)
	for i in range(al):
		print(*au, end=' ')
	print('')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = []
	f = 0
	if n == k:
		b = a[0:]
		b.append(a[0])
	else:
		s = set(a)
		l = list(s)
		l.sort()
		if len(l) < k:
			for i in range(1, n + 1):
				if i not in l:
					l.append(i)
				if len(l) == k:
					break
		if len(s) > k:
			f = 1
			print(-1)
		d = {}
		for i in a:
			d[i] = d.get(i, 0) + 1
		i = 0
		p = 0
		while i < n:
			if l[p] == a[i]:
				i += 1
			b.append(l[p])
			p = (p + 1) % len(l)
	if f == 0:
		print(len(b))
		print(*b)


t = int(input())
for q in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	flag = True
	sums = []
	last = sum(a[0:3])
	s = list(set(a))
	s.sort(reverse=True)
	if len(s) > k:
		print(-1)
		continue
	if len(s) < k:
		for x in range(n):
			if n - x not in s:
				s.append(n - x)
			if len(s) == k:
				break
	s.sort()
	l = []
	l += s * n
	print(len(l))
	for x in l:
		print(x, end=' ')
	print()


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(n, k) = value()
	a = array()
	unique = set(a)
	if len(set(a)) > k:
		print(-1)
		continue
	need = k - len(unique)
	ans = [1] * need + list(unique)
	print(len(ans) * n)
	print(*ans * n)


TT = int(input())
while TT > 0:
	TT -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	r = {}
	for c in a:
		if c in r:
			r[c] += 1
		else:
			r[c] = 1
	m = sorted(list(r.keys()))
	if len(m) > k:
		print(-1)
	elif n == k:
		print(n)
		for j in a:
			print(j, end=' ')
		print()
	else:
		print(n * k)
		for i in range(n):
			for j in range(len(m)):
				print(m[j], end=' ')
			for j in range(len(m), k):
				print(m[0], end=' ')
		print()


import sys
readline = sys.stdin.readline
T = int(readline())
Ans = []
for qu in range(T):
	(N, K) = map(int, readline().split())
	A = list(map(int, readline().split()))
	SA = set(A)
	if len(SA) <= K:
		res = list(SA)
		for i in range(1, N + 1):
			if len(res) == K:
				break
			if i not in SA:
				res.append(i)
		Ans.append(str(N * K))
		Ans.append(' '.join(map(str, res * N)))
	else:
		Ans.append('-1')
print('\n'.join(map(str, Ans)))


t = int(input())
while t:
	t -= 1
	(n, k) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	aset = set(a)
	if len(aset) > k:
		print(-1)
	else:
		ans = []
		count = [0] * (n + 1)
		for i in aset:
			count[i] = 1
		alst = list(aset)
		if len(alst) < k:
			for i in range(1, n + 1):
				if count[i] == 0:
					alst.append(i)
				if len(alst) == k:
					break
		alst.sort()
		for i in range(n):
			ans.extend(alst)
		print(len(ans))
		print(*ans)


for p in range(int(input())):
	(n, k) = input().split(' ')
	n = int(n)
	k = int(k)
	x = input().split(' ')
	x = list(map(int, x))
	s = set()
	for d in x:
		s.add(d)
	if len(s) > k:
		print(-1)
	else:
		for i in range(1, 10 ** 4 + 1):
			if i not in s and len(s) < k:
				s.add(i)
		ans = ''
		for d in s:
			ans += str(d) + ' '
		print(k * n)
		print(ans * n)


t = int(input())
for numtests in range(t):
	nums = input().split()
	n = int(nums[0])
	k = int(nums[1])
	a = input().split()
	for i in range(n):
		a[i] = int(a[i])
	distinct = {}
	counter = 0
	b = []
	for i in range(n):
		if distinct.get(a[i], 0) == 0:
			counter += 1
			b.append(a[i])
		distinct[a[i]] = distinct.get(a[i], 0) + 1
	if counter > k:
		print(-1)
	else:
		print(str(int(k * n)))
		for j in range(n):
			for i in range(counter):
				if j == n - 1 and i == k - 1:
					print(b[i], end='')
				else:
					print(b[i], end=' ')
			while i < k - 1:
				if j == n - 1 and i == k - 1:
					print(1, end='')
				else:
					print(1, end=' ')
				i += 1
		if numtests != t - 1:
			print('')


import os
import sys
from io import BytesIO, IOBase

def iin():
	return int(input())

def lin():
	return list(map(int, input().split()))

def main():
	T = iin()
	while T:
		T -= 1
		(n, k) = lin()
		a = lin()
		st = set(a)
		if len(st) > k:
			print(-1)
		else:
			ans = list(st)
			if len(ans) < k:
				ans.extend([ans[0]] * (k - len(ans)))
			print(k * n)
			ans = ans * n
			print(*ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	unique = set(a)
	if len(unique) > k:
		print(-1)
		continue
	if len(unique) * len(a) > 10 ** 4:
		raise Exception
	cycle = (list(unique) + a)[:k]
	out = cycle * len(a)
	print(len(out))
	print(' '.join(map(str, out)))


def uniq(input):
	output = []
	for x in input:
		if x not in output:
			output.append(x)
	return output
for __ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		seg = uniq(a) + [1] * (k - len(set(a)))
		res = seg * n
		print(len(res))
		print(*res)


import math

def main():
	for q in range(int(input())):
		(N, K) = map(int, input().split())
		l = list(map(int, input().split()))
		s = set()
		for i in range(len(l)):
			if not l[i] in s:
				s.add(l[i])
		si = len(s)
		if si > K:
			print('-1')
		else:
			for i in range(1, N + 1):
				if not i in s:
					if len(s) < K:
						s.add(i)
			si = K
			total = si * N
			li = []
			for i in s:
				li.append(i)
			print(total)
			for i in range(N):
				for j in range(len(li)):
					print(li[j], end=' ')
			print()
main()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	b = set(a)
	c = sorted(b)[::-1]
	if len(b) > k:
		print(-1)
	else:
		f = list(map(str, c))
		ll = len(c)
		f = ' '.join(f)
		while ll < k:
			f = f + ' ' + '1'
			ll += 1
		print(ll * n)
		for i in range(n):
			print(f, end=' ')
		print()


import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
from itertools import islice, cycle

def go():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	sa = sorted(set(a))
	if len(sa) > k:
		return -1
	res = []
	index = 0
	m = -1
	sb = list(islice(cycle(sa), k))
	for (i, c) in enumerate(cycle(sb)):
		if c == a[index]:
			index += 1
		if index == n:
			m = i + 1
			break
	sb = map(str, sb)
	part = ' '.join(islice(cycle(sb), m))
	return str(m) + '\n' + part
t = int(input())
ans = []
for _ in range(t):
	ans.append(str(go()))
print('\n'.join(ans))


def is_beautiful(arr, k):
	n = len(arr)
	for i in range(n - k):
		if arr[i:i + k] != arr[i + 1:i + 1 + k]:
			return False
	return True
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	if is_beautiful(a, k):
		print(n)
		print(' '.join(map(str, a)))
		continue
	unique = set(a)
	if len(unique) > k:
		print('-1')
		continue
	for i in range(1, n + 1):
		if i not in unique:
			if len(unique) == k:
				break
			unique.add(i)
	print(len(unique) * n)
	print(' '.join(map(str, list(unique) * n)))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	sl = len(s)
	if sl > k:
		print(-1)
		continue
	ans = []
	for _ in range(n):
		for si in s:
			ans.append(si)
		for _ in range(k - sl):
			ans.append(1)
	print(n * k)
	print(*ans)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	ans = []
	for _ in range(ri()):
		(n, k) = ria()
		a = ria()
		z = len(set(a))
		d = {}
		if z > k:
			print(-1)
		else:
			c = 0
			ans = []
			for i in a:
				if i not in d:
					d[i] = 1
					c += 1
					ans.append(i)
				else:
					d[i] += 1
				if c == z:
					break
			ans = ans * 100
			ans = ans[:k]
			wi(k * n)
			wia(ans * n)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


def printing(a, b):
	ans = []
	start = 0
	while start < len(a):
		second = 0
		while second < len(b):
			ans.append(b[second])
			if a[start] == b[second]:
				start += 1
				second += 1
			else:
				second += 1
			if start >= len(a):
				break
	print(len(ans))
	for i in ans:
		print(i, end=' ')
	print()
	del ans
T = int(input())
for t in range(T):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	distinct = []
	for i in a:
		if i not in distinct:
			distinct.append(i)
	first = distinct[0]
	if len(distinct) > k:
		print(-1)
	else:
		while len(distinct) < k:
			distinct.append(first)
		printing(a, distinct)


t = int(input())
for i in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	seta = set(a)
	if k < len(seta):
		print(-1)
	else:
		print(n * k)
		appender = list(seta)
		for j in range(k - len(seta)):
			appender.append(1)
		for j in range(n):
			for z in appender:
				print(z, end=' ')
		print('')


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set(l)
	a = len(s)
	if a > k:
		print(-1)
		continue
	l2 = list(s)
	b = k - a
	for j in range(1, b + 1):
		l2.append(1)
	l1 = l2.copy()
	for j in range(n - 1):
		l2.extend(l1)
	print(len(l2))
	for j in range(len(l2)):
		if j == len(l2) - 1:
			print(l2[j])
		else:
			print(l2[j], end=' ')


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda : int(input())
ip = lambda : [int(w) for w in input().split()]
mp = lambda : map(int, input().split())
for _ in range(int(input())):
	(n, k) = mp()
	x = ip()
	nos = list(set(x))
	if len(nos) > k:
		print(-1)
		continue
	for i in range(k - len(nos)):
		nos.append(1)
	x = nos * n
	print(len(x))
	print(*x)


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	Arr = list(map(int, input().split()))
	Done = False
	elts = []
	for elt in Arr:
		if not elt in elts:
			elts += (elt,)
			if len(elts) > K:
				print(-1)
				Done = True
				break
	if Done:
		continue
	i = 1
	while len(elts) < K:
		if not i in elts:
			elts += (i,)
		i += 1
	ans = ''
	for serie in range(N):
		for car in range(K):
			ans += str(elts[car]) + ' '
	M = N * K
	print(M)
	print(ans)


from sys import stdin
a = int(stdin.readline())
for b in range(0, a):
	c = stdin.readline().split()
	d = int(c[0])
	e = int(c[1])
	f = stdin.readline().split()
	A = set()
	for g in range(0, d):
		A.add(int(f[g]))
	if len(A) > e:
		print(-1)
		continue
	B = set(range(1, d + 1))
	C = B.difference(A)
	A = list(A)
	C = list(C)
	C = C[:e - len(A)]
	for p in range(0, e - len(A)):
		A.append(C[p])
	print(d * e)
	for k in range(0, d):
		for l in range(0, e):
			if k == d - 1 and l == e - 1:
				print(A[l])
			else:
				print(A[l], end=' ')


loop_runner = int(input())

def Remove(duplicate):
	if duplicate.count(duplicate[0]) == len(duplicate):
		return duplicate
	else:
		final_list = []
		for num in duplicate:
			if num not in final_list:
				final_list.append(num)
		return final_list

def Nmaxelements(list1, N):
	final_list = []
	for i in range(0, N):
		max1 = 0
		for j in range(len(list1)):
			if list1[j] > max1:
				max1 = list1[j]
		list1.remove(max1)
		final_list.append(max1)
	return final_list
for x in range(loop_runner):
	first_numbers = [int(n) for n in input().split()]
	len_array = first_numbers[0]
	len_subarray = first_numbers[1]
	numbers = list(map(int, input().split()))
	numbers_2 = numbers
	lista_different = []
	for x in numbers:
		if x not in lista_different:
			lista_different.append(x)
	if len(lista_different) > len_subarray:
		print(-1)
	else:
		remove_duplicate_values = Remove(numbers_2)
		if len(remove_duplicate_values) < len_subarray and max(remove_duplicate_values) < len_subarray:
			lista2 = []
			for u in range(1, len_array + 1):
				for q in range(1, len_subarray + 1):
					lista2.append(q)
			print(len(lista2))
			for n in range(len(lista2)):
				print(lista2[n], end='')
				print(' ', end='')
			print('')
		else:
			while len(remove_duplicate_values) < len_subarray and max(remove_duplicate_values) >= len_subarray:
				total_numbers = []
				remove_duplicate_values.append(remove_duplicate_values[0])
			acceptable_values = Nmaxelements(remove_duplicate_values, len_subarray)
			numbers_2 = acceptable_values[::-1]
			final_array = numbers_2 * len_array
			print(len(final_array))
			for n in final_array:
				print(n, end='')
				print(' ', end='')
			print('')


def solve(n, k, a):
	s = set()
	for i in a:
		s.add(i)
	if len(s) > k:
		print(-1)
		return
	l = list(s)
	i = 0
	while len(l) < k:
		l.append(l[(i + 1) % len(s)])
	print(n * k)
	for i in range(n):
		for b in l:
			print(b, end=' ')
	print()

def main():
	t = int(input())
	for i in range(t):
		(n, k) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		solve(n, k, a)
main()


def read():
	return map(int, input().split())
for _ in range(int(input())):
	(n, k) = read()
	arr = set(read())
	p = len(arr)
	if p > k:
		print(-1)
	else:
		print(n * k)
		print(*(list(arr) + [1] * (k - p)) * n)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	li = [False for j in range(100)]
	ans = []
	count = 0
	for j in arr:
		if not li[j - 1]:
			li[j - 1] = True
			ans.append(j)
			count += 1
	if count > k:
		print(-1)
	else:
		print(n * k)
		for j in range(n):
			for l in ans:
				print(l, end=' ')
			for l in range(k - count):
				print(ans[-1], end=' ')
		print()


t = int(input())
while t:
	(n, k) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	Temp_list = []
	for i in range(0, 101):
		Temp_list.append(0)
	for x in A:
		Temp_list[x] += 1
	diff = 0
	temp_list2 = []
	for i in range(0, 101):
		if Temp_list[i] > 0:
			diff += 1
			temp_list2.append(i)
	if diff > k:
		print('-1')
	else:
		temp_str = ''
		tempo = '1 '
		i = 0
		for x in temp_list2:
			temp_str += str(x) + ' '
			i += 1
		temp_str = temp_str + (k - i) * tempo
		ans = n * temp_str
		print(n * k)
		print(ans)
	t -= 1


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]
for _ in range(int(input())):
	(n, k) = inar()
	arr = inar()
	mm = list(set(arr))
	cnt = 0
	if len(mm) > k:
		print(-1)
	else:
		string = ''
		last = ''
		for i in mm:
			string += str(i)
			cnt += 1
			string += ' '
			last = str(i)
		for i in range(k - len(mm)):
			cnt += 1
			string += last
			string += ' '
		print(cnt * n)
		print(string * n)


def solve(nums, k):
	s = set()
	for c in nums:
		s.add(c)
	if len(s) > k:
		print(-1)
	else:
		nnums = []
		for c in s:
			nnums.append(c)
		while len(nnums) < k:
			nnums.append(1)
		i = j = 0
		res = []
		while j < len(nums):
			if nums[j] == nnums[i]:
				j += 1
			res.append(nnums[i])
			i += 1
			i = i % len(nnums)
		print(len(res))
		print(' '.join([str(x) for x in res]))
m = int(input())
for _ in range(m):
	(n, k) = list(map(int, input().split()))
	nums = list(map(int, input().split()))
	solve(nums, k)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	m = 1
	a.sort()
	b = [a[0]]
	for i in range(1, n):
		if a[i] > a[i - 1]:
			m += 1
			b.append(a[i])
	if k < m:
		print('-1')
	else:
		for i in range(k - m):
			b.append(b[0])
		c = []
		for i in range(n):
			c.extend(b)
		print(k * n)
		print(*c)


import bisect as bi
import sys
import collections as cc
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n, k) = I()
	l = I()
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		if len(s) != k:
			d = abs(len(s) - k)
			s = s + [1] * d
		print(n * len(s))
		for i in range(n):
			print(*s, end=' ') if i != n - 1 else print(*s)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	aa = list(set(a))
	if len(aa) <= k:
		for i in range(1, n + 1):
			if len(aa) == k:
				break
			if i not in aa:
				aa.append(i)
		print(n * len(aa))
		for i in range(n):
			for ai in aa:
				print(ai, end=' ')
		print()
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	data = list(map(int, input().split()))
	my_set = set()
	my_dict = dict()
	for i in data:
		my_set.add(i)
		if i not in my_dict:
			my_dict[i] = 1
		else:
			my_dict[i] += 1
	length = len(my_set)
	most_value = sorted(my_dict.values(), reverse=True)[0]
	now = list(my_set)
	if length > k:
		print(-1)
	else:
		temp = []
		for i in range(k):
			temp.append(now[i % length])
		print(10000)
		for i in range(10000):
			print(temp[i % k], end=' ')
		print()


from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
for i in range(ip()):
	(n, k) = ei()
	li = ai()
	d = Counter(li)
	val = d.values()
	z = list(d.keys())
	if len(z) > k:
		print(-1)
		continue
	while len(z) != k:
		z.append(1)
	ans = z * n
	print(len(ans))
	print(*ans)


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	dic = {}
	for val in l:
		if val in dic.keys():
			dic[val] += 1
		else:
			dic[val] = 1
	ct = len(dic.keys())
	if ct <= k:
		val = n
		print(val * k)
		keys = list(dic.keys())
		for x in range(val):
			for j in range(k):
				print(keys[j % ct], end=' ')
		print()
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	if len(set(arr)) > k:
		print(-1)
	else:
		sa = list(set(arr))
		while len(sa) < k:
			sa.append(sa[0])
		print(n * k)
		for i in range(n * k):
			print(sa[i % k], end=' ')
		print()


def inp():
	return int(input())

def insr():
	s = input()
	return s

def inlt():
	return list(map(int, input().split()))
r = inp()
for i in range(r):
	l2 = inlt()
	series = inlt()
	ser_ln = l2[1]
	valids = sorted(list(set(series)))
	if len(valids) > ser_ln:
		print(-1)
		continue
	res_temp = [1] * (ser_ln - len(valids)) + valids
	i = 0
	res = []
	j = 0
	while i < len(series):
		if series[i] == res_temp[j]:
			res.append(res_temp[j])
			i += 1
			j += 1
		else:
			res.append(res_temp[j])
			j += 1
		j = j % len(res_temp)
	print(len(res))
	print(' '.join([str(s) for s in res]))


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	lis = list(map(int, input().split()))
	s = set(lis)
	if len(s) > m:
		print(-1)
	else:
		aa = []
		ans = []
		for i in s:
			aa.append(i)
		while len(aa) < m:
			aa.append(aa[-1])
		for i in range(n):
			ans += aa
		print(len(ans))
		print(*ans)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
int1 = lambda x: int(x) - 1
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
ilelec = lambda : map(int1, input().split())
alelec = lambda : list(map(int1, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
for _ in range(int(input())):
	(n, k) = ilele()
	A = alele()
	f = 1
	if n == k:
		print(n)
		print(*A)
		continue
	else:
		dif = set(A)
		if len(dif) > k:
			print(-1)
			continue
		pat = list(dif)
		while len(pat) < k:
			pat += pat
		pat = pat[:k]
		pat = pat * n
		print(len(pat))
		print(*pat)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = list(map(int, input().split()))
	d = sorted(list(set(c)))
	q = len(d)
	if q > b:
		print(-1)
	else:
		r = ''
		print(b * a)
		for j in range(b - q):
			r += str(d[0])
			r += ' '
		for j in d:
			r += str(j)
			r += ' '
		print(r * a)


s = []
for ifdjj in range(int(input())):
	(n, k) = map(int, input().split())
	p = input().split()
	if len(set(p)) > k:
		s.append([-1])
	else:
		yy = set(p)
		p.reverse()
		for i in yy:
			p.append(i)
		p.reverse()
		i = k
		while i != len(p):
			if p[i] != p[i - k]:
				p.insert(i, p[i - k])
			i += 1
		if len(p) > 10000:
			del p[10000:len(p)]
		s.append([len(p)])
		s.append(p)
for i in s:
	for j in i:
		print(j, end=' ')
	print()


t = int(input())
while t:
	t = t - 1
	(n, k) = map(int, input().split())
	listi = list(map(int, input().split()))
	uniq = set(listi)
	if len(uniq) > k:
		print(-1)
	else:
		print(n * k)
		for j in range(0, n):
			for i in uniq:
				print(i, end=' ')
			for i in range(0, k - len(uniq)):
				print(1, end=' ')


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	s = set()
	arr = []
	for a in A:
		if a not in s:
			s.add(a)
			arr.append(a)
	if len(arr) > K:
		print(-1)
		continue
	if len(arr) < K:
		arr += [1] * (K - len(arr))
	ans = arr * N
	print(len(ans))
	print(*ans)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().rstrip().split()))
	a = list(map(int, input().rstrip().split()))
	uq = {}
	for i in a:
		uq[i] = True
	if len(uq) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for j in uq:
				print(j, end=' ')
			for x in range(k - len(uq)):
				print(1, end=' ')
		print()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(int(input())):
	(n, k) = map(int, input().split())
	t = n
	a = set()
	l = list(map(int, input().split()))
	for j in range(k):
		a.add(l[j])
	c = 0
	c1 = 0
	flag = 0
	ans = [0] * 10000
	l2 = set(l)
	if l2 != a:
		for j in a:
			if j not in l2:
				l2.add(j)
		if len(l2) > k:
			print(-1)
			continue
	y = list(l2)
	t = 0
	for j in range(len(y), k):
		y.append(y[t])
		t += 1
	for j in range(10000):
		ans[j] = y[j % k]
	print(10000)
	print(*ans, sep=' ')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	s = set(map(int, input().split()))
	if len(s) > k:
		print(-1)
		continue
	s = list(s) + [1] * (k - len(s))
	print(n * k)
	for i in range(n):
		for i in s:
			print(i, end=' ')
	print()


import sys
I = sys.stdin.readline
for _ in range(int(I())):
	(n, k) = map(int, I().split())
	a = list(map(int, I().split()))
	sett = set(a)
	if len(sett) > k:
		print(-1)
	else:
		if len(sett) < k:
			s = list(sett) + [list(sett)[0]] * (k - len(sett))
			m = s * n
		else:
			s = list(sett)
			m = s * n
		print(len(m))
		print(*m)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set()
	for i in range(n):
		s.add(l[i])
	if len(s) > k:
		print(-1)
	else:
		for i in range(1, n + 1):
			if len(s) < k:
				s.add(i)
		m = len(s)
		print(m * n)
		d = sorted(s)
		for i in range(n):
			print(*d, end=' ')
		print()


R1 = lambda : list(map(int, input().split()))
R2 = lambda : int(input())
for _ in range(R2()):
	(n, k) = R1()
	res = ''
	A = set(map(int, input().split()))
	if len(A) > k:
		print(-1)
		continue
	print(n * k)
	for i in range(n):
		for a in A:
			res += str(a) + ' '
		for _ in range(k - len(A)):
			res += '1' + ' '
	print(res)


t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		elements = list(s) + (k - len(s)) * [1]
		ans = [str(elements[i % k]) for i in range(n * k)]
		print(n * k)
		print(' '.join(ans))


import sys
import heapq
import math
import bisect

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, input().split())

def rlinput():
	return list(map(int, input().split()))

def srlinput():
	return sorted(list(map(int, input().split())))

def main():
	(n, k) = rinput()
	q = rlinput()
	s = set(q)
	if len(s) > k:
		print(-1)
		return 0
	for t in s:
		q.insert(0, t)
	(l, r) = (0, k - 1)
	while r < len(q) - 1:
		r += 1
		if q[r] == q[l]:
			l += 1
			continue
		q.insert(r, q[l])
		l += 1
	print(len(q))
	print(*q)
for sdfghjkl in range(iinput()):
	main()


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = set(map(int, input().split()))
	if len(a) > k:
		print(-1)
	else:
		print(n * k)
		print(*(list(a) + [1] * (k - len(a))) * n)


t = int(input())
while t > 0:
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	l = list(map(int, input().split()))
	s = set(l)
	print()
	for i in s:
		p = i
		break
	if len(s) > k:
		print(-1)
	elif len(s) == k:
		print(n * k)
		for i in range(n):
			for j in s:
				print(j, end=' ')
	else:
		le = len(s)
		final = []
		for i in s:
			final.append(i)
		while le < k:
			final.append(p)
			le += 1
		print(n * k)
		for i in range(n):
			for j in final:
				print(j, end=' ')
	t = t - 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	x = list(map(int, input().split()))
	sx = set(x)
	s = sorted(list(sx))
	ls = len(s)
	if ls > k:
		print(-1)
	elif ls == k:
		s *= n
		print(len(s))
		print(*s)
	else:
		for i in range(1, n + 1):
			if ls == k:
				break
			if i not in s:
				s.append(i)
				ls += 1
		s *= n
		print(len(s))
		print(*s)


T = int(input())

def uniqs(l):
	seen = set()
	ret = []
	for e in l:
		if e not in seen:
			ret += [e]
			seen.add(e)
	return ret

def ans():
	(n, k) = input().split(' ')
	n = int(n)
	k = int(k)
	a = input().split(' ')
	a = list((int(x) for x in a))
	if len(set(a)) > k:
		return -1
	a = uniqs(a)
	if len(a) > k:
		return -1
	a += [1] * (k - len(a))
	a = list((str(x) for x in a))
	a = a * n
	return f"{len(a)}\n{' '.join(a)}"
for t in range(T):
	print(ans())


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
import math

def takeInput():
	return [int(x) for x in input().strip().split()]
t = int(input())

def beauty_check(a, n, k):
	sums = set()
	for i in range(n - k + 1):
		current_sum = 0
		for j in range(k):
			current_sum += a[i + j]
		sums.add(current_sum)
	if len(sums) == 1:
		return True
	return False
while t != 0:
	t -= 1
	(n, k) = takeInput()
	a = takeInput()
	chars = set()
	for i in range(n):
		chars.add(a[i])
	if len(chars) > k:
		print(-1)
	elif beauty_check(a, n, k):
		print(len(a))
		print(*a)
	else:
		num_chars = len(chars)
		for i in range(1, n + 1):
			if len(chars) == k:
				break
			if i not in chars:
				chars.add(i)
		beautiful = []
		pattern = sorted(list(chars))
		for i in range(n):
			for j in range(k):
				beautiful.append(pattern[j])
		print(len(beautiful))
		print(*beautiful)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def solve():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
		return
	ans = []
	base = set(a)
	cur = 1
	while len(base) != k:
		if cur not in base:
			base.add(cur)
		cur += 1
	base = list(base)
	for i in range(100):
		ans.extend(base)
	print(len(ans))
	print(*ans)
t = int(input())
for i in range(t):
	solve()


for _ in range(int(input())):
	(n, k) = map(int, input().split(' '))
	l = list(map(int, input().split(' ')))
	if k < len(set(l)):
		print(-1)
	else:
		print(n * k, end='\n')
		size = list(set(l))
		for i in range(n):
			for b in size:
				print(b, end=' ')
			for j in range(k - len(size)):
				print(1, end=' ')


from collections import Counter
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	sett = set(a)
	l = len(sett)
	if l > k:
		print(-1)
	elif k == n:
		print(n)
		for i in a:
			print(i, end=' ')
	else:
		psett = set([])
		i = -1
		while i < n and len(psett) != l:
			i += 1
			psett.add(a[i])
		psett = list(psett)
		while len(psett) < k:
			psett.append(1)
		print(n * len(psett))
		for _ in range(n):
			for j in range(len(psett)):
				print(psett[j], end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	s = set()
	for x in a:
		s.add(x)
	if len(s) > k:
		print(-1)
	else:
		l = list(s)
		l.sort()
		print(n * (len(s) * (k // len(s)) + k % len(s)))
		for i in range(n):
			for j in range(k // len(s)):
				for x in l:
					print(x, end=' ')
			j = len(s) - 1
			for li in range(k % len(s)):
				print(l[j], end=' ')
				j = (j - 1) % len(s)
		print()


T = int(input())

def beautiful_array():
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s1 = set(arr)
	if len(s1) > k:
		print('-1')
	else:
		ls = list(s1)
		while len(ls) < k:
			ls.append(1)
		print(n * len(ls))
		for i in range(n):
			for j in range(len(ls)):
				print(ls[j], end=' ')
		print()
while T > 0:
	beautiful_array()
	T -= 1


import sys
input = sys.stdin.readline
(t,) = map(int, input().split())
for _ in range(t):
	(N, K) = map(int, input().split())
	X = list(map(int, input().split()))
	sX = set(X)
	if len(sX) > K:
		print(-1)
		continue
	tX = list(sX)
	ll = len(tX)
	ttX = []
	for i in range(K):
		ttX.append(tX[i % ll])
	r = []
	for i in range(10 ** 4):
		r.append(ttX[i % K])
	print(10 ** 4)
	print(*r)


t = int(input())
for q in range(t):
	(n, k) = map(int, input().split())
	mass = [int(x) for x in input().split()]
	ch = 0
	for i in range(k):
		ch += mass[i]
	s = set(mass)
	if len(s) > k:
		print(-1)
	else:
		arr = list(s)
		i = 1
		while len(arr) < k:
			if i not in s:
				arr.append(i)
			i += 1
		mass = arr * n
		print(k * n)
		print(*mass)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		r = list(set(a))
		while len(r) < k:
			r.append(1)
		r = list(r) * n
		print(len(r))
		print(*r)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	s = list(map(int, input().split()))
	ss = list(set(s))
	if len(ss) > k:
		print(-1)
	else:
		y = 1
		x = 0
		p = len(ss)
		while x < k - p:
			if y not in ss:
				ss.append(y)
				x += 1
			y += 1
		a = ss
		i = 0
		j = 0
		while i < n:
			if j == len(a):
				a = a + ss
			if a[j] == s[i]:
				i += 1
				j += 1
			else:
				j += 1
		print(len(a))
		for i in a:
			print(i, end=' ')
		print()


T = int(input())
for tc in range(T):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	l = len(arr)
	sarr = []
	for i in arr:
		if str(i) in sarr:
			pass
		else:
			sarr.append(str(i))
	if k < len(sarr):
		print(-1)
		continue
	ext = k - len(sarr)
	for i in range(ext):
		sarr.append('1')
	m = l * len(sarr)
	sarr = sarr * l
	print(m)
	ars = ' '.join(sarr)
	print(ars)


def main():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set()
	cnt = k
	string = []
	for i in range(len(a)):
		temp = len(s)
		s.add(a[i])
		if temp != len(s):
			cnt -= 1
			if cnt == -1:
				print('-1')
				return
			else:
				string.append(a[i])
	if len(string) != k:
		for i in range(len(string), k):
			string.append(string[i - len(string)])
	print(len(a) * len(string))
	for _ in range(len(a)):
		for x in string:
			print(x, end=' ')
	print()
	return
t = int(input())
while t:
	main()
	t -= 1


T = int(input())
while T != 0:
	(n, k) = map(int, input().split())
	numbers = list(map(int, input().split()))
	dn = set(numbers)
	dn_num = len(dn)
	if dn_num > k:
		print('-1')
		T -= 1
		continue
	else:
		fa = []
		for i in dn:
			fa.append(i)
		while len(fa) < k:
			fa.append(1)
		fa = fa * n
		print(len(fa))
		print(' '.join([str(e) for e in fa]))
	T -= 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	m = len(s)
	if m > k:
		print(-1)
		continue
	arr = []
	for i in range(n):
		for i in s:
			arr.append(i)
		if len(s) < k:
			j = 0
			while j < k - len(s):
				arr.append(1)
				j += 1
	print(n * k)
	print(*arr)


t = int(input())
for xy in range(t):
	(a, b) = list(map(int, input().split()))
	kp = list(map(int, input().split()))
	l = [0] * a
	r = []
	pq = []
	for ab in kp:
		l[ab - 1] += 1
	for z in range(a):
		if l[z] != 0:
			r.append(z + 1)
		else:
			pq.append(z + 1)
	if len(r) > b:
		print(-1)
	else:
		if b > len(r):
			x = b - len(r)
			for lp in range(x):
				r.append(pq[lp])
			r = sorted(r)
		r = [str(x) for x in r]
		print(len(r * a))
		print(' '.join(r * a))


import sys
input = sys.stdin.readline

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))
t = int(input())
for q in range(t):
	(n, k) = inputnums()
	a = inputlist()
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	print(n * k)
	for i in range(n):
		print(*s, end=' ')
		for i in range(k - len(s)):
			print(1, end=' ')
	print()


import math
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	flag = 1
	arr = list(map(int, input().split()))
	arr1 = []
	if k == n:
		print(n)
		print(*arr)
	elif k == 1:
		se = set(arr)
		if len(se) == 1:
			print(n)
			print(*arr)
		else:
			print('-1')
	else:
		s = set(arr)
		if len(s) > k:
			print('-1')
		else:
			d = {}
			final = []
			for i in range(n):
				if arr[i] not in d:
					arr1.append(arr[i])
					d[arr[i]] = 1
			for i in range(n):
				for j in range(k):
					final.append(arr1[j % len(arr1)])
			print(len(final))
			print(*final)


from collections import *
t = int(input())
for y in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	c = Counter(a)
	if len(c) > k:
		print(-1)
		continue
	ct = k - len(c)
	b = []
	for i in c.keys():
		b.append(i)
	for i in range(1, 101):
		if ct == 0:
			break
		if i not in c:
			b.append(i)
			ct -= 1
	b = b * 100
	print(len(b))
	for i in b:
		print(i, end=' ')
	print()


t = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
for u in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	res = ''
	diff = []
	for i in range(n):
		if a[i] in diff:
			pass
		else:
			diff.append(a[i])
	if len(diff) > k:
		res = -1
	elif len(diff) >= 2:
		for i in range(n):
			for i in range(k):
				res += str(diff[i % len(diff)]) + ' '
	else:
		res = ' '.join(list(map(str, a)))
	if res != -1:
		print(len(list(res.split())))
	print(res)


for q in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ss = list(set(a))
	if len(ss) > k:
		print(-1)
	else:
		print(k * n)
		w = []
		j = 0
		while j < k:
			w.append(ss[j % len(ss)])
			j += 1
		print(*w * n)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = set(map(int, input().split()))
	i = 1
	if len(a) > k:
		print(-1)
	else:
		print('\n')
		while len(a) < k:
			while i in a:
				i += 1
			a.add(i)
		print(len(a) * n)
		for i in range(n):
			print(*a, end=' ')


def solve():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	x = set(a)
	m = len(x)
	if m > k:
		print(-1)
		return 0
	temp = list(x)
	for _ in range(k - m):
		temp.append(1)
	print(n * k)
	for _ in range(n):
		for ele in temp:
			print(ele, end=' ')
	print()
t = int(input())
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	(n, k) = [int(c) for c in input().split()]
	arr = [int(x) for x in input().split()]
	s = set(arr)
	if len(s) > k:
		print(-1)
	else:
		newarr = list(s)
		for i in range(1, n + 1):
			if len(newarr) >= k:
				break
			elif i not in newarr:
				newarr.append(i)
		newarr = newarr * len(arr)
		print(len(newarr))
		print(' '.join([str(c) for c in newarr]))


test_case = int(input())
for _ in range(test_case):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	x = sorted(arr)
	if m < len(set(x)):
		print(-1)
	else:
		y = list(set(x))
		count = 0
		while len(y) < m:
			y.append(y[count])
			count += 1
		print(len(y) * n)
		for i in range(n):
			for j in y:
				print(j, end=' ')
		print()


t = int(input())
while t:
	t -= 1
	(n, k) = input().split(' ')
	(n, k) = (int(n), int(k))
	a = input().split(' ')
	for i in range(n):
		a[i] = int(a[i])
	if len(set(a)) > k:
		print(-1, end='')
	else:
		print(n * k)
		a = sorted(list(set(a)))
		while len(a) != k:
			a.append(n)
		while n:
			n -= 1
			for i in a:
				print(i, end=' ')
	print()


import sys
input = sys.stdin.readline
from collections import Counter
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	array = [int(item) for item in input().split()]
	cnt = Counter(array)
	if len(cnt) > k:
		print(-1)
		continue
	keys = list(cnt.keys())
	ret = keys + [keys[0]] * (k - len(cnt))
	ans = ret * n
	print(len(ans))
	print(*ans)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	num = set(sorted(map(int, input().split())))
	if len(num) > k:
		print(-1)
	else:
		i = 1
		while k - len(num) > 0:
			num.add(i)
			i += 1
		print(n * k)
		for i in range(n):
			for j in num:
				print(j, end=' ')
		print()


for ii in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if n == k:
		print(n)
		print(*arr)
		continue
	dele = list(set(arr))
	if len(dele) > k:
		print(-1)
	else:
		while len(dele) < k:
			dele.append(1)
		print(n * len(dele))
		print(*n * dele)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = []
	uniq = 0
	for i in a:
		if i not in d:
			uniq += 1
			d.append(i)
	if uniq > k:
		print(-1)
	else:
		ans = ''
		for i in d:
			ans += str(i) + ' '
		if uniq < k:
			ans += (str(d[0]) + ' ') * (k - len(d))
		print(k * n)
		print(n * ans)


from collections import Counter, defaultdict, deque
import heapq as hq
import math
import sys
input = sys.stdin.readline

def solve():
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	s = set(arr)
	if len(s) > k:
		print(-1)
	else:
		res = list(s)
		for i in range(1, n + 1):
			if len(res) == k:
				break
			if i not in s:
				res.append(i)
		ans = res * n
		print(len(ans))
		print(*ans)
tt = int(input())
for test in range(tt):
	solve()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	d = dict()
	a = []
	new = []
	for x in input().split():
		x = int(x)
		a.append(x)
		if x not in d:
			d[x] = 0
			new.append(x)
		d[x] += 1
	if len(d) > k:
		print('-1')
	else:
		while len(new) != k:
			new.append(new[-1])
		print(n * k)
		for i in range(n):
			print(*new[:k], end=' ')
		print('')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k == n:
		print(n)
		print(*a)
		continue
	s = list(set(a))
	if len(s) > k:
		print(-1)
	elif len(s) == k:
		print(k * n)
		print(*s * n)
	else:
		print(k * n)
		i = 1
		while len(s) < k and i <= n:
			if i not in s:
				s.append(i)
			i += 1
		print(*s * n)


T = int(input())
for _ in range(T):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	nums = sorted(set(a))
	if len(nums) > k:
		print(-1)
		continue
	else:
		new_list = nums * 100
		new_list = new_list[:k]
		print(n * k)
		print(*new_list * n)


T = int(input())
for t in range(T):
	tmp = input().split()
	(n, k) = (int(tmp[0]), int(tmp[1]))
	a = [0 for _ in range(n)]
	tmp = input().split()
	for i in range(n):
		a[i] = int(tmp[i])
	d = dict()
	for aa in a:
		d[aa] = 1
	if len(d) > k:
		print(-1)
	else:
		ans = []
		b = list(d)
		b = b + [b[0]] * (k - len(d))
		for i in range(n):
			ans.extend(b)
		print(len(ans))
		print(*ans)


t = int(input())
for i10 in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if n == k:
		print(n)
		print(*a)
	else:
		a1 = a.copy()
		a1.sort()
		a2 = [a1[0]]
		s = 1
		for i in range(1, n):
			if a1[i] != a1[i - 1]:
				s += 1
				a2.append(a1[i])
		if k < s:
			print(-1)
		else:
			print(n * k)
			for i in range(n):
				for j in range(k):
					if j > len(a2) - 1:
						print(a2[-1], end=' ')
					else:
						print(a2[j], end=' ')
			print()


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	l = [int(x) for x in input().split()]
	l2 = len(list(set(l)))
	if l2 > k:
		print(-1)
	else:
		l3 = list(set(l))
		l4 = [1 for i in range(k - l2)]
		l3 = l3 + l4
		l3 = n * l3
		print(len(l3))
		print(' '.join((str(x) for x in l3)))
	t -= 1


def solution():
	from sys import stdout, stdin
	(_input, _print) = (stdin.readline, stdout.write)
	for _ in range(int(input())):
		(n, k) = [int(i) for i in input().split()]
		arr = [int(i) for i in input().split()]
		t_len = len(set(arr))
		if t_len > k:
			print(-1)
		else:
			template = list(set(arr))
			i = 0
			while t_len < k:
				template.append(template[i % t_len])
				i += 1
				t_len += 1
			if k * n == 10000:
				print(k * n - 1)
				print(*(template * n)[:-1])
			else:
				print(k * n)
				print(*template * n)
solution()


def all_done(d):
	ans = 1
	for i in d.keys():
		if d[i] == 0:
			ans = 0
			break
	return ans
t = int(input())
while t:
	t = t - 1
	(n, k) = [int(s) for s in input().split()]
	a = [int(s) for s in input().split()]
	if n == k:
		print(n)
		for i in a:
			print(i, end=' ')
		print()
	else:
		d = {}
		for i in a:
			try:
				d[i] = d[i] + 1
			except KeyError:
				d[i] = 1
		if len(d) > k:
			print(-1)
		else:
			ans = []
			total_subsequence = n - k + 1
			index = 0
			dic = {}
			for i in d.keys():
				dic[i] = 0
			for i in range(k):
				if dic[a[index]] == 0:
					ans.append(a[index])
					dic[a[index]] = 1
					index = index + 1
					continue
				elif all_done(dic) == 0:
					for i in dic.keys():
						if dic[i] == 0:
							ans.append(i)
							dic[i] = 1
							break
				else:
					ans.append(a[index])
					index = index + 1
			dic = {}
			for i in range(k):
				try:
					dic[ans[i]] = dic[ans[i]] + 1
				except KeyError:
					dic[ans[i]] = 1
			it = 1
			while index != n:
				temp_d = dic.copy()
				x = it
				for i in range(k - 1):
					temp_d[ans[x]] = temp_d[ans[x]] - 1
					x = x + 1
				for i in temp_d.keys():
					if temp_d[i] != 0:
						next_ele = i
						break
				if next_ele == a[index]:
					ans.append(next_ele)
					index = index + 1
				else:
					ans.append(next_ele)
				it = it + 1
			print(len(ans))
			for i in ans:
				print(i, end=' ')
			print()


t = int(input())
for i in range(t):
	(n, k) = [int(n) for n in input().split()]
	arr = list(map(int, input().strip().split()))
	s = set()
	for j in range(n):
		s.add(arr[j])
	brr = list(s)
	l = len(brr)
	if l > k:
		print(-1)
		continue
	else:
		r = k - l
		for u in range(r):
			brr.append(1)
	l = len(brr)
	crr = []
	for i in range(n):
		for j in range(l):
			crr.append(brr[j])
	g = len(crr)
	print(g)
	for d in crr:
		print(d, end=' ')
	print('')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	(a, b, c, d, l, s) = (0, 1, 0, 0, [], [])
	lst = list(map(int, input().split()))
	st = list(set(lst))
	if len(st) > k:
		print(-1)
	else:
		f = k - len(st)
		st = st + [1] * f
		st = st * n
		print(len(st))
		print(*st)


def main():
	m = int(input())
	for q in range(m):
		(n, k) = map(int, input().split())
		arr = list(map(int, input().split()))
		p = set(arr)
		if len(p) > k:
			print(-1)
		else:
			p = list(set(arr))
			if len(p) > k:
				print(-1)
			else:
				res = []
				i = 0
				while i < k:
					j = 0
					while j < len(p) and i < k:
						res.append(p[j])
						j += 1
						i += 1
				print(len(res) * len(arr))
				for i in range(len(arr)):
					for j in res:
						print(j, end=' ')
				print()
main()


t = int(input())
for z in range(t):
	(m, k) = map(int, input().split())
	arr = [int(i) for i in input().split()]
	flag = 0
	nn = len(set(arr))
	if nn > k:
		print(-1)
		flag = 1
	if flag == 0:
		jk = list(set(arr))
		if nn == k:
			print(m * k)
			jk = jk * m
			print(*jk)
		else:
			mk = k - nn
			for i in range(mk):
				jk.append(1)
			nnn = len(jk)
			jk = jk * m
			print(m * k)
			print(*jk)


import sys
import math
import bisect

def solve(A, m):
	n = len(A)
	s = set(A)
	if len(s) > m:
		return []
	for i in range(1, n + 1):
		if len(s) < m and i not in s:
			s.add(i)
	B = list(s)
	ans = []
	for i in range(n):
		ans.extend(B)
	return ans

def main():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		A = list(map(int, input().split()))
		B = solve(A, m)
		if len(B) == 0:
			print(-1)
		else:
			print(len(B))
			print(' '.join(list((str(a) for a in B))))
main()


alph = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	ip = input()
	n = int(ip.split()[0])
	k = int(ip.split()[1])
	a = []
	ip = input()
	for i in range(n):
		a.append(int(ip.split()[i]))
	se = set(a)
	lenth = len(se)
	se = list(se)
	if lenth > k:
		print(-1)
		continue
	while len(se) < k:
		se.append(se[0])
	print(k * n)
	se = se * (k * n // len(se))
	for i in se:
		print(i, end=' ')
	print()


for ii in range(int(input())):
	a = [int(i) for i in input().split()]
	b = [int(i) for i in input().split()]
	n = a[0]
	k = a[1]
	c = set(b)
	if len(c) > k:
		print(-1)
	else:
		pattern = list(c)
		y = 1
		if len(pattern) < k:
			for x in pattern:
				if x <= n:
					y = x
					break
			pattern = pattern + [y for i in range(k - len(pattern))]
		ans = []
		i = 0
		curr = 0
		while i < len(b):
			if pattern[curr % k] == b[i]:
				ans.append(pattern[curr % k])
				i += 1
				curr += 1
			else:
				ans.append(pattern[curr % k])
				curr += 1
		print(len(ans))
		print(*ans)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	check = 0
	cnt = 0
	ans = []
	for i in range(k):
		if a[i] in ans:
			cnt += 1
		else:
			ans.append(a[i])
	for i in range(k, n):
		if not a[i] in ans:
			if cnt <= 0:
				check = 1
			else:
				cnt -= 1
				ans.append(a[i])
	if len(ans) != k:
		while len(ans) != k:
			ans.append(1)
	if check == 1:
		print(-1, end=' ')
	else:
		print(len(ans) * n)
		for j in range(n):
			print(*ans, end=' ')
	print()


from collections import Counter
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	c = Counter(a)
	if len(c) > k:
		print(-1)
		continue
	ans = list(c.keys())
	ans += (k - len(ans)) * [1]
	ans *= 100
	print(100 * k)
	print(*ans)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [Scanner.string() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [Scanner.int() for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	(N, K) = Scanner.map_int()
	A = Scanner.map_int()
	t = len(set(A))
	if t > K:
		print(-1)
		return
	l = 0
	loop = [0 for _ in range(K)]
	for i in range(N):
		if not A[i] in loop:
			loop[l] = A[i]
			l += 1
			t -= 1
		elif i + t < K:
			loop[l] = A[i]
			l += 1
	print(N * K)
	for _ in range(N):
		print(*loop, end=' ')
	print()

def main():
	T = Scanner.int()
	for _ in range(T):
		solve()
main()


from collections import Counter
from _collections import defaultdict
import math
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rls = lambda : list(map(str, input().split()))
from collections import deque
t = int(input())
for _ in range(0, t):
	(n, k) = rl()
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
		continue
	else:
		d = deque()
		d = set()
		ans = []
		for i in range(0, n):
			d.add(a[i])
			if len(d) == len(set(a)):
				break
		d = list(d)
		d.extend([1] * (k - len(set(a))))
		ans = d * n
		print(len(ans))
		print(*ans)


def process_test_case(i_test):
	(n, k) = map(int, input().split())
	b = list(map(int, input().split()))
	unique_b = set(b)
	if len(unique_b) > k:
		print(-1)
		return None
	target_vec = list(unique_b) + list(set(range(1, n + 1)).difference(unique_b))[:k - len(unique_b)]
	out_vec = [x for i in range(n) for x in target_vec]
	print(len(out_vec))
	print(' '.join([str(x) for x in out_vec]))
n_tests = int(input())
for i_test in range(1, n_tests + 1):
	process_test_case(i_test)


import sys
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def b():
	ans = ''
	for _ in range(int(inp())):
		(n, k) = read()
		sett = list(set(read()))
		if len(sett) > k:
			ans += str(-1) + '\n'
		else:
			arr = (sett + [1] * (k - len(sett))) * n
			ans += str(len(arr)) + '\n'
			ans += ' '.join(map(str, arr)) + '\n'
	print(ans)
b()


for tests in range(int(input())):
	(n, m) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	ans = []
	if len(set(arr)) <= m:
		arr = sorted(set(arr))
		for j in range(n):
			app = []
			for i in range(len(arr)):
				app.append(arr[i])
				if i == len(arr) - 1 and len(app) < m:
					for x in range(m - len(app)):
						app.append(arr[i])
			ans += app
		print(len(ans))
		print(*ans)
	else:
		print(-1)


import math
t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	s = list(map(int, input().split()))
	dict = {}
	for i in range(n):
		dict[s[i]] = 1
	p = list(set(s))
	if len(p) > k:
		print(-1)
		continue
	for i in range(1, n + 1):
		if len(p) == k:
			break
		if dict.get(i) is None:
			p.append(i)
	print(n * k)
	p.sort()
	for i in range(n):
		for j in range(k):
			print(p[j], end=' ')
	print()


t = int(input())

def sol():
	(n, k) = map(int, input().split())
	nums = list(map(int, input().split()))
	a = dict()
	un = []
	i = 0
	for u in nums:
		if u not in a:
			a[u] = i
			un.append(str(u))
			i += 1
	if len(a) > k:
		return -1
	un += ['1'] * (k - i)
	return str(k * n) + '\n' + ' '.join(un * n)
for _ in range(t):
	print(sol())


def make_beauty(array, k):
	numbers_in_array = set(array)
	if len(numbers_in_array) > k:
		return []
	numbers = list(numbers_in_array) + non_in_array(k - len(numbers_in_array), numbers_in_array)
	return numbers * len(array)

def non_in_array(count, numbers_in_array):
	all_numbers = set(range(1, 101))
	numbers = all_numbers - numbers_in_array
	return list(sorted(numbers))[:count]
number_of_tests = int(input())
for _ in range(number_of_tests):
	(_, k) = map(int, input().split())
	array = [int(x) for x in input().split()]
	result = make_beauty(array, k)
	if not result:
		print('-1')
		continue
	print(len(result))
	print(' '.join(map(str, result)))


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if n == k:
		print(len(a))
		print(*a)
		continue
	l = set(a)
	if len(l) > k:
		print(-1)
		continue
	l = list(l)
	d = k - len(l)
	for i in range(1, n + 1):
		if d == 0:
			break
		if i not in l:
			l.append(i)
			d -= 1
	l.sort()
	ans = []
	for _ in range(n):
		for li in l:
			ans.append(li)
	print(len(ans))
	print(*ans)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = input().split()
	se = set(a)
	l = len(se)
	if l > k:
		print(-1)
	else:
		s = ''
		for v in se:
			s = s + v + ' '
		for j in range(l, k):
			s = s + s[0] + ' '
		m = 0
		an = ''
		for j in range(n):
			m = m + k
			an = an + s
		print(m)
		print(an)


T = int(input())
for _ in range(T):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if len(set(arr)) > k:
		print(-1)
	else:
		l = list(set(arr))
		for i in range(k - len(l)):
			l.append(2)
		print(len(l) * n)
		for _ in range(n):
			print(*l, end=' ')
		print()


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(n, k) = sp()
	arr = l()
	if len(set(arr)) > k:
		out(-1)
		continue
	unique = set(arr)
	temp = k - len(unique)
	i = 1
	while temp > 0:
		if i not in unique:
			unique.add(i)
			temp -= 1
		i += 1
	answer = [i for i in unique] * n
	out(len(answer))
	out(*answer)


t = int(input())
while t:
	(n, k) = map(int, input().split())
	l1 = list(map(int, input().split()))
	l2 = []
	x = set(l1)
	l = len(x)
	if l > k:
		print(-1)
	else:
		while x:
			l2.append(x.pop())
		for i in range(0, l):
			if l2[i] == l1[0]:
				temp = l2[i]
				l2[i] = l2[0]
				l2[0] = temp
		iterl1 = 0
		iterl2 = l
		while iterl1 < n:
			if iterl2 >= k:
				if l1[iterl1] == l2[iterl2 - k]:
					l2.append(l1[iterl1])
					iterl1 = iterl1 + 1
					iterl2 = iterl2 + 1
				else:
					l2.append(l2[iterl2 - k])
					iterl2 = iterl2 + 1
			else:
				l2.append(l1[iterl1])
				iterl1 = iterl1 + 1
				iterl2 = iterl2 + 1
		print(len(l2))
		print(*l2)
	t = t - 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	p = list(set(a))
	if k < len(set(a)):
		print(-1)
	else:
		result = []
		for i in range(1, n + 1):
			if k == len(p):
				break
			if i not in p:
				p.append(i)
		for i in range(len(a)):
			result.extend(p)
		print(len(result))
		print(*result)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	t = sorted(s, reverse=False)
	if len(s) > k:
		print('-1')
	else:
		print(n * k)
		ls = (t + [1] * (k - len(s))) * n
		print(*ls)


import sys
sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline

def solve():
	(n, k) = map(int, rl().split())
	b = set(map(int, rl().split()))
	if k < len(b):
		print(-1)
		return
	print(n * k)
	for _ in range(n):
		print(' '.join(map(str, b)), end=' ')
		print(' '.join(['1' for _ in range(k - len(b))]), end=' ')
	print('')
t = int(rl())
for _ in range(t):
	solve()


import math
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	s = list(set(arr))
	if len(s) > k:
		print(-1)
		continue
	else:
		nStr = s * math.floor(k / len(s)) + s[:k - len(s) * math.ceil(k / len(s))]
		print(10000 - 10000 % k)
		print(*nStr * int((10000 - 10000 % k) / k))


import math

def tc():
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	s = list(set(a))
	if len(s) > k:
		print(-1)
		return
	if len(s) < k:
		s.extend([a[0]] * (k - len(s)))
	seg = ' '.join(map(str, s))
	print(len(s) * n)
	print(' '.join([seg] * n))
T = int(input())
for _ in range(T):
	tc()


from collections import Counter
tc = int(input())
for zzz in range(tc):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	c = Counter(arr)
	keys = c.keys()
	if len(keys) > k:
		print(-1)
	else:
		brr = []
		m = max(c.values())
		m += 1
		for ele in keys:
			brr.append(str(ele))
		for i in range(k - len(keys)):
			brr.append('1')
		ans = ' '.join(brr)
		print(len(brr) * n)
		for i in range(n):
			print(ans, end=' ')
		print()


t = int(input())
all_answers = []
for _ in range(t):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	s = set(arr)
	if len(s) > k:
		print(-1)
		continue
	new_arr = list(s)
	while len(new_arr) < k:
		new_arr.append(1)
	ans = new_arr * n
	assert len(ans) == k * n
	print(len(ans))
	print(*ans, sep=' ')


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set()
	for i in range(n):
		s.add(l[i])
	dl = len(s)
	if dl > k:
		print(-1)
	else:
		print(k * n)
		for x in range(n):
			for i in s:
				print(i, end=' ')
			for i in range(k - dl):
				print(1, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	x = list(map(int, input().split()))
	d = set(x)
	if len(d) > k:
		print(-1)
	else:
		ans = list(d) + [1] * (k - len(d))
		print(k * n)
		print(*ans * n)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	arr = set(map(int, input().split()))
	list_arr = list(arr)
	if len(arr) > k:
		print(-1)
	else:
		for i in range(k - len(arr)):
			list_arr.append(list_arr[i])
		print(n * len(list_arr))
		for i in range(n):
			print(*list_arr, end=' ')
		print(' ')


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(set(l)) > k:
		print(-1)
	else:
		l = list(set(l))
		for i in range(abs(k - len(l))):
			l += [1]
		print(len(l) * n)
		print(*l * n)


import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	ans = []
	pos = 0
	i = 1
	while len(s) < k:
		if i not in s:
			s.add(i)
		i += 1
	temp = []
	for i in range(k):
		if a[i] in s:
			temp.append(a[i])
			s.remove(a[i])
	s = list(s)
	while s:
		temp.append(s.pop())
	ans = []
	for _ in range(n):
		for k in temp:
			ans.append(k)
	print(len(ans))
	print(*ans)


def Solve(nCase):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	l = list(set(a))
	p = len(l)
	if p > k:
		print(-1)
		return
	for i in range(k - p):
		l.append(a[0])
	ans = n * l
	print(len(ans))
	print(' '.join((str(x) for x in ans)))
T = int(input())
for i in range(1, T + 1):
	Solve(i)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	tab = list(map(int, input().split()))
	if n < k:
		for i in range(k - n):
			tab.append(1)
	else:
		distinctNumbers = list(set(tab))
		if len(distinctNumbers) <= k:
			print(n * k)
			for i in range(n):
				for number in distinctNumbers:
					print(number, end=' ')
				for j in range(k - len(distinctNumbers)):
					print(1, end=' ')
			print()
		else:
			print(-1)


def solve(nums, n, k):
	vals = set(nums)
	if len(vals) > k:
		return '-1'
	res = []
	for i in range(k):
		if not nums[i] in vals:
			break
		else:
			res.append(nums[i])
			vals.discard(nums[i])
	while len(vals) > 0:
		x = vals.pop()
		res.append(x)
	j = 0
	while len(res) < k:
		res.append(res[j])
		j += 1
	while i < n:
		_l = res[len(res) - k]
		res.append(_l)
		if nums[i] == _l:
			i += 1
	return f'{len(res)}\n' + ' '.join(map(str, res))
T = int(input())
for _ in range(T):
	_nk = input().split()
	n = int(_nk[0])
	k = int(_nk[1])
	nums = list(map(int, input().split()))
	print(solve(nums, n, k))


t = int(input())
for case in range(t):
	(n, k) = [int(n) for n in input().split()]
	arr = [int(n) for n in input().split()]
	s = set(arr)
	s = list(s)
	if len(s) > k:
		print(-1)
	elif len(s) <= k:
		while len(s) < k:
			s.append(1)
		ans = s * n
		print(len(ans))
		for elem in ans:
			print(elem, end=' ')


t = int(input())
for test in range(t):
	(n, k) = input().split()
	(n, k) = (int(n), int(k))
	arr = input().split()
	s = {}
	for i in arr:
		if i not in s:
			s[i] = 0
		s[i] += 1
	length = len(s)
	if length > k:
		print(-1)
		continue
	print(n * k)
	l = list(s)
	for i in range(k - length):
		l.append(1)
	l = l * n
	for i in l:
		print(i, end=' ')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = set(map(int, input().split()))
	if len(a) > k:
		print(-1)
	else:
		print(n * k)
		for i in range(n):
			for el in a:
				print(el, end=' ')
			for j in range(k - len(a)):
				print(1, end=' ')
		print()


from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def powmod(a, b):
	a %= mod
	if a == 0:
		return 0
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % mod
		a = a * a % mod
		b >>= 1
	return res

def solve():
	for _ in range(ii()):
		(n, m) = mi()
		a = li()
		m1 = {}
		for i in a:
			if i not in m1:
				m1[i] = 1
			else:
				m1[i] += 1
		x = 0
		a1 = []
		for i in m1.keys():
			x = max(x, m1[i])
			a1.append(i)
		if len(a1) > m:
			print('-1')
		else:
			a1 = a1 + [1] * (m - len(a1))
			ans = []
			for i in range(100):
				for j in a1:
					ans.append(j)
			print(len(ans))
			print(*ans)
solve()


for _ in range(int(input())):
	[n, k] = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = set(a)
	if len(b) > k:
		print(-1)
	else:
		c = list(b)
		a1 = len(c)
		q = k // a1
		r = k % a1
		d = c * q + c[:r]
		print(n * len(d))
		print(*d * n)


import sys
from math import sqrt, floor, factorial, gcd
from collections import Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def a():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		s = 2
		m = 2
		for i in range(1, n // 2):
			s += 2 ** m
			m += 1
		ans += str(s) + '\n'
	print(ans)

def b():
	ans = ''
	for _ in range(int(inp())):
		(n, k) = read()
		arr = read()
		sett = list(set(arr))
		if len(sett) > k:
			print(-1)
		else:
			tem = sett + [i for i in range(1, k - len(sett) + 1)]
			arr = tem * n
			print(len(arr))
			print(*arr)
b()


t = int(input())
ans = []
for x in range(t):
	nk = list(map(int, input().split(' ')))
	n = nk[0]
	k = nk[1]
	values = list(map(int, input().split(' ')))
	a = list(set(values))
	if len(a) > k:
		ans.append(-1)
	elif k == n:
		ans.append(n)
		ans.append(' '.join((str(elem) for elem in values)))
	else:
		while len(a) < k:
			a.append(1)
		newValues = []
		while len(newValues) <= n * k:
			for elem in a:
				newValues.append(elem)
		ans.append(len(newValues))
		ans.append(' '.join((str(elem) for elem in newValues)))
for elem in ans:
	print(elem)


from sys import stdin
input = stdin.readline
import bisect
import math
for xoxo in range(1):
	for _ in range(int(input())):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		c = list(set(a))
		if len(c) > k:
			print('-1')
			continue
		i = 1
		while len(c) != k:
			if i not in c:
				c.append(i)
			i += 1
			if i > 100:
				break
		c.sort()
		print(n * len(c))
		for i in range(len(c) * n):
			print(c[i % len(c)], end=' ')
		print()


def solve(arr, n, k):
	s = set()
	for i in range(n):
		s.add(arr[i])
	m = len(s)
	if m > k:
		print(-1)
		return
	print(n * k)
	for i in range(n):
		for b in s:
			print(b, end=' ')
		for j in range(k - m):
			print(1, end=' ')
	print()
tc = int(input())
for _ in range(tc):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	solve(arr, n, k)


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	d = defaultdict(int)
	for i in range(n):
		if d[arr[i]] == 0:
			d[arr[i]] += 1
	flag = 0
	if len(d) > k:
		flag = 1
	if flag == 1:
		print(-1)
	else:
		print(n * k)
		ans = []
		for i in d:
			ans.append(i)
		m = len(ans)
		for i in range(m, k):
			ans.append(arr[i])
		for i in range(n * k):
			print(ans[i % k], end=' ')
		print()


from collections import defaultdict
iter_cnt = 1

def iter_pattern(lst):
	global iter_cnt
	per = len(lst)
	while True:
		for c in lst:
			yield c
		iter_cnt += 1
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	c = defaultdict(int)
	for i in a:
		c[i] += 1
	num_values = len(c)
	if num_values > k:
		print(-1)
	else:
		r = [1] * k
		r[0:num_values] = list(c.keys())
		times = 0
		iter_cnt = 0
		it = iter_pattern(r)
		p = next(it)
		for i in a:
			while i != p:
				p = next(it)
			p = next(it)
		times = iter_cnt + 1
		print(str(k * times))
		print(' '.join(map(str, r * times)))


def foo(n, a):
	q = sorted(a)
	num_distinct = 1
	for i in range(0, n - 1):
		if q[i] != q[i + 1]:
			num_distinct += 1
	return num_distinct
t = int(input())
for ds in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	if n == k:
		print(n)
		print(*a)
		continue
	if foo(n, a) > k:
		print(-1)
		continue
	fd = 0
	set_a = []
	while len(set_a) < foo(n, a):
		if a[fd] not in set_a:
			set_a.append(a[fd])
		fd += 1
	for i in range(1, n + 1):
		if len(set_a) < k and i not in set_a:
			set_a.append(i)
	x = list(set_a) * n
	print(len(x))
	print(*x)


t = int(input())
for i in range(t):
	nk = input().split()
	n = int(nk[0])
	k = int(nk[1])
	numbers = input().split()
	numbers = [int(number) for number in numbers]
	s = set(numbers)
	if len(s) > k:
		print(-1)
		continue
	print(n * k)
	for i in range(n):
		print(*s, sep=' ', end=' ')
		for j in range(k - len(s)):
			print(1, end=' ')
	print()


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	B = [0 for i in range(N + 1)]
	D = 0
	S = []
	for i in A:
		if B[i] == 0:
			D = D + 1
			S.append(i)
		B[i] = B[i] + 1
	D2 = []
	for i in range(1, N + 1):
		if B[i] == 0:
			D2.append(i)
	if D > K:
		print(-1)
	else:
		D1 = D
		for i in range(K - D):
			S.append(D2[i])
			D1 = D1 + 1
		print(D1 * N)
		for i in range(N):
			print(*S, end=' ')
		print()


from collections import deque
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	vals = list(sorted(set(arr)))
	need = []
	for i in range(k):
		need.append(vals[i % len(vals)])
	last = 0
	res = []
	i = 0
	times = 0
	can = True
	while i < n:
		if arr[i] == need[last]:
			last += 1
			res.append(arr[i])
			times = 0
		else:
			res.append(need[last])
			last += 1
			times += 1
			i -= 1
		last %= k
		i += 1
		if times >= k:
			can = False
			break
	if not can:
		print(-1)
	else:
		print(len(res))
		print(*res)


from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	(n, k) = [int(x) for x in inp().split()]
	array = [int(x) for x in inp().split()]
	arr = [0] * (n + 1)
	setArray = set(array)
	if len(setArray) > k:
		print(-1)
	else:
		counter = 1
		while True:
			if len(setArray) == k:
				break
			setArray.add(counter)
			counter += 1
		print(n * k)
		for i in range(n):
			print(*setArray, end=' ')
		print()


from sys import stdin, stdout
T = int(stdin.readline())
for i in range(T):
	[N, K] = [int(x) for x in stdin.readline().split()]
	A = [int(x) for x in stdin.readline().split()]
	m = {}
	count = 0
	if K == N:
		stdout.write(str(len(A)) + '\n')
		res = ' '.join([str(x) for x in A])
		stdout.write(str(res) + '\n')
	else:
		temp = []
		for x in A:
			if x not in m:
				count += 1
				m[x] = True
				temp.append(str(x))
		if count > K:
			stdout.write(str(-1) + '\n')
		else:
			if count < K:
				temp += [temp[-1]] * (K - count)
			stdout.write(str(len(temp) * N) + '\n')
			res = ' '.join(temp * N)
			stdout.write(str(res) + '\n')


tests = int(input())
for _ in range(tests):
	(n, k) = map(int, input().split())
	sp = list(map(int, input().split()))
	r = set(sp)
	if len(r) > k:
		print(-1)
		continue
	now = 1
	while len(r) < k:
		r.add(now)
		now += 1
	print(k * n)
	r = sorted(list(r))
	for i in range(n):
		for j in r:
			print(j, end=' ')
	print()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().rstrip().split()))
	a = list(map(int, input().rstrip().split()))
	chk = True
	d = {}
	for j in a:
		d[j] = True
	if len(d) > k:
		print(-1)
		continue
	else:
		print(n * k)
		for i in range(n):
			for j in d:
				print(j, end=' ')
			for p in range(k - len(d)):
				print(1, end=' ')
		print()


for t in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(set(map(int, input().split())))
	if len(arr) > k:
		print(-1)
		continue
	print(n * k)
	one = [1] * (k - len(arr))
	for i in range(n - 1):
		print(*arr, *one, end=' ')
	print(*arr, *one)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	lis = set()
	s = ''
	for j in range(n):
		lis.add(str(arr[j]))
	if len(lis) > k:
		print('-1')
		continue
	for j in range(n):
		for r in lis:
			s += r + ' '
		for r in range(0, k - len(lis)):
			s += '1' + ' '
	print(n * k)
	print(s)


def linput():
	return list(map(int, input().split()))

def lisdiv():
	return list(map(int, list(input())))
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	lis = linput()
	arr = [0] * (n + 1)
	maxi = -1
	distinct = 0
	d = []
	s = list(set(lis))
	for i in s:
		p = lis.count(i)
		arr[i] = p
	for i in range(n + 1):
		if arr[i] > 0:
			distinct += 1
			d.append(i)
			maxi = max(maxi, arr[i])
	if distinct > k:
		print(-1)
		continue
	size = 100 * k
	print(size)
	p = [d[0]] * (k - distinct + 1)
	p = (p + d[1:]) * 100
	print(*p, sep=' ')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = list(set(a))
	if k < len(s):
		print(-1)
	else:
		m = n
		l = len(s)
		b = []
		for i in a:
			if i not in b:
				b.append(i)
		while k > l:
			b.append(m)
			l += 1
		b = b * n
		print(len(b))
		for j in b:
			print(j, end=' ')
		print()


t = int(input())
from collections import Counter
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = Counter(a)
	c = len(b)
	if c > k:
		print(-1)
		continue
	else:
		d = list(b)
		aa = []
		for i in d:
			aa.append(i)
		aa += [i] * (k - len(aa))
		aa *= n
		print(len(aa))
		print(*aa)


def solve():
	(n, k) = map(int, input().split())
	a = input().split()
	a_without_repeat = list({key: 1 for key in a})
	if len(a_without_repeat) > k:
		print(-1)
	else:
		a_without_repeat += [a_without_repeat[0]] * (k - len(a_without_repeat))
		print(n * k)
		print(' '.join(a_without_repeat * n))

def main():
	for _ in range(int(input())):
		solve()
main()


t = int(input())
while t:
	t -= 1
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	a = [int(i) for i in input().split()]
	a.sort()
	d = [a[0]]
	for i in range(1, n):
		if d[-1] != a[i]:
			d.append(a[i])
	if len(d) > k:
		print(-1)
	else:
		while len(d) != k:
			d.append(1)
		print(n * k)
		for i in range(n):
			for j in range(k):
				print(d[j], end=' ')
		print()


def RA():
	return list(map(int, input().split()))

def solve():
	(n, k) = RA()
	a = RA()
	s = set(a)
	if k < len(s):
		print(-1)
		return
	rep = [1 for i in range(k - len(s))] + list(s)
	print(len(rep) * n)
	print(*rep * n)
t = int(input())
for i in range(t):
	solve()


T = int(input())
for case in range(T):
	(N, K) = input().split()
	N = int(N)
	K = int(K)
	A = [int(x) for x in input().split()]
	B = [False if j not in A else True for j in range(N + 1)]
	new = []
	C = []
	for i in A:
		if i not in C:
			C.append(i)
	C.sort()
	k = 1
	while len(C) < K:
		if k not in C:
			C.append(k)
		C.sort()
		k += 1
	if B.count(True) > K:
		print(-1)
	elif B.count(True) <= K:
		print(len(C) * len(A))
		for num in A:
			for i in C:
				print(i, end=' ')
		print()


import math
from sys import stdin, stdout
from heapq import heapify, heappop, heappush
T = int(stdin.readline())
for i in range(T):
	(N, K) = list(map(int, stdin.readline().split()))
	arr = list(map(int, stdin.readline().split()))
	if K < len(set(arr)):
		print('-1')
		continue
	res = (list(set(arr)) + [1] * (K - len(set(arr)))) * N
	print(len(res))
	for i in res:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = map(int, input().split())
	arr = list(set(arr))
	if k >= len(arr):
		ans = []
		for _ in range(k - len(arr)):
			ans.append(1)
		ans += arr
		ans = ans * n
		print(len(ans))
		print(' '.join(map(str, ans)))
	else:
		print(-1)


t = int(input())
while t != 0:
	(n, m) = [int(i) for i in input().split()]
	x = 0
	l = [int(i) for i in input().split()]
	q = set(l)
	q = list(q)
	z = len(q)
	if m < z:
		print(-1)
	else:
		print(m * n)
		for i in range(n):
			for j in range(m):
				if j >= z:
					print(1, end=' ')
				else:
					print(q[j], end=' ')
		print()
	t = t - 1


def solve(n, k):
	a_set = set(arr)
	if len(a_set) > k:
		print(-1)
		return
	else:
		print(n * k)
		for i in range(n):
			print(*a_set, end=' ')
			if k != len(a_set):
				l = [1] * (k - len(a_set))
				print(*l, end=' ')
		print()
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	solve(n, k)


from collections import deque

def solve():
	(n, k) = [int(x) for x in input().split()]
	li = [int(x) for x in input().split()]
	d = {}
	no_of_distinct = 0
	final = deque()
	for i in range(n):
		if d.get(li[i], 0) == 0:
			no_of_distinct += 1
			d[li[i]] = d.get(li[i], 0) + 1
			final.append(li[i])
		else:
			d[li[i]] = d.get(li[i], 0) + 1
		if no_of_distinct > k:
			print(-1)
			return
	if no_of_distinct < k:
		val = k - no_of_distinct
		for i in range(1, val + 1):
			final.appendleft(i)
		final2 = final * n
		print(k * n)
		print(*final2)
		return
	final2 = [ele for ele in final] * n
	print(len(final) * n)
	print(*final2)
t = int(input())
for i in range(t):
	solve()


def f():
	(n, k) = map(int, input().split())
	data = list(map(int, input().split()))
	pre_ans = list(set(data))
	if len(pre_ans) > k:
		print(-1)
	elif len(pre_ans) == k:
		print(n * k)
		print(*pre_ans * n)
	else:
		pre_ans += [pre_ans[-1]] * (k - len(pre_ans))
		print(n * k)
		print(*pre_ans * n)
for _ in range(int(input())):
	f()


from collections import Counter
for i in range(int(input())):
	(n, k) = [int(i) for i in input().split(' ')]
	l = [int(i) for i in input().split(' ')]
	max_sum = 0
	total_window = n - k + 1
	for i in range(total_window):
		total = sum(l[i:i + k])
		if total > max_sum:
			max_sum = total
	unique_nums = list(Counter(l).keys())
	final_list = []
	if len(unique_nums) > k:
		print(-1)
		continue
	elif len(unique_nums) == k:
		cur_index = 0
		while cur_index < len(l):
			for x in unique_nums:
				if cur_index >= len(l):
					break
				if x == l[cur_index]:
					final_list.append(x)
					cur_index += 1
				else:
					final_list.append(x)
	else:
		repeating_window = []
		cur_index = 0
		for i in range(k):
			repeating_window.append(unique_nums[cur_index])
			cur_index += 1
			if cur_index >= len(unique_nums):
				cur_index = 0
		unique_nums = repeating_window
		cur_index = 0
		while cur_index < len(l):
			for x in unique_nums:
				if cur_index >= len(l):
					break
				if x == l[cur_index]:
					final_list.append(x)
					cur_index += 1
				else:
					final_list.append(x)
	print(len(final_list))
	print(' '.join([str(i) for i in final_list]))


def rd(n):
	if n == 0:
		return input('')
	if n == 1:
		return int(input())
	if n == 2:
		return map(int, input().split())
	if n == 3:
		return list(map(int, input().split()))

def solve():
	t = rd(1)
	for _ in range(t):
		(n, k) = rd(2)
		A = rd(3)
		B = []
		if len(set(A)) > k:
			print(-1)
			continue
		A = set(A)
		i = 1
		while len(A) < k:
			A.add(i)
			i += 1
		A = list(A)
		B = A * 100
		print(len(B))
		for i in range(len(B)):
			print(B[i], end=' ')
		print()
solve()


import sys
from itertools import islice, cycle
stdin = sys.stdin
t = int(stdin.readline())
for line in stdin:
	if not line:
		break
	(n, k) = line.split()
	(n, k) = (int(n), int(k))
	A = stdin.readline().split()
	sA = set(A)
	if len(sA) > k:
		print(-1)
	else:
		sA = islice(cycle(sA), k)
		sA = list(sA)
		length = len(sA) * n
		sA = ' '.join(sA)
		string = (sA + ' ') * n
		print(length)
		print(string)


for case in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	cnt = 0
	ha = {}
	m = []
	for i in range(n):
		if a[i] not in ha.keys():
			m.append(a[i])
			ha[a[i]] = 1
			cnt += 1
	if cnt > k:
		print(-1)
		continue
	a = m + a[1:]
	i = 0
	while i < len(a) - k:
		if a[i + k] != a[i]:
			a.insert(i + k, a[i])
		i += 1
	print(len(a))
	print(' '.join(list(map(str, a))))


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	lis = list(map(int, input().split()))
	if len(set(lis)) > m:
		print(-1)
	else:
		dist = list(set(lis))
		temp = []
		c = 0
		g = 0
		w = m - 1
		while c <= m - 1:
			if lis[c] not in dist:
				temp += dist
				w = c - 1
				c = m
			else:
				temp.append(lis[c])
				dist.remove(lis[c])
				c += 1
		while len(temp) < m:
			temp.append(temp[g])
			g += 1
		lis = temp + lis[w + 1:]
		lisans = temp[:]
		(i, j) = (m, 0)
		while i < len(lis):
			if lis[i] == lisans[j]:
				lisans.append(lis[i])
				i += 1
			else:
				lisans.append(lisans[j])
			j += 1
		print(len(lisans))
		print(*lisans)


import sys, re, math
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest

def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def sortListWithIndex(listOfTuples, idx):
	return sorted(listOfTuples, key=lambda x: x[idx])

def sortDictWithVal(passedDic):
	temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
	toret = {}
	for tup in temp:
		toret[tup[0]] = tup[1]
	return toret

def sortDictWithKey(passedDic):
	return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
t = INT()
while t != 0:
	(n, k) = MAP()
	a = LIST()
	mx = max(a)
	mn = min(a)
	set1 = set(a)
	uniqlen = len(set1)
	set1.remove(mx)
	if mn in set1:
		set1.remove(mn)
	if uniqlen > k:
		print('-1')
	else:
		l = []
		if mx == mn:
			l.append(mx)
		else:
			l.append(mx)
			l.append(mn)
		for el in set1:
			l.append(el)
		for j in range(k - len(l)):
			l.append(1)
		x = 10 ** 4 // k
		ans = l * x
		print(len(ans))
		print(*ans)
	t -= 1


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	if len(set(a)) > k:
		print(-1)
		continue
	l = list(set(a))
	l.extend([1] * (k - len(l)))
	print(n * k)
	for _ in range(n):
		print(*l, end=' ')
	print()


t = int(input())
for _ in range(t):
	(n, k) = [int(el) for el in input().split()]
	d = {int(el) for el in input().split()}
	if len(d) > k:
		print(-1)
	else:
		i = 1
		while len(d) < k and i <= n:
			if i not in d:
				d.add(i)
			i += 1
		print(n * len(d))
		print(*n * list(d))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	A = map(int, input().split())
	S = set(A)
	if len(S) > k:
		print(-1)
		continue
	R = list(S) * k
	print(n * k)
	for i in range(n * k):
		print(R[i % k], end=' ')
	print()


class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	pos = True
	st = set()
	for each in a:
		st.add(each)
	if len(st) > k:
		print(-1)
		continue
	c = []
	b = []
	for each in st:
		c += [each]
	while len(c) != k:
		c += [1]
	for i in range(n):
		b += c
	print(len(b))
	print(' '.join((str(k) for k in b)))


import sys
t = int(input())
inp = [line.strip().split() for line in reversed(sys.stdin.readlines())]
ans = []
unique = set()
maxm = 10 ** 4
while t:
	(n, k) = map(int, inp.pop())
	a = [int(i) for i in inp.pop()]
	for ai in a:
		unique.add(ai)
	if len(unique) > k:
		ans.append(-1)
		unique.clear()
		t -= 1
		continue
	tmp = list(unique)
	nunique = len(unique)
	for i in range(nunique, k):
		tmp.append(1)
	ans.append(k * n)
	ans.append(' '.join([str(i) for i in tmp] * n))
	unique.clear()
	t -= 1
print(*ans, sep='\n')


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	arr = set(map(int, input().split()))
	if len(arr) > K:
		print(-1)
		continue
	arr = list(arr)
	x = arr + [arr[0]] * (K - len(arr))
	res = []
	for i in range(N):
		res.extend(x)
	print(len(res))
	print(*res)


for i in range(int(input())):
	(n, k) = map(int, input().split(' '))
	m = list(map(int, input().split(' ')))
	sp = list(set(m))
	ma = list((x for x in range(1, max(sp) + 1)))
	de = []
	de.clear()
	for e in range(len(ma)):
		if ma[e] not in sp:
			de.append(e)
	de.reverse()
	for e in de:
		ma.pop(e)
	while len(ma) < k:
		ma.append(min(ma))
	ma = list(map(str, ma))
	if len(sp) > k:
		print(-1)
		continue
	else:
		sp = []
		for x in m:
			for e in ma:
				sp.append(str(e))
		print(str(len(sp)))
		print(' '.join(sp))


import sys
from collections import deque
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	(n, k) = map(int, input().split())
	s = list(map(int, input().split()))
	ind = 0
	if len(set(s)) > k:
		print(-1)
		continue
	d = deque()
	for i in set(s):
		d.append(i)
	for i in range(k - len(set(s))):
		d.append(s[0])
	ans = []
	popa = 0
	while d:
		lol = d.popleft()
		if ind < n:
			d.append(lol)
			if lol == s[ind]:
				ind += 1
		ans.append(lol)
	print(len(ans))
	print(*ans)


def but_array(L, k):
	n = len(L)
	K = []
	for i in L:
		if i not in K:
			K.append(i)
	if len(K) > k:
		return -1
	elif len(K) == k:
		return K * n
	else:
		K = K + [1] * (k - len(K))
		return K * n
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	L = list(map(int, input().split()))
	if but_array(L, k) == -1:
		print(-1)
	else:
		print(n * k)
		s = ''
		for i in but_array(L, k):
			s = s + str(i) + ' '
		print(s)


t = int(input())
for q in range(0, t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = set(a)
	a1 = min(a)
	a2 = max(a)
	lenb = len(b)
	if lenb > k:
		print(-1)
	else:
		print(n * k)
		for i in range(0, n):
			if i == n - 1:
				print(*b, '', end='')
				print('1 ' * (k - len(b)))
			else:
				print(*b, '', end='')
				print('1 ' * (k - len(b)), end='')


T = int(input())
for _ in range(T):
	(n, k) = [int(i) for i in input().split()]
	A = [int(i) for i in input().split()]
	if len(set(A)) > k:
		print(-1)
	else:
		distinct = set(A)
		for i in range(1, n + 1):
			if len(distinct) == k:
				break
			if i not in distinct:
				distinct.add(i)
		distinct = list(distinct)
		print(n * k)
		ans = []
		for i in range(n):
			ans.extend(distinct)
		print(*ans)


T = int(input())
for t in range(T):
	(N, K) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	check = set()
	for ele in arr:
		check.add(ele)
	if len(check) > K:
		print(-1)
		continue
	if len(check) < K:
		for i in range(1, 101):
			check.add(i)
			if len(check) == K:
				break
	added = list(check)
	added.sort(reverse=True)
	ans = []
	i = 0
	j = 0
	length = len(added)
	while i < len(arr):
		if j >= length:
			j = 0
		if added[j] == arr[i]:
			ans.append(arr[i])
			i += 1
			j += 1
		else:
			ans.append(added[j])
			j += 1
	print(len(ans))
	print(' '.join(map(str, ans)))


import sys
from sys import stdin, stdout

def R():
	return map(int, stdin.readline().strip().split())
for h in range(int(stdin.readline().strip())):
	(n, k) = R()
	arr = list(R())
	if len(set(arr)) > k:
		print(-1)
	else:
		ans = list(set(arr))
		ans = ans + [1] * (k - len(ans))
		ans = ans * n
		print(len(ans))
		print(*ans)


def solution(a, n, k):
	if len(set(a)) > k:
		return -1
	for e in a:
		if e > n or e < 1:
			return -1
	if len(a) > k:
		Set = set()
		cache = []
		dup = k - len(set(a))
		for e in a:
			if e not in Set:
				cache.append(e)
				Set.add(e)
			elif dup > 0:
				cache.append(e)
				dup -= 1
		ans = []
		(i, j) = (0, 0)
		while i < len(a):
			if cache[j % k] != a[i]:
				ans.append(cache[j % k])
			else:
				ans.append(arr[i])
				i += 1
			j += 1
		return (len(ans), ans)
	else:
		while len(a) < k:
			a.append(1)
		b = a * 2
		return (len(b), b)
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	result = solution(arr, n, k)
	if result == -1:
		print(-1)
	else:
		(a, b) = (result[0], result[1])
		print(a)
		print(*b, sep=' ')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = {}
	v = 0
	for j in range(n):
		if l[j] not in d:
			v += 1
			d[l[j]] = 1
	if v > k:
		print(-1)
	else:
		l1 = sorted(d)
		if len(l1) < k:
			c = k - len(l1)
			for j in range(c):
				l1.append(1)
		print(n * len(l1))
		s = ''
		for j in range(len(l1)):
			s += str(l1[j]) + ' '
		print(s * n)


t = int(input())
import math
delay = []
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = input().split()
	arr = [int(a) for a in arr]
	dic = {}
	for i in range(n):
		if arr[i] not in dic:
			dic[arr[i]] = 1
		else:
			dic[arr[i]] += 1
	if len(dic) > k:
		print(-1)
	else:
		pattern = (k * list(dic.keys()))[:k]
		ptr = 0
		i = 0
		ans = []
		while i < n:
			if arr[i] != pattern[ptr]:
				ans.append(pattern[ptr])
			else:
				ans.append(arr[i])
				i += 1
			ptr = (ptr + 1) % k
		print(len(ans))
		arr = [str(a) for a in ans]
		print(' '.join(arr))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	x = set(l)
	if len(x) > k:
		print(-1)
	else:
		if k == len(x):
			t = list(x)
		else:
			x = list(x)
			y = k - len(x)
			i = 1
			while i <= n and y > 0:
				if i not in x:
					x.append(i)
					y -= 1
				i += 1
			t = x
		print(len(t) * n)
		for i in range(n):
			for j in t:
				print(j, end=' ')
		print()


from collections import Counter

def solve():
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	if len(set(A)) > K:
		print(-1)
		return
	C = Counter(A)
	ans = []
	used = set()
	for a in A:
		if a in used:
			continue
		else:
			ans.append(a)
			used.add(a)
	if len(ans) != K:
		r = K - len(ans)
		for i in range(1, N + 1):
			if r != 0 and i not in used:
				ans.append(i)
				used.add(i)
				r -= 1
	print(N * len(ans))
	ANS = []
	for _ in range(N):
		ANS.append(' '.join(map(str, ans)))
	print(' '.join(map(str, ANS)))
for _ in range(int(input())):
	solve()


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	p = set(a)
	t = []
	ans = []
	if len(p) > k:
		print(-1)
		continue
	else:
		for el in p:
			t.append(el)
			ans.append(el)
		while len(t) < k:
			t.append(t[-1])
			ans.append(t[-1])
	ptr = 0
	i = 0
	done = False
	while i < n:
		if a[i] != t[ptr]:
			ans.append(t[ptr])
		else:
			ans.append(a[i])
			i += 1
		ptr += 1
		if ptr == k:
			ptr = 0
	print(len(ans))
	print(*ans)


import sys, math, random
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	(n, k) = invr()
	ara = inara()
	s = set()
	for num in ara:
		s.add(num)
	if len(s) > k:
		print(-1)
	else:
		i = 1
		while len(s) < k:
			s.add(i)
			i += 1
		print(len(s) * n)
		for j in range(n):
			for num in s:
				print(num, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	ans = ''
	if len(s) > k:
		print(-1)
		continue
	for i in range(n):
		cnt = 0
		x = 0
		for item in s:
			ans += f'{item} '
			cnt += 1
			x = item
		while cnt < k:
			ans += f'{x} '
			cnt += 1
	print(n * k)
	print(ans)


for m in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(set(a))
	x = k * (k + 1) // 2
	if len(b) > k:
		print(-1)
	else:
		if len(b) < k:
			i = 1
			while i <= k and len(b) < k:
				if i not in b:
					b.append(i)
				i += 1
		b = b * len(a)
		print(len(b))
		print(*b)


q = int(input())
for i in range(q):
	(n, k) = [int(i) for i in input().split()]
	m = [int(i) for i in input().split()]
	t = []
	for j in m:
		if j not in t:
			t.append(j)
	if len(t) > k:
		print(-1)
	else:
		summ = sum(t)
		o = 0
		while len(t) < k:
			t.append(t[o])
			o += 1
		for j in m:
			t.append(j)
		o = k
		while o < len(t):
			if t[o] != t[o - k]:
				t.insert(o, t[o - k])
				o += 1
			else:
				o += 1
		print(len(t))
		print(*t)


def makeint(x):
	A = []
	for i in x:
		i = int(i)
		A.append(i)
	return A
t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	list1 = input().split()
	list1 = makeint(list1)
	list2 = []
	for i in list1:
		if (i in list2) == False:
			list2.append(i)
	if len(list2) > k:
		print(-1, end='')
	elif len(list2) == k:
		result = list2 * n
		print(len(result))
		for i in result:
			print(i, end=' ')
	else:
		j = k - len(list2)
		for m in range(1, j + 1):
			for i in range(1, n + 1):
				list2.append(i)
				break
		result = list2 * n
		print(len(result))
		for i in result:
			print(i, end=' ')
	print(end='\n')
	t -= 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = set(l)
	if len(l1) > k:
		print(-1)
	else:
		l2 = []
		l2 += l1
		for j in range(1, n + 1, 1):
			if len(l2) == k:
				break
			if j not in l1 and len(l2) < k:
				l2.append(j)
		print(n * k)
		for i in range(1, n * k + 1, 1):
			j = i % k
			print(l2[j - 1], end=' ')
		print()


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	d = defaultdict(int)
	arr = list(map(int, input().split()))
	temp = []
	for i in arr:
		if i not in d:
			temp.append(i)
		d[i] += 1
	if k < len(d):
		print(-1)
		continue
	start = 1
	print(n * k)
	while len(temp) < k:
		if start not in d:
			temp.append(start)
		start += 1
	temp.sort()
	for _ in range(n):
		for i in range(len(temp)):
			print(temp[i], end=' ')
	print()


import math
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	dic = {}
	d = []
	m = 1
	for i in range(n):
		if a[i] in dic:
			dic[a[i]] = dic[a[i]] + 1
			if dic[a[i]] > m:
				m = dic[a[i]]
		else:
			dic[a[i]] = 1
			d.append(a[i])
	x = len(set(a))
	if n == k:
		print(len(a))
		for i in a:
			print(i, end=' ')
		print()
	elif x == k:
		s = []
		for j in d:
			s.append(j)
		l = s * n
		print(len(l))
		for i in l:
			print(i, end=' ')
		print()
	elif x < k:
		s = []
		temp = k - x
		for j in d:
			s.append(j)
		moto = [s[0]]
		l = (s + moto * temp) * n
		print(len(l))
		for i in l:
			print(i, end=' ')
		print()
	else:
		print(-1)


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	orig = list(map(int, input().split()))
	dis = []
	for ele in orig:
		if ele not in dis:
			dis.append(ele)
	if len(dis) > k:
		print(-1)
	elif len(dis) == k:
		ans = dis * n
		print(len(ans))
		for ele in ans:
			print(ele, end=' ')
		print()
	else:
		ans = dis
		while len(ans) < k:
			ans.append(dis[-1])
		ans = ans * n
		print(len(ans))
		for ele in ans:
			print(ele, end=' ')
		print()
	t -= 1


q = int(input())
for _ in range(q):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if k == 1:
		if max(l) == min(l):
			print(len(l))
			print(*l)
		else:
			print(-1)
	else:
		cyk = set()
		for i in l:
			cyk.add(i)
		if len(cyk) > k:
			dasie = 0
		else:
			dasie = 1
		if dasie == 0:
			print(-1)
		else:
			a = list(cyk)
			while len(a) != k:
				a.append(l[0])
			odp = n * a
			print(len(odp))
			print(*odp)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	x = n
	l = list(map(int, input().split()))
	s = set(l)
	s = list(s)
	s = sorted(s)
	if len(s) > k:
		print(-1)
	else:
		p = []
		for i in range(k):
			p.append(s[i % len(s)])
		print(10000)
		i = 0
		while i < 10000:
			print(p[i % len(p)], end=' ')
			i += 1
		print('')


for w in range(int(input())):
	(n, k) = tuple(map(int, input().split()))
	a = list(map(int, input().split()))
	if k == n or (k == 1 and len(set(a)) == 1):
		print(n)
		for i in range(n):
			print(a[i], end=' ')
		print()
	elif len(set(a)) > k:
		print(-1)
	else:
		l = sorted(list(set(a)))
		if len(l) < k:
			i = 0
			while len(l) < k:
				l.append(l[i])
				i += 1
		print(len(l) * n)
		for i in range(n):
			for j in range(len(l)):
				print(l[j], end=' ')
		print()


t = int(input())
for you in range(t):
	l = input().split()
	n = int(l[0])
	k = int(l[1])
	l = input().split()
	li = [int(i) for i in l]
	hashi = dict()
	arrfi = []
	for i in li:
		if i in hashi:
			hashi[i] += 1
		else:
			arrfi.append(i)
			hashi[i] = 1
	if len(arrfi) > k:
		print(-1)
	else:
		arrz = []
		for i in range(k):
			arrz.append(arrfi[i % len(arrfi)])
		print(n * k)
		for i in range(n):
			for j in arrz:
				print(j, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = [int(p) for p in input().split()]
	arr = [int(p) for p in input().split()]
	freq = {}
	if n == k:
		print(n)
		print(*arr)
		continue
	for i in arr:
		if i not in freq:
			freq[i] = 1
		else:
			freq[i] += 1
	m = max(freq.values())
	l = len(freq)
	if l > k:
		print(-1)
		continue
	s = []
	for i in freq:
		s.append(i)
	while len(s) < k:
		s.append(s[0])
	print(n * k)
	for i in range(n):
		print(*s, end=' ')
	print('\n')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	ans = 0
	C = set(A)
	if len(C) > k:
		print('-1')
		continue
	C = list(C)
	if len(C) < k:
		for i in range(k - len(C)):
			C.append(1)
	print(n * k)
	for i in range(n):
		print(*C, end=' ')
	print()


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if len(set(l)) > k:
		print('-1')
	else:
		l2 = list(set(l))
		while len(l2) < k:
			l2.append(1)
		l2.sort(reverse=True)
		print(n * len(l2))
		for i in range(n):
			for j in l2:
				print(j, end=' ')
		print()


import sys

def read():
	return list(map(int, sys.stdin.readline().rstrip().split(' ')))

def main(n, k, a):
	p = list(set(a))
	if len(p) > k:
		return (-1, None)
	p *= k
	p = p[:k]
	b = []
	i = 0
	j = 0
	while i < n:
		while p[j] != a[i]:
			b.append(p[j])
			j += 1
			j %= k
		b.append(a[i])
		i += 1
		j += 1
		j %= k
	return (len(b), b)
(t,) = read()
for _ in range(t):
	(n, k) = read()
	a = read()
	(m, b) = main(n, k, a)
	print(m)
	if m > 0:
		print(' '.join(map(str, b)))


import sys
from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	temp = set()
	for i in range(n):
		temp.add(arr[i])
	if len(temp) > k:
		print(-1)
	elif len(temp) == k:
		print(n * k)
		fin = []
		for i in range(n):
			for j in temp:
				fin.append(j)
		print(' '.join(map(str, fin)))
	elif n == k:
		print(n)
		print(' '.join(map(str, arr)))
	else:
		for i in range(1, n):
			if i not in temp:
				temp.add(i)
			if len(temp) == k:
				break
		print(n * k)
		fin = []
		for i in range(n):
			for j in temp:
				fin.append(j)
		print(' '.join(map(str, fin)))


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
		continue
	b = list(set(a))
	r = 1
	for i in range(k - len(b)):
		while r in b:
			r += 1
		b.append(r)
	i = 0
	res = []
	print(len(b) * n)
	for i in range(n):
		print(*b, end=' ')
	print()


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip()
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def t():
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	sa = set(a)
	if len(sa) > k:
		print(-1)
		return
	for i in range(1, n + 1):
		if i not in sa and len(sa) < k:
			sa.add(i)
	sa = list(sa)
	print(n * k)
	ans = n * sa
	print(*ans)
test = int(input())
for _ in range(test):
	t()


t = int(input())
for test in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	c = list(set(arr))
	c.sort()
	if len(c) > k:
		print(-1)
		continue
	for i in range(1, n + 1):
		if i in c:
			continue
		if i not in c and len(c) < k:
			c.append(i)
		else:
			break
	ans = []
	for i in range(n):
		for j in range(k):
			ans.append(c[j])
	print(n * k)
	print(*ans)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	s = set()
	for i in a:
		s.add(i)
	if len(s) > k:
		print(-1)
	else:
		r = 0
		l = list(s)
		l.sort()
		z = k - len(s)
		r = []
		r.append(l[0])
		for i in range(z):
			r.append(l[0])
		for i in range(1, len(l)):
			r.append(l[i])
		r = r * n
		print(len(r))
		for i in r:
			print(i, end=' ')
		print()


import sys
sys.setrecursionlimit(10000)

class Memoize:

	def __init__(self, f):
		self.f = f
		self.memo = {}

	def __call__(self, *args):
		if not args in self.memo:
			self.memo[args] = self.f(*args)
		return self.memo[args]

class Recurse(Exception):

	def __init__(self, *args, **kwargs):
		self.args = args
		self.kwargs = kwargs

def recurse(*args, **kwargs):
	raise Recurse(*args, **kwargs)

def tail_recursive(f):

	def decorated(*args, **kwargs):
		while True:
			try:
				return f(*args, **kwargs)
			except Recurse as r:
				args = r.args
				kwargs = r.kwargs
				continue
	return decorated
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = map(int, input().split())
	unique = set(a)
	for i in range(1, n + 1):
		if len(unique) < k and i not in unique:
			unique.add(i)
	unique = sorted(list(unique))
	if len(unique) > k:
		print(-1)
	else:
		print(len(unique) * n)
		print(' '.join(map(str, unique * n)))


for _ in range(int(input())):
	tle = [0] * 1000
	f = []
	(a, b) = map(int, input().split())
	arr = list(map(int, input().split()))
	count = 0
	for i in range(a):
		tle[arr[i]] = 1
	for i in range(1000):
		if tle[i] == 1:
			count += 1
			f.append(i)
	i = 1
	while len(f) < b:
		if i not in f:
			f.append(i)
		i += 1
	if count > b:
		print(-1)
		continue
	t = f * a
	print(a * b)
	for i in range(len(t)):
		print(t[i], end=' ')
	print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(str, input().split()))
	q = []
	d = dict()
	for i in a:
		if i not in d:
			d[i] = 1
			q.append(i)
	if len(q) > k:
		print('-1')
	else:
		while len(q) < k:
			q.append('1')
		print(k * n)
		for i in range(n):
			print(' '.join(q), end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	diff = sorted(set(a))
	if len(diff) > k:
		print(-1)
	else:
		diff = diff * 100
		diff = diff[:k]
		print(n * k)
		print(*diff * n)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	st = set(arr)
	if len(st) > k:
		print(-1)
	else:
		nst = list(st) + [arr[0]] * (k - len(st))
		res = list(nst) * n
		print(len(list(nst) * n))
		for (i, x) in enumerate(res):
			print(x, end=' ' if not i == len(res) - 1 else '\n')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = set(arr)
	if len(s) > k:
		print(-1)
	else:
		if len(s) == k:
			arr1 = list(s)
			arr1 = arr1 * n
		else:
			arr1 = list(s)
			x = k - len(arr1)
			arr2 = [arr[0]] * x
			arr1.extend(arr2)
			arr1 = arr1 * n
		print(len(arr1))
		for i in arr1:
			print(i, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	lst = list(map(int, input().split()))
	temp = set(lst)
	ans = list(temp)
	if len(temp) > k:
		print(-1)
		continue
	while len(ans) < k:
		ans.append(1)
	lst = ans * n
	print(len(lst))
	print(*lst)


for u in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		s.extend([l[0]] * (k - len(s)))
		s = s * n
		print(n * k)
		print(*s)


import sys
import math
t = int(input())
for _ in range(t):
	(n, k) = [int(c) for c in input().split()]
	ints = [int(c) for c in input().split()]
	if n == k:
		print(n)
		print(*ints)
		continue
	s = set(ints)
	d = len(s)
	if k < d:
		print(-1)
		continue
	os_asc = list(sorted(s, reverse=True))
	print(n * k)
	for i in range(n):
		for j in range(k):
			toto = os_asc[j] if j < d else os_asc[-1]
			print(toto, end=' ')
	print()


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	a = list(map(int, input().split()))
	s = set()
	for i in a:
		s.add(i)
	if len(s) > k:
		print(-1)
		continue
	print(len(a) * k)
	for i in range(len(a)):
		print(*s, end=' ')
		if len(s) < k:
			for i in range(k - len(s)):
				print(a[0], end=' ')
	print()


def count(mylist):
	newlist = []
	newlist.append(mylist[0])
	stor = False
	for i in mylist:
		stor = False
		for j in newlist:
			if j == i:
				stor = True
		if not stor:
			newlist.append(i)
	return newlist
t = int(input())
for i in range(t):
	s = input().split()
	n = int(s[0])
	k = int(s[1])
	s = input().split()
	for j in range(n):
		s[j] = int(s[j])
	x = count(s)
	if len(x) > k:
		print('-1')
		continue
	e = k - len(x)
	for k in range(e):
		x.append(1)
	print(len(x) * n)
	for j in range(n):
		for k in range(len(x)):
			print(x[k], end=' ')
	print('')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	s = set(a)
	lens = len(s)
	if lens > k:
		print('-1')
		continue
	rem = k - lens
	d = []
	num = 1
	while rem != 0:
		if num in s:
			num += 1
		else:
			d.append(num)
			rem -= 1
	d += list(s)
	d.sort()
	print(n * k)
	for i in range(n):
		print(' '.join(map(str, d)), end=' ')
	print()


t = int(input())
for tt in range(t):
	(n, k) = (int(i) for i in input().split())
	a = [i for i in input().split()]
	unique = list(set(a))
	if len(unique) > k:
		print(-1)
		continue
	while len(unique) < k:
		unique.append(unique[0])
	print(100 * len(unique))
	print(' '.join(100 * unique))


from itertools import combinations

def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))

def solve():
	(n, k) = read_ints()
	nums = list(read_ints())
	unique = set(nums)
	if len(unique) > k:
		print(-1)
		return
	rem = k - len(unique)
	res = []
	for i in range(1, n + 1):
		if i in unique:
			res.append(i)
		elif rem > 0:
			rem -= 1
			res.append(i)
	print(n * len(res))
	for i in range(n):
		for item in res:
			print(str(item) + ' ', end='')
	print()
t = read_int()
for case_num in range(t):
	solve()


import sys
readline = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, readline().split())
	a = list(map(int, readline().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
		continue
	ans = list(s) + [a[0]] * (k - len(s))
	tail = 0
	for i in range(n):
		while ans[tail] != a[i]:
			ans.append(ans[tail])
			tail += 1
		ans.append(a[i])
		tail += 1
	ans = ans[len(s):]
	if len(ans) > 10 ** 4:
		print(-1)
	else:
		print(len(ans))
		print(*ans)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	ans = []
	if k >= n:
		while k != len(l):
			l.append(1)
		print(2 * len(l))
		print(*l + l)
	else:
		if len(set(l)) > k:
			print(-1)
			continue
		else:
			z = set(l)
			for i in range(1, 100):
				if len(z) == k:
					break
				else:
					z.add(i)
			ka = l[0]
			ans = []
			for i in z:
				if i != ka:
					ans.append(i)
			ans.append(l[0])
			z.remove(ans[0])
			i = 1
			j = 1
			while i < len(l):
				if l[i] not in z:
					z.add(l[i])
					ans.append(l[i])
					z.remove(ans[j])
					i += 1
					j += 1
				else:
					for x in range(k):
						if ans[x] not in z:
							z.add(ans[x])
							ans.append(ans[x])
							z.remove(ans[j])
							j += 1
							break
		print(len(ans))
		print(*ans)


from collections import OrderedDict
t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split(' ')]
	nums = [int(i) for i in input().split(' ')]
	distinct = list(OrderedDict.fromkeys(nums))
	if len(distinct) > k:
		print(-1)
		continue
	print(n * k)
	for _ in range(n):
		for i in distinct:
			print(i, end=' ')
		for i in range(k - len(distinct)):
			print(1, end=' ')
	print()


t = int(input())
for i in range(t):
	(n, k) = map(lambda x: int(x), input().split(' '))
	numbers = set(map(lambda x: int(x), input().split(' ')))
	j = 1
	while len(numbers) < k and j <= n:
		if j not in numbers:
			numbers.add(j)
		j += 1
	if len(numbers) != k:
		print(-1)
		continue
	sequence = set(numbers)
	print(n * k)
	print(' '.join(list(map(lambda x: str(x), sequence)) * n))


from sys import stdin, stdout
import math

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = [int(i) for i in input().split()]
		arr = [int(i) for i in input().split()]
		s = set()
		for el in arr:
			s.add(el)
		if len(s) > k:
			print(-1)
			continue
		need = k - len(s)
		if need > 0:
			for i in range(1, n + 1):
				if i not in s:
					s.add(i)
					need -= 1
					if need == 0:
						break
		keys = sorted(list(s))
		arr_in_str = [str(e) for e in keys] * n
		answer = ' '.join(arr_in_str)
		print(len(arr_in_str))
		print(answer)
main()


t = int(input())
ans = []
for s in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	se = set(arr)
	if len(se) > k:
		ans.append([-1])
	else:
		i = 1
		while len(se) < k:
			se.add(i)
			i += 1
		str = list(se) * n
		ans.append([len(str)])
		ans.append(str)
m = 0
while m < len(ans):
	if ans[m] != [-1]:
		print(*ans[m], sep=' ')
		print(*ans[m + 1], sep=' ')
		m += 2
	else:
		print('-1')
		m += 1


from sys import stdin, stdout
input = stdin.buffer.readline
t = int(input())
while t > 0:
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	s = set(a)
	l = list(s)
	if len(l) > k:
		print(-1)
	else:
		l.sort()
		le = len(l)
		for i in range(le, k):
			l.append(i)
		print(n * k)
		for i in range(1, n + 1):
			for j in range(len(l)):
				print(l[j], end=' ')
		print()
	t -= 1


def solve():
	(n, k) = map(int, input().split())
	a = list(set(map(int, input().split())))
	if len(a) > k:
		print(-1)
		return
	a += [1] * (k - len(a))
	print(len(a) * n)
	print(*a * n)
t = int(input())
for _ in range(t):
	solve()


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()
t = getInt()
for _ in range(t):
	(n, k) = getVars()
	a = getList()
	d = {}
	for i in range(n):
		if a[i] not in d:
			d[a[i]] = []
		d[a[i]].append(i)
	keys = list(d.keys())
	if len(keys) <= k:
		keys = keys + [1] * (k - len(keys))
		res = keys * n
		print(len(res))
		print(*res)
	else:
		print(-1)


test_cases = int(input())
while test_cases > 0:
	(length, k) = map(int, input().split())
	data = list(map(int, input().split()))
	dataSum = []
	toFind = list(set(data[:]))
	toFind.sort()
	toPrint = []
	if len(toFind) > k:
		print(-1)
	else:
		toMul = []
		for j in toFind:
			toMul.append(j)
		finder = 1
		while len(toMul) < k:
			if finder not in toFind:
				toMul.append(finder)
			finder += 1
		for p in range(length):
			toPrint.extend(toMul)
		print(len(toPrint))
		print(*toPrint)
	test_cases -= 1


ileZ = int(input())
for i in range(ileZ):
	(n, k) = tuple(map(int, input().split()))
	ciag = tuple(map(int, input().split()))
	wynik = []
	liczby = set()
	if len(ciag) == k:
		print(k)
		print(*ciag)
		continue
	for j in ciag:
		liczby.add(j)
	if len(liczby) > k:
		print(-1)
		continue
	for j in liczby:
		wynik.append(j)
	j1 = 0
	j2 = 0
	while j1 < len(ciag):
		if len(wynik) < k:
			wynik.append(ciag[j1])
			j1 += 1
		else:
			if ciag[j1] == wynik[j2]:
				j1 += 1
			wynik.append(wynik[j2])
			j2 += 1
	print(len(wynik))
	print(*wynik)


def solve(arr, n, k, ans):
	final = [0] * 10 ** 4
	index = 0
	visited = set()
	for i in arr:
		if final[index] == 0:
			if i not in visited:
				visited.add(i)
				temp = index
				while temp < len(final):
					final[temp] = i
					temp += k
				index += 1
	while index < len(final) and final[index] == 0:
		temp = index
		while temp < len(final):
			final[temp] = 1
			temp += k
		index += 1
	i = 0
	j = 0
	while i < len(arr) and j < len(final):
		if arr[i] == final[j]:
			i += 1
		j += 1
	if i == len(arr):
		ans.append(final)
	else:
		ans.append([-1])

def main():
	t = int(input())
	ans = []
	for i in range(t):
		(n, k) = map(int, input().split())
		arr = list(map(int, input().split()))
		solve(arr, n, k, ans)
	for i in ans:
		if len(i) == 1:
			print(-1)
		else:
			print(len(i))
			for j in i:
				print(j, end=' ')
			print()
main()


from sys import stdin, stdout

def main():
	t = int(stdin.readline())
	ans = []
	sizes = []
	for j in range(t):
		(n, k) = map(int, stdin.readline().split(' '))
		a = map(int, stdin.readline().split(' '))
		a = set(a)
		if len(a) > k:
			print(-1)
			continue
		else:
			a = list(a)
			for i in range(k - len(a)):
				a.append(1)
			print(len(a * n))
			print(*a * n, sep=' ')
main()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = set(arr)
	if len(s) > k:
		print(-1)
		continue
	s = list(s)
	for _ in range(k - len(s)):
		s.append(1)
	t = n * len(s)
	res = [0] * t
	for i in range(t):
		res[i] = s[i % len(s)]
	print(t)
	print(*res)


def solve(arr, k: int):
	s = set(arr)
	if k < len(s):
		print(-1)
		return
	l = []
	print(k * len(arr))
	for i in range(len(arr)):
		l += list(s) + [1] * max(0, k - len(s))
	print(*l)
	return

def main():
	t = int(input())
	while t > 0:
		[n, k] = map(int, input().split())
		array = list(input().split())
		solve(array, k)
		t -= 1
main()


from math import ceil, sqrt, gcd
from itertools import groupby, zip_longest
from collections import defaultdict, Counter
from functools import reduce
from heapq import nlargest, nsmallest
for q in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	num = [0] * (n + 1)
	for i in range(n):
		num[a[i]] = 1
	yy = sum(num)
	if yy > k:
		print(-1)
		continue
	res = []
	for i in range(1, n + 1):
		if num[i] == 1:
			res.append(i)
	yy = k - yy
	ind = 1
	while yy > 0:
		if num[ind] == 1:
			res.append(ind)
			yy -= 1
		ind += 1
		ind = ind % (n + 1)
	res *= n
	print(len(res))
	print(*res)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) > k:
		print(-1)
	else:
		b = []
		aa = set()
		c = []
		for i in a:
			if i not in aa:
				b.append(i)
				aa.add(i)
			else:
				c.append(i)
		d = len(b)
		b = b + c[:k - d]
		b = b * n
		print(len(b))
		print(*b)


def find_uni(A):
	x = set(A)
	return x
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	unique = find_uni(a)
	N_uniq = len(unique)
	if N_uniq > k:
		print(-1)
	else:
		out = []
		l = list(unique)
		for i in range(N_uniq, k):
			l.append(1)
		for i in range(n):
			out.extend(l)
		print(n * k)
		for x in out:
			print(x, end=' ')
		print()


import sys
t = int(input())
for _ in range(t):
	line = input()
	arr = line.split(' ')
	n = int(arr[0])
	k = int(arr[1])
	line = input()
	arr = line.split(' ')
	num = []
	diff = []
	result = []
	for i in arr:
		integer = int(i)
		num.append(integer)
		if integer not in diff:
			diff.append(integer)
	if len(diff) > k:
		print(-1)
	else:
		while len(diff) < k:
			for i in range(1, n + 1):
				if i not in diff:
					diff.append(i)
					break
		pos = -1
		for i in num:
			while pos < len(diff):
				pos += 1
				if pos == len(diff):
					pos = 0
				result.append(diff[pos])
				if diff[pos] == i:
					break
		print(len(result))
		print(' '.join((str(i) for i in result)))


def solve():
	(n, k) = [int(v) for v in input().split()]
	arr = [int(v) for v in input().split()]
	ans = []
	st = set(arr)
	if len(st) > k:
		print(-1)
		return
	for i in range(1, n + 1):
		if len(st) < k:
			st.add(i)
		else:
			break
	ans = []
	for i in range(n):
		for v in st:
			ans.append(v)
	print(len(ans))
	print(' '.join((str(v) for v in ans)))
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().rstrip().split(' ')))
	arr = list(input().rstrip().split(' '))
	distinct = set(arr)
	if len(distinct) > k:
		print('-1')
		continue
	else:
		if len(distinct) < k:
			for i in range(1, n + 1):
				if i not in distinct:
					distinct.add(str(i))
				if len(distinct) == k:
					break
		print(len(distinct) * n)
		out = (' '.join(distinct) + ' ') * n
		out.rstrip()
		print(out)


def next():
	return [int(x) for x in input().split()]

def f(n):
	return (n + 1) * n // 2 * 3 - n
(cas,) = next()
for _ in range(cas):
	(n, k) = next()
	x = list(set(next()))
	if len(x) > k:
		print(-1)
	else:
		for c in range(len(x), k):
			x.append(c)
		print(k * n)
		print(' '.join([str(o) for o in x * n]))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = [*map(int, input().split())]
	s = set(l)
	if len(s) > k:
		print(-1)
	else:
		p = list(s)
		if len(p) < k:
			while len(p) != k:
				p.append(1)
		p.sort()
		print(len(p) * n)
		for i in range(n):
			for j in p:
				print(j, end=' ')
		print()


from sys import stdin, exit, setrecursionlimit
from collections import deque
from heapq import *
from math import gcd
from math import ceil, log2
setrecursionlimit(10000000)
from collections import deque
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()
for _ in range(int(input())):
	(n, k) = mi()
	a = lmi()
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		cnt = abs(len(s) - k)
		for i in range(1, n + 1):
			if cnt <= 0:
				break
			if i not in s:
				cnt -= 1
				s.add(i)
		print(n * len(s))
		for i in range(n):
			for j in s:
				print(j, end=' ')
		print()


import sys
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k < len(set(a)):
		print(-1)
	else:
		i = 1
		s = set(a)
		while k > len(s):
			if i not in s:
				s.add(i)
			i += 1
		print(n * k)
		for i in range(n):
			for j in s:
				print(j, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = input().split()
	sarr = set(arr)
	if len(sarr) > k:
		print(-1)
	else:
		string = []
		for i in sarr:
			string += [i]
		string += string * (k // len(string) - 1)
		for i in range(k - len(string)):
			string += [string[i]]
		print(len(string) * n)
		nstring = string * n
		print(' '.join(nstring))


T = int(input())
i = lambda : map(int, input().split())
while T > 0:
	(n, k) = i()
	l = list(i())
	s = list(set(l))
	if len(s) > k:
		print(-1)
	else:
		s.extend([l[0]] * (k - len(s)))
		s = s * n
		print(n * k)
		print(*s)
	T -= 1


for i in range(int(input())):
	(n, k) = map(int, input().split())
	s = list(map(int, input().split()))
	check = set()
	for j in s:
		check.add(str(j))
	if len(check) > k:
		print(-1)
	else:
		ss = []
		for h in check:
			ss.append(h)
		while len(ss) != k:
			ss.append(ss[0])
		ch = 0
		am = len(ss) * len(s)
		print(am)
		while len(ss) != am:
			ss.append(ss[ch])
			ch += 1
		print(*ss)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	v = [0] * (n + 1)
	ct = 0
	ele = []
	for i in ar:
		if v[i] == 0:
			v[i] = 1
			ele.append(str(i))
			ct += 1
	if ct > k:
		print(-1)
	elif n == k:
		print(n)
		for i in ar:
			print(i, end=' ')
		print('')
	else:
		print(n * k)
		l = len(ele)
		c = 0
		if l < k:
			for i in range(n):
				if v[i % k + 1]:
					continue
				else:
					ele.append(str(i % k + 1))
					c += 1
				if c == k - l:
					break
		st = ' '.join(ele)
		for i in range(n):
			print(st, end=' ')
		print('')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	temp = set(a)
	if len(temp) > k:
		print(-1)
		continue
	i = 1
	while len(temp) < k:
		temp.add(i)
		i += 1
	print(n * k)
	another_temp = list(temp)
	print(' '.join([str(x) for x in another_temp * n]))


t = int(input())
for v in range(t):
	(a, b) = [int(c) for c in input().split()]
	d = [int(c) for c in input().split()]
	arr = sorted(set(d))
	if len(arr) > b:
		print('-1')
		continue
	else:
		arr = arr * 100
		arr = arr[:b]
		print(a * b)
		print(*arr * a)


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def main():
	ntest = int(stdin.readline())
	for testcase in range(ntest):
		(n, k) = [int(x) for x in stdin.readline().split()]
		a = [int(x) for x in stdin.readline().split()]
		valset = set(a)
		if len(valset) > k:
			stdout.write('-1\n')
			continue
		for i in range(1, n + 1):
			if len(valset) < k:
				valset.add(i)
			else:
				break
		vals = list(valset)
		b = []
		for j in range(n * k):
			b.append(vals[j % k])
		stdout.write('%d\n%s\n' % (len(b), ' '.join([str(x) for x in b])))
	return 0
main()


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ch = 1
	d = [0] * 105
	for i in a:
		d[i] = 1
	cn = 0
	for i in d:
		if i == 1:
			cn += 1
	if cn > k:
		ch = 0
	c = []
	if ch == 1:
		for i in range(105):
			if d[i] == 1:
				c.append(i)
	a = c + a
	b = []
	for i in range(k):
		b.append(a[i])
	i = 0
	j = k
	while j < len(a):
		if a[j] not in b:
			ch = 0
			break
		if a[i] == a[j]:
			b.append(a[j])
			i = (i + 1) % k
			j += 1
		else:
			b.append(a[i])
			i = (i + 1) % k
	if ch == 1:
		print(len(b))
		print(*b)
	else:
		print(-1)


def isBeautiful(v, k):
	for i in range(len(v)):
		if i < k or v[i] == v[i - k]:
			continue
		return False
	return True
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	impossible = False
	v = list(map(int, input().split()))
	if isBeautiful(v, k):
		print(n)
		for i in v:
			print(i, end=' ')
		print()
		continue
	s = v[:k]
	vss = set(v)
	sap = list(set(v))
	if len(vss) > k:
		print(-1)
		continue
	if len(vss) < k:
		for i in range(k - len(vss)):
			sap.append(sap[0])
	print(k * n)
	for i in range(n):
		for x in sap:
			print(x, end=' ')
	print()


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = list(set(l))
	if len(s) > k:
		print(-1)
	elif len(s) == k:
		print(len(l) * len(s))
		s = s * len(l)
		print(*s)
	else:
		x = k - len(s)
		s += [1] * x
		print(len(l) * len(s))
		s = s * len(l)
		print(*s)
	t -= 1


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 200010
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]
spf[0] = spf[1] = -1

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
for _ in range(int(input())):
	(n, k) = arrIN()
	a = arrIN()
	if n == k:
		print(n)
		print(*a)
	elif len(set(a)) > k:
		print(-1)
	else:
		x = sorted(set(a))
		rem = k - len(x)
		x.extend([x[0]] * rem)
		for i in range(100000):
			x += [x[i]]
		print(10000)
		print(*x[:10000])


T = int(input())
answer = ''
for t in range(T):
	(n, k) = list(map(int, input().split()))
	if n == k:
		answer += str(n) + '\n'
		answer += input() + '\n'
		continue
	arr = list(map(int, input().split()))
	types = dict()
	pre = []
	count = 0
	for a in arr:
		if not types.get(a):
			types[a] = True
			count += 1
			pre.append(a)
	if count > k:
		answer += '-1\n'
		continue
	for i in range(k - count):
		pre.append(1)
	preframe = sorted(pre)
	frame = ''
	for c in preframe:
		frame += str(c) + ' '
	m = n * len(preframe)
	answer += str(m) + '\n'
	answer += frame * n + '\n'
print(answer)


import random
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		s = list(s)
		for j in range(k - len(s)):
			s.append(1)
		z = []
		for j in range(n):
			z.extend(s)
		print(len(z))
		for j in range(len(z)):
			print(z[j], end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	ar = [int(x) for x in input().split()]
	d = {}
	mx = 0
	fr = []
	for i in ar:
		if i not in d:
			fr.append(i)
			d[i] = 1
		else:
			d[i] += 1
	if k < len(d):
		print('-1')
	else:
		for i in range(1, n + 1):
			if len(fr) < k:
				fr.append(i)
			else:
				break
		fr.sort()
		fr = fr * n
		print(len(fr))
		for i in fr:
			print(i, end=' ')
		print()


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	(n, k) = mapi()
	a = list(mapi())
	ans = []
	b = a[:]
	mp = defaultdict(int)
	for i in range(n):
		if b[i] not in mp:
			ans.append(b[i])
			mp[b[i]] += 1
	m = len(ans)
	res = []
	for i in range(m, k):
		ans.append(ans[i - m])
	a = a[::-1]
	for i in range(k):
		res.append(ans[i])
		if ans[i] == a[-1]:
			a.pop()
	i = 0
	f = 0
	while len(a) > 0:
		tmp = res[i]
		res.append(tmp)
		if tmp == a[-1]:
			a.pop()
		i += 1
		if len(res) > 10000:
			print(-1)
			f = 1
			break
	if f:
		pass
	else:
		print(len(res))
		print(*res)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	B = set(A)
	C = list(B)
	if len(B) > k:
		print(-1)
	elif len(B) == k:
		print(len(list(B) * n))
		print(*list(B) * n)
	else:
		x = len(B)
		for i in range(1, 10 ** 9):
			if i not in B:
				C.append(i)
				x += 1
				if x == k:
					break
		print(len(C * n))
		print(*C * n)


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def case():
	(n, k) = li()
	a = li()
	s = sum(a[:k])
	m = s
	ans = []
	b = list(set(a))
	if len(b) > k:
		print(-1)
		return
	c = 0
	l = len(b)
	for i in range(len(b), k):
		b.append(b[c])
		c += 1
		c = c % l
	print(n * len(b))
	for i in range(n):
		print(*b, end=' ')
	print()
for _ in range(int(input())):
	case()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = set()
	number = 0
	ans = []
	for i in a:
		if i in p:
			continue
		p.add(i)
		number += 1
	if number > k:
		print(-1)
	else:
		ret = []
		for i in p:
			ret.append(i)
		for i in range(k - number):
			ret.append(1)
		print(n * k)
		for i in range(n):
			for j in range(k):
				print(ret[j])


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	if len(set(a)) > k:
		print(-1)
	else:
		a = sorted(list(set(a)))
		b = []
		for i in range(k // len(a)):
			b += a
		b += a[:k - len(b)]
		print(len(b) * n)
		print(*b * n)


from sys import stdin, stdout
import collections

def read_line():
	return stdin.readline()

def read_int():
	return int(stdin.readline())

def read_arr():
	return [int(x) for x in stdin.readline().split(' ')]

def read_int_arr():
	return [int(x) for x in stdin.readline().split(' ')]

def main():
	t = read_int()
	for _ in range(t):
		(n, k) = read_int_arr()
		a = read_int_arr()
		nums = set(a)
		if len(nums) > k:
			print('-1')
			continue
		else:
			a = list(nums) + a
			n = len(a)
		window = set()
		res = []
		for x in a[:k]:
			res.append(x)
			window.add(x)
		ai = k
		while ai < n:
			entering = a[ai]
			leaving = res[-k]
			if entering not in window:
				print('-1')
				break
			elif entering == leaving:
				res.append(entering)
				ai += 1
			else:
				res.append(leaving)
		else:
			print(len(res))
			print(*(x for x in res))
main()


for xyz in range(0, int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = l.copy()
	l = set(l)
	l = list(l)
	le = len(l)
	if le > k:
		print(-1)
	else:
		ha = [0] * 100
		for i in l1:
			ha[i - 1] = 1
		np = []
		for i in range(0, len(ha)):
			if ha[i] == 0:
				np.append(i + 1)
		j = 0
		for i in range(le, k):
			l.append(np[j])
			j += 1
		l = l * 100
		print(len(l))
		print(*l)


test = int(input())
while test:
	test -= 1
	(n, k) = map(int, input().split())
	ls = list(map(int, input().split()))
	ss = set(ls)
	if n == k:
		print(n)
		print(*ls)
	elif len(ss) > k:
		print(-1)
	else:
		ans = list(set(ls))
		x = k - len(ans)
		for i in range(x):
			ans.append(1)
		kk = ''
		for i in ans:
			kk += str(i) + ' '
		print(k * n)
		print(kk * n)


try:
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		A = list(map(int, input().split()))
		check = set(A)
		if len(check) > k:
			print(-1)
			continue
		B = list(check)
		while len(B) < k:
			z = 1
			while B.count(z) != 0:
				z += 1
			B.append(z)
		B = sorted(B)
		B = B * n
		print(len(B))
		print(*B)
except:
	pass


t = int(input())
for a in range(t):
	(n, k) = map(int, input().split())
	nums = list(map(int, input().split()))
	diff = list()
	for b in nums:
		if b not in diff:
			diff.append(b)
	if len(diff) > k:
		print(-1)
	else:
		segment = diff + [nums[0] for b in range(k - len(diff))]
		currentIndex = 0
		numSegments = 1
		for c in nums:
			if c in segment[currentIndex:]:
				currentIndex = segment[currentIndex:].index(c) + currentIndex + 1
			else:
				numSegments += 1
				currentIndex = segment.index(c) + 1
		answer = ''
		for c in segment:
			answer += str(c) + ' '
		print(k * numSegments)
		print(answer * numSegments)


t = int(input())
for t1 in range(0, t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = len(set(l))
	d = {}
	if s > k:
		print(-1)
	else:
		ans = []
		for i in l:
			if i not in d:
				d[i] = 1
				ans.append(i)
		print(n * k)
		ok = []
		for i in range(0, n):
			ok = ok + ans
			l1 = [1] * (k - s)
			ok = ok + l1
		print(*ok)


t = int(input())
for tt in range(t):
	(n, k) = [int(x) for x in input().split(' ')]
	a = list(map(int, input().split(' ')))
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		rep = []
		for x in s:
			rep.append(x)
		repp = []
		for i in range(k):
			repp.append(rep[i % len(s)])
		print(n * len(repp))
		for i in range(n):
			for x in repp:
				print(x, end=' ')
		print()


from math import *
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	r = set(l)
	y = len(r)
	if y > k:
		print('-1')
	else:
		arr = []
		for i in l:
			if i in arr:
				pass
			else:
				arr.append(i)
		z = len(arr)
		if k > z:
			for i in range(1, n + 1):
				if i in arr:
					pass
				else:
					arr.append(i)
					z = z + 1
				if k == z:
					break
		print(z * n)
		for i in range(n):
			for j in range(len(arr)):
				print(arr[j], end=' ')
		print()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	x = []
	s = set(a)
	if len(s) > k:
		print(-1)
	else:
		vis = set()
		for y in a:
			if y in vis:
				continue
			x.append(y)
			vis.add(y)
		x += [1] * (k - len(x))
		print(10 ** 4 // len(x) * len(x))
		print(' '.join(list(map(str, x)) * (10 ** 4 // len(x))))
		continue