package main

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

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

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

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(reader, &n)

		var ans int64
		for ; n > 0; n-- {
			var x int64
			fmt.Fscan(reader, &x)
			ans += x
		}

		fmt.Println(int64(math.Abs(float64(ans))))
	}
}

package main

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

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

	defer writer.Flush()

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

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(reader, &n)

		var ans int64
		for ; n > 0; n-- {
			var x int64
			fmt.Fscan(reader, &x)
			ans += x
		}

		if ans < 0 {
			fmt.Fprintln(writer, -ans)
		} else {
			fmt.Fprintln(writer, ans)
		}
	}
}

package main

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

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

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

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(reader, &n)

		var ans int64
		for ; n > 0; n-- {
			var x int64
			fmt.Fscan(reader, &x)
			ans += x
		}

		if ans < 0 {
			fmt.Println(-ans)
		} else {
			fmt.Println(ans)
		}
	}
}

package main

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

func main() {
	var n int
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &n)
	for i := 0; i < n; i++ {
		var qn int
		fmt.Fscan(reader, &qn)
		var gr1 int64
		var gr2 int64
		var x int64
		gr1 = 0
		gr2 = 0
		for j := 0; j < qn; j++ {
			fmt.Fscan(reader, &x)
			if x > 0 {
				gr1 += x
			} else {
				gr2 -= x
			}
		}
		s := gr1 - gr2
		if s < 0 {
			s = -s
		}
		fmt.Fprintln(writer, s)
	}
}

package main

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

func main() {
	var testCases int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {

		var n int
		fmt.Fscan(reader, &n)

		// nSum := 0
		var sum int64
		for i := 0; i < n; i++ {
			var jj int64
			fmt.Fscan(reader, &jj)

			sum += jj
			// if jj < 0 {
			// } else {
			// 	pSum += (jj)
			// }
		}

		// d := math.Abs(math.Abs(float64(nSum)) - math.Abs(float64(pSum)))

		fmt.Fprintln(writer, int64(math.Abs(float64(sum))))
	}
}

package main
// github.com/jamesgrimard/codeforces
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		var largest,smallest int
		for j:=0;j<n;j++{
			var x int
			fmt.Fscan(in,&x)
			if x < 0 {
				smallest+=x
				continue
			}
			largest+=x
		}
		fmt.Fprintln(out, abs(abs(largest)-abs(smallest)))
	}
}
func abs(x int) int {
	if x<0{
		return x*-1
	}
	return x
}

package main

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

var (
	tot int64
)

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

func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int64) {
		in.Scan()
		t := in.Bytes()
		if t[0] == '-' {
			for _, b := range t[1:] {
				x = x*10 + int64(b&15)
			}
			return -x
		}
		for _, b := range t {
			x = x*10 + int64(b&15)
		}
		return
	}
	tot = read()
	for i := int64(1); i <= tot; i++ {
		l := read()
		var sum int64 = 0
		for j := int64(1); j <= l; j++ {
			sum += read()
		}
		Fprintln(out, abs(sum))
	}
}

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

package main

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

var (
	tot int64
)

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

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

func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int64) {
		in.Scan()
		t := in.Bytes()
		if t[0] == '-' {
			for _, b := range t[1:] {
				x = x*10 + int64(b&15)
			}
			return -x
		}
		for _, b := range t {
			x = x*10 + int64(b&15)
		}
		return
	}
	tot = read()
	for i := int64(1); i <= tot; i++ {
		l := read()
		var s1, s2 int64 = 0, 0
		for j := int64(1); j <= l; j++ {
			if t := read(); t < 0 {
				s1 -= t
			} else {
				s2 += t
			}
		}
		Fprintln(out, abs(s1-s2))
	}
}

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

package main

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

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

func absInt(num int) int {
	if num < 0 {
		return -num
	}

	return num
}

func sol(nums []int) int {
	sort.Ints(nums)
	sumLeft, sumRight :=  nums[len(nums) - 1], 0
	for i := len(nums) -2; i >= 0; i --{
		if absInt(sumLeft + nums[i]) > absInt(sumRight + nums[i]) {
			sumLeft += nums[i]
		} else {
			sumRight += nums[i]
		}
	}

	return absInt(absInt(sumLeft) - absInt(sumRight))
}

func main() {
	writer.Flush()
	var t int
	fmt.Fscanf(reader, "%d\n", &t)
	for t > 0 {
		var n int
		fmt.Fscanf(reader, "%d\n", &n)
		nums := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscanf(reader, "%d", &nums[i])
		}
		fmt.Fscanf(reader, "\n")
		fmt.Println(sol(nums))
		t--
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t, n int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var po, ne int64
		fmt.Fscan(in, &n)
		for j := 0; j < n; j++ {
			var x int64
			fmt.Fscan(in, &x)
			if x >= 0 {
				po += x
			} else {
				ne += x
			}
		}
		ne *= -1
		if po > ne {
			fmt.Println(po - ne)
		} else {
			fmt.Println(ne - po)
		}
	}
}

package main

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

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

//void find_min_diff( uint32_t sum_heap1 = 0, uint32_t sum_heap2 = 0, uint8_t i = 0 )
//{
//if (i != size)
//{
//find_min_diff(sum_heap1 + rocks[i], sum_heap2, i + 1);
//find_min_diff(sum_heap1, sum_heap2 + rocks[i], i + 1);
//}
//else
//min_diff = min_diff < sum_heap1 - sum_heap2 ? min_diff : sum_heap1 - sum_heap2;
//}

func solve() {
	_, arr := _readArr()
	s1, s2 := 0, 0
	sort.Ints(arr)
	for _, x := range arr {
		if _abs(s1+x)-s2 > s1-_abs(s2+x) {
			s1 += x
		} else {
			s2 += x
		}
	}

	_print(_abs(s1 - s2))
}

//func solve() {
//	n, arr := _readArr()
//	res := math.MinInt
//	var util func(s1, s2, i int)
//	util = func(s1, s2, i int) {
//		if i != n {
//			util(s1+arr[i], s2, i+1)
//			util(s1, s2+arr[i], i+1)
//		} else {
//			if x := _abs(s1) - _abs(s2); res < x {
//				res = x
//			}
//		}
//	}
//	util(0, 0, 0)
//	_print(res)
//}

func main() {
	defer out.Flush()
	var t int
	for fmt.Fscanln(in, &t); t > 0; t-- {
		solve()
	}
}

// ====
func _readInt() int {
	var x int
	fmt.Fscan(in, &x)
	return x
}
func _readStr() string {
	var x string
	fmt.Fscan(in, &x)
	return x
}
func _readArr(x ...int) (int, []int) {
	var n int
	if len(x) == 0 {
		fmt.Fscan(in, &n)
	} else {
		n = x[0]
	}
	var v = make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &v[i])
	}
	return n, v
}
func _print(x ...any) {
	fmt.Fprintln(out, x...)
}
func _max(x ...int) int {
	mi := 0
	for i := 1; i < len(x); i++ {
		if x[i] > x[mi] {
			mi = i
		}
	}
	return x[mi]
}
func _min(x ...int) int {
	mi := 0
	for i := 1; i < len(x); i++ {
		if x[i] < x[mi] {
			mi = i
		}
	}
	return x[mi]
}
func _sum(x ...int) int {
	res := 0
	for _, i := range x {
		res += i
	}
	return res
}
func _abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}
func _sortStr(x string) string {
	r := []rune(x)
	sort.Slice(r, func(i, j int) bool {
		return r[i] < r[j]
	})
	return string(r)
}
func _reverseInts(x []int) {
	n := len(x)
	for i := 0; i < n/2; i++ {
		x[i], x[n-1-i] = x[n-1-i], x[i]
	}
}
func _reverseStr(s string) string {
	x := []rune(s)
	n := len(x)
	for i := 0; i < n/2; i++ {
		x[i], x[n-1-i] = x[n-1-i], x[i]
	}
	return string(x)
}
func _makeMatrix(n, m int) [][]int {
	x := make([][]int, n)
	for i := range x {
		x[i] = make([]int, m)
	}
	return x
}

package main

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

type CF1747A struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1747A) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1747A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1747A) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1747A) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1747A) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1747A
Date: 5/11/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1747/A
Problem: CF1747A
**/
func (in *CF1747A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		pos := 0
		neg := 0
		all := 0
		for i := 0; i < n; i++ {
			val := in.NextInt()
			if val > 0 {
				pos += val
			} else {
				neg += val
			}
			all += val
		}

		max := int(math.Max(float64(all), math.Min(-float64(neg)-float64(pos), -float64(pos)-float64(neg))))
		fmt.Println(max)
	}
}

func NewCF1747A(r *bufio.Reader) *CF1747A {
	return &CF1747A{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1747A(bufio.NewReader(os.Stdin)).Run()
}

package main

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

const cf = true

func solve() {
	var n int
	fmt.Fscan(in, &n)
	pos, neg := 0, 0
	var num int
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &num)
		if num >= 0 {
			pos += num
		} else {
			neg -= num
		}
	}
	fmt.Fprintln(out, abs(pos-neg))
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

func LCM(a, b int) int {
	return a * b / GCD(a, b)
}

func GCD(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}

	return a
}

type SqrtInt interface {
	SignedSqrt | UnsignedSqrt
}

type SignedSqrt interface {
	~int | ~int32 | ~int64
}

type UnsignedSqrt interface {
	~uint | ~uint32 | ~uint64 | ~uintptr
}

