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.

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.

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$$$.

NoteIn 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.

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
)

var reader io.Reader
var scanner *bufio.Scanner

func Init(io io.Reader, max_token_size int) {
	reader = bufio.NewReader(io)
	scanner = bufio.NewScanner(reader)
	// max token size
	scanner.Split(bufio.ScanWords)
	scanner.Buffer([]byte{}, max_token_size)
}

func stderr(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
}

func die(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
	os.Exit(1)
}

func NextInt() int {
	bytes := NextBytes()
	i, err := Atoi(bytes)
	if err != nil {
		die(err)
	}
	return i
}
func NextInt64() int64 {
	bytes := NextBytes()
	i, err := Atoi64(bytes)
	if err != nil {
		die(err)
	}
	return i
}

func NextBytes() []byte {
	if !scanner.Scan() {
		die(scanner.Err())
	}
	bytes := scanner.Bytes()
	copied := make([]byte, len(bytes))
	copy(copied, bytes)
	return copied
}

func Atoi(b []byte) (int, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func Atoi64(b []byte) (int64, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	var n int64
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int64(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func ExtendByteArray(a []byte, size int) []byte {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]byte, size-len(a))...)
	}
}

func ExtendIntArray(a []int, size int) []int {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]int, size-len(a))...)
	}
}

func reverseInts(a []int) {
	for l, r := 0, len(a)-1; l < r; l, r = l+1, r-1 {
		a[l], a[r] = a[r], a[l]
	}
}

func unique(a []int) int {
	newLen := 0
	n := len(a)
	for i := 0; i < n; i++ {
		if newLen == 0 || a[i] != a[newLen-1] {
			a[newLen] = a[i]
			newLen++
		}
	}
	return newLen
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	inf := os.Stdin
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	// inf, err := os.Open("a.in")
	// if err != nil {
	// 	die(err)
	// }
	// out, err := os.Create("a.out")
	// if err != nil {
	// 	die(err)
	// }
	// defer out.Close()
	Init(inf, 1000010)

	T := NextInt()

	a := make([]int, 100)
	b := make([]int, 100)
	res := make([]int, 100000)

	for t := 0; t < T; t++ {
		n, k := NextInt(), NextInt()

		for i := 0; i < n; i++ {
			a[i] = NextInt()
			b[i] = a[i]
		}
		sort.Ints(b[:n])
		newlen := unique(b[:n])

		if newlen > k {
			fmt.Fprintln(out, -1)
			continue
		}

		for i := newlen; i < k; i++ {
			b[i] = 1
		}

		good := true
		l := 0
		for i, j := 0, 0; good && i < n; i++ {
			ok := false
			// stderr("i", i, "j", j, "ai", a[i], "aj", a[j], "b:", b[:l])
			for t := 0; !ok && t < k; t++ {
				// stderr("t=", t)
				if b[j] != a[i] {
					res[l] = b[j]
					j++
					l++
				} else {
					res[l] = a[i]
					j++
					l++
					ok = true
				}
				if j == k {
					j = 0
				}
			}
			good = ok
		}

		if !good {
			fmt.Fprintln(out, -1)
			continue
		}
		fmt.Fprintln(out, l)
		for i := 0; i < l; i++ {
			fmt.Fprint(out, res[i], " ")
		}
		fmt.Fprintln(out)
	}

}

package main

import  (
	"bufio"
	"fmt"
	"os"
)

func unique(intSlice []int) []int {
    keys := make(map[int]bool)
    list := []int{}
    for _, entry := range intSlice {
        if _, value := keys[entry]; !value {
            keys[entry] = true
            list = append(list, entry)
        }
    }
    return list
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for t1 := 0; t1 < t; t1++ {
		var n, k int
		scanf("%d %d\n", &n, &k)
		a := make([]int, n)

		// fmt.Print(n,k)
		for i :=0; i<n; i++ {
			if i == n-1 {
				scanf("%d\n", &a[i])
			} else {
				scanf("%d ", &a[i])
			}
		}

		uniqueSlice := unique(a)

		if len(uniqueSlice) > k {
			fmt.Println("-1")
		} else {
			var lett int
			lett = len(uniqueSlice)
			for i :=0; i<(k-lett); i++ {
				uniqueSlice = append(uniqueSlice, 1)
			}

			fmt.Println(n*k)
			for i:=0; i < n; i++ {
				for j:=0; j < k; j++ {
					if i == n-1 && j == k-1 {
						fmt.Print(uniqueSlice[j], "\n")

					} else {
						fmt.Print(uniqueSlice[j], " ")
					}
				}
			}
		}

	}
}

/*
URL:
https://codeforces.com/contest/1348/problem/B
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n, k := ReadInt2()
		A := ReadIntSlice(n)
		solve(n, k, A)
	}
}
func solve(n, k int, A []int) {
	if k == n {
		fmt.Println(n)
		fmt.Println(PrintIntsLine(A...))
		return
	}

	// 種類数をカウント
	kind := map[int]bool{}
	for i := 0; i < n; i++ {
		kind[A[i]] = true
	}
	if len(kind) > k {
		fmt.Println(-1)
		return
	}

	// memo := [105]int{}
	B := []int{}
OUTER:
	for {
		for key := range kind {
			B = append(B, key)
			if len(B) >= k {
				break OUTER
			}
		}
	}

	// for i := 0; i < k; i++ {
	// 	// memo[A[i]]++
	// 	B = append(B, A[i])
	// }

	// 未知のものが現れたら不可能
	// for i := k; i < n; i++ {
	// 	if memo[A[i]] == 0 {
	// 		fmt.Println(-1)
	// 		return
	// 	}
	// }

	backIdx := 0
	// frontIdx := k
	frontIdx := 0
	for frontIdx < n && backIdx < len(B) {
		if A[frontIdx] == B[backIdx] {
			B = append(B, A[frontIdx])
			// PrintfDebug("OK\n")

			frontIdx++
			backIdx++
		} else {
			B = append(B, B[backIdx])
			// PrintfDebug("Back: %d\n", B[backIdx])

			backIdx++
		}

		// PrintfDebug("%v\n", B)
	}

	fmt.Println(len(B))
	fmt.Println(PrintIntsLine(B...))
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
	"sync"
)

func main() {
	for t := ScanInt(); t > 0; t-- {
		n, k := ScanInt(), ScanInt()
		m := make(map[int]bool)
		for i := 0; i < n; i++ {
			m[ScanInt()] = true
		}

		solv(n, k, m)
	}

	close(O)
	oWg.Wait()
}

func solv(n, k int, m map[int]bool) {
	if k < len(m) {
		P(-1)
		return
	}
	P(n * k)
	sb := strings.Builder{}

	for key := range m {
		sb.WriteString(strconv.Itoa(key) + " ")
	}
	for i := 0; i < (k - len(m)); i++ {
		sb.WriteString("1 ")
	}

	P(strings.Repeat(sb.String(), n))
}

/*********************** I/O ***********************/

