You are given a integer $$$n$$$ ($$$n > 0$$$). Find any integer $$$s$$$ which satisfies these conditions, or report that there are no such numbers:In the decimal representation of $$$s$$$:   $$$s > 0$$$,  $$$s$$$ consists of $$$n$$$ digits,  no digit in $$$s$$$ equals $$$0$$$,  $$$s$$$ is not divisible by any of it's digits.

The input consists of multiple test cases. The first line of the input contains a single integer $$$t$$$ ($$$1 \leq t \leq 400$$$), the number of test cases. The next $$$t$$$ lines each describe a test case. Each test case contains one positive integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$). It is guaranteed that the sum of $$$n$$$ for all test cases does not exceed $$$10^5$$$.

For each test case, print an integer $$$s$$$ which satisfies the conditions described above, or "-1" (without quotes), if no such number exists. If there are multiple possible solutions for $$$s$$$, print any solution.

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	nn := 0
	fmt.Fscanf(in, "%d\n", &nn)
	for ii := 0; ii < nn; ii++ {
		n := 0
		fmt.Fscanf(in, "%d\n", &n)
		if n == 1 {
			fmt.Fprintf(out, "%d\n", -1)
		} else {
			ans := make([]byte, n)
			ans[n-1] = '3'
			for i := 1; i < n-1; i++ {
				ans[i] = '2'
			}
			if (n-1)%3 == 0 {
				ans[0] = '3'
			} else {
				ans[0] = '2'
			}
			fmt.Fprintf(out, "%s\n", string(ans))
		}
	}
	return
}

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

package main

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

var reader io.Reader
var scanner *bufio.Scanner

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

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

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

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

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

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

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

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

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

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

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

func mod(a, b, n, m int) int {
	r := 0
	for i := 0; i < n; i++ {
		r = (r*10 + a) % m
	}
	r = (((r + b - a) % m) + m) % m
	return r
}

func good(a, b, n int) bool {
	if a == b {
		return false
	}
	if mod(a, b, n, a) == 0 {
		return false
	}
	if mod(a, b, n, b) == 0 {
		return false
	}
	return true
}

func res(out io.Writer, a, b, n int) {
	for i := 0; i < n-1; i++ {
		fmt.Fprint(out, a)
	}
	fmt.Fprintln(out, b)
}

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

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

		if n == 1 {
			fmt.Fprintln(out, -1)
			continue
		}

		ok := false
		for a := 2; !ok && a <= 9; a++ {
			for b := 2; !ok && b <= 9; b++ {
				if good(a, b, n) {
					res(out, a, b, n)
					ok = true
				}
			}
		}

		if !ok {
			fmt.Fprintln(out, -1)
		}
	}

}

package main

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

func main(){

	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	out.Flush()
	var t,n int

	fmt.Fscanf(in,"%d\n",&t)

	for T := 0 ; T < t ; T ++ {
		fmt.Fscanf(in,"%d\n",&n)

		//fmt.Println("n = ",n )

		if  n == 1 {
			//fmt.Fprintf(out , "-1\n")
			fmt.Println("-1")
		} else{
			var output string = ""
			output += "2"

			for i := 0 ; i + 1 < n ; i ++ {
				output += "3"
			}
			//fmt.Fprintf(out,"%s\n",output)
			fmt.Println(output)
		}

	}

}

package main

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

const (
	maxn = int(1e5 + 50)
	mod  = int(1e9 + 7)
	eps  = 1e-8
	inf  = int(0x3f3f3f3f)
)

func main() {
	var T int
	scanInt(&T)
	for kase := 1; kase <= T; kase++ {
		n := 0
		scanInt(&n)
		if n == 1 {
			printString("-1")
		} else {
			putchar('2')
			for i := 1; i < n; i++ {
				putchar('3')
			}
			putchar('\n')
		}
	}
	close(channelType)
	oWg.Wait()
	out.Flush()
}

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

var channelType chan string
var in *bufio.Scanner
var out = bufio.NewWriter(os.Stdout)
var oWg *sync.WaitGroup

// string and slice are the return value
func init() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
	channelType = make(chan string, 16)
	oWg = &sync.WaitGroup{}
	oWg.Add(1)
	writer := bufio.NewWriter(os.Stdout)
	go func() {
		defer oWg.Done()
		defer writer.Flush()

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

func scanString() string { in.Scan(); return in.Text() }
func scanInt(a *int)     { *a, _ = strconv.Atoi(scanString()) }
func scanInts(a ...*int) {
	for i := range a {
		*a[i], _ = strconv.Atoi(scanString())
	}
}
func scanInt64(a *int64) { *a, _ = strconv.ParseInt(scanString(), 10, 64) }
func scanInt64s(a ...*int64) {
	for i := range a {
		*a[i], _ = strconv.ParseInt(scanString(), 10, 64)
	}
}
func scanStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = scanString()
	}
	return s
}
func scanIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		scanInt(&arr[i])
	}
	return arr
}
func scanInt64Slice(n int) []int64 {
	arr := make([]int64, n)
	for i := 0; i < n; i++ {
		scanInt64(&arr[i])
	}
	return arr
}
func printlnInts(args ...int) {
	for _, x := range args {
		fmt.Fprint(out, x, " ")
	}
	fmt.Fprintln(out)
}
func printlnInt64s(args ...int64) {
	for _, x := range args {
		fmt.Fprint(out, x, " ")
	}
	fmt.Fprintln(out)
}
func printIntSlice(a []int, flag bool) {
	for _, x := range a {
		fmt.Fprint(out, x, " ")
	}
	if flag { fmt.Fprintln(out) }
}
func printInt64Slice(a []int64, flag bool) {
	for _, x := range a {
		fmt.Fprint(out, x, " ")
	}
	if flag { fmt.Fprintln(out) }
}
func printRuneSlice(a []rune, flag bool) {
	for _, x := range a {
		fmt.Fprintf(out, "%c", x)
	}
	if flag { fmt.Fprintln(out) }
}
func putchar(a ...rune) {
	for _, x := range a {
		fmt.Fprintf(out, "%c", x)
	}
}
func printString(s string) { fmt.Fprintln(out, s) }

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

func stringEquivalent(v interface{}) string { return fmt.Sprintf("%v", v) }
func spaceSeperatedStringFromArray(a []int) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.Itoa(a[i]) + " ")
	}
	return sb.String()
}
func spaceSeperatedStringFromArray64(a []int64) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
	}
	return sb.String()
}
func minMaxFromArray(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func minElementFromArray(args ...int64) int64 { mn, _ := minMaxFromArray(args...); return mn }
func maxElementFromArray(args ...int64) int64 { _, mx := minMaxFromArray(args...); return mx }
func lcmCalculation(a, b int64) int64         { return a / gcdCalculation(a, b) * b }
func gcdCalculation(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return gcdCalculation(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func absoluteValue(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}
func min(args ...int) int { mn, _ := minMaxFinder(args...); return mn }
func max(args ...int) int { _, mx := minMaxFinder(args...); return mx }
func minMaxFinder(args ...int) (int, int) {
	minVal, maxVal := int(math.MaxInt32), int(math.MinInt32)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func same(x, y double) bool { return math.Abs(float64(x-y)) < eps }
func popcount(x int) (res int) {
	for i := 0; i < 32; i++ {
		if 1 == (1 & (x >> uint(i))) {
			res++
		}
	}
	return
}
func qp(a, n int64) (res int64) {
	for ; n > 0; n >>= 1 {
		if (n & 1) == 1 {
			res = res * a % int64(mod)
		}
		a = a * a % int64(mod)
	}
	return
}
func divUp(a, b int64) int64 {
	if a % b == 0 { return a / b } else { return a / b + 1 }
}
// [l, r)
func reverse(a *[]rune, l, r int) {
	for i, j := l, r - 1; i < j; i, j = i + 1, j - 1 {
		(*a)[i], (*a)[j] = (*a)[j], (*a)[i]
	}
}

/*********************** Structs ***********************/
type pair struct{ X, Y int }
type double float64
type pairSlice []pair

func (p pairSlice) Len() int { return len(p) }
func (p pairSlice) Less(i, j int) bool {
	if p[i].X != p[j].X {
		return p[i].X < p[j].X
	} else {
		return p[i].Y < p[j].Y
	}
}
func (p pairSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1326A(_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)
		if n == 1 {
			Fprintln(out, -1)
		} else {
			Fprintln(out, "5"+strings.Repeat("3", n-1))
		}
	}
}

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

package main

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

func main() {
	for t := ScanInt(); t > 0; t-- {
		n := ScanInt()
		P(solve(n))
	}

	close(O)
	oWg.Wait()
}

func solve(n int) string {
	if n == 1 {
		return "-1"
	}
	s := strings.Repeat("3", n-1)
	return "2" + s
}

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

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

func init() {
	P = fmt.Println

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

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

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

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

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

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

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

package main

import "fmt"

const SZ int = 1e5

func main() {
	var str string = "2"
	for i:= 0; i < SZ; i++ {
		str += "3"
	}
	var (
		T int
		n int
	)
	//fmt.Scan(&T)
	fmt.Scanf("%d\n",&T)
	for i:= 0; i < T; i++ {
		//fmt.Scan(&n)
		fmt.Scanf("%d\n",&n)
		if n <= 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(str[:n])
		}
	}
}

package main

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

const SZ int = 1e5

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...) }

func main() {
	// var str string = "2"
	// for i:= 0; i < SZ; i++ {
	// 	str += "3"
	// }
	var ans []byte = make([]byte,SZ)
	ans[0] = '2'
	for i:= 1; i < SZ; i++ {
		ans[i] = '3'
	}
	var (
		T int
		n int
	)
	fmt.Scan(&T)
	//fmt.Scanf("%d\n",&T)
	//scanf("%d\n",&T)
	for i:= 0; i < T; i++ {
		fmt.Scan(&n)
		//fmt.Scanf("%d\n",&n)
		//scanf("%d\n",&n)
		if n <= 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(string(ans[:n]))
		}
	}
}