func sqrt[T SqrtInt](x T) T {
	l, r := T(0), T(2000000123)
	for l < r {
		mid := (l + r) / 2
		if mid*mid > x {
			r = mid
		} else {
			l = mid + 1
		}
	}
	return l - 1
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []byte(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

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

func main() {
	var testCases int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {

		var n int
		fmt.Fscan(reader, &n)

		var sum int64
		for i := 0; i < n; i++ {
			var temp int64
			fmt.Fscan(reader, &temp)

			sum += temp

		}

		ans := int64(math.Abs((float64(sum))))

		fmt.Fprintln(writer, ans)
	}
}

package main

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

func solve(reader *bufio.Reader, writer *bufio.Writer) {
	n := readInt(reader)
	a := readArrayInt64(reader)

	var sum1, sum2 int64 = 0, 0
	for i := 0; i < n; i++ {
		if a[i] < 0 {
			sum1 += a[i]
		} else {
			sum2 += a[i]
		}
	}
	sum1 *= -1

	if sum1 > sum2 {
		fmt.Fprintln(writer, sum1-sum2)
	} else {
		fmt.Fprintln(writer, sum2-sum1)
	}
}

func main() {
	reader := bReader(os.Stdin)
	writer := bWriter(os.Stdout)

	t := readInt(reader)

	for t > 0 {
		solve(reader, writer)
		t--
	}

	writer.Flush()
}

func bReader(stdin *os.File) *bufio.Reader {
	return bufio.NewReaderSize(stdin, 16*1024*1024)
}

func bWriter(stdout *os.File) *bufio.Writer {
	return bufio.NewWriterSize(stdout, 16*1024*1024)
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}

func readInt(reader *bufio.Reader) int {
	return int(readInt64(reader))
}

func readInt64(reader *bufio.Reader) int64 {
	value, err := strconv.ParseInt(readLine(reader), 10, 64)
	checkError(err)

	return value
}

func readString(reader *bufio.Reader) string {
	return readLine(reader)
}

func readArrayString(reader *bufio.Reader) []string {
	return strings.Split(strings.TrimSpace(readLine(reader)), " ")
}

func readArrayInt(reader *bufio.Reader) []int {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := int(arItemTemp)
		ar = append(ar, arItem)
	}

	return ar
}

func readArrayInt64(reader *bufio.Reader) []int64 {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int64

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := arItemTemp
		ar = append(ar, arItem)
	}

	return ar
}

func readTwoInt(reader *bufio.Reader) (int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1]
}

func readTwoInt64(reader *bufio.Reader) (int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1]
}

func readThreeInt(reader *bufio.Reader) (int, int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1], ar[2]
}

func readThreeInt64(reader *bufio.Reader) (int64, int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1], ar[2]
}

func gcd(x, y int64) int64 {
	for y > 0 {
		x, y = y, x%y
	}

	return x
}

func lcm(x int64, y int64) int64 {
	return x * y / gcd(x, y)
}

package main

import (
	"bufio"
	"fmt"
	"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...) }

const (
	DEBUG = false
)

func debug(a ...interface{}) {
	if !DEBUG {
		return
	}
	for _, e := range a {
		printf("%v ", e)
	}
	printf("\n")
	writer.Flush()
}

func debugCondn(condn bool, a ...interface{}) {
	if !DEBUG || !condn {
		return
	}
	for _, e := range a {
		printf("%v ", e)
	}
	printf("\n")
	writer.Flush()
}

func assert(condn bool) {
	if !condn {
		panic("assertion error")
	}
}

func solve(tt int) {
	var n int
	scanf("%d\n", &n)
	arr := make([]int64, n)
	res1 := int64(0)
	res2 := int64(0)
	for i:=0; i<n; i++ {
		scanf("%d ", &arr[i])
		if arr[i] > 0 {
			res1 += arr[i]
		} else {
			res2 += arr[i]
		}
	}
	scanf("\n")

	res := res1 + res2
	if res < 0 {
		res = -res
	}
	printf("%d\n", res)
}

func main() {
	defer writer.Flush()

	var T int
	scanf("%d\n", &T)
	for tt:=1; tt<=T; tt++ {
		solve(tt)
	}
}

package main

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

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

func main() {
	defer out.Flush()

	var tc int
	for fmt.Fscan(in, &tc); tc > 0; tc-- {
		var n int
		var a, s int64
		for fmt.Fscan(in, &n); n > 0; n-- {
			fmt.Fscan(in, &a)
			s += a
		}
		if s < 0 {
			s = -s
		}
		fmt.Fprintln(out, s)
	}
}

package main

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

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

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

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(reader, &n)

		var ans int64
		for ; n > 0; n-- {
			var x int64
			fmt.Fscan(reader, &x)
			ans += x
		}

		if ans < 0 {
			fmt.Fprintln(writer, -ans)
		} else {
			fmt.Fprintln(writer, ans)
		}
	}
}

package main

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

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

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

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(reader, &n)

		var ans int
		for ; n > 0; n-- {
			var x int
			fmt.Fscan(reader, &x)
			ans += x
		}

		fmt.Println(math.Abs(float64(ans)))
	}
}

package main

import (
	"fmt"
	"math"
)

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

	for ; t > 0; t-- {
		var n int
		fmt.Scanf("%d", &n)

		var ans int
		for ; n > 0; n-- {
			var x int
			fmt.Scanf("%d", &x)
			ans += x
		}

		fmt.Println(math.Abs(float64(ans)))
	}
}

package main

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

func main() {
	var testCases int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {

		var n int
		fmt.Fscan(reader, &n)

		// nSum := 0
		var sum int64
		for i := 0; i < n; i++ {
			var jj int64
			fmt.Fscan(reader, &jj)

			sum += jj
			// if jj < 0 {
			// } else {
			// 	pSum += (jj)
			// }
		}

		// d := math.Abs(math.Abs(float64(nSum)) - math.Abs(float64(pSum)))

		fmt.Fprintln(writer, math.Abs(float64(sum)))
	}
}

package main

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

func main() {
	var testCases int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {

		var n int
		fmt.Fscan(reader, &n)

		// nSum := 0
		var sum float64
		for i := 0; i < n; i++ {
			var jj float64
			fmt.Fscan(reader, &jj)

			sum += jj
			// if jj < 0 {
			// } else {
			// 	pSum += (jj)
			// }
		}

		// d := math.Abs(math.Abs(float64(nSum)) - math.Abs(float64(pSum)))

		fmt.Fprintln(writer, math.Abs((sum)))
	}
}

package main

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

func main() {
	var testCases int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {

		var n int
		fmt.Fscan(reader, &n)

		// nSum := 0
		sum := 0
		for i := 0; i < n; i++ {
			var jj int
			fmt.Fscan(reader, &jj)

			sum += jj
			// if jj < 0 {
			// } else {
			// 	pSum += (jj)
			// }
		}

		// d := math.Abs(math.Abs(float64(nSum)) - math.Abs(float64(pSum)))

		fmt.Fprintln(writer, math.Abs(float64(sum)))
	}
}

package main

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

func main() {
	var testCases int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {

		var n int
		fmt.Fscan(reader, &n)

		nSum := 0
		pSum := 0
		for i := 0; i < n; i++ {
			var jj int
			fmt.Fscan(reader, &jj)

			if jj < 0 {
				nSum += int(math.Abs(float64(jj)))
			} else {
				pSum += int(math.Abs(float64(jj)))
			}
		}

		d := math.Abs(float64(nSum) - float64(pSum))

		fmt.Fprintln(writer, d)
	}
}

package main

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

func main() {
	var testCases int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {

		var n int
		fmt.Fscan(reader, &n)

		nSum := 0
		pSum := 0
		for i := 0; i < n; i++ {
			var i int
			fmt.Fscan(reader, &i)

			if i < 0 {
				nSum += int(math.Abs(float64(i)))
			} else {
				pSum += int(math.Abs(float64(i)))
			}
		}

		d := math.Abs(float64(nSum) - float64(pSum))

		fmt.Fprintln(writer, d)
	}
}

package main

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

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

func absInt(num int) int {
	if num < 0 {
		return -num
	}

	return num
}

func sol(nums []int) int {
	sort.Ints(nums)
	pos, sumLeft, sumRight := 0, 0, 0

	for i := 0; i < len(nums); i++ {
		if absInt(sumLeft + nums[i]) < absInt(sumLeft) {
			pos = i
			break
		} else {
			sumLeft += nums[i]
		}
	}

	if pos != 0 {
		for i := pos; i < len(nums); i++ {
			sumRight += nums[i]
		}
	}

	return absInt(sumLeft) - absInt(sumRight)
}

func main() {
	writer.Flush()
	var t int
	fmt.Fscanf(reader, "%d\n", &t)
	for t > 0 {
		var n int
		fmt.Fscanf(reader, "%d\n", &n)
		nums := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscanf(reader, "%d", &nums[i])
		}
		fmt.Fscanf(reader, "\n")
		fmt.Println(sol(nums))
		t--
	}
}


package main

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

const N = 1e5 + 5

var a, b [N]int