var O chan string
var in *bufio.Scanner
var oWg *sync.WaitGroup
var P func(a ...interface{}) (n int, err error)

func init() {
	P = fmt.Println

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)

	O = make(chan string, 16)
	oWg = &sync.WaitGroup{}
	oWg.Add(1)

	writer := bufio.NewWriter(os.Stdout)
	go func() {
		defer oWg.Done()
		defer writer.Flush()

		for line := range O {
			writer.WriteString(line + "\n")
		}
	}()
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanInt() int     { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInt64() int64 { i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i }
func ScanStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt()
	}
	return arr
}
func ScanInt64Slice(n int) []int64 {
	arr := make([]int64, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt64()
	}
	return arr
}

/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func SArr(a []int) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.Itoa(a[i]) + " ")
	}
	return sb.String()
}
func SArr64(a []int64) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
	}
	return sb.String()
}
func MnMx(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int64) int64 { mn, _ := MnMx(args...); return mn }
func Mx(args ...int64) int64 { _, mx := MnMx(args...); return mx }
func LCM(a, b int64) int64   { return a / GCD(a, b) * b }
func GCD(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)

	var n []int = make([]int, t)
	var k []int = make([]int, t)
	var arr [][]int = make([][]int, t)
	var x int

	for i:=0; i< t ; i++ {
		fmt.Scan(&n[i])
		fmt.Scan(&k[i])

		for j :=0; j< n[i]; j++ {
			fmt.Scan(&x)
			arr[i] = append(arr[i], x)
		}
	}

	for i:=0; i< t ; i++ {
		k, v := getBeautiful(n[i], k[i], arr[i])
		if k == - 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(k)
			print(v)
		}
	}
}

func print(arr []int) {
	l := len(arr)
	for i:=0; i< l; i++ {
		if i == l -1 {
			fmt.Println(arr[i])
		} else {
			fmt.Printf("%d ",arr[i])
		}
	}
}

func getBeautiful(n, k int, arr []int) (int, []int) {
	if n == k {
		result := append(arr, arr[:n-1]...)
		return (2*n -1), result
	}

	i := 0

	m := make(map[int]bool)
	for i =0; i< len(arr); i++ {
		m[arr[i]] = true
	}

	if len(m) > k {
		return -1, []int{}
	}

	for i=1; i <=n; i++ {
		if len(m) == k {
			break
		}
		m[i] = true
	}

	var tmp, result []int

	for k, _ := range m {
		tmp = append(tmp, k)
	}

	for i = 0; i< n; i++ {
		result = append(result, tmp...)
	}

	return len(result), result
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

var pre = make([]int64,31)

func doPre(){
	pre[0] = 1
	for i :=1 ;i< 31;i++{
		pre[i] = pre[i-1] * 2
	}
}
func solve(n int) {
	var max,min int64 = 0,0
	max += pre[n]
	for i := 1;i < n;i++{
		if i <= n/2 -1 {
			max += pre[i]
		}else{
			min += pre[i]
		}
	}
	fmt.Println(math.Abs(float64(max) - float64(min)))
}

func main() {
	var t int
	scanf("%d\n",&t)
	for i:=0;i<t;i++{
		var n,k int
		scanf("%d %d\n",&n,&k)
		beautyArray := make([]int,n)
		countMap := make(map[int]int)
		for j:=0;j<n;j++{
			if j == n-1 {
				scanf("%d\n",&beautyArray[j])
			}else {
				scanf("%d ", &beautyArray[j])
			}
			countMap[beautyArray[j]]++
		}
		if len(countMap) > k{
			fmt.Println("-1")
		}else{
			result := make([]int,n)
			var index int = 0
			for k,_ := range countMap{
				result[index] = k
				index++
			}
			for i:=index;i<k;i++{
				result[i] = result[0]
			}
			fmt.Println(n * k)
			for i:=0;i<n;i++{
				for j:=0;j<k;j++{
					if i == 0 && j == 0 {
						fmt.Print(result[j])
					}else {
						fmt.Print(" ", result[j])
					}
				}
				if i == n-1 {
					fmt.Println()
				}
			}
		}
	}
}

package main

import (
	"fmt"
	"bufio"
	"os"
	"sort"
)

func main() {
    in := bufio.NewReader(os.Stdin)
    out := bufio.NewWriter(os.Stdout)
    defer out.Flush()
	noEx := 0
	fmt.Fscan(in, &noEx)
	for ; noEx > 0; noEx-- {
		n, k := 0, 0
		fmt.Fscan(in, &n)
		fmt.Fscan(in, &k)
		nums := make([]int, n)
		nSet := make(map[int]bool)
		var b []int
		for i:=0; i<n; i++ {fmt.Fscan(in, &nums[i]); nSet[nums[i]] = true}
		if len(nSet) > k {fmt.Fprint(out, -1); fmt.Fprint(out, "\n"); continue}
		var rec []int
		for v, _ := range nSet {rec = append(rec, v)}
		var comp []int
		sort.Ints(rec)
		for cnt := 0; cnt<k; cnt++ {
			comp = append(comp, rec[cnt%len(nSet)])
		}
		for _, _ = range nums {
			for _, n := range comp {b = append(b, n)}
		}
		fmt.Fprint(out, len(b))
		fmt.Fprint(out, "\n")
		for k, v := range b {
			fmt.Fprint(out, v)
			if k != len(b)-1 {fmt.Fprint(out, " ")}
		}
		fmt.Fprint(out, "\n")
	}
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	for i := int64(0); i < int64(len(aa)); i++ {
		u[aa[i]] = true
	}
	if int64(len(u)) > k {
		return nil
	}
	rep := []int64{}
	for i := range u {
		rep = append(rep, i)
	}
	for i := int64(len(rep)); i < k; i++ {
		rep = append(rep, 1) // random number
	}
	ret := []int64{}
	for i := 0; i < len(aa); i++ {
		ret = append(ret, rep...)
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var reader io.Reader
var scanner *bufio.Scanner

func Init(io io.Reader, max_token_size int) {
	reader = bufio.NewReader(io)
	scanner = bufio.NewScanner(reader)
	// max token size
	scanner.Split(bufio.ScanWords)
	scanner.Buffer([]byte{}, max_token_size)
}

func stderr(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
}

func die(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
	os.Exit(1)
}

func NextInt() int {
	bytes := NextBytes()
	i, err := Atoi(bytes)
	if err != nil {
		die(err)
	}
	return i
}
func NextInt64() int64 {
	bytes := NextBytes()
	i, err := Atoi64(bytes)
	if err != nil {
		die(err)
	}
	return i
}

func NextBytes() []byte {
	if !scanner.Scan() {
		die(scanner.Err())
	}
	bytes := scanner.Bytes()
	copied := make([]byte, len(bytes))
	copy(copied, bytes)
	return copied
}

func Atoi(b []byte) (int, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func Atoi64(b []byte) (int64, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	var n int64
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int64(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func ExtendByteArray(a []byte, size int) []byte {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]byte, size-len(a))...)
	}
}

func ExtendIntArray(a []int, size int) []int {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]int, size-len(a))...)
	}
}

