package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
    if (v%4 == 0) {
      return false
    }
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] <= temp) {
    return false
  }
  temp += (keys[i] - temp) /((i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 10 * 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
  //
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.ParseInt(input.Text(), 10, 64)
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.ParseInt(str[j], 10, 64)
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	//. "testgo/helpers"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func main() {
	t := 1
	scan(&t)

	for T := 0; T < t; T++ {
		n := 0
		scan(&n)

		a := make([]int64, 2*n)
		for i := 0; i < 2*n; i++ {
			scan(&a[i])
		}

		solve(a)
	}

	writer.Flush()
}

func solve(a []int64) {
	N := len(a)

	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })
	for i := 0; i < len(a); i += 2 {
		if a[i] != a[i+1] {
			printf("NO\n")
			return
		}
	}
	a = UniqueInts(a)

	if len(a) != N/2 {
		printf("NO\n")
		return
	}

	dist := make([]int64, len(a)-1)
	for i := range dist {
		if (a[i+1]-a[i])%int64(2*(i+1)) != 0 {
			printf("NO\n")
			return
		}
		dist[i] = (a[i+1] - a[i]) / int64(2*(i+1))
	}

	d0 := int64(0)
	for i := 0; i < len(dist); i++ {
		d0 += dist[i] * int64(len(a)-1-i)
	}

	if (a[0] - 2*d0) <= 0 {
		printf("NO\n")
		return
	}

	if (a[0]-2*d0)%int64(2*len(a)) == 0 {
		printf("YES\n")
	} else {
		printf("NO\n")
	}
}

func UniqueInts(v []int64) []int64 {
	prev := int64(0)
	if len(v) > 0 && v[0] == prev {
		prev = -1
	}

	i := 0
	for j := range v {
		if v[j] != prev {
			prev = v[j]
			v[i], v[j] = v[j], v[i]
			i++
		}
	}

	return v[:i]
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
		if i-2 >= 0 && d[i-2] == d[i] {
			return "NO"
		}
	}
	cum := int64(0)
	rem := n
	for i := len(d) - 2; i >= 0; i -= 2 {
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if x <= 0 || x&1 != 0 {
			return "NO"
		}
		cum += x
		rem--
	}
	return "YES"
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int64{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,(d[i]-d[i-1])/int64(cnt*2))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = 1000000000000
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)

	var t int
	var n int64
	fmt.Fscan(in, &t)

MainLoop:
	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		d := make([]int64, 2*n)
		for i := int64(0); i < 2*n; i++ {
			fmt.Fscan(in, &d[i])
		}
		sort.Slice(d, func(i, j int) bool {
			return d[i] > d[j]
		})
		a := make([]int64, n)
		outerSum := int64(0)
		for i := int64(0); i < n; i++ {
			if d[2*i] != d[2*i+1] || (d[2*i]-outerSum)%(2*(n-i)) != 0 || outerSum >= d[2*i] {
				fmt.Println("NO")
				continue MainLoop
			}
			a[i] = (d[2*i] - outerSum) / (2 * (n - i))
			outerSum += 2 * a[i]
			if i > 0 && a[i] >= a[i-1] {
				fmt.Println("NO")
				continue MainLoop
			}
		}

		fmt.Println("YES")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n := readNum(reader)
		D := make([]int64, 2*n)
		var pos int
		var tmp uint64
		s, _ := reader.ReadBytes('\n')
		for i := 0; i < 2*n; i++ {
			pos = readUint64(s, pos, &tmp) + 1
			D[i] = int64(tmp)
		}

		res := solve(n, D)

		if res {
			buf.WriteString("YES\n")
		} else {
			buf.WriteString("NO\n")
		}
	}

	fmt.Print(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, A []int64) bool {
	// don't care the ordering,
	sort.Slice(A, func(i, j int) bool {
		return A[i] > A[j]
	})

	B := make([]int64, n)

	for i := 0; i < n; i++ {
		if A[2*i] != A[2*i+1] {
			return false
		}
		B[i] = A[2*i]
	}

	D := make([]int64, n)
	for i := 1; i < n; i++ {
		if B[i-1] == B[i] || (B[i-1]-B[i])%(2*int64(n-i)) > 0 {
			return false
		}
		D[i] = (B[i-1] - B[i]) / 2 / int64(n-i)
	}

	for i := 1; i < n; i++ {
		B[n-1] -= 2 * int64(i) * D[i]
	}

	if B[n-1] <= 0 || B[n-1]%(2*int64(n)) > 0 {
		return false
	}
	return true
}

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1478C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, n int
o:
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		a := make([]int64, 2*n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Slice(a, func(i, j int) bool { return a[i] > a[j] })
		s := int64(0)
		for i := 0; i < 2*n; i += 2 {
			v := (a[i] - s) / int64(2*n-i)
			if a[i] != a[i+1] || a[i] <= s || (a[i]-s)%int64(2*n-i) > 0 || i > 0 && v >= a[i-2] {
				Fprintln(out, "NO")
				continue o
			}
			a[i] = v
			s += v * 2
		}
		Fprintln(out, "YES")
	}
}