func main() {
  stdin := bufio.NewReader(os.Stdin)
  var na, nb int
  fmt.Fscanf(stdin, "%d %d\n", &na, &nb)
  var k, m int
  fmt.Fscanf(stdin, "%d %d\n", &k, &m)
  for i := 1; i <= na; i++ {
    if i != na {
      fmt.Fscanf(stdin, "%d ", &a[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &a[i])
    }
  }
  for i := 1; i <= nb; i++ {
    if i != nb {
      fmt.Fscanf(stdin, "%d ", &b[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &b[i])
    }
  }
  if a[k] < b[nb - m + 1] {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main
import (
  "bufio"
  "fmt"
  "os"
)

const maxN = 100005
var a,b [maxN]int

func main() {
  var nA, nB, k, m int
  stdin := bufio.NewReader(os.Stdin)

  fmt.Fscanf(stdin, "%d %d\n", &nA, &nB)
  fmt.Fscanf(stdin, "%d %d\n", &k, &m)

  for i := 0; i < nA; i++ {
    if i != nA - 1 {
      fmt.Fscanf(stdin, "%d ", &a[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &a[i])
    }
  }
  for i := 0; i < nB; i++ {
    if i != nB - 1 {
      fmt.Fscanf(stdin, "%d ", &b[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &b[i])
    }
  }
  if (a[k-1] < b[nB-m]) {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

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

func I(i ...interface{}) error {
	_, err := fmt.Fscan(r, i...)
	return err
}

func O(o ...interface{}) {
	fmt.Fprint(w, o...)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.goC"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n, nn int
	for I(&n, &nn) == nil {
		solve(n, nn)
	}
}

func solve(n, nn int) {
	var k, m int
	I(&k, &m)
	ak, am := make([]int, n), make([]int, nn)
	for i := 0; i < n; i++ {
		I(&ak[i])
	}
	for i := 0; i < nn; i++ {
		I(&am[i])
	}
	ak = ak[:k]
	am = am[len(am)-m:]
	if am[0] > ak[len(ak)-1] {
		O("YES", "\n")
	} else {
		O("NO", "\n")
	}
}

package main

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

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

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	na, nb := nextInt(), nextInt()
	k, m := nextInt(), nextInt()
	a, maxa, minb := 0, 0, 0

	// a := make([]int, na)
	// b := make([]int, nb)

	for i := 0; i < na; i++ {
		a = nextInt()

		if i == k-1 {
			maxa = a
		}
	}

	for i := 0; i < nb; i++ {
		a = nextInt()

		if i == nb-m {
			minb = a
		}
	}

	if maxa < minb {
		println("YES")
	} else {
		println("NO")
	}

}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

func nextInt() int {
	n, _ := strconv.Atoi(next())
	return n
}

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

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

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	na, nb := nextInt(), nextInt()
	k, m := nextInt(), nextInt()
	maxa, minb := 0, 0

	// a := make([]int, na)
	// b := make([]int, nb)

	for i := 0; i < na; i++ {
		if i == k-1 {
			maxa = nextInt()
			continue
		}
		nextInt()
	}

	for i := 0; i < nb; i++ {
		if i == nb-m {
			minb = nextInt()
			continue
		}
		nextInt()
	}

	if maxa < minb {
		println("YES")
	} else {
		println("NO")
	}

}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

func nextInt() int {
	n, _ := strconv.Atoi(next())
	return n
}

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	var n1, n2, m, k int
	fmt.Fscanf(r, "%d %d\n", &n1, &n2)
	fmt.Fscanf(r, "%d %d\n", &m, &k)

	min := make([]int, n1)
	max := make([]int, n2)

	for i := range min {
		fmt.Fscanf(r, "%d", &min[i])
	}
	fmt.Fscanf(r, "\n")
	for i := range max {
		fmt.Fscanf(r, "%d", &max[i])
	}
	result := "NO"
	if min[m-1] < max[n2-k] {
		result = "YES"
	}
	fmt.Fprint(os.Stdout, result)
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	var lenA, lenB, k, m int
	fmt.Fscanf(r, "%d %d\n", &lenA, &lenB)
	fmt.Fscanf(r, "%d %d\n", &k, &m)
	a := make([]int, lenA)
	b := make([]int, lenB)

	for i := range a {
		if i == lenA-1 {
			fmt.Fscanf(r, "%d\n", &a[i])
		} else {
			fmt.Fscanf(r, "%d", &a[i])
		}

	}
	for i := range b {
		fmt.Fscanf(r, "%d", &b[i])
	}
	if a[k-1] < b[len(b)-m] {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

package main

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

func solve(a []int, b []int, k int, m int) string {
	if a[k-1] < b[len(b)-m] {
		return "YES"
	}
	return "NO"
}

func main() {
	r := bufio.NewReader(os.Stdin)
	var lenA, lenB, k, m int
	fmt.Fscanf(r, "%d %d\n", &lenA, &lenB)
	fmt.Fscanf(r, "%d %d\n", &k, &m)
	a := make([]int, lenA)
	b := make([]int, lenB)

	for i := range a {
		if i == lenA-1 {
			fmt.Fscanf(r, "%d\n", &a[i])
		} else {
			fmt.Fscanf(r, "%d", &a[i])
		}

	}
	for i := range b {
		fmt.Fscanf(r, "%d", &b[i])
	}

	fmt.Fprintf(os.Stdout, "%s\n", solve(a, b, k, m))
}

package main

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

func main() {
	reader := NewStdReader(os.Stdin)

	na, nb, k, m := reader.ReadInt(), reader.ReadInt(), reader.ReadInt(), reader.ReadInt()

	var a, b, t int

	for i := 1; i <= na; i++ {
		t = reader.ReadInt()
		if i == k {
			a = t
		}
	}

	for i := 0; i < nb; i++ {
		t = reader.ReadInt()
		if i == nb-m {
			b = t
		}
	}

	if a < b {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}

type StdReader struct {
	buf *bufio.Reader
}

func NewStdReader(reader io.Reader) *StdReader {
	return &StdReader{bufio.NewReaderSize(reader, 16*1024*1024)}
}

func (std *StdReader) ReadInt() int {

	r := 0
	sign := 1
	ok := false

	for {
		b, e := std.buf.ReadByte()

		if e != nil {
			break
		}
		if b >= '0' && b <= '9' {
			r = r*10 + int(b-'0')
			ok = true
		} else {
			if ok {
				break
			} else {
				if b == '-' {
					sign = -sign
				}
			}
		}
	}

	return sign * r
}

package main
import (
  "bufio"
  "fmt"
  "os"
)

const maxN = 100005
var a,b [maxN]int

func main() {
  var nA, nB, k, m int
  stdin := bufio.NewReader(os.Stdin)

  fmt.Fscanf(stdin, "%d %d\n", &nA, &nB)
  fmt.Fscanf(stdin, "%d %d\n", &k, &m)

  for i := 0; i < nA; i++ {
    if i != nA - 1 {
      fmt.Scanf("%d ", &a[i])
    } else {
      fmt.Scanf("%d\n", &a[i])
    }
  }
  for i := 0; i < nB; i++ {
    if i != nB - 1 {
      fmt.Scanf("%d ", &b[i])
    } else {
      fmt.Scanf("%d\n", &b[i])
    }
  }
  if (a[k-1] < b[nB-m]) {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

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

const N = 1e5 + 5

var a, b [N]int

func main() {
  stdin := bufio.NewReader(os.Stdin)
  var na, nb int
  fmt.Fscanf(stdin, "%d %d\n", &na, &nb)
  var k, m int
  fmt.Fscanf(stdin, "%d %d\n", &k, &m)
  for i := 1; i <= na; i++ {
    if i != na {
      fmt.Fscanf(stdin, "%d ", &a[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &a[i])
    }
  }
  fmt.Fscanf(stdin, "\n")
  for i := 1; i <= nb; i++ {
    if i != nb {
      fmt.Fscanf(stdin, "%d ", &b[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &b[i])
    }
  }
  if a[k] > b[nb - m + 1] {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

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

const N = 1e5 + 5

var a, b [N]int

func main() {
  stdin := bufio.NewReader(os.Stdin)
  var na, nb int
  fmt.Fscanf(stdin, "%d %d\n", &na, &nb)
  var k, m int
  fmt.Fscanf(stdin, "%d %d\n", &k, &m)
  for i := 1; i <= na; i++ {
    if i != na {
      fmt.Fscanf(stdin, "%d ", &a[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &a[i])
    }
  }
  for i := 1; i <= nb; i++ {
    if i != nb {
      fmt.Fscanf(stdin, "%d ", &b[i])
    } else {
      fmt.Fscanf(stdin, "%d\n", &b[i])
    }
  }
  if a[k] > b[nb - m + 1] {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

import "fmt"

const N = 1e5 + 5;

var a, b [N]int

func main() {
  var na, nb int
  fmt.Scan(&na, &nb)
  var k, m int
  fmt.Scan(&k, &m)
  for i := 1; i <= na; i++ {
    fmt.Scan(&a[i])
  }
  for i := 1; i <= nb; i++ {
    fmt.Scan(&b[i])
  }
  if a[na] < b[nb - m + 1] {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

package main

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

func solve(a []int, b []int, k int, m int) string {
	if a[k-1] < b[len(b)-m] {
		return "YES"
	}
	return "NO"
}

func main() {
	r := bufio.NewReader(os.Stdin)
	var lenA, lenB, k, m int
	fmt.Fscanf(r, "%d %d\n", &lenA, &lenB)
	fmt.Fscanf(r, "%d %d\n", &k, &m)
	a := make([]int, lenA)
	b := make([]int, lenB)

	for i := range a {
		fmt.Fscanf(r, "%d", &a[i])
	}

	for i := range b {
		fmt.Fscanf(r, "%d", &b[i])
	}

	fmt.Fprintf(os.Stdout, "%s\n", solve(a, b, k, m))
}

package main

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

func solve(a []int, b []int, k int, m int) string {
	fmt.Println(a, b, k, m)
	if a[k-1] < b[len(b)-m] {
		return "YES"
	}
	return "NO"
}

func main() {
	r := bufio.NewReader(os.Stdin)
	var lenA, lenB, k, m int
	fmt.Fscanf(r, "%d %d\n", &lenA, &lenB)
	fmt.Fscanf(r, "%d %d\n", &k, &m)
	a := make([]int, lenA)
	b := make([]int, lenB)

	for i := range a {
		if i == lenA-1 {
			fmt.Fscanf(r, "%d\n", &a[i])
		} else {
			fmt.Fscanf(r, "%d", &a[i])
		}

	}
	for i := range b {
		fmt.Fscanf(r, "%d", &b[i])
	}

	fmt.Fprintf(os.Stdout, "%s\n", solve(a, b, k, m))

}

package main

import (
	"fmt"
)

func main() {
	var na, nb, k, m int
	fmt.Scan(&na, &nb, &k, &m)

	var a, b, t int

	for i := 1; i <= na; i++ {
		fmt.Scanf("%d", &t)
		if i == k {
			a = t
			var s string
			fmt.Scanln(&s)
			break
		}
	}

	for i := 0; i < nb; i++ {
		fmt.Scanf("%d", &t)
		if i == nb-m {
			b = t
			var s string
			fmt.Scanln(&s)
			break
		}
	}

	if a < b {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}

package main

import (
	"os"
)

func main() {
	na, nb, k, m := getInt(), getInt(), getInt(), getInt()

	var a, b, t int

	for i := 1; i <= na; i++ {
		t = getInt()
		if i == k {
			a = t
		}
	}

	for i := 0; i < nb; i++ {
		t = getInt()
		if i == nb-m {
			b = t
		}
	}

	if a < b {
		print("YES")
	} else {
		print("NO")
	}
}

func getInt() int {
	b := []byte{0}
	r := 0
	ok := false

	for {
		_, e := os.Stdin.Read(b)
		if e != nil {
			break
		}
		if b[0] >= '0' && b[0] <= '9' {
			r = r*10 + int(b[0]-'0')
			ok = true
		} else {
			if ok {
				break
			}
		}
	}

	return r
}

package main

import (
	"fmt"
)

func main() {
	var na, nb, k, m int
	fmt.Scanf("%d", &na)
	fmt.Scanf("%d", &nb)
	fmt.Scanf("%d", &k)
	fmt.Scanf("%d", &m)

	var a, b, t int

	for i := 1; i <= na; i++ {
		fmt.Scanf("%d", &t)
		if i == k {
			a = t
		}
	}

	for i := 0; i < nb; i++ {
		fmt.Scanf("%d", &t)
		if i == nb-m {
			b = t
		}
	}

	if a < b {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}

package main

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

func main() {
	reader := NewStdReader(os.Stdin)

	na, nb, k, m := reader.ReadInt(), reader.ReadInt(), reader.ReadInt(), reader.ReadInt()

	var a, b, t int

	for i := 1; i <= na; i++ {
		t = reader.ReadInt()
		if i == k {
			a = t
		}
	}

	for i := 0; i < nb; i++ {
		t = reader.ReadInt()
		if i == nb-m {
			b = t
		}
	}

	if a < b {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}

type StdReader struct {
	buf *bufio.Reader
}

func NewStdReader(reader io.Reader) *StdReader {
	return &StdReader{bufio.NewReaderSize(reader, 10*1024*1024)}
}

func (std *StdReader) ReadInt() int {

	r := 0
	ok := false

	for {
		b, e := std.buf.ReadByte()

		if e != nil {
			break
		}
		if b >= '0' && b <= '9' {
			r = r*10 + int(b-'0')
			ok = true
		} else {
			if ok {
				break
			}
		}
	}

	return r
}

package main

import (
	"fmt"
)

func main() {
	var na, nb, k, m int
	fmt.Scan(&na, &nb, &k, &m)

	var a, b, t int

	for i := 1; i <= na; i++ {
		fmt.Scanf("%d", &t)
		if i == k {
			a = t
		}
	}

	for i := 0; i < nb; i++ {
		fmt.Scanf("%d", &t)
		if i == nb-m {
			b = t
		}
	}

	if a < b {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}

package main

import (
	"fmt"
)

func main() {
	var na, nb, k, m int64
	fmt.Scanf("%d", &na)
	fmt.Scanf("%d", &nb)
	fmt.Scanf("%d", &k)
	fmt.Scanf("%d", &m)

	var a, b, t, i int64

	for i = 1; i <= na; i++ {
		fmt.Scanf("%d", &t)
		if i == k {
			a = t
		}
	}

	for i = 0; i < nb; i++ {
		fmt.Scanf("%d", &t)
		if i == nb-m {
			b = t
		}
	}

	if a < b {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}


package main

import "fmt"

func main() {
	var T uint8
	fmt.Scan(&T)
	for T > 0 {
		var A, B uint16
		fmt.Scan(&A, &B)
		fmt.Printf("%d\n", A*B)
		T--
	}
}

package main

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

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

	var t, a, b int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		fmt.Fscan(in, &a, &b)

		fmt.Println(a * b)
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scan(&t)
	for i := 1; i <= t; i++ {
		var a, b int
		fmt.Scan(&a)
		fmt.Scan(&b)
		fmt.Println(a * b)
	}
}

package main

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

// var m []int
// err = json.Unmarshal([]byte(r.FormValue("example")), &m)

// for i := 0; i < len(m); i++ {
// 	fmt.Println(m[i])
// }

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

func MKO(x, y int) int {
	if x < y {
		return 0
	} else {
		return x - y + 1
	}
}

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

func LCM(x, y int) int {
	if x >= y {
		initial := x
		for i := 1; i < y+2; i++ {
			if initial%y == 0 {
				break
			} else {
				initial = initial + x
			}

		}
		return initial
	} else {
		initial := y
		for i := 1; i < x+2; i++ {
			if initial%x == 0 {
				break
			} else {
				initial = initial + y
			}

		}
		return initial
	}
}

func IsItPrime(x int) bool {
	if x < 10 {
		if x == 2 || x == 3 || x == 5 || x == 7 {
			return true
		} else {
			return false
		}
	} else {
		j := 0
		k := math.Sqrt(float64(x))
		for m := 3; m <= int(k); {
			if x%m == 0 {
				j = 1
				break
			}
			m = m + 2
		}
		if j == 1 {
			return false
		} else {
			return true
		}
	}

}

// sort.Slice(arr, func(i, j int) bool {
// 	return arr[i] > arr[j]
// })
var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &t)
	for o := 0; o < t; o++ {

		var n, m int

		fmt.Fscan(input, &n)
		fmt.Fscan(input, &m)

		fmt.Println(m * n)

		// STRING := make([]byte, 0)
		// fmt.Fscan(input, &STRING)

		// ARRAY := make([]int, n)
		// for i := 0; i < n; i++ {
		// 	fmt.Fscan(input, &ARRAY[i])
		// }

	}

}

package main

import(
  "fmt"
)

func main(){
	var t int
	fmt.Scan(&t)
	for tt:=1;tt<=t;tt++ {
		solve()
	}
}

func solve(){
	var a,b int
	fmt.Scan(&a)
	fmt.Scan(&b)
	fmt.Println(a*b)
}

package main

import "fmt"

func main() {
	var T uint8
	fmt.Scan(&T)
	for T > 0 {
		var A, B uint8
		fmt.Scan(&A, &B)
		fmt.Printf("%d\n", A*B)
		T--
	}
}


package main

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

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

func CF1704B(in io.Reader, out io.Writer) {
	r := bufio.NewReader(in)
	w := bufio.NewWriter(out)
	defer w.Flush()

	var T int
	for fmt.Fscan(r, &T); T > 0; T-- {
		var n, x int64
		fmt.Fscan(r, &n, &x)
		var val, ans int64
		maxV, minV := int64(math.MinInt64), int64(math.MaxInt64)
		for i := int64(0); i < n; i++ {
			fmt.Fscan(r, &val)
			maxV = max(maxV, val)
			minV = min(minV, val)
			if maxV-minV > 2*x {
				ans++
				maxV = val
				minV = val
			}
		}
		fmt.Fprintln(w, ans)
	}
}

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

func max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

package main

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

const cf = true

func solve() {
	var n, x int
	fmt.Fscan(in, &n, &x)
	var num, mx, mn int64
	mx, mn = -1, 10000000000
	ans := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &num)
		mx = max(mx, num)
		mn = min(mn, num)
		if mx-mn > int64(x*2) {
			ans++
			mx = num
			mn = num
		}
	}
	fmt.Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

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

func main() {
	var n, x, a, l, r int
	f := bufio.NewReader(os.Stdin)
	s, _ := f.ReadString('\n')
	s = strings.ReplaceAll(s, "\n", "")
	s = strings.ReplaceAll(s, "\r", "")
	t, _ := strconv.ParseInt(s, 10, 32)
	for i := 0; i < int(t); i++ {
		res := 0
		s, _ = f.ReadString('\n')
		s = strings.ReplaceAll(s, "\n", "")
		s = strings.ReplaceAll(s, "\r", "")
		_, _ = fmt.Sscanf(s, "%d %d", &n, &x)
		s, _ = f.ReadString('\n')
		s = strings.ReplaceAll(s, "\r", "")
		s = strings.ReplaceAll(s, "\n", "")
		as := strings.SplitN(s, " ", n)
		if len(as) != n {
			fmt.Println(len(as), n)
			panic("kek")
		}
		for j := 0; j < n; j++ {
			a1, _ := strconv.ParseInt(as[j], 10, 64)
			a = int(a1)
			if j == 0 {
				l = a
				r = a
			} else {
				if a >= l && a <= r {
					continue
				} else if a < l {
					if r-a <= x*2 {
						l = a
						continue
					} else {
						res++
						l = a
						r = a
					}
				} else if a > r {
					if a-l <= x*2 {
						r = a
						continue
					} else {
						res++
						l = a
						r = a
					}
				}
			}
		}
		fmt.Println(res)
	}
}

package main

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

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

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		var x int64
		fmt.Fscan(in, &n, &x)

		aa := make([]int64, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &aa[i])
		}

		var tot int
		l, r := aa[0]-x, aa[0]+x
		for i := 1; i < n; i++ {
			if aa[i]-x > r || aa[i]+x < l {
				l, r = aa[i]-x, aa[i]+x
				tot++
			}
			l = max(l, aa[i]-x)
			r = min(r, aa[i]+x)
		}
		fmt.Fprintln(out, tot)
	}
}

package main

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

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

	var buf bytes.Buffer

	tc := readNum(reader)

	for tc > 0 {
		tc--
		n, x := readTwoNums(reader)
		A := readNNums(reader, n)
		res := solve(A, x)
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}

	fmt.Print(buf.String())
}

func readString(reader *bufio.Reader) string {
	s, _ := reader.ReadString('\n')
	for i := 0; i < len(s); i++ {
		if s[i] == '\n' || s[i] == '\r' {
			return s[:i]
		}
	}
	return s
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

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(A []int, x int) int {
	n := len(A)

	var res int

	lo := 0
	hi := 1 << 30
	for i := 0; i < n; i++ {
		// hi - A[i] <= x
		// A[i] - lo <= x
		a := A[i] - x
		b := A[i] + x
		lo = max(lo, a)
		hi = min(hi, b)
		if lo <= hi {
			continue
		}
		res++
		lo = a
		hi = b
	}

	return res
}

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
}

package main

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

var _, _, _ = main, rw, do

func main() {
	r, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()
	rw(r, w)
}

func rw(r io.Reader, w io.Writer) {
	var t int
	fmt.Fscan(r, &t)
	for ti := 0; ti < t; ti++ {
		var n, m int
		fmt.Fscan(r, &n, &m)
		a := make([]int, n)
		for i := range a {
			fmt.Fscan(r, &a[i])
		}
		w1 := do(n, m, a)
		fmt.Fprintln(w, w1)
	}
}

func do(n, x int, a []int) int {
	l := math.MinInt
	r := math.MinInt
	ans := -1
	for _, v := range a {
		c := v - x
		d := v + x
		if r < c || l > d {
			ans++
			l, r = c, d
			continue
		}
		if l < c {
			l = c
		}
		if r > d {
			r = d
		}
	}
	return ans
}

package main

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

func main() {
	input := bufio.NewReader(os.Stdin)
	cases := readInt(input)
	for asdf := 0; asdf < cases; asdf++ {
		tmp := readArrInt(input)
		arr := readArrInt(input)
		fmt.Println(solve(tmp[0], tmp[1], arr))
	}
}

func solve(n int, jump int, arr []int) int {
	// fmt.Println(n, jump, arr)
	result := 0
	bottom := arr[0]
	top := arr[0]
	for i := 1; i < n; i++ {
		bottom = min(bottom, arr[i])
		top = max(top, arr[i])
		if top-bottom > jump*2 {
			result++
			bottom = arr[i]
			top = arr[i]
		}
	}
	return result
}

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 readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

func readInt64(in *bufio.Reader) int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return int64(n)
}

func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrInt64(in *bufio.Reader) []int64 {
	numbs := readLineNumbs(in)
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

package main

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

func solve() {
	n := get()
	x := L(get())
	a := geta(n)

	count := 0
	l := a[0]
	r := a[0]
	for _, v := range a[1:] {
		l = min(l, v)
		r = max(r, v)
		if L(r-l) > 2*x {
			l, r = v, v
			count++
		}
	}
	putln(count)
}

const (
	once       = false
	maxBufSize = 0 //10_000_000
	YES        = "YES"
	NO         = "NO"
)

var (
	splitFunc = bufio.ScanWords //bufio.SplitFunc(nil)
)

func main() {
	in = bufio.NewScanner(bufio.NewReader(os.Stdin))
	if splitFunc != nil {
		in.Split(splitFunc)
	}
	if maxBufSize > 0 {
		in.Buffer(make([]byte, maxBufSize), maxBufSize)
	}

	out = bufio.NewWriter(os.Stdout)
	defer out.Flush()

	if once {
		solve()
		return
	}

	for t := get(); t > 0; t-- {
		solve()
	}
}

var (
	in  *bufio.Scanner
	out *bufio.Writer
)

func get() int {
	x, _ := strconv.Atoi(gets())
	return x
}

func geta(n int) []int {
	a := make([]int, n)
	for i := range a {
		a[i] = get()
	}
	return a
}

func geta1(n int) []int {
	a := make([]int, n)
	for i := range a {
		a[i] = get() - 1
	}
	return a
}

func get64() int64 {
	x, _ := strconv.ParseInt(gets(), 10, 64)
	return x
}

func get64a(n int) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = get64()
	}
	return a
}

func get64a1(n int) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = get64() - 1
	}
	return a
}

func getf() float64 {
	x, _ := strconv.ParseFloat(gets(), 64)
	return x
}

func getfa(n int) []float64 {
	a := make([]float64, n)
	for i := range a {
		a[i] = getf()
	}
	return a
}

func gets() string {
	scan()
	return in.Text()
}

func scanN(n int) {
	for n > 0 {
		scan()
		n--
	}
}

func scan() {
	in.Scan()
}

func putc(c rune) {
	out.WriteRune(c)
}

func line() {
	putc('\n')
}

func space() {
	putc(' ')
}

func put(x int) {
	out.WriteString(strconv.Itoa(x))
}

func putln(i int) {
	put(i)
	line()
}

func puta(a []int) {
	for _, v := range a {
		put(v)
		space()
	}
	line()
}

func put64(x int64) {
	out.WriteString(strconv.FormatInt(x, 10))
}

func put64ln(x int64) {
	put64(x)
	line()
}

func put64a(a []int64) {
	for _, v := range a {
		put64(v)
		space()
	}
	line()
}

func puts(s string) {
	out.WriteString(s)
}

func putsln(s string) {
	puts(s)
	line()
}

func yn(y bool) {
	if y {
		yes()
		return
	}
	no()
}

func yes() {
	puts(YES)
	line()
}

func no() {
	puts(NO)
	line()
}

func putf(x float64) {
	out.WriteString(strconv.FormatFloat(x, 'f', -1, 64))
}

func putfln(x float64) {
	putf(x)
	line()
}

func putfa(a []float64) {
	for _, v := range a {
		putf(v)
		space()
	}
	line()
}

type IntTp interface {
	int | int64
}

type Tp interface {
	IntTp | float64
}

func abs[T IntTp](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func fabs(x float64) float64 {
	return math.Abs(x)
}

func max1[T Tp](x T, y T) T {
	if x > y {
		return x
	}
	return y
}

func max[T Tp](xs ...T) T {
	r := xs[0]
	for _, x := range xs[1:] {
		r = max1(r, x)
	}
	return r
}

func maxa[T Tp](a []T) (i int, val T) {
	i, val = 0, a[0]
	for j := 1; j < len(a); j++ {
		if a[j] <= val {
			continue
		}
		i = j
		val = a[j]
	}
	return
}

func min1[T Tp](x T, y T) T {
	if x < y {
		return x
	}
	return y
}

func min[T Tp](xs ...T) T {
	r := xs[0]
	for _, x := range xs[1:] {
		r = min1(r, x)
	}
	return r
}

func mina[T Tp](a []T) (i int, val T) {
	i, val = 0, a[0]
	for j := 1; j < len(a); j++ {
		if a[j] >= val {
			continue
		}
		i = j
		val = a[j]
	}
	return
}

func L(i int) int64 {
	return int64(i)
}

func F(i int) float64 {
	return float64(i)
}

func ints(n int, val int) (a []int) {
	a = make([]int, n)
	if val == 0 {
		return
	}
	for i := range a {
		a[i] = val
	}
	return
}

func int64s(n int, val int64) (a []int64) {
	a = make([]int64, n)
	if val == 0 {
		return
	}
	for i := range a {
		a[i] = val
	}
	return
}

func floats(n int, val float64) (a []float64) {
	a = make([]float64, n)
	if val == 0 {
		return
	}
	for i := range a {
		a[i] = val
	}
	return
}

const heapBase = 4

func children(i int) (int, int) {
	start := heapBase * i
	return start + 1, start + (1 + heapBase)
}

func parent(i int) int {
	return (i - 1) / heapBase
}

package main

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

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

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

func main() {
	scanner := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var niter int
	fmt.Fscan(scanner, &niter)
	for iiter := 0; iiter < niter; iiter++ {
		var n int
		var x int
		fmt.Fscan(scanner, &n, &x)
		res := 0
		vmin := 0
		vmax := 1000000001
		for i := 0; i < n; i++ {
			var elem int
			fmt.Fscan(scanner, &elem)
			nvmin := elem - x
			nvmax := elem + x
			potmin := max(vmin, nvmin)
			potmax := min(vmax, nvmax)
			if potmin <= potmax {
				vmin = potmin
				vmax = potmax
			} else {
				res++
				vmin = elem - x
				vmax = elem + x
			}
		}
		fmt.Fprintln(writer, res)
	}
}

package main

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

var rr = bufio.NewReader(os.Stdin)
var ww = bufio.NewWriter(os.Stdout)

func slove() {
	var n, x int
	fmt.Fscan(rr, &n, &x)
	nums := make([]int, n)
	for i:=0;i<len(nums);i++ {
		fmt.Fscan(rr, &nums[i])
	}
	ans := 0
	l, r := nums[0], nums[0]
	for i:=1;i<n;i++ {
		l = min(l, nums[i])
		r = max(r, nums[i])
		if r - l > 2 * x {
			ans++
			l, r = nums[i], nums[i]
		}
	}
	fmt.Fprintln(ww, ans)
}

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

func main() {
	defer ww.Flush()
	var n int
	fmt.Fscan(rr, &n)
	for i:=1;i<=n;i++ {
		slove()
	}
}

package main

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

const cf = true

func solve() {
	var n, x int
	fmt.Fscan(in, &n, &x)
	var num int
	mx, mn := -1, int(1e8)
	ans := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &num)
		mx = max(mx, num)
		mn = min(mn, num)
		if mx-mn > x*2 {
			ans++
			mx = num
			mn = num
		}
	}
	fmt.Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

import (
	"fmt"
)

func main() {
	var t, n, x, a, l, r int
	_, _ = fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		res := 0
		_, _ = fmt.Scanf("%d %d", &n, &x)
		for j := 0; j < n; j++ {
			_, _ = fmt.Scanf("%d", &a)
			if j == 0 {
				l = a
				r = a
			} else {
				if a >= l && a <= r {
					continue
				} else if a < l {
					if r-a <= x*2 {
						l = a
						continue
					} else {
						res++
						l = a
						r = a
					}
				} else if a > r {
					if a-l <= x*2 {
						r = a
						continue
					} else {
						res++
						l = a
						r = a
					}
				}
			}
		}
		fmt.Println(res)
	}
}

package main

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

func abs(n int64) int64 {
	if n < 0 {
		return n * -1
	}
	return n
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		var x int64
		fmt.Fscan(in, &n, &x)

		aa := make([]int64, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &aa[i])
		}

		l, r := aa[0]-x, aa[0]+x
		var tot int
		for i := 1; i < n; i++ {
			if abs(aa[i]-l) > x && abs(aa[i]-r) > x {
				l, r = aa[i]-x, aa[i]+x
				tot++
			}
			// fmt.Println(l, r)
		}
		fmt.Fprintln(out, tot)
	}
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	var t, n, i int
	fmt.Scan(&t)
	for t != 0 {
		fmt.Scan(&n)
		var x int
		var count int

		for i = 0; i < n; i++ {
			fmt.Scan(&x)
			if x == 1 {
				count++
			}
		}

		if count <= n/2 {
			fmt.Println(n - count)
			fmt.Println(strings.Repeat("0 ", n-count))
		} else {
			fmt.Println(count - count%2)
			fmt.Println(strings.Repeat("1 ", count-count%2))
		}
		t--
	}
}

// Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools

package main

import (
  "fmt"
)

func main() {
  var tests int
  _, _ = fmt.Scanf("%d\n", &tests)
  for ; tests > 0; tests-- {
    var n int
    _, _ = fmt.Scanf("%d\n", &n)
    a := make([]int, n)
    for i := 0; i < n; i++ {
      if i < n-1 {
        _, _ = fmt.Scanf("%d", &a[i])
      } else {
        _, _ = fmt.Scanf("%d\n", &a[i])
      }
    }

    res := make([]int, 0)
    for i := 0; i < n; i += 2 {
      if a[i]+a[i+1] == 0 {
        res = append(res, 0, 0)
      } else if a[i]+a[i+1] == 1 {
        res = append(res, 0)
      } else {
        res = append(res, 1, 1)
      }
    }
    fmt.Println(len(res))
    for i, d := range res {
      fmt.Printf("%d", d)
      if i < len(res)-1 {
        fmt.Print(" ")
      }
    }
    fmt.Println()
  }
}

package main

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

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

	var T, n, v int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		c := [2]int{}
		for ; n > 0; n-- {
			Fscan(in, &v)
			c[v]++
		}
		if c[0] >= c[1] {
			Fprintln(out, c[0])
			Fprintln(out, strings.Repeat("0 ", c[0]))
		} else {
			c[1] &^= 1
			Fprintln(out, c[1])
			Fprintln(out, strings.Repeat("1 ", c[1]))
		}
	}
}

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

package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

var err error

func next() (n string) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return ""
		}
	}
}

func nextInt() (n int) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return 0
		}
	}
}

func nextLong() (n int64) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return 0
		}
	}
}