func reverseInts(a []int) {
	for l, r := 0, len(a)-1; l < r; l, r = l+1, r-1 {
		a[l], a[r] = a[r], a[l]
	}
}

func unique(a []int) int {
	newLen := 0
	n := len(a)
	for i := 0; i < n; i++ {
		if newLen == 0 || a[i] != a[newLen-1] {
			a[newLen] = a[i]
			newLen++
		}
	}
	return newLen
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	inf := os.Stdin
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	// inf, err := os.Open("a.in")
	// if err != nil {
	// 	die(err)
	// }
	// out, err := os.Create("a.out")
	// if err != nil {
	// 	die(err)
	// }
	// defer out.Close()
	Init(inf, 1000010)

	T := NextInt()

	a := make([]int, 100)
	b := make([]int, 100000)

	for t := 0; t < T; t++ {
		n, k := NextInt(), NextInt()

		s := 0
		for i := 0; i < n; i++ {
			a[i] = NextInt()
			if i < k {
				s += a[i]
				b[i] = a[i]
			}
		}

		l := k
		good := true
		for i, j := k, 0; good && i < n; i++ {
			ok := false
			// stderr("i", i, "j", j, "ai", a[i], "aj", a[j], "b:", b[:l])
			for t := 0; !ok && t < k; t++ {
				// stderr("t=", t)
				if a[j] != a[i] {
					b[l] = a[j]
					j++
					l++
				} else {
					b[l] = a[i]
					j++
					l++
					ok = true
				}
				if j == k {
					j = 0
				}
			}
			good = ok
		}

		if !good {
			fmt.Fprintln(out, -1)
			continue
		}
		fmt.Fprintln(out, l)
		for i := 0; i < l; i++ {
			fmt.Fprint(out, b[i], " ")
		}
		fmt.Fprintln(out)
	}

}

package main

import  (
	"bufio"
	"fmt"
	"os"
)

func unique(intSlice []int) []int {
    keys := make(map[int]bool)
    list := []int{}
    for _, entry := range intSlice {
        if _, value := keys[entry]; !value {
            keys[entry] = true
            list = append(list, entry)
        }
    }
    return list
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for t1 := 0; t1 < t; t1++ {
		var n, k int
		scanf("%d %d\n", &n, &k)
		a := make([]int, n)

		// fmt.Print(n,k)
		for i :=0; i<n; i++ {
			if i == n-1 {
				scanf("%d\n", &a[i])
			} else {
				scanf("%d ", &a[i])
			}
		}

		uniqueSlice := unique(a)
		if len(uniqueSlice) > k {
			fmt.Println("-1")
		} else {
			for i :=0; i<(k-len(uniqueSlice)); i++ {
				uniqueSlice = append(uniqueSlice, 1)
			}

			fmt.Println(n*k)
			for i:=0; i < n; i++ {
				for j:=0; j < k; j++ {
					if i == n-1 && j == k-1 {
						fmt.Print("\n");
					} else {
						fmt.Print(uniqueSlice[j], " ")
					}
				}
			}
		}

	}
}