package main

import "fmt"

const SZ int = 1e5

func main() {
	var str string = "2"
	for i:= 0; i < SZ; i++ {
		str += "3"
	}
	var (
		T int
		n int
	)
	fmt.Scan(&T)
	for i:= 0; i < T; i++ {
		fmt.Scan(&n)
		if n <= 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(str[:n])
		}
	}
}

package main

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

const SZ int = 1e5

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...) }

func main() {
	var str string = "2"
	for i:= 0; i < SZ; i++ {
		str += "3"
	}
	var (
		T int
		n int
	)
	//fmt.Scan(&T)
	//fmt.Scanf("%d\n",&T)
	scanf("%d\n",&T)
	for i:= 0; i < T; i++ {
		//fmt.Scan(&n)
		//fmt.Scanf("%d\n",&n)
		scanf("%d\n",&n)
		if n <= 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(str[:n])
		}
	}
}

package main

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

const SZ int = 1e5

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...) }

func main() {
	// var str string = "2"
	// for i:= 0; i < SZ; i++ {
	// 	str += "3"
	// }
	var ans []byte = make([]byte,SZ)
	ans[0] = '2'
	for i:= 1; i < SZ; i++ {
		ans[i] = '3'
	}
	var (
		T int
		n int
	)
	//fmt.Scan(&T)
	//fmt.Scanf("%d\n",&T)
	scanf("%d\n",&T)
	for i:= 0; i < T; i++ {
		//fmt.Scan(&n)
		//fmt.Scanf("%d\n",&n)
		scanf("%d\n",&n)
		if n <= 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(string(ans[:n]))
		}
	}
}

package main

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

func solve(n uint64) string {
	if n == 1 {
		return "-1"
	}

	sum := 0
	r := make([]byte, n)
	for i := range r {
		d := 2
		for d < 9 && (sum+d)%9 == 0 {
			d *= 2
		}
		if d > 9 {
			return "-1"
		}
		sum += d
		r[i] = '0' + byte(d)
	}
	r[n-1] = '9'

	return string(r)
}

func main() {
	toInt := func(buf []byte) uint64 {
		var n uint64
		for _, v := range buf {
			n = n*10 + uint64(v-'0')
		}
		return n
	}

	var n uint64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := uint64(0); i < n; i++ {
		scanner.Scan()
		input := toInt(scanner.Bytes())
		fmt.Println(solve(input))
	}

}

package main

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

func main() {
	sc := NewScanner()

	N := sc.NextInt()
	for i := 0; i < N; i++ {
		A := sc.NextInt()

		s := strings.Builder{}
		if A == 1 {
			fmt.Println(-1)
			continue
		}
		if (A-1)%3 != 0 {
			for j := 0; j < A-1; j++ {
				s.WriteByte('2')
			}
			s.WriteByte('3')
		} else {
			for j := 0; j < A-2; j++ {
				s.WriteByte('2')
			}
			s.WriteByte('3')
			s.WriteByte('3')
		}
		fmt.Println(s.String())

	}
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

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

func ReadInt(line []byte) int {
	var ret = 0
	for i := range line {
		ret = ret * 10 + int(line[i] - '0')
	}
	return ret
}

func Reader() func() int {
	var input []byte
	var idx int
	scanner := bufio.NewReader(os.Stdin)
	return func() int {
		var ret, sign = 0, 1
		for flag := true; flag; {
			for ; idx < len(input); idx++ {
				if (input[idx] >= '0' && input[idx] <= '9') || input[idx] == '-' {
					if input[idx] == '-' {
						sign = -1
						idx += 1
					}
					flag = false
					break
				}
			}
			if !flag {
				break
			}

			var err error
			input, _, err = scanner.ReadLine()
			idx = 0
			if err == io.EOF {
				return -1
			}
		}
		for ; idx < len(input) && input[idx]>='0' && input[idx]<='9'; idx++ {
			ret = ret * 10 + int(input[idx] -'0');
		}
		return ret * sign
	}
}

func main() {
	reader := Reader()
	n := reader()

	for ; n > 0; n-- {
		a := reader()
		if a == 1 {
			fmt.Println(-1)
		} else {
			fmt.Print(5)
			for i := 0; i < a-1; i++ {
				fmt.Print(7)
			}
			fmt.Println()
		}
	}
}

package main

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

var (
	reader Reader = NewReader()
	writer Writer = NewWriter()
)

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

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

type readerImpl struct {
	*bufio.Scanner
}

func NewReader() Reader {
	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	return &readerImpl{Scanner: s}
}

func (i *readerImpl) NextInt() int {
	i.Scan()
	ret, _ := strconv.Atoi(i.Text())
	return ret
}

func (i *readerImpl) NextInt64() int64 {
	i.Scan()
	ret, _ := strconv.ParseInt(i.Text(), 10, 64)
	return ret
}

func (i *readerImpl) NextString() string {
	i.Scan()
	return i.Text()
}

type writerImpl struct {
	*bufio.Writer
}

func NewWriter() Writer {
	return &writerImpl{Writer: bufio.NewWriter(os.Stdout)}
}

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

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

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n := reader.NextInt64()
		writer.Printf("%s\n", sol(n))
	}
}

func sol(i int64) string {
	if i == 1 {
		return "-1"
	}
	return "2" + strings.Repeat("3", int(i-1))
}

package main

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

func main() {
	for t := ScanInt(); t > 0; t-- {
	    n := ScanInt()
	    P(solve(n))
	}

	close(O)
	oWg.Wait()
}

func solve(n int) string {
	if n == 1 {
		return "-1"
	}
	s := strings.Repeat("2", n-1)
	return s + "3"
}
/*********************** I/O ***********************/

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