func main() { CF1478C(os.Stdin, os.Stdout) }

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1478C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, n int
o:
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		a := make([]int64, 2*n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Slice(a, func(i, j int) bool { return a[i] > a[j] })
		s, vis := int64(0), map[int64]bool{}
		for i := 0; i < 2*n; i += 2 {
			v := (a[i] - s) / int64(2*n-i)
			if a[i] != a[i+1] || a[i] <= s || (a[i]-s)%int64(2*n-i) > 0 || vis[v] {
				Fprintln(out, "NO")
				continue o
			}
			vis[v] = true
			s += v * 2
		}
		Fprintln(out, "YES")
	}
}

func main() { CF1478C(os.Stdin, os.Stdout) }

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
    if (v/4 == 0) {
      return false
    }
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] <= temp) {
    return false
  }
  temp += (keys[i] - temp) /((i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 10 * 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
  //
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.ParseInt(input.Text(), 10, 64)
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.ParseInt(str[j], 10, 64)
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] <= temp) {
    return false
  }
  temp += (keys[i] - temp) /((i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 10 * 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
  //
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.ParseInt(input.Text(), 10, 64)
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.ParseInt(str[j], 10, 64)
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] == temp) {
    return false
  }
  temp += 2*(keys[i] - temp) /(2*(i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 10 * 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
  //
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.Atoi(input.Text())
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.ParseInt(str[j], 10, 64)
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] == temp) {
    return false
  }
  temp += 2*(keys[i] - temp) /(2*(i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 10 * 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
  //
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.Atoi(input.Text())
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.Atoi(str[j])
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] == temp) {
    return false
  }
  temp += 2*(keys[i] - temp) /(2*(i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 100 * 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.Atoi(input.Text())
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.Atoi(str[j])
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] == temp) {
    return false
  }
  temp += 2*(keys[i] - temp) /(2*(i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 10 * 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.Atoi(input.Text())
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.Atoi(str[j])
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
  if n == 1 {
    return items[0] % 2 == 0 && items[0] == items[1]
  }
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] == temp) {
    return false
  }
  temp += 2*(keys[i] - temp) /(2*(i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.Atoi(input.Text())
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.Atoi(str[j])
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] == temp) {
    return false
  }
  temp += 2*(keys[i] - temp) /(2*(i+1))
  //fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.Atoi(input.Text())
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.Atoi(str[j])
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func calc(items []int64, n int64) bool {
	sum := int64(0)
	m := make(map[int64]int)
	for _, i := range items {
		if i%2 != 0 {
			return false
		}
		sum += i
		m[i] += 1
	}
	keys := make([]int64, 0)
	if sum%4 != 0 {
		return false
	}
	for k, v := range m {
		if v%2 != 0 {
			return false
		}
		for i := 0; i < v/2; i++ {
			keys = append(keys, k)
		}
	}
  temp := int64(0)
	sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
  for i := n-1; i >= 0; i-- {
	if (keys[i] - temp) %(2*(i+1)) != 0 {
		return false
	}
  if (keys[i] == temp) {
    return false
  }
  temp += 2*(keys[i] - temp) /(2*(i+1))
  fmt.Println(i, keys, temp)
}

	return true
}

func main() {
	const maxCapacity = 1024 * 1024
	buf := make([]byte, maxCapacity)
	input := bufio.NewScanner(os.Stdin)
	input.Buffer(buf, maxCapacity)
	input.Scan()
	t, _ := strconv.Atoi(input.Text())
	results := make([]bool, 0)
	for i := 0; i < t; i++ {
		input.Scan()
		q, _ := strconv.Atoi(input.Text())
		input.Scan()
		str := strings.Split(input.Text(), " ")
		items := make([]int64, 0)
		for j := int64(0); j < 2*int64(q); j++ {
			item, _ := strconv.Atoi(str[j])
			items = append(items, int64(item))
		}

		results = append(results, calc(items, int64(q)))
	}

	for _, result := range results {
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := int64(0)
	rem := n
	for i := len(d) - 2; i >= 0; i -= 2 {
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if x <= 0 || x&1 != 0 {
			return "NO"
		}
		cum += x
		rem--
	}
	return "YES"
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := d[len(d)-2] / n
	if !valid(cum) {
		return "NO"
	}
	rem := n
	for i := len(d) - 4; i >= 0; i -= 2 {
		rem--
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if !valid(x) {
			return "NO"
		}
		cum += x
	}
	return "YES"
}

func valid(x int64) bool {
	return x > 0 && x&1 == 0
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := d[len(d)-2] / n
	if cum&1 == 1 {
		return "NO"
	}
	prev := cum
	rem := n
	for i := len(d) - 4; i >= 0; i -= 2 {
		rem--
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if x <= 0 || x&1 == 1 || x >= prev {
			return "NO"
		}
		cum += x
		prev = x
	}
	return "YES"
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := d[len(d)-2] / n
	prev := cum
	rem := n
	for i := len(d) - 4; i >= 0; i -= 2 {
		rem--
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if x <= 0 || x & 1 == 1 || x >= prev {
			return "NO"
		}
		cum += x
		prev = x
	}
	return "YES"
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := d[len(d)-2] / n
	prev := cum
	rem := n
	for i := len(d) - 4; i >= 0; i -= 2 {
		rem--
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if x <= 0 || x >= prev {
			return "NO"
		}
		cum += x
		prev = x
	}
	return "YES"
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := d[len(d)-2] / n
	prev := cum
	rem := n
	for i := len(d) - 4; i >= 0; i -= 2 {
		rem--
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if x == 0 || x >= prev {
			return "NO"
		}
		cum += x
		prev = x
	}
	return "YES"
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := d[len(d)-2] / n
	rem := n
	for i := len(d) - 4; i >= 0; i -= 2 {
		rem--
		tmp := d[i] - cum
		if tmp%rem != 0 {
			return "NO"
		}
		x := tmp / rem
		if x == 0 {
			return "NO"
		}
		cum += x
	}
	return "YES"
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1e6), 1e6)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.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 suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func sbytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		d := make([]int64, 2*n)
		for i := range d {
			d[i] = sint64()
		}
		printf("%s\n", sol(n, d))
	}
}