/*
URL:
https://codeforces.com/contest/1348/problem/B
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n, k := ReadInt2()
		A := ReadIntSlice(n)
		solve(n, k, A)
	}
}

func solve(n, k int, A []int) {
	memo := [105]int{}
	B := []int{}

	for i := 0; i < k; i++ {
		memo[A[i]]++
		B = append(B, A[i])
	}

	// 未知のものが現れたら不可能
	for i := k; i < n; i++ {
		if memo[A[i]] == 0 {
			fmt.Println(-1)
			return
		}
	}

	backIdx := 0
	frontIdx := k
	for frontIdx < n {
		if A[frontIdx] == B[backIdx] {
			B = append(B, A[frontIdx])
			// PrintfDebug("OK\n")

			frontIdx++
			backIdx++
		} else {
			B = append(B, B[backIdx])
			// PrintfDebug("Back: %d\n", B[backIdx])

			backIdx++
		}

		// PrintfDebug("%v\n", B)
	}

	fmt.Println(len(B))
	fmt.Println(PrintIntsLine(B...))
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

/*
URL:
https://codeforces.com/contest/1348/problem/B
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n, k := ReadInt2()
		A := ReadIntSlice(n)
		solve(n, k, A)
	}
}

// func solve(n, k int, A []int) {
// 	memo := [105]int{}

// 	for i := 0; i < k; i++ {
// 		memo[A[i]]++
// 	}

// 	// 未知のものが現れたら不可能
// 	for i := k; i < n; i++ {
// 		if memo[A[i]] == 0 {
// 			fmt.Println(-1)
// 			return
// 		}
// 	}

// 	B := []int{}
// 	for i := 0; i < k; i++ {
// 		B = append(B, A[i])
// 	}
// 	for i := k - 1; i < n; i++ {
// 		a := A[i]
// 		B = append(B, a)

// 		for j := 1; j <= n; j++ {
// 			num := memo[j]
// 			if a == j {
// 				num--
// 			}

// 			for l := 0; l < num; l++ {
// 				B = append(B, j)
// 			}
// 		}
// 	}

// 	fmt.Println(len(B))
// 	fmt.Println(PrintIntsLine(B...))
// }

func solve(n, k int, A []int) {
	if k == n {
		fmt.Println(n)
		fmt.Println(PrintIntsLine(A...))
		return
	}

	memo := [105]int{}
	B := []int{}

	for i := 0; i < k; i++ {
		memo[A[i]]++
		B = append(B, A[i])
	}

	// 未知のものが現れたら不可能
	for i := k; i < n; i++ {
		if memo[A[i]] == 0 {
			fmt.Println(-1)
			return
		}
	}

	backIdx := 0
	frontIdx := k
	for frontIdx < n && backIdx < len(B) {
		if A[frontIdx] == B[backIdx] {
			B = append(B, A[frontIdx])
			// PrintfDebug("OK\n")

			frontIdx++
			backIdx++
		} else {
			B = append(B, B[backIdx])
			// PrintfDebug("Back: %d\n", B[backIdx])

			backIdx++
		}

		// PrintfDebug("%v\n", B)
	}

	fmt.Println(len(B))
	fmt.Println(PrintIntsLine(B...))
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

/*
URL:
https://codeforces.com/contest/1348/problem/B
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n, k := ReadInt2()
		A := ReadIntSlice(n)
		solve(n, k, A)
	}
}

// func solve(n, k int, A []int) {
// 	memo := [105]int{}

// 	for i := 0; i < k; i++ {
// 		memo[A[i]]++
// 	}

// 	// 未知のものが現れたら不可能
// 	for i := k; i < n; i++ {
// 		if memo[A[i]] == 0 {
// 			fmt.Println(-1)
// 			return
// 		}
// 	}

// 	B := []int{}
// 	for i := 0; i < k; i++ {
// 		B = append(B, A[i])
// 	}
// 	for i := k - 1; i < n; i++ {
// 		a := A[i]
// 		B = append(B, a)

// 		for j := 1; j <= n; j++ {
// 			num := memo[j]
// 			if a == j {
// 				num--
// 			}

// 			for l := 0; l < num; l++ {
// 				B = append(B, j)
// 			}
// 		}
// 	}

// 	fmt.Println(len(B))
// 	fmt.Println(PrintIntsLine(B...))
// }

func solve(n, k int, A []int) {
	if k == n {
		fmt.Println(n)
		fmt.Println(PrintIntsLine(A...))
		return
	}

	memo := [105]int{}
	B := []int{}

	for i := 0; i < k; i++ {
		memo[A[i]]++
		B = append(B, A[i])
	}

	// 未知のものが現れたら不可能
	for i := k; i < n; i++ {
		if memo[A[i]] == 0 {
			fmt.Println(-1)
			return
		}
	}

	backIdx := 0
	frontIdx := k
	for frontIdx < n {
		if A[frontIdx] == B[backIdx] {
			B = append(B, A[frontIdx])
			// PrintfDebug("OK\n")

			frontIdx++
			backIdx++
		} else {
			B = append(B, B[backIdx])
			// PrintfDebug("Back: %d\n", B[backIdx])

			backIdx++
		}

		// PrintfDebug("%v\n", B)
	}

	fmt.Println(len(B))
	fmt.Println(PrintIntsLine(B...))
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
	"sync"
)

func main() {
	for t := ScanInt(); t > 0; t-- {
		n, k := ScanInt(), ScanInt()
		m := make(map[int]bool)
		for i := 0; i < n; i++ {
			m[ScanInt()] = true
		}

		solv(n, k, m)
	}

	close(O)
	oWg.Wait()
}

func solv(n, k int, m map[int]bool) {
	if k < len(m) {
		P(-1)
		return
	}
	P(n * k)
	sb := strings.Builder{}

	for q := 0; q < n; q++ {
		for key := range m {
			sb.WriteString(strconv.Itoa(key) + " ")
		}
		for i := 0; i < (k - len(m)); i++ {
			sb.WriteString( "1 ")
		}
	}
	P(sb.String())
}

/*********************** I/O ***********************/

var O chan string
var in *bufio.Scanner
var oWg *sync.WaitGroup
var P func(a ...interface{}) (n int, err error)

func init() {
	P = fmt.Println

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)

	O = make(chan string, 16)
	oWg = &sync.WaitGroup{}
	oWg.Add(1)

	writer := bufio.NewWriter(os.Stdout)
	go func() {
		defer oWg.Done()
		defer writer.Flush()

		for line := range O {
			writer.WriteString(line + "\n")
		}
	}()
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanInt() int     { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInt64() int64 { i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i }
func ScanStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt()
	}
	return arr
}
func ScanInt64Slice(n int) []int64 {
	arr := make([]int64, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt64()
	}
	return arr
}