func nextDouble() (n float64) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return 0
		}
	}
}

func Fill(a []int, v int) {
	for i := range a {
		a[i] = v
	}
}

func FillB(a []bool, v bool) {
	for i := range a {
		a[i] = v
	}
}

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 Abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func Gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return Gcd(b, a%b)
}

const mod = 1000000007

func Add(a, b int64) int64 {
	return (a + b) % mod
}

func Mult(a, b int64) int64 {
	return (a * b) % mod
}

func Sub(a, b int64) int64 {
	return (a - b + mod) % mod
}

func solve() {
	n := nextInt()

	a, b := 0, 0
	arr := make([]int, n)
	for i := range arr {
		arr[i] = nextInt()
		if arr[i] == 0 {
			a++
		} else {
			b++
		}
	}

	if a >= b {
		printf("%d\n", a)
		for i := 0; i < a; i++ {
			printf("0 ")
		}
	} else {
		if b%2 == 1 {
			b--
		}
		printf("%d\n", b)
		for i := 0; i < b; i++ {
			printf("1 ")
		}
	}
	printf("\n")
}

func main() {
	in = bufio.NewReaderSize(os.Stdin, 8192)
	out = bufio.NewWriterSize(os.Stdout, 8192)
	if false {
		name := "foreign"
		file1, err := os.Open(name + ".in")
		if err != nil {
			log.Fatal(err)
		}
		file2, err := os.Create(name + ".out")
		if err != nil {
			log.Fatal(err)
		}
		in = bufio.NewReaderSize(file1, 8192)
		out = bufio.NewWriterSize(file2, 8192)
	}
	defer out.Flush()
	// start := time.Now()

	for t, i := nextInt(), 1; t > 0; t, i = t-1, i+1 {
		// 	printf("Case #%d:\n", i)
		solve()
	}

	// printf("%v\n", time.Now().Sub(start))
}