func sol(n int64, d []int64) string {
	sort.Slice(d, func(il, ir int) bool {
		return d[il] < d[ir]
	})
	for i := 0; i < len(d); i += 2 {
		if d[i] != d[i+1] {
			return "NO"
		}
		if d[i]&1 != 0 {
			return "NO"
		}
	}
	cum := d[len(d)-2] / n
	prev := cum
	rem := n
	for i := len(d) - 4; i >= 0; i -= 2 {
		rem--
		// d[i] = rem*2x + 2cum
		// => d[i]/2 = rem*x + cum
		// => d[i]/2 - cum = rem*x
		// => (d[i]/2 - cum) / rem = x
		if (d[i]/2-cum)%(rem) != 0 {
			return "NO"
		}
		x := (d[i]/2 - cum) / rem
		if x >= prev {
			return "NO"
		}
		cum += x
		prev = x
	}
	return "YES"
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int64{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,(d[i]-d[i-1])/int64(cnt*2))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = 1000000000000
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				if t==1{
					fmt.Println("hi")
				}
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int64{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,(d[i]-d[i-1])/int64(cnt*2))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = 1000000000000
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			fmt.Println(sum,m)
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				if t==1{
					fmt.Println("hi")
				}
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,int((d[i]-d[i-1])/int64(cnt*2)))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = 1000000000000
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				if t==1{
					fmt.Println("hi")
				}
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,int((d[i]-d[i-1])/int64(cnt*2)))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = 1000000000000
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,int((d[i]-d[i-1])/int64(cnt*2)))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = 5000000000000
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,int((d[i]-d[i-1])/int64(cnt*2)))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = math.MaxInt32*90
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
)
type darr []int64

func (a darr)Len()int{
	return len(a)
}
func (a darr)Swap(i, j int){
	a[i],a[j] = a[j],a[i]
}
func (a darr)Less(i, j int)bool{
	return a[i]<a[j]
}
func main() {
	 in:= bufio.NewReader(os.Stdin)
	 out := os.Stdout
	 var t int
	 fmt.Fscan(in,&t)
	 for u:=1;u<=t;u++{
	 	var n int
	 	fmt.Fscan(in,&n)
	 	d := make(darr,2*n)
	 	for i:=0;i<2*n;i++{
	 		fmt.Fscan(in,&d[i])
		}
		flag := true
		sort.Sort(d)
		gap := []int{}
		cnt := 0
		for i:=0;i<len(d);i+=2{
			if d[i]%2!=0{
				flag = false
				break
			}
			if d[i]!=d[i+1]{
				flag = false
				break
			}
			if i!=0{
				if d[i-1]==d[i]{
					flag = false
					break
				}
				if (d[i]-d[i-1])%int64(cnt*2)!=0{
					flag = false
					break
				}
				gap = append(gap,int((d[i]-d[i-1])/int64(cnt*2)))
			}
			cnt++
		}
		if !flag{
			fmt.Fprintln(out,"NO")
			continue
		}
		var l, r int64
		l = 1
		r = math.MaxInt32*10
		var ans int64
		ans = -1
		for l<=r{
			m := (l+r)>>1
			sum := m*2
			lst := m
			for i:=0;i<len(gap);i++{
				sum += (lst+int64(gap[i]))*2
				lst = lst + int64(gap[i])
			}
			if sum < d[0]{
				l = m+1
			}else if sum > d[0]{
				r = m-1
			}
			if sum == d[0]{
				ans = m
				break
			}
		}
		if ans != -1{
			fmt.Fprintln(out,"YES")
		}else{
			fmt.Fprintln(out,"NO")
		}
	 }
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)

	var t int
	var n int64
	fmt.Fscan(in, &t)