func init() {
	P = fmt.Println

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

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

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

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

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

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

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

package main

import "fmt"

const SZ int = 1e5

func main() {
	var str string = "2"
	for i:= 0; i < SZ; i++ {
		str += "3"
	}
	var (
		T int
		n int
	)
	fmt.Scanf("%d",&T)
	for i:= 0; i < T; i++ {
		fmt.Scanf("%d", &n)
		if n <= 1 {
			fmt.Println(-1)
		} else {
			fmt.Println(str[:n])
		}
	}
}

package main

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

func solve(n uint64) string {
	if n == 1 {
		return "-1"
	}

	sum := 0
	r := make([]byte, n)
	for i := range r {
		d := 2
		for d < 9 && (sum+d)%9 == 0 {
			d += 2
		}
		if d > 9 {
			return "-1"
		}
		r[i] = '0' + byte(d)
	}
	r[n-1] = '9'

	return string(r)
}

func main() {
	toInt := func(buf []byte) uint64 {
		var n uint64
		for _, v := range buf {
			n = n*10 + uint64(v-'0')
		}
		return n
	}

	var n uint64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := uint64(0); i < n; i++ {
		scanner.Scan()
		input := toInt(scanner.Bytes())
		fmt.Println(solve(input))
	}

}

package main

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

func solve(n uint64) string {
	if n == 1 {
		return "-1"
	}

	r := make([]rune, n)
	for i := range r {
		r[i] = '2'
	}
	r[n-1] = '7'

	return string(r)
}

func main() {
	toInt := func(buf []byte) uint64 {
		var n uint64
		for _, v := range buf {
			n = n*10 + uint64(v-'0')
		}
		return n
	}

	var n uint64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := uint64(0); i < n; i++ {
		scanner.Scan()
		input := toInt(scanner.Bytes())
		fmt.Println(solve(input))
	}

}

package main

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

func solve(n uint64) string {
	if n == 1 {
		return "-1"
	}

	r := make([]rune, n)
	for i := range r {
		r[i] = '2'
	}
	r[n-1] = '9'

	return string(r)
}

func main() {
	toInt := func(buf []byte) uint64 {
		var n uint64
		for _, v := range buf {
			n = n*10 + uint64(v-'0')
		}
		return n
	}

	var n uint64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := uint64(0); i < n; i++ {
		scanner.Scan()
		input := toInt(scanner.Bytes())
		fmt.Println(solve(input))
	}

}

package main

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

func solve(n uint64) string {
	if n == 1 {
		return "-1"
	}

	r := make([]rune, n)
	for i := range r {
		r[i] = '3'
	}
	r[n-1] = '7'

	return string(r)
}

func main() {
	toInt := func(buf []byte) uint64 {
		var n uint64
		for _, v := range buf {
			n = n*10 + uint64(v-'0')
		}
		return n
	}

	var n uint64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := uint64(0); i < n; i++ {
		scanner.Scan()
		input := toInt(scanner.Bytes())
		fmt.Println(solve(input))
	}

}

package main

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

func solve(n uint64) string {
	if n == 1 {
		return "-1"
	}

	sum := 0
	r := make([]byte, n)
	for i := range r {
		d := 2
		for d < 9 && (sum+d)%9 == 0 {
			d *= 2
		}
		if d > 9 {
			return "-1"
		}
		r[i] = '0' + byte(d)
	}
	r[n-1] = '9'

	return string(r)
}

func main() {
	toInt := func(buf []byte) uint64 {
		var n uint64
		for _, v := range buf {
			n = n*10 + uint64(v-'0')
		}
		return n
	}

	var n uint64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := uint64(0); i < n; i++ {
		scanner.Scan()
		input := toInt(scanner.Bytes())
		fmt.Println(solve(input))
	}

}

package main

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

func main() {
	sc := NewScanner()

	N := sc.NextInt()
	for i := 0; i < N; i++ {
		A := sc.NextInt()

		s := strings.Builder{}
		if (A-1)%3 != 0 {
			for j := 0; j < A-1; j++ {
				s.WriteByte('2')
			}
			s.WriteByte('3')
		} else {
			for j := 0; j < A-2; j++ {
				s.WriteByte('2')
			}
			s.WriteByte('3')
			s.WriteByte('3')
		}
		fmt.Println(s.String())

	}
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Gildong has bought a famous painting software cfpaint. The working screen of cfpaint is square-shaped consisting of $$$n$$$ rows and $$$n$$$ columns of square cells. The rows are numbered from $$$1$$$ to $$$n$$$, from top to bottom, and the columns are numbered from $$$1$$$ to $$$n$$$, from left to right. The position of a cell at row $$$r$$$ and column $$$c$$$ is represented as $$$(r, c)$$$. There are only two colors for the cells in cfpaint — black and white.There is a tool named eraser in cfpaint. The eraser has an integer size $$$k$$$ ($$$1 \le k \le n$$$). To use the eraser, Gildong needs to click on a cell $$$(i, j)$$$ where $$$1 \le i, j \le n - k + 1$$$. When a cell $$$(i, j)$$$ is clicked, all of the cells $$$(i', j')$$$ where $$$i \le i' \le i + k - 1$$$ and $$$j \le j' \le j + k - 1$$$ become white. In other words, a square with side equal to $$$k$$$ cells and top left corner at $$$(i, j)$$$ is colored white.A white line is a row or a column without any black cells.Gildong has worked with cfpaint for some time, so some of the cells (possibly zero or all) are currently black. He wants to know the maximum number of white lines after using the eraser exactly once. Help Gildong find the answer to his question.

The first line contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2000$$$) — the number of rows and columns, and the size of the eraser. The next $$$n$$$ lines contain $$$n$$$ characters each without spaces. The $$$j$$$-th character in the $$$i$$$-th line represents the cell at $$$(i,j)$$$. Each character is given as either 'B' representing a black cell, or 'W' representing a white cell.

Print one integer: the maximum number of white lines after using the eraser exactly once.

NoteIn the first example, Gildong can click the cell $$$(2, 2)$$$, then the working screen becomes: BWWWWWWWWWWWWWWBThen there are four white lines — the $$$2$$$-nd and $$$3$$$-rd row, and the $$$2$$$-nd and $$$3$$$-rd column.In the second example, clicking the cell $$$(2, 3)$$$ makes the $$$2$$$-nd row a white line.In the third example, both the $$$2$$$-nd column and $$$5$$$-th row become white lines by clicking the cell $$$(3, 2)$$$.

package main

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

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Simple math functions

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

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

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

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

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

func abs64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

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

func gcd64(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return gcd64(b, a%b)
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()

	n := readi()
	k := readi()
	f := make([][]byte, n)
	gr := make([][]int, n)
	gc := make([][]int, n)
	var wrows, wcolumns int

	for i := range f {
		f[i] = readb()
		gr[i] = make([]int, n)
		gc[i] = make([]int, n)
	}

	for i := range f {
		var l, r int
		for l < n && f[i][l] == 'W' {
			l++
		}
		for r = len(f[i]) - 1; 0 <= r && f[i][r] == 'W'; {
			r--
		}
		if r < l {
			wrows++
			continue
		}
		for p, q := 0, k-1; q < n; p, q = p+1, q+1 {
			if p <= l && r <= q {
				gr[i][p] = 1
			}
		}
	}

	for j := range f[0] {
		var u, d int
		for u < n && f[u][j] == 'W' {
			u++
		}
		for d = len(f) - 1; 0 <= d && f[d][j] == 'W'; {
			d--
		}
		if d < u {
			wcolumns++
			continue
		}
		for p, q := 0, k-1; q < n; p, q = p+1, q+1 {
			if p <= u && d <= q {
				gc[p][j] = 1
			}
		}
	}

	sr := make([][]int, n)
	for i := range sr {
		sr[i] = make([]int, n+1)
	}
	for i := range gc {
		for j := range gc[i] {
			sr[i][j+1] = sr[i][j] + gc[i][j]
		}
	}

	sc := make([][]int, n+1)
	for i := range sc {
		sc[i] = make([]int, n)
	}
	for j := range gr[0] {
		for i := range gr {
			sc[i+1][j] = sc[i][j] + gr[i][j]
		}
	}

	sum := func(i, j int) int {
		sumr := sr[i][j+k] - sr[i][j]
		sumc := sc[i+k][j] - sc[i][j]
		return sumr + sumc
	}

	var ans int
	for i := 0; i+k-1 < n; i++ {
		for j := 0; j+k-1 < n; j++ {
			ans = max(ans, wrows+wcolumns+sum(i, j))
		}
	}

	println(ans)
}

package main
import "fmt"
import "os"
import "bufio"

var input *bufio.Reader

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

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

const N = 2005
var arr [N][N]int

func process(x1, x2, y1, y2 int) {
    x1++; y1++; x2++; y2++
    arr[x1][y1]++
    arr[x1][y2+1]--
    arr[x2+1][y1]--
    arr[x2+1][y2+1]++
}

func gao() {
    for i:=1; i<=2000; i++ {
        for j:=1; j<=2000; j++ {
            arr[i][j] += arr[i-1][j] + arr[i][j-1] - arr[i-1][j-1]
        }
    }
}

func main(){
    input = bufio.NewReader(os.Stdin)
    var n, k int
    fmt.Fscanf(input, "%d%d\n", &n, &k)
    var s [N]string

    ans := 0
    for i:=0; i<n; i++ {
        fmt.Fscanf(input, "%s\n", &s[i])
        l := n; r := -1
        for j:=0; j<n; j++ {
            if s[i][j]=='B' {
                l = min(l, j)
                r = max(r, j)
            }
        }
        if l==n {
            ans++
            continue
        }
        if r-l+1>k {
            continue
        }
        process(max(0, i-k+1), i, max(0, r+1-k), l)
    }

    for j:=0; j<n; j++ {
        u := n; d := -1
        for i:=0; i<n; i++ {
            if s[i][j]=='B' {
                u = min(u, i)
                d = max(d, i)
            }
        }
        if u==n {
            ans++
            continue
        }
        if d-u+1>k {
            continue
        }
        process(max(0, d-k+1), u, max(0, j-k+1), j)
    }

    gao()
    mx := 0
    for i:=1; i<=2000; i++ {
        for j:=1; j<=2000; j++ {
            mx=max(mx, arr[i][j])
        }
    }
    fmt.Println(ans+mx)
}


You are given sequence a1, a2, ..., an and m queries lj, rj (1 ≤ lj ≤ rj ≤ n). For each query you need to print the minimum distance between such pair of elements ax and ay (x ≠ y), that:  both indexes of the elements lie within range [lj, rj], that is, lj ≤ x, y ≤ rj;  the values of the elements are equal, that is ax = ay. The text above understands distance as |x - y|.

The first line of the input contains a pair of integers n, m (1 ≤ n, m ≤ 5·105) — the length of the sequence and the number of queries, correspondingly.  The second line contains the sequence of integers a1, a2, ..., an ( - 109 ≤ ai ≤ 109).  Next m lines contain the queries, one per line. Each query is given by a pair of numbers lj, rj (1 ≤ lj ≤ rj ≤ n) — the indexes of the query range limits.

Print m integers — the answers to each query. If there is no valid match for some query, please print -1 as an answer to this query.

// main
package main

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

var scanner *bufio.Scanner

func nextInt64() int64 {
    scanner.Scan()
    x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
    return x
}
func nextInt() int {
    return int(nextInt64())
}
func nextFloat() float64 {
    scanner.Scan()
    x, _ := strconv.ParseFloat(scanner.Text(), 64)
    return x
}
func nextString() string {
    scanner.Scan()
    return scanner.Text()
}

type Query struct {
    l, r, id int
}
type QueryArr []Query

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

var (
    n, m int
    T    []int
)

const Inf int = 1000000000

func min(a, b int) int {
    if a < b {
        return a
    } else {
        return b
    }
}
func makeTree() {
    T = make([]int, n)
    for i := 0; i < n; i++ {
        T[i] = Inf
    }
}
func add(i, val int) {
    for ; i < n; i = (i | (i + 1)) {
        T[i] = min(T[i], val)
    }
}
func get(r int) int {
    res := Inf
    for ; r >= 0; r = (r & (r + 1)) - 1 {
        res = min(res, T[r])
    }
    return res
}

func main() {
    scanner = bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)
    writer := bufio.NewWriter(os.Stdout)
    defer writer.Flush()

    n, m = nextInt(), nextInt()
    a := make([]int, n)
    for i := 0; i < n; i++ {
        a[i] = nextInt()
    }
    q := make([]Query, m)
    for i := 0; i < m; i++ {
        q[i] = Query{nextInt() - 1, nextInt() - 1, i}
    }
    sort.Sort(QueryArr(q))
    mp := make(map[int]int)
    pos := 0
    makeTree()
    res := make([]int, m)
    for i := 0; i < n; i++ {
        prev, ok := mp[a[i]]
        if ok {
            add(n-1-prev, i-prev)
        }
        mp[a[i]] = i
        for ; pos < m && q[pos].r == i; pos++ {
            res[q[pos].id] = get(n - 1 - q[pos].l)
        }
    }
    for _, v := range res {
        if v == Inf {
            v = -1
        }
        writer.WriteString(fmt.Sprintln(v))
    }
}


There is a field divided into $$$n$$$ rows and $$$m$$$ columns. Some cells are empty (denoted as E), other cells contain robots (denoted as R).You can send a command to all robots at the same time. The command can be of one of the four types:  move up;  move right;  move down;  move left. When you send a command, all robots at the same time attempt to take one step in the direction you picked. If a robot tries to move outside the field, it explodes; otherwise, every robot moves to an adjacent cell in the chosen direction.You can send as many commands as you want (possibly, zero), in any order. Your goal is to make at least one robot reach the upper left corner of the field. Can you do this without forcing any of the robots to explode?

The first line contains one integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of test cases. Each test case starts with a line containing two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 5$$$) — the number of rows and the number of columns, respectively. Then $$$n$$$ lines follow; each of them contains a string of $$$m$$$ characters. Each character is either E (empty cell} or R (robot). Additional constraint on the input: in each test case, there is at least one robot on the field.

