← Home
```go
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	out := &strings.Builder{}
	for i := 0; i < t; i++ {
		scanner.Scan()
		parts := strings.Fields(scanner.Text())
		n, _ := strconv.Atoi(parts[0])
		m, _ := strconv.Atoi(parts[1])
		removed := make([]uint64, n)
		for j := 0; j < n; j++ {
			scanner.Scan()
			s := scanner.Text()
			var val uint64
			for _, c := range s {
				val = val<<1 | uint64(c-'0')
			}
			removed[j] = val
		}
		sort.Slice(removed, func(i, j int) bool { return removed[i] < removed[j] })
		total := uint64(1) << m
		k := total - uint64(n)
		target := (k - 1) / 2
		low, high := uint64(0), total-1
		for low < high {
			mid := (low + high) / 2
			cnt := sort.Search(len(removed), func(i int) bool { return removed[i] > mid })
			rem := mid + 1 - uint64(cnt)
			if rem > target {
				high = mid
			} else {
				low = mid + 1
			}
		}
		fmt.Fprintf(out, "%0*b\n", m, low)
	}
	fmt.Print(out.String())
}
```