MainLoop:
	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		d := make([]int64, 2*n)
		for i := int64(0); i < 2*n; i++ {
			fmt.Fscan(in, &d[i])
		}
		sort.Slice(d, func(i, j int) bool {
			return d[i] > d[j]
		})
		a := make([]int64, n)
		outerSum := int64(0)
		for i := int64(0); i < n; i++ {
			if d[2*i] != d[2*i+1] || (d[2*i]-outerSum)%(2*(n-i)) != 0 {
				fmt.Println("NO")
				continue MainLoop
			}
			a[i] = (d[2*i] - outerSum) / (2 * (n - i))
			outerSum += 2 * a[i]
			if a[i] == 0 || i > 0 && a[i] >= a[i-1] {
				fmt.Println("NO")
				continue MainLoop
			}
		}

		fmt.Println("YES")
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)

	var t int
	var n int64
	fmt.Fscan(in, &t)

MainLoop:
	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		d := make([]int64, 2*n)
		for i := int64(0); i < 2*n; i++ {
			fmt.Fscan(in, &d[i])
		}
		sort.Slice(d, func(i, j int) bool {
			return d[i] > d[j]
		})
		a := make([]int64, n)
		outerSum := int64(0)
		for i := int64(0); i < n; i++ {
			if d[2*i] != d[2*i+1] || (d[2*i]-outerSum)%(2*(n-i)) != 0 {
				fmt.Println("NO")
				continue MainLoop
			}
			a[i] = (d[2*i] - outerSum) / (2 * (n - i))
			outerSum += 2 * a[i]
			if a[i] == 0 || i > 0 && a[i] == a[i-1] {
				fmt.Println("NO")
				continue MainLoop
			}
		}

		fmt.Println("YES")
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)

	var t int
	var n int64
	fmt.Fscan(in, &t)

MainLoop:
	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		d := make([]int64, 2*n)
		for i := int64(0); i < 2*n; i++ {
			fmt.Fscan(in, &d[i])
		}
		sort.Slice(d, func(i, j int) bool {
			return d[i] > d[j]
		})
		a := make([]int64, n)
		outerSum := int64(0)
		for i := int64(0); i < n; i++ {
			if d[2*i] != d[2*i+1] || (d[2*i]-outerSum)%(2*(n-i)) != 0 {
				fmt.Println("NO")
				continue MainLoop
			}
			a[i] = (d[2*i] - outerSum) / (2 * (n - i))
			outerSum += 2 * a[i]
			if a[i] == 0 {
				fmt.Println("NO")
				continue MainLoop
			}
		}

		fmt.Println("YES")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n := readNum(reader)
		D := make([]int64, 2*n)
		var pos int
		var tmp uint64
		s, _ := reader.ReadBytes('\n')
		for i := 0; i < 2*n; i++ {
			pos = readUint64(s, pos, &tmp) + 1
			D[i] = int64(tmp)
		}

		res := solve(n, D)

		if res {
			buf.WriteString("YES\n")
		} else {
			buf.WriteString("NO\n")
		}
	}

	fmt.Print(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, D []int64) bool {
	// don't care the ordering,
	sort.Slice(D, func(i, j int) bool {
		return D[i] < D[j]
	})
	var prev int64 = 1 << 30
	N := 2 * n
	var L int64
	var cnt int
	for i := N - 1; i > 0; i -= 2 {
		if D[i] != D[i-1] {
			// pair A[l] & A[r], A[l] = -A[r]
			return false
		}
		// L - cnt * A[i] + cnt * (-A[i]) - R + (N - 2 * cnt) * A[i] = D[i]
		// R = -L
		// 2 * L - 2 * cnt * A[i] + (N - 2 * cnt) * A[i] = D[i]
		// (N - 4 * cnt) * A[i] = D[i] - L
		a := (D[i] - 2*L) / int64(N-2*cnt)
		if a <= 0 || a*int64(N-2*cnt) != (D[i]-2*L) || a >= prev {
			return false
		}
		prev = a
		L += a
		cnt++
	}
	return true
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n := readNum(reader)
		D := make([]int64, 2*n)
		var pos int
		var tmp uint64
		s, _ := reader.ReadBytes('\n')
		for i := 0; i < 2*n; i++ {
			pos = readUint64(s, pos, &tmp) + 1
			D[i] = int64(tmp)
		}

		res := solve(n, D)

		if res {
			buf.WriteString("YES\n")
		} else {
			buf.WriteString("NO\n")
		}
	}

	fmt.Print(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, D []int64) bool {
	// don't care the ordering,
	sort.Slice(D, func(i, j int) bool {
		return D[i] < D[j]
	})

	N := 2 * n
	var L int64
	var cnt int
	for i := N - 1; i > 0; i -= 2 {
		if D[i] != D[i-1] {
			// pair A[l] & A[r], A[l] = -A[r]
			return false
		}
		// L - cnt * A[i] + cnt * (-A[i]) - R + (N - 2 * cnt) * A[i] = D[i]
		// R = -L
		// 2 * L - 2 * cnt * A[i] + (N - 2 * cnt) * A[i] = D[i]
		// (N - 4 * cnt) * A[i] = D[i] - L
		a := (D[i] - 2*L) / int64(N-2*cnt)
		if a <= 0 || a*int64(N-2*cnt) != (D[i]-2*L) {
			return false
		}
		L += a
		cnt++
	}
	return true
}