/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func SArr(a []int) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.Itoa(a[i]) + " ")
	}
	return sb.String()
}
func SArr64(a []int64) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
	}
	return sb.String()
}
func MnMx(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int64) int64 { mn, _ := MnMx(args...); return mn }
func Mx(args ...int64) int64 { _, mx := MnMx(args...); return mx }
func LCM(a, b int64) int64   { return a / GCD(a, b) * b }
func GCD(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
	"sync"
)

func main() {
	for t := ScanInt(); t > 0; t-- {
		n, k := ScanInt(), ScanInt()
		m := make(map[int]bool)
		for i := 0; i < n; i++ {
			m[ScanInt()] = true
		}

		solv(n, k, m)
	}

	close(O)
	oWg.Wait()
}

func solv(n, k int, m map[int]bool) {
	if k < len(m) {
		P(-1)
		return
	}
	for q := 0; q < n; q++ {

		a := make([]int, 0, n*len(m))
		for k := range m {
			a = append(a, k)
		}
		for i := 0; i < (k - len(m)); i++ {
			a = append(a, 1)
		}
		P(n * k)
		P(SArr(a))
	}
}

/*********************** I/O ***********************/

var O chan string
var in *bufio.Scanner
var oWg *sync.WaitGroup
var P func(a ...interface{}) (n int, err error)

func init() {
	P = fmt.Println

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)

	O = make(chan string, 16)
	oWg = &sync.WaitGroup{}
	oWg.Add(1)

	writer := bufio.NewWriter(os.Stdout)
	go func() {
		defer oWg.Done()
		defer writer.Flush()

		for line := range O {
			writer.WriteString(line + "\n")
		}
	}()
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanInt() int     { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInt64() int64 { i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i }
func ScanStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt()
	}
	return arr
}
func ScanInt64Slice(n int) []int64 {
	arr := make([]int64, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt64()
	}
	return arr
}

/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func SArr(a []int) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.Itoa(a[i]) + " ")
	}
	return sb.String()
}
func SArr64(a []int64) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
	}
	return sb.String()
}
func MnMx(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int64) int64 { mn, _ := MnMx(args...); return mn }
func Mx(args ...int64) int64 { _, mx := MnMx(args...); return mx }
func LCM(a, b int64) int64   { return a / GCD(a, b) * b }
func GCD(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
	"sync"
)

func main() {
	for t := ScanInt(); t > 0; t-- {
		n, k := ScanInt(), ScanInt()
		m := make(map[int]bool)
		for i := 0; i < n; i++ {
			m[ScanInt()] = true
		}

		solv(n, k, m)
	}

	close(O)
	oWg.Wait()
}

func solv(n, k int, m map[int]bool) {
	if k < len(m) {
		P(-1)
		return
	}

	a := make([]int, 0, n*len(m))
	for k := range m {
		a = append(a, k)
	}
	for i := 0; i < (k - len(m)); i++ {
		a = append(a, 1)
	}
	P(n * k)
	P(SArr(a))
}

/*********************** I/O ***********************/

var O chan string
var in *bufio.Scanner
var oWg *sync.WaitGroup
var P func(a ...interface{}) (n int, err error)

func init() {
	P = fmt.Println

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)

	O = make(chan string, 16)
	oWg = &sync.WaitGroup{}
	oWg.Add(1)

	writer := bufio.NewWriter(os.Stdout)
	go func() {
		defer oWg.Done()
		defer writer.Flush()

		for line := range O {
			writer.WriteString(line + "\n")
		}
	}()
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanInt() int     { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInt64() int64 { i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i }
func ScanStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt()
	}
	return arr
}
func ScanInt64Slice(n int) []int64 {
	arr := make([]int64, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt64()
	}
	return arr
}

/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func SArr(a []int) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.Itoa(a[i]) + " ")
	}
	return sb.String()
}
func SArr64(a []int64) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
	}
	return sb.String()
}
func MnMx(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int64) int64 { mn, _ := MnMx(args...); return mn }
func Mx(args ...int64) int64 { _, mx := MnMx(args...); return mx }
func LCM(a, b int64) int64   { return a / GCD(a, b) * b }
func GCD(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)

	var n []int = make([]int, t)
	var k []int = make([]int, t)
	var arr [][]int = make([][]int, t)
	var x int

	for i:=0; i< t ; i++ {
		fmt.Scan(&n[i])
		fmt.Scan(&k[i])

		for j :=0; j< n[i]; j++ {
			fmt.Scan(&x)
			arr[i] = append(arr[i], x)
		}
	}

	for i:=0; i< t ; i++ {
		k, v := getBeautiful(n[i], k[i], arr[i])
		if k == - 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(k)
			print(v)
		}
	}
}

func print(arr []int) {
	l := len(arr)
	for i:=0; i< l; i++ {
		if i == l -1 {
			fmt.Println(arr[i])
		} else {
			fmt.Printf("%d ",arr[i])
		}
	}
}

func getBeautiful(n, k int, arr []int) (int, []int) {
	if n == k {
		result := append(arr, arr[:n-1]...)
		return (2*n -1), result
	}

	var top []int = make([]int, k)
	copy(top, arr[:k])

	i := 0
	j := k

	diff := 0

	for j < len(arr) {
		if top[i] == arr[j] {
			top = append(top, arr[j])
			if diff > 0 {
				diff--
			}
			j++
		} else {
			top = append(top, top[i])
			diff++
		}

		if diff == k {
			return -1, []int{}
		}
		i++
	}

	return len(top), top
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)

	var n []int = make([]int, t)
	var k []int = make([]int, t)
	var arr [][]int = make([][]int, t)
	var x int

	for i:=0; i< t ; i++ {
		fmt.Scan(&n[i])
		fmt.Scan(&k[i])

		for j :=0; j< n[i]; j++ {
			fmt.Scan(&x)
			arr[i] = append(arr[i], x)
		}
	}

	for i:=0; i< t ; i++ {
		k, v := getBeautiful(n[i], k[i], arr[i])
		if k == - 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(k)
			fmt.Println(v)
		}
	}
}