package main

import (
	"fmt"
)

func main()  {
	//fileInput, _ := os.Open("input.txt")
	//os.Stdin = fileInput

	//fileOutput, _ := os.Create("output.txt")
	//os.Stdout = fileOutput

	var n, t, k int
	a := make([]int, 1003)
	res := make([]int, 1003)
	fmt.Scan(&t)

	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		for j := 0; j < n ; j++ {
			fmt.Scan(&a[j])
		}
		k = 0
		if n == 2 {
			if a[0] == a[1] {
				k = 2
				res = a
			} else {
				k = 1
				res[0] = 0
			}
		}
		for j := 0; j < n - 2; {
			if a[j] != a[j+1] {
				if a[j] == a[j+2] {
					res[k] = a[j]
					res[k+1] = a[j+2]
					k += 2
					j += 3
				} else {
					res[k] = a[j+1]
					res[k+1] = a[j+2]
					k += 2
					j += 3
				}
			} else {
				res[k] = a[j]
				res[k+1] = a[j+1]
				k += 2
				j += 2
			}
		}
		fmt.Println(k)
		for j := 0; j < k; j++ {
			fmt.Printf("%d ", res[j])
		}
		fmt.Println("")
	}
}

package main

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

func main() {
	io := NewFastIO(os.Stdin, os.Stdout)
	defer io.Flush()

	for t := io.NextInt(); t > 0; t-- {
		n := io.NextInt()
		a := io.NextInts(n)
		var o, z []int
		for _, x := range a {
			if x == 0 {
				z = append(z, x)
			} else {
				o = append(o, x)
			}
		}
		ans := z
		if len(o) > len(z) {
			ans = o
			if len(ans)%2 == 1 {
				ans = ans[:len(ans)-1]
			}
		}
		io.Println(len(ans))
		io.PrintlnInts(ans...)
	}
}