If it is possible to make at least one robot reach the upper left corner of the field so that no robot explodes, print YES. Otherwise, print NO.

6

1 3

ERR

2 2

ER

RE

2 2

ER

ER

1 1

R

4 3

EEE

EEE

ERR

EER

3 3

EEE

EER

REE

NoteExplanations for test cases of the example:  in the first test case, it is enough to send a command to move left.  in the second test case, if you try to send any command, at least one robot explodes.  in the third test case, it is enough to send a command to move left.  in the fourth test case, there is already a robot in the upper left corner.  in the fifth test case, the sequence "move up, move left, move up" leads one robot to the upper left corner;  in the sixth test case, if you try to move any robot to the upper left corner, at least one other robot explodes.

package main

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

func main() {
	var (
		t int
	)

	reader := bufio.NewReader(os.Stdin)
	fmt.Scanf("%d\n", &t)

	for t > 0 {
		t--

		text, _ := reader.ReadString('\n')
		ninps := strings.Fields(text)
		n, _ := strconv.Atoi(ninps[0])
		m, _ := strconv.Atoi(ninps[1])

		il := -1
		jl := -1

		failed := false
		for i := 0; i < n; i++ {
			s, _ := reader.ReadString('\n')
			if s[len(s)-1] == 10 {
				s = s[:len(s)-1]
			}
			if s[len(s)-1] == 13 {
				s = s[:len(s)-1]
			}

			for j := 0; j < m; j++ {
				if il > -1 && j < jl {
					if string(s[j]) == "R" {
						failed = true
					}
				}
				if string(s[j]) == "R" && il == -1 {
					il = i
					jl = j
				}
			}
		}

		//fmt.Println("M: p1: ", il, jl, " p2:", id, jd)
		if failed == false {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func acc(op func(int64, int64) int64, c ...int64) int64 {
	res := c[0]
	for _, i := range c {
		res = op(res, i)
	}
	return res
}

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

func min(c ...int64) int64 {
	return acc(func(a int64, b int64) int64 {
		if a > b {
			return b
		}
		return a
	}, c...)
}

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

func solve(inout io.ReadWriter) {
	scan := func(inp ...interface{}) {
		fmt.Fscan(inout, inp...)
	}
	printf := func(format string, outp ...interface{}) {
		fmt.Fprintf(inout, format, outp...)
	}

	var n, m int
	scan(&n, &m)
	s := make([]string, n)

	r, c := n, m

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

		scan(&s[i])
		for j := 0; j < m; j++ {
			if s[i][j] == 'R' {
				if i < r {
					r = i
				}
				if j < c {
					c = j
				}
			}
		}
	}

	if r == n || s[r][c] != 'R' {
		printf("NO\n")
	} else {
		printf("YES\n")
	}

}

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

	var T int = 1
	fmt.Fscan(inout, &T)
	for ; T > 0; T-- {
		solve(inout)
	}
}

package main

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

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

func (in *CF1680B) 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 *CF1680B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

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

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

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

/**
Run solve the problem CF1680B
Date: 8/8/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1680/B
Problem: CF1680B
**/
func (in *CF1680B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n, m := in.NextInt(), in.NextInt()

		pos := make([][]int, 0)

		for i := 0; i < n; i++ {
			data := in.GetLine()
			for j := 0; j < m; j++ {
				if data[j] == 'R' {
					pos = append(pos, []int{i, j, i + j})
				}
			}
		}

		sort.Slice(pos, func(i, j int) bool {
			if pos[i][2] < pos[i][2] {
				return true
			}
			return false
		})

		ws := true
		for i := 1; i < len(pos); i++ {
			if pos[i][0]-pos[0][0] < 0 || pos[i][1]-pos[0][1] < 0 {
				ws = false
			}
		}

		if ws {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

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

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

package main

import "fmt"

type position struct {
	x, y int
}

func solve() string {
	var n, m int
	fmt.Scanln(&n, &m)

	var leftMost position = position{n, m}
	var upMost position = position{n, m}

	for i := 0; i < n; i++ {
		var row string
		fmt.Scanln(&row)
		for j := 0; j < m; j++ {
			if row[j] == 'R' {
				if j < leftMost.y {
					leftMost.x = i
					leftMost.y = j
				}

				if i < upMost.x {
					upMost.x = i
					upMost.y = j
				}
			}
		}
	}

	if leftMost.y == upMost.y {
		return "YES"
	}

	return "NO"
}

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

	for test > 0 {
		test--
		fmt.Println(solve())
	}
}

package main

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

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, m int
		fmt.Fscan(in, &n, &m)

		robs := [][]int{}
		for i := 0; i < n; i++ {
			var s string
			fmt.Fscan(in, &s)

			for j, ch := range s {
				if ch == 'R' {
					robs = append(robs, []int{i, j})
				}
			}
		}

		var f bool
		for i := 0; i < len(robs); i++ {
			ok := true
			for j := 0; j < len(robs); j++ {
				if robs[j][0] < robs[i][0] || robs[j][1] < robs[i][1] {
					ok = false
				}
			}

			if ok {
				f = true
				break
			}
		}

		if f {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}
}

package main

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

const N int = 10

type Pair struct { x, y int }

var (
	n, m int
	g [N]string
	points []Pair
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for ; t > 0; t-- {
		Fscan(in, &n, &m)
		points = make([]Pair, 0)
		for i := 0; i < n; i++ {
			Fscan(in, &g[i])
		}
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				if g[i][j] == 'R' {
					points = append(points, Pair{i, j})
				}
			}
		}
		sort.Slice(points, func(i, j int) bool {
			return points[i].x + points[i].y < points[j].x + points[j].y
		})
		for {
			c := points[0]
			if c.x == 0 && c.y == 0 {
				Fprintln(out, "YES")
				goto next
			} else if c.x > 0 {
				points[0].x--
				for i := 1; i < len(points); i++ {
					points[i].x--
					if points[i].x < 0 {
						Fprintln(out, "NO")
						goto next
					}
				}
			} else if c.y > 0 {
				points[0].y--
				for i := 1; i < len(points); i++ {
					points[i].y--
					if points[i].y < 0 {
						Fprintln(out, "NO")
						goto next
					}
				}
			}
		}
		next:
	}
}

func min(a, b int) int { if a > b { return b }; return a }
func max(a, b int) int { if a < b { return b }; return a }
func abs(v int) int { if v > 0 { return v }; return -v }
func gcd(a, b int) int { if b > 0 { return gcd(b, a % b) }; return a }
func lcm(a, b int) int { return a * b / gcd(a, b) }

package main

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

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

func b1680(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T int
	var m int
	var n int
	var s string

	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &m)
		Fscan(in, &n)

		g := make([]string, m)
		for i := 0; i < m; i++ {
			Fscan(in, &s)
			g[i] = s
		}

		ma := 1 << 30

	loop:
		for _, v := range g {
			for i, x := range v {
				if x == 'R' {
					ma = i
					break loop
				}
			}
		}

		ans := "YES"

	lp2:
		for j := 0; j < n; j++ {
			for i := 0; i < m; i++ {
				if g[i][j] == 'R' {
					if j < ma {
						ans = "NO"
						break lp2
					}
				}
			}
		}

		Fprintln(out, ans)
	}
}

package main

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

type Int int64

const (
	INF = 3e5 + 10
	L0  = Int(0)
	L1  = Int(1)
)

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

	var T int
	Fscan(in, &T)

	for tt := 0; tt < T; tt++ {
		var n, m Int
		Fscan(in, &n, &m)

		mx := Max(n, m)

		s := make([]string, n)

		ml, mu := mx, mx

		for i := L0; i < n; i++ {
			Fscan(in, &s[i])

			for jj, ch := range s[i] {
				j := Int(jj)
				if ch == 'R' {
					ml = Min(ml, j)
					mu = Min(mu, i)
				}
			}

		}

		flag := false
		for i := L0; i < n && !flag; i++ {
			for jj, ch := range s[i] {
				j := Int(jj)
				if ch == 'R' {
					if i <= mu && j <= ml {
						flag = true
						break
					}

				}
			}
		}

		if flag {
			Fprintln(out, "YES")
		} else {
			Fprintln(out, "NO")
		}

	}

}

func MakeGrid(h, w int) [][]Int {
	index := make([][]Int, h)
	data := make([]Int, h*w)
	for i := 0; i < h; i++ {
		index[i] = data[i*w : (i+1)*w]
	}
	return index
}

func Abs(x Int) Int {
	if x > 0 {
		return x
	}
	return -x
}

func Min(nums ...Int) Int {
	return nums[MinIdx(nums...)]
}

func MinIdx(nums ...Int) Int {
	maxNumIdx := L0
	for i, num := range nums {
		if num < nums[maxNumIdx] {
			maxNumIdx = Int(i)
		}
	}
	return maxNumIdx
}

func Max(nums ...Int) Int {
	return nums[MaxIdx(nums...)]
}

func MaxIdx(nums ...Int) Int {
	maxNumIdx := L0
	for i, num := range nums {
		if num > nums[maxNumIdx] {
			maxNumIdx = Int(i)
		}
	}
	return maxNumIdx
}

var (
	mod  Int
	fmod func(Int) Int = doNothing
)

// SetMod sets the mod. It must be called first.
func SetMod(newMod Int) {
	mod = newMod
	fmod = dynamicMod
}

func dynamicMod(m Int) Int {
	m %= mod
	if m < 0 {
		return m + mod
	}
	return m
}

func doNothing(m Int) Int {
	return m
}

// Mod returns m % mod.
func (m Int) Mod() Int {
	return fmod(m)
}

// Inv returns modular multiplicative inverse
func (m Int) Inv() Int {
	return m.Pow(Int(0).Sub(2))
}

// Pow returns m^n
func (m Int) Pow(n Int) Int {
	p := Int(1)
	for n > 0 {
		if n&1 == 1 {
			p.MulAs(m)
		}
		m.MulAs(m)
		n >>= 1
	}
	return p
}