package main

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

var (
    i, j, n, m, now, nowsum int64
)

func myscanf() int64 {
    var temp int64
    for _, b := fmt.Scanf("%d", &temp); b != nil; {
        _, b = fmt.Scanf("%d", &temp)
    }
    return temp
}

func main() {
    reader := bufio.NewReader(os.Stdin)
    t, _ := reader.ReadString('\n')
    s := strings.Split(t[:len(t)-2], " ")

    n, _ = strconv.ParseInt(s[0], 10, 64)
    m, _ = strconv.ParseInt(s[1], 10, 64)
    nowsum = 0
    j = 0
    for i = 1; i <= n; i++ {
        var s string
        if i < n {
            s, _ = reader.ReadString(' ')
        } else {
            s, _ = reader.ReadString('\n')
        }

        now, _ = strconv.ParseInt(s[:len(s)-1], 10, 64)
        if nowsum-(n-i)*now*j < m {
            fmt.Println(i)
        } else {
            j++
            nowsum += now*j - now
        }
    }
}

package main

import (
  "bufio"
  "os"
  "strconv"
)

var sc *bufio.Scanner = bufio.NewScanner(os.Stdin)
var w *bufio.Writer = bufio.NewWriter(os.Stdout)

func ni() int {
  sc.Scan()
  ans, _ := strconv.Atoi(sc.Text())
  return ans
}

func next() string {
  sc.Scan()
  return sc.Text()
}

func pri(n int)    { w.WriteString(strconv.Itoa(n)) }
func prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }
func sp()          { w.WriteByte(' ') }
func endl()        { w.WriteByte('\n') }

func main() {
  sc.Split(bufio.ScanWords)
  n, k := int64(ni()), int64(ni())
  n2 := n
  d := int64(0)
  for i, idx, a1, a2, skipped := int64(1),
    int64(1),
    int64(0),
    int64(0),
    false; i <= n; i++ {
    a2 = int64(ni())
    if idx > 1 {
      if skipped {
        d += a1*(idx-1)*(n2+1-idx) - a2*(idx-1)*(n2-idx)
      } else {
        d += a1*(idx-2) + a1*(idx-2)*(n2-idx+1) - a2*(idx-1)*(n2-idx)
      }
    }
    a1 = a2
    if d < k {
      skipped = true
      n2--
      prll(i)
      endl()
    } else {
      skipped = false
      idx++
    }
  }
  w.Flush()
}

package main

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

var (
    i, j, n, m, now, nowsum int64
)

var reader = bufio.NewReader(os.Stdin)

func myscanf() int {
    var temp int
    var ne bool
    var now byte
    for {
        now,_ = reader.ReadByte()
        switch {
        default: {
            if ne {
                return -temp
            }
            return temp
        }
        case now=='-':
            ne = true
        case now >= '0' && now <= '9':
            temp = temp*10 + int(now) - '0'
        }
    }

    if ne {
        return -temp
    }

    return temp
}

func main() {
    n  = int64(myscanf())
    m  = int64(myscanf())
    reader.ReadByte()
    nowsum = 0
    j = 0
    for i = 1; i <= n; i++ {
        now  = int64(myscanf())
        if nowsum-(n-i)*now*j < m {
            fmt.Println(i)
        } else {
            j++
            nowsum += now*j - now
        }
    }
}

package main

import (
	"fmt"
)

var (
	i, j, n, m, now, nowsum int64
)

func main() {
	fmt.Scanf("%d %d", &n, &m)
	nowsum=0
	j = 0
	for i = 1; i <= n; i++ {
		fmt.Scanf("%d", &now)
		if nowsum-(n-i)*now*j < m {
			fmt.Println(i)
		} else {
			j++
			nowsum += now*j - now
		}
	}
}

package main

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

var (
    i, j, n, m, now, nowsum int64
)

var reader = bufio.NewReader(os.Stdin)

func myscanf() int {
    var temp int
    var ne bool
    var now byte
    for {
        now,_ = reader.ReadByte()
        switch {
        default: {
            if ne {
                return -temp
            }
            return temp
        }
        case now=='-':
            ne = true
        case now >= '0' && now <= '9':
            temp = temp*10 + int(now) - '0'
        }
    }

    if ne {
        return -temp
    }

    return temp
}

func main() {
    n  = int64(myscanf())
    m  = int64(myscanf())
    nowsum = 0
    j = 0
    for i = 1; i <= n; i++ {
        now  = int64(myscanf())
        if nowsum-(n-i)*now*j < m {
            fmt.Println(i)
        } else {
            j++
            nowsum += now*j - now
        }
    }
}

package main

import (
    "fmt"
)

var (
    i, j, n, m, now, nowsum int64
)

func main() {
    fmt.Scanf("%d %d", &n, &m)
    j = 0
    for i = 1; i <= n; i++ {
        fmt.Scanf("%d", &now)
        if nowsum-(n-i)*now*j < m {
            fmt.Println(i)
        } else {
            j++
            nowsum += now*j - now
        }
    }
}

package main

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