type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}

func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}

func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		zeroCount := 0
		oneCount := 0
		a := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a[j])
			if a[j] == 1 {
				oneCount++
			} else {
				zeroCount++
			}
		}
		if oneCount <= zeroCount {
			fmt.Println(zeroCount)
			for j := 0; j < n; j++ {
				if a[j] == 0 {
					fmt.Print(a[j], " ")
				}
			}
		} else {
			ignoreFirst := false
			if oneCount%2 != 0 {
				oneCount--
				ignoreFirst = true
			}
			fmt.Println(oneCount)
			for j := 0; j < n; j++ {
				if a[j] == 1 {
					if ignoreFirst {
						ignoreFirst = false
						continue
					}
					fmt.Print(a[j], " ")
				}
			}
		}
		fmt.Println()
	}
}

package main

import (
	"fmt"
)

func main()  {
	//fileInput, _ := os.Open("input.txt")
	//os.Stdin = fileInput

	//fileOutput, _ := os.Create("output.txt")
	//os.Stdout = fileOutput

	var n, t, k int
	a := make([]int, 1003)
	res := make([]int, 1003)
	fmt.Scan(&t)

	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		for j := 0; j < n ; j++ {
			fmt.Scan(&a[j])
		}
		k = 0
		if n == 2 {
			if a[0] == a[1] {
				k = 2
				res = a
			} else {
				k = 1
				res[0] = 0
			}
		}
		for j := 0; j < n - 2; {
			if a[j] != a[j+1] {
				if a[j] == a[j+2] {
					res[k] = a[j]
					res[k+1] = a[j+1]
					k += 2
					j += 3
				} else {
					res[k] = a[j+1]
					res[k+1] = a[j+2]
					k += 2
					j += 3
				}
			} else {
				res[k] = a[j]
				res[k+1] = a[j+1]
				k += 2
				j += 2
			}
		}
		fmt.Println(k)
		for j := 0; j < k; j++ {
			fmt.Printf("%d ", res[j])
		}
		fmt.Println("")
	}
}

package main

import (
	"fmt"
)

func main()  {
	//fileInput, _ := os.Open("input.txt")
	//os.Stdin = fileInput

	//fileOutput, _ := os.Create("output.txt")
	//os.Stdout = fileOutput

	var n, t, k int
	a := make([]int, 1003)
	res := make([]int, 1003)
	fmt.Scanf("%d", &t)

	for i := 0; i < t; i++ {
		fmt.Scanf("%d", &n)
		for j := 0; j < n ; j++ {
			fmt.Scanf("%d", &a[j])
		}
		k = 0
		if n == 2 {
			if a[0] == a[1] {
				k = 2
				res = a
			} else {
				k = 1
				res[0] = 0
			}
		}
		for j := 0; j < n - 2; {
			if a[j] != a[j+1] {
				if a[j] == a[j+2] {
					res[k] = a[j]
					res[k+1] = a[j+1]
					k += 2
					j += 3
				} else {
					res[k] = a[j+1]
					res[k+1] = a[j+2]
					k += 2
					j += 3
				}
			} else {
				res[k] = a[j]
				res[k+1] = a[j+1]
				k += 2
				j += 2
			}
		}
		fmt.Println(k)
		for j := 0; j < k; j++ {
			fmt.Printf("%d ", res[j])
		}
		fmt.Println("")
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		zeroCount := 0
		oneCount := 0
		a := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a[j])
			if a[j] == 1 {
				oneCount++
			} else {
				zeroCount++
			}
		}
		if oneCount <= zeroCount {
			fmt.Println(zeroCount)
			for j := 0; j < n; j++ {
				if a[j] == 0 {
					fmt.Print(a[j], " ")
				}
			}
		} else {
			fmt.Println(oneCount)
			for j := 0; j < n; j++ {
				if a[j] == 1 {
					fmt.Print(a[j], " ")
				}
			}
		}
		fmt.Println()
	}
}

// Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools

package main

import (
  "fmt"
)

func main() {
  var tests int
  _, _ = fmt.Scanf("%d\n", &tests)
  for ; tests > 0; tests-- {
    var n int
    _, _ = fmt.Scanf("%d\n", &n)
    a := make([]int, n)
    for i := 0; i < n; i++ {
      _, _ = fmt.Scanf("%d", &a[i])
    }

    res := make([]int, 0)
    for i := 0; i < n; i += 2 {
      if a[i]+a[i+1] == 0 {
        res = append(res, 0, 0)
      } else if a[i]+a[i+1] == 1 {
        res = append(res, 0)
      } else {
        res = append(res, 1, 1)
      }
    }
    fmt.Println(len(res))
    for i, d := range res {
      fmt.Printf("%d", d)
      if i < len(res)-1 {
        fmt.Print(" ")
      }
    }
    fmt.Println()
  }
}

// Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools

package main

import (
  "fmt"
)

func main() {
  var tests int
  _, _ = fmt.Scanf("%d\n", &tests)
  for ; tests > 0; tests-- {
    var n int
    _, _ = fmt.Scanf("%d\n", &n)
    a := make([]int, n)
    for i := 0; i < n; i++ {
      _, _ = fmt.Scan(&a[i])
    }

    res := make([]int, 0)
    for i := 0; i < n; i += 2 {
      if a[i]+a[i+1] == 0 {
        res = append(res, 0, 0)
      } else if a[i]+a[i+1] == 1 {
        res = append(res, 0)
      } else {
        res = append(res, 1, 1)
      }
    }
    fmt.Println(len(res))
    for i, d := range res {
      fmt.Printf("%d", d)
      if i < len(res)-1 {
        fmt.Print(" ")
      }
    }
    fmt.Println()
  }
}

// Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools

package main

import (
  "fmt"
)

func main() {
  var tests int
  _, _ = fmt.Scanf("%d\n", &tests)
  for ; tests > 0; tests-- {
    var n int
    _, _ = fmt.Scanf("%d", &n)
    a := make([]int, n)
    for i := 0; i < n; i++ {
      _, _ = fmt.Scanf("%d", &a[i])
    }

    res := make([]int, 0)
    for i := 0; i < n; i += 2 {
      if a[i]+a[i+1] == 0 {
        res = append(res, 0, 0)
      } else if a[i]+a[i+1] == 1 {
        res = append(res, 0)
      } else {
        res = append(res, 1, 1)
      }
    }
    fmt.Println(len(res))
    for i, d := range res {
      fmt.Printf("%d", d)
      if i < len(res)-1 {
        fmt.Print(" ")
      }
    }
    fmt.Println()
  }
}

// Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools

package main

import (
  "fmt"
)

func main() {
  var tests int
  _, _ = fmt.Scanf("%d", &tests)
  for ; tests > 0; tests-- {
    var n int
    _, _ = fmt.Scanf("%d", &n)
    a := make([]int, n)
    for i := 0; i < n; i++ {
      _, _ = fmt.Scanf("%d", &a[i])
    }

    res := make([]int, 0)
    for i := 0; i < n; i += 2 {
      if a[i]+a[i+1] == 0 {
        res = append(res, 0, 0)
      } else if a[i]+a[i+1] == 1 {
        res = append(res, 0)
      } else {
        res = append(res, 1, 1)
      }
    }
    fmt.Println(len(res))
    for i, d := range res {
      fmt.Printf("%d", d)
      if i < len(res)-1 {
        fmt.Print(" ")
      }
    }
    fmt.Println()
  }
}

package main

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

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

	var T, n int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		for {
			s := 0
			for i, v := range a {
				if i&1 == 0 {
					s += v
				} else {
					s -= v
				}
			}
			if s == 0 {
				break
			}
			if s > 0 {
				for i := 0; i < n; i += 2 {
					if a[i] > 0 {
						a = append(a[:i], a[i+1:]...)
						break
					}
				}
			} else {
				for i := 1; i < n; i += 2 {
					if a[i] > 0 {
						a = append(a[:i], a[i+1:]...)
						break
					}
				}
			}
		}
		Fprintln(out, len(a))
		for _, v := range a {
			Fprint(out, v, " ")
		}
		Fprintln(out)
	}
}

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

package main

import (
	"fmt"
	"strings"
)

func main() {
	var t, n, i int
	fmt.Scan(&t)
	for t != 0 {
		fmt.Scan(&n)
		var x int
		var count int

		for i = 0; i < n; i++ {
			fmt.Scan(&x)
			if x == 1 {
				count++
			}
		}
		fmt.Println(n / 2)
		if count > n/2 {
			fmt.Println(strings.Repeat("1 ", n/2))
		} else {
			fmt.Println(strings.Repeat("0 ", n/2))
		}
		t--
	}
}


//Codeforces Round #633 (Div. 2)
//https://codeforces.com/contest/1339/problem/C

package main

import (
	"bufio"
	"fmt"
	"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 db bool = true
var db bool = false

const maxn int = 1e5

var t, n int
var a [maxn]int64
var pre, ans, p2, p2sum int64

func main() {
	defer writer.Flush()

	scanf("%d\n", &t)
	for tc := 1; tc <= t; tc++ {
		scanf("%d\n", &n)
		for i := 0; i < n; i++ {
		    scanf("%d", &a[i])
		    if i != n-1 {
		        scanf(" ")
		    } else {
		        scanf("\n")
		    }
		    //printf("%d ", a[i])
	    }
	    //printf("\n")
	    pre = a[0]
	    ans = 0
	    p2 = 0
	    p2sum = 0
	    for i := 1; i < n; i++ {
	        if db {
	            printf("a[%d] = %d,%d, pre = %v, p2sum = %v\n", i, a[i], a[i]+p2sum, pre, p2sum)
	        }
	        if a[i] >= pre {
	            pre = a[i]
	            continue
	        }
	        if a[i] + p2sum >= pre {
	            a[i] = pre
	            continue
	        }
	        a[i] += p2sum
		    if a[i] < pre {
		        for a[i] < pre {
		            if db {
	                    printf("    a[%d] = %d\n", i, a[i])
	                }
		            ans++
		            if p2 == 0 {
		                p2 = 1
		            } else {
		                p2 *= 2
		            }
		            a[i] += p2
		            if a[i] > pre {
		                a[i] = pre
		            }
		            p2sum += p2
		            if db {
	                    printf("    p2 = %v, p2sum = %v,                  ans = %v\n", p2, p2sum, ans)
	                }
		        }
		    }
		    if db {
	            printf("        fa[%d] = %d\n", i, a[i])
	        }
		    pre = a[i]
	    }
	    printf("%v\n", ans)
	}
}

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 := reader.NextInt64()
		curr := reader.NextInt64()
		secsNeeded := int64(0)
		for ; n > 1; n-- {
			next := reader.NextInt64()
			if next >= curr {
				curr = next
				continue
			}
			delta := curr - next
			tmpSecsNeeded := int64(1)
			tmpSecsValue := int64(1)
			for tmpSecsValue < delta {
				tmpSecsNeeded++
				tmpSecsValue = ((tmpSecsValue + 1) << 1) - 1
			}
			secsNeeded = max(secsNeeded, tmpSecsNeeded)
			// curr does not change
		}
		writer.Printf("%d\n", secsNeeded)
	}
}

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

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	bf := make([]byte, 1024*1024)
	sc.Buffer(bf, 10*1024*1024)
	sc.Split(bufio.ScanWords)

	in := func() int64 {
		sc.Scan()
		i, _ := strconv.ParseInt(sc.Text(), 0, 64)
		return i
	}

	for t := in(); t > 0; t-- {
		n := in()
		a := make([]int64, n)

		for i := range a {
			a[i] = in()
		}

		max := a[0]

		for i := range a {
			if max < a[i] {
				max = a[i]
			}

			a[i] = max - a[i]
		}

		max = a[0]

		for i := range a {
			if max < a[i] {
				max = a[i]
			}
		}

		cnt := 0

		for max != 0 {
			cnt++
			max /= 2
		}

		fmt.Println(cnt)
	}
}

/*
URL:
https://codeforces.com/problemset/problem/1338/A
*/

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() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int

	n int
	A []int64
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n = ReadInt()
		A = ReadInt64Slice(n)

		solve()
	}
}

func solve() {
	md := int64(0)

	cur := A[0]
	for i := 1; i < n; i++ {
		if !ChMax(&cur, A[i]) {
			ChMax(&md, AbsInt(cur-A[i]))
		}
	}

	ans := -1
	for i := 0; i < 60; i++ {
		if NthBit(md, i) == 1 {
			ans = i
		}
	}
	fmt.Println(ans + 1)
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num int64, nth int) int64 {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num int64, nth int) int64 {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num int64, nth int) int64 {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int64) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

// AbsInt is integer version of math.Abs
func AbsInt(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int64, target int64) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

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