// Add returns m+x
func (m Int) Add(x Int) Int {
	return (m + x).Mod()
}

// Sub returns m-x
func (m Int) Sub(x Int) Int {
	return (m - x).Mod()
}

// Mul returns m*x
func (m Int) Mul(x Int) Int {
	return (m * x).Mod()
}

// Div returns m/x
func (m Int) Div(x Int) Int {
	return m.Mul(x.Inv())
}

// AddAs assigns *m + x to *m and returns m
func (m *Int) AddAs(x Int) *Int {
	*m = m.Add(x)
	return m
}

// SubAs assigns *m - x to *m and returns m
func (m *Int) SubAs(x Int) *Int {
	*m = m.Sub(x)
	return m
}

// MulAs assigns *m * x to *m and returns m
func (m *Int) MulAs(x Int) *Int {
	*m = m.Mul(x)
	return m
}

// DivAs assigns *m / x to *m and returns m
func (m *Int) DivAs(x Int) *Int {
	*m = m.Div(x)
	return m
}

func (m *Int) MaxAs(x ...Int) *Int {
	*m = Max(append(x, *m)...)
	return m
}

func (m *Int) MinAs(x ...Int) *Int {
	*m = Min(append(x, *m)...)
	return m
}

package main

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

func main_edu_128_A() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	// Coding...beg!
	sol = func() {
		/* var l1, l2, r1, r2 int
		Fscan(in, &l1, &r1, &l2, &r2)
		if l1 > l2 {
			l1, r1, l2, r2 = l2, r2, l1, r1
		}
		if l1 == l2 {
			Fprintln(out, l1)
			return
		}
		if r1 < l2 {
			Fprintln(out, l1+l2)
			return
		}
		Fprintln(out, l2) */
		var n, m, col int
		col = -1
		Fscan(in, &n, &m)
		a := make([]string, n)
		for i := 0; i < n; i++ {
			Fscan(in, &a[i])
		}
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				if a[i][j] == 'R' {
					col = j
					break
				}
			}
			if col != -1{
				break
			}
		}
		for i := 0; i < n; i++ {
			for j := 0; j < col; j++ {
				if a[i][j] == 'R' {
				//	Fprintln(out, ":", i, j, col)
					Fprintln(out, "NO")
					return
				}
			}
		}
		Fprintln(out, "YES")
	}
	// Coding...ove!
	for i := 0; i < cas; i++ {
		sol()
	}
}

func main() {
	main_edu_128_A()
}

package main

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

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

func slove() {
	var n, m int
	fmt.Fscan(r, &n, &m)
	board := make([]string, n)
	for i := range board {
		fmt.Fscan(r, &board[i])
	}
	first := -1
	for i := range board {
		for j := range board[i] {
			if board[i][j] == 'R' {
				if first > j {
					fmt.Fprintln(w, "No")
					return
				}
				if first == -1 {
					first = j
				}
			}
		}
	}
	fmt.Fprintln(w, "Yes")
}

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

package main

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

func main() {
	var (
		t int
	)

	reader := bufio.NewReader(os.Stdin)
	fmt.Scanf("%d\n", &t)

	for t > 0 {
		t--

		text, _ := reader.ReadString('\n')
		ninps := strings.Fields(text)
		n, _ := strconv.Atoi(ninps[0])
		m, _ := strconv.Atoi(ninps[1])

		il := -1
		jl := -1
		id := -1
		jd := -1

		for i := 0; i < n; i++ {
			s, _ := reader.ReadString('\n')
			if s[len(s)-1] == 10 {
				s = s[:len(s)-1]
			}
			if s[len(s)-1] == 13 {
				s = s[:len(s)-1]
			}

			for j := 0; j < m; j++ {
				if i > il && il > -1 && j <= jl {
					if string(s[j]) == "R" && id == -1 {
						id = i
						jd = j
					}
				}
				if string(s[j]) == "R" && il == -1 {
					il = i
					jl = j
				}
			}
		}

		//fmt.Println("M: p1: ", il, jl, " p2:", id, jd)
		if il == -1 || id == -1 {
			fmt.Println("YES")
			continue
		}

		if il <= id && jl <= jd {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	var (
		t int
	)

	reader := bufio.NewReader(os.Stdin)
	fmt.Scanf("%d\n", &t)

	for t > 0 {
		t--

		text, _ := reader.ReadString('\n')
		ninps := strings.Fields(text)
		n, _ := strconv.Atoi(ninps[0])
		m, _ := strconv.Atoi(ninps[1])

		il := -1
		jl := -1
		id := -1
		jd := -1

		for i := 0; i < n; i++ {
			s, _ := reader.ReadString('\n')
			if s[len(s)-1] == 10 {
				s = s[:len(s)-1]
			}
			if s[len(s)-1] == 13 {
				s = s[:len(s)-1]
			}

			for j := 0; j < m; j++ {
				if i > il && il > -1 {
					if string(s[j]) == "R" && id == -1 {
						id = i
						jd = j
					}
				}
				if string(s[j]) == "R" && il == -1 {
					il = i
					jl = j
				}
			}
		}

		//fmt.Println("M: p1: ", il, jl, " p2:", id, jd)
		if il == -1 || id == -1 {
			fmt.Println("YES")
			continue
		}

		if il <= id && jl <= jd {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}


You are given an array $$$a$$$ consisting of $$$n$$$ integers.In one move, you can choose two indices $$$1 \le i, j \le n$$$ such that $$$i \ne j$$$ and set $$$a_i := a_j$$$. You can perform such moves any number of times (possibly, zero). You can choose different indices in different operations. The operation := is the operation of assignment (i.e. you choose $$$i$$$ and $$$j$$$ and replace $$$a_i$$$ with $$$a_j$$$).Your task is to say if it is possible to obtain an array with an odd (not divisible by $$$2$$$) sum of elements.You have to answer $$$t$$$ independent test cases.

The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 2000$$$) — the number of test cases. The next $$$2t$$$ lines describe test cases. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2000$$$) — the number of elements in $$$a$$$. The second line of the test case contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 2000$$$), where $$$a_i$$$ is the $$$i$$$-th element of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2000$$$ ($$$\sum n \le 2000$$$).

For each test case, print the answer on it — "YES" (without quotes) if it is possible to obtain the array with an odd sum of elements, and "NO" otherwise.

package main

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

func main(){
	var t,n,a int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		sum :=0
		hasEven := false
		hasOdd := false
		fmt.Fscan(in,&n)
		for j:=0;j<n;j++{
			fmt.Fscan(in,&a)
			sum +=a
			if a%2==0{
				hasEven = true
			}else{
				hasOdd = true
			}
		}
		if sum%2 ==1{
			fmt.Println("YES")
		}else{
			if hasEven && hasOdd{
				fmt.Println("YES")
			}else{
				fmt.Println("NO")
			}
		}
	}
}

package main

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

func main() {
	defer writer.Flush()

	if _, ok := os.LookupEnv("NOTONLINEJUDGE"); ok {
		reader, _ = os.Open("dat.in")
	}

	tc := 0

	cin(&tc)

	for ; tc > 0; tc-- {
		n := 0
		cin(&n)

		sum := 0
		odd, even := false, false
		for i := 0; i < n; i++ {
			a := 0
			cin(&a)

			sum += a
			if a&1 == 0 {
				even = true
			} else {
				odd = true
			}
		}

		if sum&1 != 0 || (odd && even) {
			cout("YES\n")
		} else {
			cout("NO\n")
		}
	}
}

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

func cin(x ...interface{}) error {
	_, e := fmt.Fscan(reader, x...)
	return e
}

func cout(x ...interface{}) error {
	_, e := fmt.Fprint(writer, x...)
	return e
}

package main

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

func main() {
	defer writer.Flush()

	if _, ok := os.LookupEnv("NOTONLINEJUDGE"); ok {
		reader, _ = os.Open("dat.in")
	}

	tc := 0

	scanf("%d\n", &tc)

	for ; tc > 0; tc-- {
		n := 0
		scanf("%d\n", &n)

		sum := 0
		odd, even := false, false
		for i := 0; i < n; i++ {
			a := 0
			scanf("%d", &a)

			sum += a
			if a&1 == 0 {
				even = true
			} else {
				odd = true
			}
		}
		scanf("\n")

		if sum&1 != 0 || (odd && even) {
			printf("YES\n")
		} else {
			printf("NO\n")
		}
	}
}

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

func scanf(f string, x ...interface{}) error {
	_, e := fmt.Fscanf(reader, f, x...)
	return e
}

func printf(f string, x ...interface{}) error {
	_, e := fmt.Fprintf(writer, f, x...)
	return e
}

package main

import "fmt"

const (
	maxn = 2010
)

var (
	a    [maxn]int
	n, t int
)