var (
    i, j, n, m, now, nowsum int64
)

func myscanf() int64 {
    var temp int64
    for _, b := fmt.Scanf("%d", &temp); b != nil; {
        _, b = fmt.Scanf("%d", &temp)
    }
    return temp
}

func main() {
    reader := bufio.NewReader(os.Stdin)
    t,_ :=reader.ReadString('\n')
    s := strings.Split(t[:len(t)-1], " ")

    n,_ = strconv.ParseInt(s[0],10,64)
    m,_ = strconv.ParseInt(s[1],10,64)

    nowsum = 0
    j = 0
    for i = 1; i <= n; i++ {
        s,_ := reader.ReadString('\n')
        now,_ = strconv.ParseInt(s,10,64)
        if nowsum-(n-i)*now*j < m {
            fmt.Println(i)
        } else {
            j++
            nowsum += now*j - now
        }
    }
}

package main

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

var (
    i, j, n, m, now, nowsum int64
)

func myscanf() int64 {
    var temp int64
    for _, b := fmt.Scanf("%d", &temp); b != nil; {
        _, b = fmt.Scanf("%d", &temp)
    }
    return temp
}

func main() {
    reader := bufio.NewReader(os.Stdin)
    t, _ := reader.ReadString('\n')
    s := strings.Split(t[:len(t)-1], " ")

    n, _ = strconv.ParseInt(s[0], 10, 64)
    m, _ = strconv.ParseInt(s[1], 10, 64)

    nowsum = 0
    j = 0
    for i = 1; i <= n; i++ {
        var s string
        if i < n {
            s, _ = reader.ReadString(' ')
        } else {
            s, _ = reader.ReadString('\n')
        }

        now, _ = strconv.ParseInt(s[:len(s)-1], 10, 64)
        if nowsum-(n-i)*now*j < m {
            fmt.Println(i)
        } else {
            j++
            nowsum += now*j - now
        }
    }
}


package main

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

var in = bufio.NewReader(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func scanf(format string, value ...interface{}) {
	_, _ = fmt.Fscanf(in, format, value...)
}

func printf(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(out, format, value...)
}

const M = 1000000007

func main() {

	defer out.Flush()
	var t int
	scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		solve()
	}
}

func solve() {
	var n, m int
	scanf("%d %d\n", &n, &m)
	var fm = make([][]int, m)
	for i := range fm {
		fm[i] = make([]int, 26)
	}
	for i := 0; i < n; i++ {
		var s string
		scanf("%s\n", &s)
		for i := range s {
			fm[i][int(s[i])-'a']++
		}
	}
	for i := 0; i < n-1; i++ {
		var s string
		scanf("%s\n", &s)
		for i := range s {
			fm[i][int(s[i])-'a']--
		}
	}

	var ans []byte
	for i := range fm {
		for j := range fm[i] {
			if fm[i][j] > 0 {
				ans = append(ans, byte(j+'a'))
				break
			}
		}
	}
	printf("%s\n", string(ans))
}

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

const LOCAL = false

func main() {

	if LOCAL {

		rand.Seed(time.Now().UnixNano())

		mp := make(map[int]int64, 10)
		for i := 0; i < 10; i++ {
			mp[i] = int64(1 + rand.Intn(1e6))
		}

		a1 := getNum("ddddccdddc", mp)
		a2 := getNum("dddcddcddc", mp)

		fmt.Println(a1)
		fmt.Println(a2)
		return
	}

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	rand.Seed(time.Now().UnixNano())

	mp := make(map[int]int64, m)
	for i := 0; i < m; i++ {
		mp[i] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[int]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[j]
		b := s[j] - 'a'
		a += i * add * int64(b)

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

const LOCAL = false

func main() {

	if LOCAL {

		rand.Seed(time.Now().UnixNano())

		mp := make(map[int]int64, 10)
		for i := 0; i < 10; i++ {
			mp[i] = int64(1 + rand.Intn(1e6))
		}

		a1 := getNum("ddddccdddc", mp)
		a2 := getNum("dddcddcddc", mp)

		fmt.Println(a1)
		fmt.Println(a2)
		return
	}

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	rand.Seed(time.Now().UnixNano())

	mp := make(map[int]int64, 10)
	for i := 0; i < 10; i++ {
		mp[i] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[int]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[j]
		b := s[j] - 'a'
		a += i * add * int64(b)

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	s := sstring()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func sint64s(n int64) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = sint64()
	}
	return a
}

func sstring() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		m := sint64()
		s1 := make([]string, n)
		for i := range s1 {
			s1[i] = sstring()
		}
		s2 := make([]string, n-1)
		for i := range s2 {
			s2[i] = sstring()
		}
		printf("%s\n", sol(n, m, s1, s2))
	}
}

func sol(n, m int64, s1, s2 []string) string {
	ret := []byte{}
	for i := int64(0); i < m; i++ {
		s1f := map[byte]int{}
		s2f := map[byte]int{}
		for _, s := range s1 {
			s1f[s[i]]++
		}
		for _, s := range s2 {
			s2f[s[i]]++
		}
		ret = append(ret, diff(s1f, s2f))
	}
	return string(ret)
}