func getBeautiful(n, k int, arr []int) (int, []int) {
	if n == k {
		result := append(arr, arr[:n-1]...)
		return (2*n -1), result
	}

	var top []int = make([]int, k)
	copy(top, arr[:k])

	i := 0
	j := k

	diff := 0

	for j < len(arr) {
		if top[i] == arr[j] {
			top = append(top, arr[j])
			if diff > 0 {
				diff--
			}
			j++
		} else {
			top = append(top, top[i])
			diff++
		}

		if diff == k {
			return -1, []int{}
		}
		i++
	}

	return len(top), top
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)

	var n []int = make([]int, t)
	var k []int = make([]int, t)
	var arr [][]int = make([][]int, t)
	var x int

	for i:=0; i< t ; i++ {
		fmt.Scan(&n[i])
		fmt.Scan(&k[i])

		for j :=0; j< n[i]; j++ {
			fmt.Scan(&x)
			arr[i] = append(arr[i], x)
		}
	}

	for i:=0; i< t ; i++ {
		k, v := getBeautiful(n[i], k[i], arr[i])
		if k == - 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(k)
			print(v)
		}
	}
}

func print(arr []int) {
	l := len(arr)
	for i:=0; i< l; i++ {
		if i == l -1 {
			fmt.Println(arr[i])
		} else {
			fmt.Printf("%d ",arr[i])
		}
	}
}

func getBeautiful(n, k int, arr []int) (int, []int) {
	if n == k {
		result := append(arr, arr[:n-1]...)
		return (2*n -1), result
	}

	i := 0

	m := make(map[int]int)
	for i =0; i< len(arr); i++ {
		m[arr[i]] = m[arr[i]] +1
	}

	if len(m) > k {
		return -1, []int{}
	}

	for i=1; i <=n; i++ {
		m[i] = 1
		if len(m) == k {
			break
		}
	}

	var tmp, result []int

	for k, v := range m {
		for j:=0; j< v; j++ {
			tmp = append(tmp, k)
		}
	}

	for i = 0; i< n; i++ {
		result = append(result, tmp...)
	}

	return len(result), result
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)

	var n []int = make([]int, t)
	var k []int = make([]int, t)
	var arr [][]int = make([][]int, t)
	var x int

	for i:=0; i< t ; i++ {
		fmt.Scan(&n[i])
		fmt.Scan(&k[i])

		for j :=0; j< n[i]; j++ {
			fmt.Scan(&x)
			arr[i] = append(arr[i], x)
		}
	}

	for i:=0; i< t ; i++ {
		k, v := getBeautiful(n[i], k[i], arr[i])
		if k == - 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(k)
			print(v)
		}
	}
}

func print(arr []int) {
	l := len(arr)
	for i:=0; i< l; i++ {
		if i == l -1 {
			fmt.Println(arr[i])
		} else {
			fmt.Printf("%d ",arr[i])
		}
	}
}

func getBeautiful(n, k int, arr []int) (int, []int) {
	if n == k {
		result := append(arr, arr[:n-1]...)
		return (2*n -1), result
	}

	i := 0

	m := make(map[int]bool)
	for i =0; i< len(arr); i++ {
		m[arr[i]] = true
	}

	if len(m) > k {
		return -1, []int{}
	}

	for i=1; i <=n; i++ {
		m[i] = true
		if len(m) == k {
			break
		}
	}

	var tmp, result []int

	for k, _ := range m {
		tmp = append(tmp, k)
	}

	for i = 0; i< n; i++ {
		result = append(result, tmp...)
	}

	return len(result), result
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)

	var n []int = make([]int, t)
	var k []int = make([]int, t)
	var arr [][]int = make([][]int, t)
	var x int

	for i:=0; i< t ; i++ {
		fmt.Scan(&n[i])
		fmt.Scan(&k[i])

		for j :=0; j< n[i]; j++ {
			fmt.Scan(&x)
			arr[i] = append(arr[i], x)
		}
	}

	for i:=0; i< t ; i++ {
		k, v := getBeautiful(n[i], k[i], arr[i])
		if k == - 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(k)
			print(v)
		}
	}
}

func print(arr []int) {
	l := len(arr)
	for i:=0; i< l; i++ {
		if i == l -1 {
			fmt.Print("%d",arr[i])
		} else {
			fmt.Print("%d ",arr[i])
		}

	}
}