func main() {
	fmt.Scan(&t)
	for cnt := 1; cnt <= t; cnt++ {
		var odd, even int
		fmt.Scan(&n)
		for i := 1; i <= n; i++ {
			var x int
			fmt.Scan(&x)
			if x&1 != 0 {
				odd++
			} else {
				even++
			}
		}
		if odd == 0 {
			fmt.Println("NO")
		} else if even == 0 {
			if n&1 != 0 {
				fmt.Println("YES")
			} else {
				fmt.Println("NO")
			}
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	numStr := scanner.Text()
	num, _ := strconv.Atoi(numStr)
	for i:=0;i<num;i++ {
		scanner.Scan()
		nnumStr := scanner.Text()
		nnum, _ := strconv.Atoi(nnumStr)
		hasOdd := false
		hasNotOdd := false
		scanner.Scan()
		arrs:= scanner.Text()
		arr := strings.Split(arrs, " ")
		for _, j := range arr {
			jNum, _ := strconv.Atoi(j)
			if jNum % 2 == 1 {
				hasOdd = true
			} else {
				hasNotOdd = true
			}
			if hasOdd && hasNotOdd {
				break
			}
		}
		if !hasOdd {
			fmt.Println("NO")
			continue
		}
		if !hasNotOdd && nnum % 2 == 0 {
			fmt.Println("NO")
			continue
		}
		fmt.Println("YES")
	}
}

package main

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

//•*¨*•.¸¸♪I/O•*¨*•.¸¸♪

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

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

func scanInt64() int64 {
	sc.Scan()
	a,_ := strconv.ParseInt(sc.Text(),10,64)
	return a
}

func scanFloat64() float64 {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return float64(a)
}

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

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

func printInts(a ...int) {
	for i, e := range a {
		fmt.Fprint(wr, e)
		if i != len(a)-1 { fmt.Fprint(wr, " ") }
	}
	fmt.Fprintln(wr)
	wr.Flush()
}

//•*¨*•.¸¸♪func(int)•*¨*•.¸¸♪
func abs(a int) int { if a<0 { return -a }; return a }
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 }

//•*¨*•.¸¸♪Main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)

func main() {
	sc.Split(bufio.ScanWords)
	// sc.Buffer(make([]byte, 10000), 100000000)

	in := scanInt()

	for t := 0; t < in; t++ {
		n := scanInt()
		a := scanInts(n)

		even := false
		odd := false
		for i := 0; i < n; i++ {
			if a[i]%2==0 {
				even = true
			} else {
				odd = true
			}
		}

		if even && odd {
			fmt.Println("YES")
		} else {
			if odd {
				if n%2==0 {
					fmt.Println("NO")
				} else {
					fmt.Println("YES")
				}
			} else {
				fmt.Println("NO")
			}
		}
	}
}

package main

import "fmt"
import "os"
import "bufio"
import "strings"
import "strconv"
//~ import "sort"

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    capacity := 5000 * 1024
    scanner.Buffer(make([]byte, capacity), capacity)
    scanner.Scan()
    line := scanner.Text()
    t, _ := strconv.Atoi(line)
    for i := 0; i < t; i++ {
        scanner.Scan()
        line = scanner.Text()
        parts := strings.Split(line, " ")
        n, _ := strconv.Atoi(parts[0])

        a := make([]int, n)
        scanner.Scan()
        line = scanner.Text()
        parts = strings.Split(line, " ")
        for j := 0; j < n; j++ {
            a[j], _ = strconv.Atoi(parts[j]);
        }

        //~ fmt.Println(a)
        has_odd := false
        for j := 0; j < n; j++ {
            if a[j] % 2 == 1 {
                has_odd = true
                break
            }
        }

        if has_odd {
            if n % 2 == 1 {
                fmt.Println("YES")
            } else {
                has_even := false
                for j := 0; j < n; j++ {
                    if a[j] % 2 == 0 {
                        has_even = true
                        break
                    }
                }

                if has_even {
                    fmt.Println("YES")
                } else {
                    fmt.Println("NO")
                }
            }
        } else {
            fmt.Println("NO")
        }
    }
}

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.Fscanf(reader, "%d\n", &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscanf(reader, "%d\n", &n)
		vals := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscanf(reader, "%d", &vals[j])
		}
		fmt.Fprintf(writer, "%s\n", canMakeOdd(vals))
		fmt.Fscanf(reader, "\n")
	}
}

func canMakeOdd(vals []int) string {
	hasOdd := false
	hasEven := false
	sum := 0
	for _, e := range vals {
		sum += e
		if e%2 == 0 {
			hasEven = true
		} else {
			hasOdd = true
		}
	}

	if sum%2 != 0 {
		return "YES"
	}

	if hasEven && hasOdd {
		return "YES"
	} else {
		return "NO"
	}
}

package main

import (
	"fmt"
)

func main() {
	var t, n, num, oddCount, evenCount int
	fmt.Scan(&t)
	answers := make([]string, t)
	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			fmt.Scan(&num)
			if num%2 == 0 {
				evenCount++
			} else {
				oddCount++
			}
		}
		if oddCount%2 == 0 && oddCount > 0 && evenCount > 0 {
			answers[i] = "YES"
		} else if oddCount%2 != 0 {
			answers[i] = "YES"
		} else {
			answers[i] = "NO"
		}
		evenCount = 0
		oddCount = 0
	}
	for i := 0; i < t; i++ {
		fmt.Println(answers[i])
	}
}

package main

import (
	"fmt"
	"strconv"
	"strings"
)

func split(in string) []int {
	res := []int{}
	for _, v := range strings.Split(in, " ") {
		i, _ := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
		res = append(res, int(i))
	}
	return res
}

func main() {
	t := 0
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		n := 0
		fmt.Scanln(&n)
		numbers := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Scan(&numbers[i])
		}
		fmt.Scanln()
		sum := 0
		hasEven := false
		hasOdd := false
		for _, num := range numbers {
			hasEven = hasEven  || num % 2 == 1
			hasOdd = hasOdd || num % 2 == 0
			sum += num
		}
		if sum %2 == 1 || (hasEven && hasOdd) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import "fmt"