func diff(m1, m2 map[byte]int) byte {
	for b := range m2 {
		m1[b] -= m2[b]
	}
	for b := range m1 {
		if m1[b] != 0 {
			return b
		}
	}
	panic("no valid answer")
}

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

const LOCAL = false

func main() {

	if LOCAL {

		str := "abcdefghijklmnopqrstuvwxyz"
		rand.Seed(time.Now().UnixNano())

		mp := make(map[byte]int64, 26)
		for i := 0; i < len(str); i++ {
			mp[str[i]] = int64(1 + rand.Intn(1e9))
		}

		a1 := getNum("ddddccdddc", mp)
		a2 := getNum("dddcddcddc", mp)

		fmt.Println(a1)
		fmt.Println(a2)
		return
	}

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * (int64(b)) ^ add

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a ^= i * (int64(b)) ^ add

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += (i ^ add) * (int64(b))

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e3))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += (i ^ add) * (int64(b))

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * (int64(b) ^ add)

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * int64(b) ^ add

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e6))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * int64(b) ^ add

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(rand.Int())
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * int64(b) + add

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e9))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * int64(b) + add

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e3))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * (int64(b) * add)

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

import (
	"bufio"
	"os"
	"fmt"
	"math/rand"
	"time"
)

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	str := "abcdefghijklmnopqrstuvwxyz"
	rand.Seed(time.Now().UnixNano())

	mp := make(map[byte]int64, 26)
	for i := 0; i < len(str); i++ {
		mp[str[i]] = int64(1 + rand.Intn(1e6))
	}

	for i := 0; i < n; i++ {
		allOr += getNum(o[i], mp)
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j], mp)
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i], mp)

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string, mp map[byte]int64) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		add := mp[s[j]]
		b := s[j] - 'a'
		a += i * int64(b) + add

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	for i := 0; i < n; i++ {
		allOr += getNum(o[i])
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j])
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i])

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		b := s[j] - 'a'
		a += i ^ int64(b)

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	var allOr int64

	for i := 0; i < n; i++ {
		allOr += getNum(o[i])
	}

	var allR int64

	for j := 0; j < n - 1; j++ {
		allR += getNum(r[j])
	}

	diff := allOr - allR

	for i := 0; i < n; i++ {

		s := getNum(o[i])

		if s == diff {
			return o[i]
		}
	}

	return ""
}

func getNum(s string) int64 {
	var i int64 = 1

	var a int64

	for j := 0; j < len(s); j++ {
		b := s[j] - 'a'
		a += i * int64(b)

		i++
	}

	return a
}

//kbcdef
//kekeke
//pedsrs
//zlkdst
//azoert
//lmnbka
//iuqame

//kbdsef
//pecdrs
//

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {

		var n, m int
		fmt.Fscan(r, &n, &m)

		or := make([]string, n)

		for j := 0; j < n; j++ {
			fmt.Fscan(r, &or[j])
		}

		reod := make([]string, n - 1)

		for j := 0; j < n - 1; j++ {
			fmt.Fscan(r, &reod[j])
		}

		ans := solve(or, reod, n, m)

		fmt.Fprintln(w, ans)
		w.Flush()
	}
}

func solve(o, r []string, n , m int) string {
	mp := make([][27]bool, m)

	for j := 0; j < m; j++ {
		for i := 0; i < n - 1; i++ {
			mp[j][r[i][j] - 'a'] = true
		}
	}

	for i := 0; i < n; i++ {
		all := true
		for j := 0; j < m; j++ {
			cur := o[i][j]

			if !mp[j][cur - 'a'] {
				all = false
				break
			}
		}
		if !all {
			return o[i]
		}
	}

	return ""
}


package main

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

func solve() {
    n, s := readInt(), readInt()-1
    a := readIntArray(n)
    chef := 0
    if a[s] > 0 {
        a[s] = 0
        chef++
    }
    inf := 2*n+2
    for i := range a {
        if i != s && a[i] == 0 {
            a[i] = inf
        }
    }
    sort.Ints(a)

    try := func(cnt int) bool {
        mask := make([]bool, inf+1)
        for _, v := range a[:len(a)-cnt] {
            mask[v] = true
        }

        left, wasHole := cnt, false
        for _, v := range mask {
            if v {
                if wasHole {
                    return false
                }
            } else {
                if left > 0 {
                    left--
                } else {
                    wasHole = true
                }
            }
        }
        return true
    }

    l, r := 0, n-1
    for l < r {
        if mid := (l+r) / 2; try(mid) {
            r = mid
        } else {
            l = mid+1
        }
    }

    fmt.Println(r+chef)
}

// Helpers

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

// Sort

type Ints64 []int64

func (a Ints64) Len() int           { return len(a) }
func (a Ints64) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Ints64) Less(i, j int) bool { return a[i] < a[j] }