func getBeautiful(n, k int, arr []int) (int, []int) {
	if n == k {
		result := append(arr, arr[:n-1]...)
		return (2*n -1), result
	}

	var top []int = make([]int, k)
	copy(top, arr[:k])

	i := 0
	j := k

	diff := 0

	for j < len(arr) {
		if top[i] == arr[j] {
			top = append(top, arr[j])
			if diff > 0 {
				diff--
			}
			j++
		} else {
			top = append(top, top[i])
			diff++
		}

		if diff == k {
			return -1, []int{}
		}
		i++
	}

	return len(top), top
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

var pre = make([]int64,31)

func doPre(){
	pre[0] = 1
	for i :=1 ;i< 31;i++{
		pre[i] = pre[i-1] * 2
	}
}
func solve(n int) {
	var max,min int64 = 0,0
	max += pre[n]
	for i := 1;i < n;i++{
		if i <= n/2 -1 {
			max += pre[i]
		}else{
			min += pre[i]
		}
	}
	fmt.Println(math.Abs(float64(max) - float64(min)))
}

func main() {
	var t int
	scanf("%d\n",&t)
	for i:=0;i<t;i++{
		var n,k int
		scanf("%d %d\n",&n,&k)
		beautyArray := make([]int,n)
		countMap := make(map[int]int)
		maxCount := 0
		toutal := 0
		for j:=0;j<n;j++{
			if j == n-1 {
				scanf("%d\n",&beautyArray[j])
			}else {
				scanf("%d ", &beautyArray[j])
			}
			countMap[beautyArray[j]]++
			if countMap[beautyArray[j]] >  maxCount{
				maxCount = countMap[beautyArray[j]]
			}
		}
		if len(countMap) > k{
			fmt.Println("-1")
		}else{
			for _,v := range countMap{
				toutal += v
			}
			fmt.Println(toutal * k)
			result := make([]int,k)
			for i := 0;i<k;i++{
				result[i] = beautyArray[i%n]
			}
			for i:=0;i<toutal;i++{
				for j:=0;j<k;j++{
					if i == 0 && j == 0 {
						fmt.Print(result[j])
					}else {
						fmt.Print(" ", result[j])
					}
				}
				if i == toutal-1 {
					fmt.Println()
				}
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

var pre = make([]int64,31)

func doPre(){
	pre[0] = 1
	for i :=1 ;i< 31;i++{
		pre[i] = pre[i-1] * 2
	}
}
func solve(n int) {
	var max,min int64 = 0,0
	max += pre[n]
	for i := 1;i < n;i++{
		if i <= n/2 -1 {
			max += pre[i]
		}else{
			min += pre[i]
		}
	}
	fmt.Println(math.Abs(float64(max) - float64(min)))
}

func main() {
	var t int
	scanf("%d\n",&t)
	for i:=0;i<t;i++{
		var n,k int
		scanf("%d %d\n",&n,&k)
		beautyArray := make([]int,n)
		countMap := make(map[int]int)
		toutal := 0
		for j:=0;j<n;j++{
			if j == n-1 {
				scanf("%d\n",&beautyArray[j])
			}else {
				scanf("%d ", &beautyArray[j])
			}
			countMap[beautyArray[j]]++
		}
		if len(countMap) > k{
			fmt.Println("-1")
		}else{
			result := make([]int,n)
			var index int = 0
			for k,v := range countMap{
				toutal += v
				result[index] = k
				index++
			}
			for i:=len(result);i<k;i++{
				result[i] = result[0]
			}
			fmt.Println(toutal * k)
			for i:=0;i<toutal;i++{
				for j:=0;j<k;j++{
					if i == 0 && j == 0 {
						fmt.Print(result[j])
					}else {
						fmt.Print(" ", result[j])
					}
				}
				if i == toutal-1 {
					fmt.Println()
				}
			}
		}
	}
}

package main

import (
	"fmt"
	"math"
)

var pre = make([]int64,31)

func doPre(){
	pre[0] = 1
	for i :=1 ;i< 31;i++{
		pre[i] = pre[i-1] * 2
	}
}
func solve(n int) {
	var max,min int64 = 0,0
	max += pre[n]
	for i := 1;i < n;i++{
		if i <= n/2 -1 {
			max += pre[i]
		}else{
			min += pre[i]
		}
	}
	fmt.Println(math.Abs(float64(max) - float64(min)))
}

func main() {
	var t int
	fmt.Scanf("%d\n",&t)
	for i:=0;i<t;i++{
		var n,k int
		fmt.Scanf("%d %d\n",&n,&k)
		beautyArray := make([]int,n)
		countMap := make(map[int]int)
		maxCount := 0
		toutal := 0
		for j:=0;j<n;j++{
			fmt.Scanf("%d",&beautyArray[j])
			countMap[beautyArray[j]]++
			if countMap[beautyArray[j]] >  maxCount{
				maxCount = countMap[beautyArray[j]]
			}
		}
		if len(countMap) > k{
			fmt.Println("-1")
		}else{
			for _,v := range countMap{
				toutal += v
			}
			fmt.Println(toutal * k)
			result := make([]int,k)
			for i := 0;i<k;i++{
				result[i] = beautyArray[i%n]
			}
			for i:=0;i<toutal;i++{
				for j:=0;j<k;j++{
					if i == 0 && j == 0 {
						fmt.Print(result[j])
					}else {
						fmt.Print(" ", result[j])
					}
				}
				if i == toutal-1 {
					fmt.Println()
				}
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

var pre = make([]int64,31)

func doPre(){
	pre[0] = 1
	for i :=1 ;i< 31;i++{
		pre[i] = pre[i-1] * 2
	}
}
func solve(n int) {
	var max,min int64 = 0,0
	max += pre[n]
	for i := 1;i < n;i++{
		if i <= n/2 -1 {
			max += pre[i]
		}else{
			min += pre[i]
		}
	}
	fmt.Println(math.Abs(float64(max) - float64(min)))
}

func main() {
	var t int
	scanf("%d\n",&t)
	for i:=0;i<t;i++{
		var n,k int
		scanf("%d %d\n",&n,&k)
		beautyArray := make([]int,n)
		countMap := make(map[int]int)
		maxCount := 0
		toutal := 0
		for j:=0;j<n;j++{
			scanf("%d ",&beautyArray[j])
			countMap[beautyArray[j]]++
			if countMap[beautyArray[j]] >  maxCount{
				maxCount = countMap[beautyArray[j]]
			}
		}
		if len(countMap) > k{
			fmt.Println("-1")
		}else{
			for _,v := range countMap{
				toutal += v
			}
			fmt.Println(toutal * k)
			result := make([]int,k)
			for i := 0;i<k;i++{
				result[i] = beautyArray[i%n]
			}
			for i:=0;i<toutal;i++{
				for j:=0;j<k;j++{
					if i == 0 && j == 0 {
						fmt.Print(result[j])
					}else {
						fmt.Print(" ", result[j])
					}
				}
				if i == toutal-1 {
					fmt.Println()
				}
			}
		}
	}
}

package main

import (
	"fmt"
	"math"
)

var pre = make([]int64,31)

func doPre(){
	pre[0] = 1
	for i :=1 ;i< 31;i++{
		pre[i] = pre[i-1] * 2
	}
}
func solve(n int) {
	var max,min int64 = 0,0
	max += pre[n]
	for i := 1;i < n;i++{
		if i <= n/2 -1 {
			max += pre[i]
		}else{
			min += pre[i]
		}
	}
	fmt.Println(math.Abs(float64(max) - float64(min)))
}

func main() {
	var t int
	fmt.Scanf("%d\n",&t)
	for i:=0;i<t;i++{
		var n,k int
		fmt.Scanf("%d %d\n",&n,&k)
		beautyArray := make([]int,n)
		countMap := make(map[int]int)
		maxCount := 0
		toutal := 0
		for j:=0;j<n;j++{
			fmt.Scanf("%d\n",&beautyArray[j])
			countMap[beautyArray[j]]++
			if countMap[beautyArray[j]] >  maxCount{
				maxCount = countMap[beautyArray[j]]
			}
		}
		if len(countMap) > k{
			fmt.Println("-1")
		}else{
			for _,v := range countMap{
				toutal += v
			}
			fmt.Println(toutal * k)
			result := make([]int,k)
			for i := 0;i<k;i++{
				result[i] = beautyArray[i%n]
			}
			for i:=0;i<toutal;i++{
				for j:=0;j<k;j++{
					if i == 0 && j == 0 {
						fmt.Print(result[j])
					}else {
						fmt.Print(" ", result[j])
					}
				}
				if i == toutal-1 {
					fmt.Println()
				}
			}
		}
	}
}

package main

import (
	"fmt"
	"bufio"
	"os"
)

func main() {
    in := bufio.NewReader(os.Stdin)
    out := bufio.NewWriter(os.Stdout)
    defer out.Flush()
	noEx := 0
	fmt.Fscan(in, &noEx)
	for ; noEx > 0; noEx-- {
		n, k := 0, 0
		fmt.Fscan(in, &n)
		fmt.Fscan(in, &k)
		nums := make([]int, n)
		max := 0
		for i:=0; i<n; i++ {fmt.Fscan(in, &nums[i]); if max < nums[i] {max = nums[i]}}
		max += k
		var b []int
		for _, v := range nums {
			b = append(b, v)
			rem := 0
			for t:=0; t<k-2; t++ {
				b = append(b, 1)
				rem++
			}
			b = append(b, max-v-rem)
		}
		fmt.Fprint(out, len(b))
		fmt.Fprint(out, "\n")
		for k, v := range b {
			fmt.Fprint(out, v)
			if k != len(b)-1 {fmt.Fprint(out, " ")}
		}
		fmt.Fprint(out, "\n")
	}
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	rep := []int64{}
	for i := int64(0); i < k; i++ {
		u[aa[i]] = true
		rep = append(rep, aa[i])
	}
	for i := k; i < int64(len(aa)); i++ {
		if !u[aa[i]] {
			return nil
		}
	}
	ret := []int64{}
	for i := 0; i < len(aa); i++ {
		ret = append(ret, rep...)
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	rep := []int64{}
	for i := int64(0); i < k; i++ {
		u[aa[i]] = true
		rep = append(rep, aa[i])
	}
	for i := k; i < int64(len(aa)); i++ {
		if !u[aa[i]] {
			return nil
		}
	}
	ret := []int64{}
	for i := int64(0); i < int64(len(aa)) - k + 1; i++ {
		ret = append(ret, rep...)
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	for i := int64(0); i < int64(len(aa)); i++ {
		u[aa[i]] = true
	}
	if int64(len(u)) > k {
		return nil
	}
	rep := []int64{}
	for i := range u {
		rep = append(rep, i)
	}
	for i := int64(len(rep)); i < k; i++ {
		rep = append(rep, 100) // random number
	}
	ret := []int64{}
	for i := 0; i < len(aa); i++ {
		ret = append(ret, rep...)
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	ret := []int64{}
	l := int64(0)
	r := k
	for i := l; i < r; i++ {
		ret = append(ret, aa[i])
	}
	counter := int64(0)
	for r < int64(len(aa)) {
		if aa[r] == aa[l] {
			ret = append(ret, aa[r])
			l++
			l%=k
			r++
			counter = 0
			continue
		}
		ret = append(ret, aa[l])
		l++
		l%=k
		counter++
		if counter > k {
			return nil
		}
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	for i := int64(0); i < int64(len(aa)); i++ {
		u[aa[i]] = true
	}
	rep := []int64{}
	for i := range u {
		rep = append(rep, i)
	}
	ret := []int64{}
	for i := 0; i < len(aa); i++ {
		ret = append(ret, rep...)
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	for i := int64(0); i < int64(len(aa)); i++ {
		u[aa[i]] = true
	}
	if int64(len(u)) > k {
		return nil
	}
	rep := []int64{}
	for i := range u {
		rep = append(rep, i)
	}
	ret := []int64{}
	for i := 0; i < len(aa); i++ {
		ret = append(ret, rep...)
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	rep := []int64{}
	for i := int64(0); i < k; i++ {
		u[aa[i]] = true
		rep = append(rep, aa[i])
	}
	for i := k; i < int64(len(aa)); i++ {
		if !u[aa[i]] {
			return nil
		}
	}
	ret := []int64{}
	for i := int64(0); i < k; i++ {
		ret = append(ret, rep...)
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n, k := reader.NextInt64(), reader.NextInt64()
		aa := make([]int64, n)
		for i := int64(0); i < n; i++ {
			aa[i] = reader.NextInt64()
		}
		res := sol(aa, k)
		if res == nil {
			writer.Printf("-1\n")
		} else {
			writer.Printf("%d\n", len(res))
			for _, num := range res {
				writer.Printf("%d ", num)
			}
			writer.Printf("\n")
		}
	}
}

func sol(aa []int64, k int64) []int64 {
	u := map[int64]bool{}
	rep := []int64{}
	for i := int64(0); i < k; i++ {
		u[aa[i]] = true
		rep = append(rep, aa[i])
	}
	for i := k; i < int64(len(aa)); i++ {
		if !u[aa[i]] {
			return nil
		}
	}
	ret := []int64{}
	for i := 0; i < 100; i++ {
		ret = append(ret, rep...)
	}
	return ret
}