func main() {
	var t int
	for fmt.Scan(&t); t > 0; t-- {
		var n, sum int
		fmt.Scan(&n)
		var odd, even bool
		for i := 0; i < n; i++ {
			var x int
			fmt.Scan(&x)
			sum += x
			if x % 2 == 1 {
				odd = true
			} else {
				even = true
			}
		}
		if sum % 2 == 1 || (odd && even) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

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

const (
   MX_INT int64 = math.MaxInt64
   MN_INT int64 = math.MinInt64
)

func main() {
   for t := ScanInt64(); t > 0; t-- {
      n := ScanInt64()
     a := ScanInt64Slice(n)

     oddCount := 0
     evenCount := 0

     for i := range a {
     	if a[i] % 2 != 0 {
     		oddCount++
     	} else {
     		evenCount++
     	}
     }

     if oddCount == 0 {
     	fmt.Println("NO")
     } else if oddCount % 2 != 0 {
     	fmt.Println("YES")
     } else if evenCount > 0 {
     	fmt.Println("YES")
     } else {
     	fmt.Println("NO")
     }

 	// if oddCount % 2 != 0 {
  //    	fmt.Println("YES")
  //    } else {
  //    	fmt.Println("NO")
  //    }
   }

   close(O)
   oWg.Wait()
}

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

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

func init() {
   Pl = fmt.Println

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

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

   writer := bufio.NewWriterSize(os.Stdout, int(1e5))
   go func(writer *bufio.Writer) {
      defer oWg.Done()
      defer writer.Flush()

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

func ScanWord() string {
   in.Scan()
   return in.Text()
}

func ScanStringSlice(n int64) []string {
   length := int(n)
   s := make([]string, n)
   for i := 0; i < length; i++ {
      s[i] = ScanWord()
   }
   return s
}

func ScanInt64() int64 {
   intStr := ScanWord()
   i, err := strconv.ParseInt(intStr, 10, 64)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt() int {
   intStr := ScanWord()
   i, err := strconv.Atoi(intStr)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt64Slice(n int64) []int64 {
   length := int(n)
   arr := make([]int64, n)
   for i := 0; i < length; i++ {
      arr[i] = ScanInt64()
   }
   return arr
}

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

func Mx(args ...int64) int64 {
   maxVal := MN_INT
   for _, v := range args {
      if v > maxVal {
         maxVal = v
      }
   }
   return maxVal
}

func Mn(args ...int64) int64 {
   minVal := MX_INT
   for _, v := range args {
      if v < minVal {
         minVal = v
      }
   }
   return minVal
}

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

func GCD(a, b int64) int64 {
   if (a == 0) {
      return b
   }
   return GCD(b%a, a)
}

func S(v interface{}) string {
   return fmt.Sprintf("%v", v)
}

package main

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

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

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

func solve() {
	n := 0
	scanf("%d\n", &n)
	var o, e, s int
	a := make([]int, n)
	for i := 0; i < n-1; i++ {
		scanf("%d ", &a[i])
		if a[i] & 1 == 1 {
			o++
		} else {
			e++
		}
		s += a[i]
	}
	scanf("%d\n", &a[n-1])
	if a[n-1] & 1 == 1 {
		o++
	} else {
		e++
	}
	s += a[n-1]

	if s & 1 == 1 {
		printf("YES\n")
	} else {
		if o == 0 || e == 0 {
			printf("NO\n")
		} else {
			printf("YES\n")
		}
	}
}

func main() {
	t := 0
	scanf("%d\n", &t)
	for t > 0 {
		solve()
		t--
	}
	writer.Flush()
}

package main

import "fmt"

func main() {
    var noEx int
    fmt.Scan(&noEx)
    for cEx:=0; cEx<noEx; cEx++ {
        var noE int
        fmt.Scan(&noE)
        nums := make([]int, noE)
        for i:=0; i<noE; i++ {fmt.Scan(&nums[i])}
        odd, even := 0, 0
        for _, n := range nums {if n % 2 == 0 {even++} else {odd++}}
        if odd % 2 != 0 {
            fmt.Println("YES")
        } else {
            if even > 0 && odd > 0 {fmt.Println("YES")} else {fmt.Println("NO")}
        }
    }
}

package main

import "fmt"

func main() {
	var t, n int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		var arr = make([]int, n)
		odd := 0
		even := 0
		for j := 0; j < n; j++ {
			fmt.Scan(&arr[j])
			if arr[j]%2 == 0 {
				even += 1
			} else {
				odd += 1
			}
		}
		if odd == 0 || (even == 0 && n%2 == 0) {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import "fmt"

func sum(a []int) string {
	var sum int

	for index:=0;index<len(a);index++{
		sum+=a[index]
	}
	if sum%2==1 {
		return "YES"
	}

	if sum%2==0{
		for m:=0;m<len(a);m++{
			for n:=m+1; n<len(a);n++{
				if (a[m]+a[n])%2==1 {
					return "YES"
				}
			}
		}
	}

	return "NO"
}

func main(){
	var x int
	var n int

	fmt.Scan(&n)
	for i:=0;i<n;i++{
		fmt.Scan(&x)
		var list = make([]int,x,x)
		for i:=0;i<x;i++ {
			fmt.Scan(&list[i])
		}
		fmt.Println(sum(list))
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	var t int;
	fmt.Fscan(in, &t);
	for i := 0; i < t; i++ {
		var hasEven, hasNotEven bool;
		var n int;
		fmt.Fscan(in, &n);
		for j := 0; j < n; j++ {
			var x int;
			fmt.Fscan(in, &x);
			if (x % 2 != 0) {
				hasNotEven = true;
			} else {
				hasEven = true;
			}
		}
		if (n%2 != 0 && hasNotEven || n%2 == 0 && hasEven && hasNotEven) {
			fmt.Fprintln(out, "YES");
		} else {
			fmt.Fprintln(out, "NO");
		}
	}
	out.Flush();
}

package main

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

func isOdd(a int) int {
	if a%2 == 1 {
		return 1
	}
	return 0
}

func toBool(a int) bool {
	if a != 0 {
		return true
	}
	return false
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		n := 0
		fmt.Fscan(in, &n)
		N := n
		evenFlag, oddFlag := 0, 0
		for ; n > 0; n-- {
			a := 0
			fmt.Fscan(in, &a)
			odd := isOdd(a)
			oddFlag |= odd
			evenFlag |= 1 ^ odd
		}
		hasOdd := toBool(oddFlag)
		hasEven := toBool(evenFlag)
		if (!hasEven && toBool(isOdd(N))) || (hasOdd && hasEven) {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}
}

package main

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

func isOdd(a int) int {
	if a%2 == 1 {
		return 1
	}
	return 0
}

func toBool(a int) bool {
	if a != 0 {
		return true
	}
	return false
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	t := 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		n := 0
		fmt.Fscan(in, &n)
		N := n
		evenFlag, oddFlag := 0, 0
		for ; n > 0; n-- {
			a := 0
			fmt.Fscan(in, &a)
			odd := isOdd(a)
			oddFlag |= odd
			evenFlag |= 1 ^ odd
		}
		hasOdd := toBool(oddFlag)
		hasEven := toBool(evenFlag)
		if (!hasEven && toBool(isOdd(N))) || (hasOdd && hasEven) {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
		out.Flush()
	}
}

package main

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

func isOdd(a int) int {
	if a%2 == 1 {
		return 1
	}
	return 0
}

func toBool(a int) bool {
	if a != 0 {
		return true
	}
	return false
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		n := 0
		fmt.Fscan(in, &n)
		sum := 0
		evenFlag, oddFlag := 0, 0
		for ; n > 0; n-- {
			a := 0
			fmt.Fscan(in, &a)
			sum += a
			odd := isOdd(a)
			oddFlag |= odd
			evenFlag |= 1 ^ odd
		}
		hasOdd := toBool(oddFlag)
		hasEven := toBool(evenFlag)
		if toBool(isOdd(sum)) || (hasOdd && hasEven) {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}
}

package main

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

func isOdd(a int) int {
	if a%2 == 1 {
		return 1
	}
	return 0
}

func toBool(a int) bool {
	if a != 0 {
		return true
	}
	return false
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	t := 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		n := 0
		fmt.Fscan(in, &n)
		sum := 0
		evenFlag, oddFlag := 0, 0
		for ; n > 0; n-- {
			a := 0
			fmt.Fscan(in, &a)
			sum += a
			odd := isOdd(a)
			oddFlag |= odd
			evenFlag |= 1 ^ odd
		}
		hasOdd := toBool(oddFlag)
		hasEven := toBool(evenFlag)
		if toBool(isOdd(sum)) || (hasOdd && hasEven) {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
		out.Flush()
	}
}

package main
import (
	"bufio"
	"fmt"
	"os"
	"strings"
)
func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var t int
	fmt.Fscan(r, &t)
	ans := make([]string, t)
	for i := 0; i < t; i++ {
		var n, a, b int
		fmt.Fscan(r, &n)
		for j := 0; j < n; j++ {
			var c int
			fmt.Fscan(r, &c)
			if c%2 == 0 {
				a++
			} else {
				b++
			}
		}
		if n == 1 {
			if a == 1 {
				ans[i] = "NO"
			} else {
				ans[i] = "YES"
			}
		} else {
			if a == n || (n%2 == 0 && b == n) {
				ans[i] = "NO"
			} else {
				ans[i] = "YES"
			}
		}
	}
	fmt.Fprintln(w, strings.Join(ans, "\n"))
}

package main

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

func main() {
	defer writer.Flush()

	if _, ok := os.LookupEnv("NOTONLINEJUDGE"); ok {
		reader, _ = os.Open("dat.in")
	}

	tc := 0

	scanf("%d", &tc)

	for ; tc > 0; tc-- {
		n := 0
		scanf("%d", &n)

		sum := 0
		odd, even := false, false
		for i := 0; i < n; i++ {
			a := 0
			scanf("%d", &a)

			sum += a
			if a&1 == 0 {
				even = true
			} else {
				odd = true
			}
		}

		if sum&1 != 0 || (odd && even) {
			printf("YES\n")
		} else {
			printf("NO\n")
		}
	}
}

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

func scanf(f string, x ...interface{}) error {
	_, e := fmt.Fscanf(reader, f, x...)
	return e
}

func printf(f string, x ...interface{}) error {
	_, e := fmt.Fprintf(writer, f, x...)
	return e
}

package main

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

func main() {
	defer writer.Flush()

	if _, ok := os.LookupEnv("NOTONLINEJUDGE"); ok {
		reader, _ = os.Open("dat.in")
	}

	tc := 0

	scanf("%d\n", &tc)
	println("tc =", tc)

	for ; tc > 0; tc-- {
		n := 0
		scanf("%d\n", &n)
		println("n =", n)

		sum := 0
		odd, even := false, false
		for i := 0; i < n; i++ {
			a := 0
			scanf("%d", &a)
			println("a =", a)

			sum += a
			if a&1 == 0 {
				even = true
			} else {
				odd = true
			}
		}
		//scanf("\n")

		if sum&1 != 0 || (odd && even) {
			printf("YES\n")
		} else {
			printf("NO\n")
		}
	}
}

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

func scanf(f string, x ...interface{}) error {
	_, e := fmt.Fscanf(reader, f, x...)
	return e
}

func printf(f string, x ...interface{}) error {
	_, e := fmt.Fprintf(writer, f, x...)
	return e
}

package main

import (
	"fmt"
)

func main() {
	var t, n, a int
	var ans bool
	fmt.Scan(&t)
	answers := make([]string, t)
	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			fmt.Scan(&a)
			if a%2 != 0 {
				ans = !ans
			}
		}
		if ans {
			answers[i] = "YES"
		} else {
			answers[i] = "NO"
		}
		ans = false
	}
	for i := 0; i < t; i++ {
		fmt.Println(answers[i])
	}
}

package main

import (
	"fmt"
)

func main() {
	var t, n, num, oddCount, evenCount int
	fmt.Scan(&t)
	answers := make([]string, t)
	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			fmt.Scan(&num)
			if num%2 == 0 {
				evenCount++
			} else {
				oddCount++
			}
		}
		fmt.Println(i, oddCount, evenCount)
		if oddCount%2 == 0 && oddCount > 0 && evenCount > 0 {
			answers[i] = "YES"
		} else if oddCount%2 != 0 {
			answers[i] = "YES"
		} else {
			answers[i] = "NO"
		}
		evenCount = 0
		oddCount = 0
	}
	for i := 0; i < t; i++ {
		fmt.Println(answers[i])
	}
}

package main

import (
	"fmt"
)

func main() {
	var t, n, sum, a int
	fmt.Scan(&t)
	answers := make([]string, t)
	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			fmt.Scan(&a)
			sum += a
		}
		if sum%2 == 0 {
			answers[i] = "NO"
		} else {
			answers[i] = "YES"
		}
		sum = 0
	}
	for i := 0; i < t; i++ {
		fmt.Println(answers[i])
	}
}

package main

import (
	"fmt"
	"strconv"
	"strings"
)

func split(in string) []int {
	res := []int{}
	for _, v := range strings.Split(in, " ") {
		i, _ := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
		res = append(res, int(i))
	}
	return res
}

func main() {
	t := 0
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		n := 0
		fmt.Scanln(&n)
		numbers := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Scan(&numbers[i])
		}
		fmt.Println(numbers)
		sum := 0
		hasEven := false
		hasOdd := false
		for _, num := range numbers {
			hasEven = hasEven  || num % 2 == 1
			hasOdd = hasOdd || num % 2 == 0
			sum += num
		}
		if sum %2 == 1 || (hasEven && hasOdd) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func split(in string) []int {
	res := []int{}
	for _, v := range strings.Split(in, " ") {
		i, _ := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
		res = append(res, int(i))
	}
	return res
}

func main() {
	t := 0
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		n := 0
		fmt.Scanln(&n)
		r := bufio.NewReader(os.Stdin)
		s, _ := r.ReadString('\n')
		numbers := split(s)
		sum := 0
		hasEven := false
		hasOdd := false
		for _, num := range numbers {
			hasEven = hasEven  || num % 2 == 1
			hasOdd = hasOdd || num % 2 == 0
			sum += num
		}
		if sum %2 == 1 || (hasEven && hasOdd) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func split(in string) []int {
	res := []int{}
	for _, v := range strings.Split(in, " ") {
		i, _ := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
		res = append(res, int(i))
	}
	return res
}

func main() {
	t := 0
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		n := 0
		fmt.Scanln(&n)
		r := bufio.NewReader(os.Stdin)
		s, _ := r.ReadString('\n')
		numbers := split(s)
		fmt.Println(numbers)
		sum := 0
		hasEven := false
		hasOdd := false
		for _, num := range numbers {
			hasEven = hasEven  || num % 2 == 1
			hasOdd = hasOdd || num % 2 == 0
			sum += num
		}
		if sum %2 == 1 || (hasEven && hasOdd) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"strconv"
	"strings"
)

func split(in string) []int {
	res := []int{}
	for _, v := range strings.Split(in, " ") {
		i, _ := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
		res = append(res, int(i))
	}
	return res
}

func main() {
	t := 0
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		n := 0
		fmt.Scanln(&n)
		numbers := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Scan(&numbers[i])
		}
		fmt.Scanln()
		fmt.Println(numbers)
		sum := 0
		hasEven := false
		hasOdd := false
		for _, num := range numbers {
			hasEven = hasEven  || num % 2 == 1
			hasOdd = hasOdd || num % 2 == 0
			sum += num
		}
		if sum %2 == 1 || (hasEven && hasOdd) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

const (
   MX_INT int64 = math.MaxInt64
   MN_INT int64 = math.MinInt64
)

func main() {
   for t := ScanInt64(); t > 0; t-- {
      n := ScanInt64()
     a := ScanInt64Slice(n)

     oddCount := int64(0)

     for i := range a {
     	//if a[i] % 2 != 0 {
     		oddCount+= a[i]
     	//}
     }

     // if oddCount != 0 && oddCount % 2 != 0 {
     // 	fmt.Println("YES")
     // } else {
     // 	fmt.Println("NO")
     // }

 	if oddCount % 2 != 0 {
     	fmt.Println("YES")
     } else {
     	fmt.Println("NO")
     }
   }

   close(O)
   oWg.Wait()
}

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

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

func init() {
   Pl = fmt.Println

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

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

   writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
   go func(writer *bufio.Writer) {
      defer oWg.Done()
      defer writer.Flush()

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

func ScanWord() string {
   in.Scan()
   return in.Text()
}

func ScanStringSlice(n int64) []string {
   length := int(n)
   s := make([]string, n)
   for i := 0; i < length; i++ {
      s[i] = ScanWord()
   }
   return s
}

func ScanInt64() int64 {
   intStr := ScanWord()
   i, err := strconv.ParseInt(intStr, 10, 64)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt() int {
   intStr := ScanWord()
   i, err := strconv.Atoi(intStr)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt64Slice(n int64) []int64 {
   length := int(n)
   arr := make([]int64, n)
   for i := 0; i < length; i++ {
      arr[i] = ScanInt64()
   }
   return arr
}

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

func Mx(args ...int64) int64 {
   maxVal := MN_INT
   for _, v := range args {
      if v > maxVal {
         maxVal = v
      }
   }
   return maxVal
}

func Mn(args ...int64) int64 {
   minVal := MX_INT
   for _, v := range args {
      if v < minVal {
         minVal = v
      }
   }
   return minVal
}

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

func GCD(a, b int64) int64 {
   if (a == 0) {
      return b
   }
   return GCD(b%a, a)
}

func S(v interface{}) string {
   return fmt.Sprintf("%v", v)
}

package main

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

const (
   MX_INT int64 = math.MaxInt64
   MN_INT int64 = math.MinInt64
)

func main() {
   for t := ScanInt64(); t > 0; t-- {
      n := ScanInt64()
     a := ScanInt64Slice(n)

     oddCount := int64(0)

     for i := range a {
     	//if a[i] % 2 != 0 {
     		oddCount+= a[i]
     	//}
     }

     // if oddCount != 0 && oddCount % 2 != 0 {
     // 	fmt.Println("YES")
     // } else {
     // 	fmt.Println("NO")
     // }

 	if oddCount % 2 != 0 {
     	fmt.Println("YES")
     } else {
     	fmt.Println("NO")
     }
   }

   close(O)
   oWg.Wait()
}

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

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

func init() {
   Pl = fmt.Println

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

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

   writer := bufio.NewWriterSize(os.Stdout, int(1e5))
   go func(writer *bufio.Writer) {
      defer oWg.Done()
      defer writer.Flush()

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

func ScanWord() string {
   in.Scan()
   return in.Text()
}

func ScanStringSlice(n int64) []string {
   length := int(n)
   s := make([]string, n)
   for i := 0; i < length; i++ {
      s[i] = ScanWord()
   }
   return s
}

func ScanInt64() int64 {
   intStr := ScanWord()
   i, err := strconv.ParseInt(intStr, 10, 64)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt() int {
   intStr := ScanWord()
   i, err := strconv.Atoi(intStr)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt64Slice(n int64) []int64 {
   length := int(n)
   arr := make([]int64, n)
   for i := 0; i < length; i++ {
      arr[i] = ScanInt64()
   }
   return arr
}

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

func Mx(args ...int64) int64 {
   maxVal := MN_INT
   for _, v := range args {
      if v > maxVal {
         maxVal = v
      }
   }
   return maxVal
}

func Mn(args ...int64) int64 {
   minVal := MX_INT
   for _, v := range args {
      if v < minVal {
         minVal = v
      }
   }
   return minVal
}

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

func GCD(a, b int64) int64 {
   if (a == 0) {
      return b
   }
   return GCD(b%a, a)
}

func S(v interface{}) string {
   return fmt.Sprintf("%v", v)
}

package main

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

const (
   MX_INT int64 = math.MaxInt64
   MN_INT int64 = math.MinInt64
)

func main() {
   for t := ScanInt64(); t > 0; t-- {
      n := ScanInt64()
     a := ScanInt64Slice(n)

     oddCount := 0

     for i := range a {
     	if a[i] % 2 != 0 {
     		oddCount++
     	}
     }

     if oddCount != 0 && oddCount % 2 != 0 {
     	fmt.Println("YES")
     } else {
     	fmt.Println("NO")
     }

   }

   close(O)
   oWg.Wait()
}

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

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

func init() {
   Pl = fmt.Println

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

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

   writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
   go func(writer *bufio.Writer) {
      defer oWg.Done()
      defer writer.Flush()

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

func ScanWord() string {
   in.Scan()
   return in.Text()
}

func ScanStringSlice(n int64) []string {
   length := int(n)
   s := make([]string, n)
   for i := 0; i < length; i++ {
      s[i] = ScanWord()
   }
   return s
}

func ScanInt64() int64 {
   intStr := ScanWord()
   i, err := strconv.ParseInt(intStr, 10, 64)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt() int {
   intStr := ScanWord()
   i, err := strconv.Atoi(intStr)
   if err != nil {
      panic(err)
   }
   return i
}

func ScanInt64Slice(n int64) []int64 {
   length := int(n)
   arr := make([]int64, n)
   for i := 0; i < length; i++ {
      arr[i] = ScanInt64()
   }
   return arr
}

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

func Mx(args ...int64) int64 {
   maxVal := MN_INT
   for _, v := range args {
      if v > maxVal {
         maxVal = v
      }
   }
   return maxVal
}

func Mn(args ...int64) int64 {
   minVal := MX_INT
   for _, v := range args {
      if v < minVal {
         minVal = v
      }
   }
   return minVal
}

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

func GCD(a, b int64) int64 {
   if (a == 0) {
      return b
   }
   return GCD(b%a, a)
}

func S(v interface{}) string {
   return fmt.Sprintf("%v", v)
}

package main

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

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

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

func main() {
	t, n := 0, 0
	scanf("%d\n", &t)
	for t > 0 {
		t--
		scanf("%d\n", &n)

		p := 1
		var a []int
		for n > 0 {
			if n % 10 > 0 {
				a = append(a, p * (n % 10))
			}
			n /= 10
			p *= 10
		}
		printf("%d\n", len(a))
		for _, v := range a {
			printf("%d ", v)
		}
		printf("\n")
	}
	writer.Flush()
}

package main

import "fmt"

func sum(a []int) string {
	var sum int

	for index:=0;index<len(a);index++{
		sum+=a[index]
	}
	if sum%2==1 {
		return "YES"
	}

	if sum%2==0{
		for m:=0;m<len(a);m++{
			for n:=m+1; n<len(a);n++{
				if (a[m]+a[n])%2==1 {
					return "YES"
				}
			}
		}
	}

	return "NO"
}

func main(){
	var x int
	var n int

	fmt.Scanln(&n)
	for i:=0;i<n;i++{
		fmt.Scanln(&x)
		var list = make([]int,x,x)
		for i:=0;i<x;i++ {
			fmt.Scanln()
			fmt.Scanln(&list[i])
		}
		fmt.Println(sum(list))
	}
}

package main

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

func isOdd(a int) int {
	if a%2 == 1 {
		return 1
	}
	return 0
}

func toBool(a int) bool {
	if a != 0 {
		return true
	}
	return false
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		n := 0
		fmt.Fscan(in, &n)
		N := n
		evenFlag, oddFlag := 0, 0
		for ; n > 0; n-- {
			a := 0
			fmt.Fscan(in, &a)
			odd := isOdd(a)
			oddFlag |= odd
			evenFlag |= 1 ^ odd
			if oddFlag+evenFlag == 2 {
				break
			}
		}
		hasOdd := toBool(oddFlag)
		hasEven := toBool(evenFlag)
		if (!hasEven && toBool(isOdd(N))) || (hasOdd && hasEven) {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}

}

package main

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

func isOdd(a int) int {
	if a%2 == 1 {
		return 1
	}
	return 0
}

func toBool(a int) bool {
	if a != 0 {
		return true
	}
	return false
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	t := 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		n := 0
		fmt.Fscan(in, &n)
		N := n
		evenFlag, oddFlag := 0, 0
		for ; n > 0; n-- {
			a := 0
			fmt.Fscan(in, &a)
			odd := isOdd(a)
			oddFlag |= odd
			evenFlag |= 1 ^ odd
			if oddFlag+evenFlag == 2 {
				// exhaust the remaing input line
				fmt.Fscanln(in)
				break
			}
		}
		hasOdd := toBool(oddFlag)
		hasEven := toBool(evenFlag)
		if (!hasEven && toBool(isOdd(N))) || (hasOdd && hasEven) {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
		out.Flush()
	}
}