You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 1363D.go
    path of file: ./repos/codeforces-go/main/1300-1399
    
    the code of the file until where you have to start completion: package main

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

type (
	input1363 struct {
		n, k int
		a    [][]int
	}
	guess1363 struct{ ans []int }
	qIn1363   struct{ q []int }
	qOut1363  struct{ max int }
)

// github.com/EndlessCheng/codeforces-go
func CF1363D(in input1363, Q func(qIn1363) qOut1363) (gs guess1363) {
	n, k, a := in.n, in.k, in.a
	gs.ans = make([]int, k)
	q := []int{}
	for i := 1; i <= n; i++ {
		q = append(q, i)
	}
	allMax := Q(qIn1363{q}).max
	l, r := 0, k
	for r-l > 1 {
		m := (l + r) >> 1
		q = [
    
func CF1363D(in input1363, Q func(qIn1363) qOut1363) (gs guess1363) {
	n, k, a := in.n, in.k, in.a
	gs.ans = make([]int, k)
	q := []int{}
	for i := 1; i <= n; i++ {
		q = append(q, i)
	}
	allMax := Q(qIn1363{q}).max
	l, r := 0, k
	for r-l > 1 {
		m := (l + r) >> 1
		q = []int{}
		for _, ids := range a[l:m] {
			q = append(q, ids...)
		}
		if Q(qIn1363{q}).max == allMax {
			for i := m; i < r; i++ {
				gs.ans[i] = allMax
			}
			r = m
		} else {
			for i := l; i < m; i++ {
				gs.ans[i] = allMax
			}
			l = m
		}
	}
	sort.Ints(a[l])
	q = []int{}
	for i, j := 1, 0; i <= n; i++ {
		if j == len(a[l]) || i != a[l][j] {
			q = append(q, i)
		} else {
			j++
		}
	}
	gs.ans[l] = Q(qIn1363{q}).max
	return
}