/*********** 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"
    "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 := reader.NextInt64()
        curr := reader.NextInt64()
        secsNeeded := int64(0)
        for ; n > 1; n-- {
            next := reader.NextInt64()
            if next >= curr {
                curr = next
                continue
            }
            delta := curr - next
            tmpSecsNeeded := int64(1)
            tmpSecsValue := int64(1)
            for tmpSecsValue < delta {
                tmpSecsNeeded++
                tmpSecsValue <<= 1
            }
            secsNeeded = max(secsNeeded, tmpSecsNeeded)
            // curr does not change
        }
        writer.Printf("%d\n", secsNeeded)
    }
}

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

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 := reader.NextInt64()
        curr := reader.NextInt64()
        secsNeeded := int64(0)
        for ; n > 1; n-- {
            next := reader.NextInt64()
            if next >= curr {
                curr = next
                continue
            }
            delta := curr - next
            tmpSecsNeeded := int64(1)
            tmpSecsValue := int64(1)
            for tmpSecsValue < delta {
                tmpSecsNeeded++
                tmpSecsValue <<= 1
            }
            secsNeeded = max(secsNeeded, tmpSecsNeeded)
            curr = next + tmpSecsValue
        }
        writer.Printf("%d\n", secsNeeded)
    }
}

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

//Codeforces Round #633 (Div. 2)
//https://codeforces.com/contest/1339/problem/C

package main

import (
	"bufio"
	"fmt"
	"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 db bool = true
var db bool = false

const maxn int = 1e5

var t, n int
var a [maxn]int64
var pre, ans, p2, p2sum int64

func main() {
	defer writer.Flush()

	scanf("%d\n", &t)
	for tc := 1; tc <= t; tc++ {
		scanf("%d\n", &n)
		for i := 0; i < n; i++ {
		    scanf("%d", &a[i])
		    if i != n-1 {
		        scanf(" ")
		    } else {
		        scanf("\n")
		    }
		    //printf("%d ", a[i])
	    }
	    //printf("\n")
	    pre = a[0]
	    ans = 0
	    p2 = 0
	    p2sum = 0
	    for i := 1; i < n; i++ {
		    a[i] += p2sum
		    if a[i] < pre {
		        for a[i] < pre {
		            ans++
		            if p2 == 0 {
		                p2 = 1
		            } else {
		                p2 *= 2
		            }
		            a[i] += p2
		            p2sum += p2

		        }
		    }
		    pre = a[i]
	    }
	    printf("%v\n", ans)
	}
}

//Codeforces Round #633 (Div. 2)
//https://codeforces.com/contest/1339/problem/C

package main

import (
	"bufio"
	"fmt"
	"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 db bool = true
var db bool = false

const maxn int = 1e5

var t, n int
var a [maxn]int64
var pre, ans, p2, p2sum int64

func main() {
	defer writer.Flush()

	scanf("%d\n", &t)
	for tc := 1; tc <= t; tc++ {
		scanf("%d\n", &n)
		for i := 0; i < n; i++ {
		    scanf("%d", &a[i])
		    if i != n-1 {
		        scanf(" ")
		    } else {
		        scanf("\n")
		    }
		    //printf("%d ", a[i])
	    }
	    //printf("\n")
	    pre = a[0]
	    ans = 0
	    p2 = 0
	    p2sum = 0
	    for i := 1; i < n; i++ {
	        if db {
	            printf("a[%d] = %d,%d, pre = %v, p2sum = %v\n", i, a[i], a[i]+p2sum, pre, p2sum)
	        }
	        if a[i] >= pre {
	            pre = a[i]
	            continue
	        }
	        if a[i] + p2sum >= pre {
	            a[i] = pre
	            continue
	        }
	        a[i] += p2sum
		    if a[i] < pre {
		        for a[i] < pre {
		            if db {
	                    printf("    a[%d] = %d\n", i, a[i])
	                }
		            ans++
		            if p2 == 0 {
		                p2 = 1
		            } else {
		                p2 *= 2
		            }
		            a[i] += p2
		            p2sum += p2
		            if db {
	                    printf("    p2 = %v, p2sum = %v,                  ans = %v\n", p2, p2sum, ans)
	                }
		        }
		    }
		    if db {
	            printf("        fa[%d] = %d\n", i, a[i])
	        }
		    pre = a[i]
	    }
	    printf("%v\n", ans)
	}
}


package main

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

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

	n, p := readTwoNums(reader)
	A := readNNums(reader, n)
	res := solve(n, p, A)
	fmt.Println(len(res))
	for i := 0; i < len(res); i++ {
		fmt.Printf("%d ", res[i])
	}
}

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
}

const MAX_N = 262144

var BK [MAX_N]int

func solve(n int, p int, A []int) []int {
	var bas = A[0]

	for i := 1; i < n; i++ {
		bas = max(bas, A[i])
	}

	for i := 0; i < MAX_N; i++ {
		BK[i] = 0
	}

	for i := 0; i < n; i++ {
		BK[max(0, A[i]-bas+n)]++
	}

	for i := 1; i < MAX_N; i++ {
		BK[i] += BK[i-1]
	}

	var st = 1
	for i := 1; i <= n; i++ {
		for BK[st+i-1] < i {
			st++
		}
	}

	st += bas - n

	fi := n

	for i := 1; i <= n; i++ {
		for fi > 0 {
			if BK[fi+(i-1)]-(i-1) < p {
				break
			}
			fi--
		}
	}

	fi += bas - n

	if fi < st {
		return nil
	}

	res := make([]int, 0, fi-st+1)

	for i := st; i <= fi; i++ {
		res = append(res, i)
	}

	return res
}

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

package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

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

type node struct {
	l, r, mid, tot int
	left, right    *node
}

func (v *node) off(le, ri int) {
	if (le <= v.l && ri >= v.r) || v.tot == 0 {
		v.tot = 0
		return
	}

	if v.left == nil {
		v.left = &node{v.l, v.mid, (v.l + v.mid) >> 1, v.mid - v.l, nil, nil}
	}
	if v.right == nil {
		v.right = &node{v.mid, v.r, (v.mid + v.r) >> 1, v.r - v.mid, nil, nil}
	}

	if le < v.mid {
		v.left.off(le, ri)
	}
	if ri > v.mid {
		v.right.off(le, ri)
	}

	v.tot = v.left.tot + v.right.tot
}

const maxLog = 30

var res = []int{}

func (v *node) find() {
	if v == nil {
		return
	}
	if v.tot == 0 {
		return
	}
	if v.l == v.r-1 {
		res = append(res, v.l)
		return
	}

	if v.left == nil {
		v.left = &node{v.l, v.mid, (v.l + v.mid) >> 1, v.mid - v.l, nil, nil}
	}
	if v.right == nil {
		v.right = &node{v.mid, v.r, (v.mid + v.r) >> 1, v.r - v.mid, nil, nil}
	}

	v.left.find()
	v.right.find()
}

func main() {
	out = bufio.NewWriterSize(os.Stdout, 8192)
	defer out.Flush()
	if false {
		file, err := os.Open("in.txt")
		if err != nil {
			log.Fatal(err)
		}
		in = bufio.NewReaderSize(file, 8192)
	} else {
		in = bufio.NewReaderSize(os.Stdin, 8192)
	}

	var n, p int
	scanf("%d %d\n", &n, &p)

	arr := make([]int, n)
	for i := range arr {
		scanf("%d", &arr[i])
	}

	sort.Slice(arr, func(i, j int) bool {
		return arr[i] < arr[j]
	})

	tree := &node{0, 1 << maxLog, 1 << (maxLog - 1), 1 << maxLog, nil, nil}
	tree.off(arr[n-1]-(n-p), 1<<30)

	for i, v := range arr {
		tree.off(0, v-i)
	}

	for i := p; i < n; i++ {
		tree.off(arr[i-1]-(i-p), arr[i]-(i-p))
	}

	tree.find()
	printf("%d\n", len(res))
	for _, v := range res {
		printf("%d ", v)
	}
	printf("\n")
}

package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

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

type node struct {
	l, r, mid, tot int
	left, right    *node
}

func (v *node) off(le, ri int) {
	if (le <= v.l && ri >= v.r) || v.tot == 0 {
		v.tot = 0
		return
	}

	if v.left == nil {
		v.left = &node{v.l, v.mid, (v.l + v.mid) >> 1, v.mid - v.l, nil, nil}
	}
	if v.right == nil {
		v.right = &node{v.mid, v.r, (v.mid + v.r) >> 1, v.r - v.mid, nil, nil}
	}

	if le < v.mid {
		v.left.off(le, ri)
	}
	if ri > v.mid {
		v.right.off(le, ri)
	}

	v.tot = v.left.tot + v.right.tot
}

var res = []int{}

func (v *node) find() {
	if v == nil {
		return
	}
	if v.tot == 0 {
		return
	}
	if v.l == v.r-1 {
		res = append(res, v.l)
		return
	}

	v.left.find()
	v.right.find()
}

func main() {
	out = bufio.NewWriterSize(os.Stdout, 8192)
	defer out.Flush()
	if false {
		file, err := os.Open("in.txt")
		if err != nil {
			log.Fatal(err)
		}
		in = bufio.NewReaderSize(file, 8192)
	} else {
		in = bufio.NewReaderSize(os.Stdin, 8192)
	}

	var n, p int
	scanf("%d %d\n", &n, &p)

	arr := make([]int, n)
	for i := range arr {
		scanf("%d", &arr[i])
	}

	sort.Slice(arr, func(i, j int) bool {
		return arr[i] < arr[j]
	})

	tree := &node{0, 1 << 30, 1 << 29, 1 << 30, nil, nil}
	tree.off(arr[n-1]-(n-p), 1<<30)

	for i, v := range arr {
		tree.off(0, v-i)
	}

	for i := p; i < n; i++ {
		tree.off(arr[i-1]-(i-p), arr[i]-(i-p))
	}

	tree.find()
	printf("%d\n", len(res))
	for _, v := range res {
		printf("%d ", v)
	}
	printf("\n")
}