/* Sort tempalte
func (a ) Len() int           { return len(a) }
func (a ) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ) Less(i, j int) bool { return  }
*/

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1<<13)
	writer := bufio.NewWriterSize(os.Stdout, 1<<13)
	n, s := ReadInt(reader), ReadInt(reader)-1
	levels := make([]int, n)
	for i := 0; i < n; i++ {
		levels[i] = ReadInt(reader)
	}
	fmt.Fprintln(writer, countMistakes(levels, s))
	writer.Flush()
}

func countMistakes(levels []int, s int) int {
	result := 0
	if levels[s] != 0 {
		result++
		levels[s] = 0
	}
	levels = getCount(levels)
	result += removeExtraZeroes(levels)
	result += removeExtra(levels)
	return result
}

func getCount(levels []int) []int {
	count := make([]int, len(levels))
	for _, val := range levels {
		count[val]++
	}
	return count
}

func removeExtraZeroes(count []int) int {
	result := max(0, count[0]-1)
	for i := 1; ; i++ {
		if count[0] == 1 { // Only the chief remains
			return result
		}
		if count[i] == 0 {
			count[i] = 1
			count[0]--
		}
	}
}

func removeExtra(count []int) int {
	result := 0
	n := len(count)
	for i, k := 0, n-1; i < n; i++ {
		if count[i] == 0 {
			for k >= 0 && count[k] <= 0 {
				k--
			}
			if k < i {
				break
			}
			count[i] = 1
			count[k]--
			result++
		}
	}
	return result
}

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

func ReadInt(reader *bufio.Reader) int {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	res := 0
	for isValid(b, err) {
		res = res*10 + int(b-'0')
		b, err = reader.ReadByte()
	}
	return res
}

func isValid(b byte, err error) bool {
	return err == nil && '0' <= b && b <= '9'
}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1<<13)
	writer := bufio.NewWriterSize(os.Stdout, 1<<13)
	n, s := ReadInt(reader), ReadInt(reader)-1
	levels := make([]int, n)
	for i := 0; i < n; i++ {
		levels[i] = ReadInt(reader)
	}
	fmt.Fprintln(writer, countMistakes(levels, s))
	writer.Flush()
}

func countMistakes(levels []int, s int) int {
	result := 0
	if levels[s] != 0 {
		result++
		levels[s] = 0
	}
	levels = getCount(levels)
	result += removeExtraZeroes(levels)
	result += removeExtra(levels)
	return result
}

func getCount(levels []int) []int {
	count := make([]int, len(levels))
	for _, val := range levels {
		count[val]++
	}
	return count
}

func removeExtraZeroes(count []int) int {
	result := max(0, count[0]-1)
	for i := 1; ; i++ {
		if count[0] == 1 { // Only the chief remains
			return result
		}
		if count[i] == 0 {
			count[i] = 1
			count[0]--
		}
	}
}

func removeExtra(count []int) int {
	result := 0
	last := lastPositive(count)
	for i, k := 0, last; i <= last; i++ {
		if count[i] == 0 {
			for k >= 0 && count[k] <= 1 {
				k--
			}
			if k < 0 {
				break
			}
			count[i] = 1
			count[k]--
			result++
		}
	}
	return result
}

func lastPositive(count []int) int {
	for i := len(count) - 1; ; i-- {
		if count[i] > 0 {
			return i
		}
	}
}

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

func ReadInt(reader *bufio.Reader) int {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	res := 0
	for isValid(b, err) {
		res = res*10 + int(b-'0')
		b, err = reader.ReadByte()
	}
	return res
}

func isValid(b byte, err error) bool {
	return err == nil && '0' <= b && b <= '9'
}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1<<13)
	writer := bufio.NewWriterSize(os.Stdout, 1<<13)
	n, s := ReadInt(reader), ReadInt(reader)-1
	levels := make([]int, n)
	for i := 0; i < n; i++ {
		levels[i] = ReadInt(reader)
	}
	fmt.Fprintln(writer, countMistakes(levels, s))
	writer.Flush()
}

func countMistakes(levels []int, s int) int {
	result := 0
	if levels[s] != 0 {
		result++
		levels[s] = 0
	}
	levels = getCount(levels)
	result += removeExtraZeroes(levels)
	result += removeExtra(levels)
	return result
}

func getCount(levels []int) []int {
	count := make([]int, len(levels))
	for _, val := range levels {
		count[val]++
	}
	return count
}

func removeExtraZeroes(count []int) int {
	result := max(0, count[0]-1)
	for i := 1; ; i++ {
		if count[0] == 1 { // Only the chief remains
			return result
		}
		if count[i] == 0 {
			count[i] = 1
			count[0]--
		}
	}
}

func removeExtra(count []int) int {
	result := 0
	n := len(count)
	for i, k := 0, n-1; i < n; i++ {
		if count[i] == 0 {
			for k >= 0 && count[k] <= 1 {
				k--
			}
			if k < 0 {
				break
			}
			count[i] = 1
			count[k]--
			result++
		}
	}
	return result
}

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

func ReadInt(reader *bufio.Reader) int {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	res := 0
	for isValid(b, err) {
		res = res*10 + int(b-'0')
		b, err = reader.ReadByte()
	}
	return res
}

func isValid(b byte, err error) bool {
	return err == nil && '0' <= b && b <= '9'
}