You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the given array.A subarray is the sequence of consecutive elements of the array. Subarray is called increasing if each element of this subarray strictly greater than previous.

The first line contains single positive integer n (1 ≤ n ≤ 105) — the number of integers. The second line contains n positive integers a1, a2, ..., an (1 ≤ ai ≤ 109).

Print the maximum length of an increasing subarray of the given array.

package main

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

func main() {
	var n int
	if _, err := fmt.Scanf("%d\n", &n); err != nil {
		return
	}

	var prev int = 0
	var inc_len int = 1
	var max_inc_len int = 0

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; scanner.Scan(); i++ {
		a, err := strconv.Atoi(scanner.Text())
		if err != nil {
			return
		}

		if a > prev && prev > 0 {
			inc_len += 1
		} else {
			if max_inc_len < inc_len {
				max_inc_len = inc_len
			}
			inc_len = 1
		}
		prev = a
	}
	if max_inc_len < inc_len {
		max_inc_len = inc_len
	}

	fmt.Println(max_inc_len)
}

package main

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

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)
    scanner.Scan()
    n, _ := strconv.Atoi(scanner.Text())
    length, maxlength := 1, 0

    scanner.Scan()
    a, _ := strconv.Atoi(scanner.Text())
    for i := 1; i < n; i++ {
        scanner.Scan()
        b, _ := strconv.Atoi(scanner.Text())
        if b-a <= 0 {
            if length > maxlength {maxlength = length}
            length = 1
        } else {
            length++
        }
        a=b
    }
    if length > maxlength {
        fmt.Println(length)
    } else {
        fmt.Println(maxlength)
    }
}

package main

import "bufio"
import "os"
import "fmt"

func Read(s *bufio.Reader) string {
    line, _ := s.ReadString('\n')
    return line
}

func Write(s *bufio.Writer, a ...interface{}) {
    fmt.Fprintln(s, a...)
    s.Flush()
}

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

    var n int
    fmt.Sscanln(Read(reader), &n)

    a := make([]int, n)

    for i := 0; i < n - 1; i++ {
        line, _ := reader.ReadString(' ')
        fmt.Sscanln(line, &a[i])
    }

    fmt.Sscanln(Read(reader), &a[n - 1])
    var last int = 1
    var max int = 1

    for i := 1; i < n; i++ {
        if a[i] > a[i - 1] {
            last++
        } else {
            if last > max {
                max = last
            }
            last = 1
        }
    }

    if last > max {
        max = last
    }

    writer := bufio.NewWriter(os.Stdout)

    Write(writer, max)
}

package main

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

var scanner *bufio.Scanner

func getI64() int64 {
	scanner.Scan()
	x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return x
}
func getI() int {
	return int(getI64())
}
func getF() float64 {
	scanner.Scan()
	x, _ := strconv.ParseFloat(scanner.Text(), 64)
	return x
}
func getS() string {
	scanner.Scan()
	return scanner.Text()
}

const MAXN = 100000 + 10
func max(_x , _y int)int {
	if(_x > _y) {
		return _x
	}
	return _y
}
func main() {
	scanner = bufio.NewScanner(os.Stdin)
  	scanner.Split(bufio.ScanWords)
 	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	n := getI()
	sol := 1
	var a [MAXN]int

	for i := 0 ; i < n ; i ++ {
		a[i] = getI()
	}
	now := 1
	for i := 1 ; i < n ; i ++ {
		if a[i] > a[i-1] {
			now ++
			sol = max(sol ,now)
		}else{
			now = 1
		}
	}

	writer.WriteString(fmt.Sprintf("%d\n",sol))
}

package main

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

func main() {
	var n, inp, maxc, perve, max uint32
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanf(in, "%d\n", &n)
	for i := uint32(0); i < n; i++ {
		fmt.Fscanf(in, "%d", &inp)
		if inp > perve {
			perve = inp
			maxc++
			if max < maxc {
				max = maxc
			}
		} else {
			perve = inp
			maxc = 0
			maxc++
			if max < maxc {
				max = maxc
			}
		}
	}
	fmt.Println(max)
}

package main

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

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

	var sc = bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	var max int
	seq := 1
	prev := int(1e9 + 1)
	for i := 0; i < n; i++ {
		sc.Scan()
		a, _ := strconv.Atoi(sc.Text())
		if a > prev {
			seq++
		} else {
			seq = 1
		}
		if seq > max {
			max = seq
		}
		prev = a
	}
	fmt.Println(max)
}

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)
var nextLine 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
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\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++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// 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())
}

// Read next line as []byte
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// 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

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

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

func minll(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 maxll(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

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

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

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// 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()
	a := make([]int, n)
	for i := range a {
		a[i] = readi()
	}
	var ans int
	i := 0
	for i < n {
		j := i + 1
		for j < n && a[j-1] < a[j] {
			j++
		}
		ans = max(ans, j-i)
		i = j
	}
	println(ans)
}

package main

import "fmt"
import "bufio"
import "os"
import "strconv"

func main() {
    var n int
    fmt.Scan(&n)
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)

    lastNum := 0
    maxCnt := 0
    for curCnt:=0; scanner.Scan(); {
        curNum, _ := strconv.Atoi(scanner.Text())
        if curNum > lastNum {
            curCnt++
            if curCnt > maxCnt {
                maxCnt = curCnt
            }
        } else {
            curCnt = 1
        }
        lastNum = curNum
    }
    fmt.Print(maxCnt)
}

package main

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

func main() {
	fsc := NewFastScanner()
	N := fsc.NextInt()
	pre := 0
	result := 0
	tmp := 0
	for i := 0; i < N; i++ {
		x := fsc.NextInt()
		if pre < x {
			tmp++
		} else {
			result = IntMax(result, tmp)
			tmp = 1
		}
		pre = x
	}
	result = IntMax(result, tmp)
	fmt.Println(result)
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) 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 *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) 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
		}
	}
}

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

func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

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

func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}

package main

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

func main() {
	var n int;
	fmt.Scan(&n)
	reader := bufio.NewScanner(os.Stdin)
	reader.Split(bufio.ScanWords)
	var lastNum uint64 = 0
	var maxCnt uint64 = 0
	var currCnt uint64 = 0
	//for _, v := range strings.Split(reader.Text(), " ") {
	for reader.Scan() {
		currNum, _ := strconv.ParseUint(reader.Text(), 10, 64)
		if currNum > lastNum {
			currCnt++
			if currCnt > maxCnt {
				maxCnt = currCnt
			}
		} else {
			currCnt = 1
		}
		lastNum = currNum
	}
	fmt.Println(maxCnt)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Split(bufio.ScanWords)
	reader.Scan()
	var lastNum = 0
	var maxCnt = 0
	var currCnt = 0
	for reader.Scan() {
		currNum, _ := strconv.Atoi(reader.Text())
		if currNum > lastNum {
			currCnt++
			if currCnt > maxCnt {
				maxCnt = currCnt
			}
		} else {
			currCnt = 1
		}
		lastNum = currNum
	}
	fmt.Println(maxCnt)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text2.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Split(bufio.ScanWords)
	reader.Scan()
	var lastNum = 0
	var currCnt = 0
	var maxCnt = 0
	for reader.Scan() {
		currNum, _ := strconv.Atoi(reader.Text())
		if currNum > lastNum {
			currCnt++

		} else {
			if currCnt > maxCnt {
				maxCnt = currCnt
			}
			currCnt = 1
		}
		lastNum = currNum
	}
	if currCnt > maxCnt {
		maxCnt = currCnt
	}
	fmt.Println(maxCnt)
}
/*
int main() {
    int n;
    cin >> n;

    int max = 0;
    int cur = 0;

    int c, p = 0;
    for (int i = 0; i < n; i++) {
        cin >> c;
        if (c > p) {
            cur++;
        } else {
            if (cur > max) {
                max = cur;
            }
            cur = 1;
        }
        p = c;
    }

    if (cur > max) {
        max = cur;
    }

    cout << max;
    return 0;

 */

//func main() {
//	//file, _ := os.Open("text5.txt")
//	file, _ := os.Create("text5.txt")
//	size := 9999999
//	file.WriteString(strconv.Itoa(size) + "\n")
//
//	for i := 0; i < size; i++ {
//		file.WriteString(strconv.Itoa(rand.Intn(99999999)) + " ")
//
//	}
//
//}

//Infra for scanner
func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text5.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Split(bufio.ScanWords)
	reader.Scan()
	var lastNum = 0
	var maxCnt int32 = 0
	var currCnt int32 = 0
	for reader.Scan() {
		currNum, _ := strconv.Atoi(reader.Text())
		if currNum > lastNum {
			currCnt++
			if currCnt > maxCnt {
				maxCnt = currCnt
			}
		} else {
			currCnt = 1
		}
		lastNum = currNum
	}
	fmt.Println(maxCnt)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text2.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	var n, a int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n)
	count := 1
	fmt.Fscan(in, &a)
	la := a
	max := 1
	for i := 1; i < n; i++ {
		fmt.Fscan(in, &a)
		if a > la {
			count++
			if max < count {
				max = count
			}
		} else {
			count = 1
		}
		la = a

	}
	fmt.Println(max)
}

package main

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

var n int
var a []int
var r int

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

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

	r = 1
	for i := 0; i < n; i++ {
		j := i
		for (i+1 < n) && (a[i] < a[i+1]) {
			i++
		}
		l := i - j + 1
		if l > r {
			r = l
		}
	}

	fmt.Fprint(bufout, r)
}

package main

import (
	"bufio"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strconv"
	// "sort"
	// "strings"
)

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

func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)
	log.SetOutput(ioutil.Discard)
	// log.SetOutput(os.Stderr)

	n := nextInt()
	ans, maxLengthNow := 1, 1
	pre := nextInt()

	for i := 1; i < n; i++ {
		a := nextInt()

		if a > pre {
			maxLengthNow++
		} else {
			maxLengthNow = 1
		}

		if maxLengthNow > ans {
			ans = maxLengthNow
		}

		pre = a
	}

	println(ans)
}

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

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

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

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

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

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1024*2048)

	text, _, err := reader.ReadLine()
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}

	n, err := strconv.ParseInt(string(text), 10, 64)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0)

	input, _, _ := reader.ReadLine()

	ns := strings.Split(string(input), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 0
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 32)
	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	if len(nums) <= 1 {
		fmt.Println(len(nums))
		os.Exit(0)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 64)

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Fprintln(os.Stderr, maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 32)
	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	if len(nums) <= 1 {
		fmt.Println(len(nums))
		os.Exit(0)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 64)

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Fprintln(os.Stderr, maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 32)

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func getInts(s *bufio.Scanner, n int) []int {
    s.Scan()
    ab := strings.Fields(s.Text())
    a := make([]int,n)
    for i:=0; i<n; i++ {
        a[i], _ = strconv.Atoi(ab[i])
    }
    return a
}

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    n := getInts(scanner,1)
    as := getInts(scanner,n[0])
    maxlength := 0
    length := 1
    for i := 1; i < n[0]; i++ {
        if as[i]<=as[i-1] {
            if length > maxlength{
                maxlength = length
                length = 1
            }
        } else {
            length++
        }
    }
    if length > maxlength {
        fmt.Println(length)
    } else {
        fmt.Println(maxlength)
    }
}

package main

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

func main() {
	reader := getReader()
	reader.Scan()
	reader.Text()
	reader.Scan()
	var prev = -1
	var maxUp = 0
	var currUp = 0
	for _, v := range strings.Split(reader.Text(), " ") {
		curr, _ := strconv.Atoi(v)
		if curr > prev {
			currUp++
		} else {
			if currUp > maxUp {
				maxUp = currUp
			}
			currUp = 1
		}
		prev = curr
	}
	if currUp > maxUp {
		maxUp = currUp
	}
	fmt.Println(maxUp)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text3.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Scan()
	reader.Text()
	reader.Scan()
	var prev int64 = -1
	var maxUp int64 = 0
	var currUp int64 = 0
	for _, v := range strings.Split(reader.Text(), " ") {
		curr, _ := strconv.ParseInt(v, 0, 64)
		if curr > prev {
			currUp++
		} else {
			if currUp > maxUp {
				maxUp = currUp
			}
			currUp = 1
		}
		prev = curr
	}
	if currUp > maxUp {
		maxUp = currUp
	}
	fmt.Println(maxUp)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Scan()
	reader.Text()
	reader.Scan()
	var lastNum uint64 = 0
	var maxCnt uint64 = 0
	var currCnt uint64 = 0
	for _, v := range strings.Split(reader.Text(), " ") {
		currNum, _ := strconv.ParseUint(v, 10, 64)
		if currNum > lastNum {
			currCnt++
			if currCnt > maxCnt {
				maxCnt = currCnt
			}
		} else {
			currCnt = 1
		}
		lastNum = currNum
	}
	fmt.Println(maxCnt)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text4.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Scan()
	reader.Text()
	reader.Scan()
	var lastNum int64 = 0
	var maxCnt uint64 = 0
	var currCnt uint64 = 0
	for _, v := range strings.Split(reader.Text(), " ") {
		currNum, _ := strconv.ParseInt(v, 0, 64)
		if currNum > lastNum {
			currCnt++
			if currCnt > maxCnt {
				maxCnt = currCnt
			}
		} else {
			currCnt = 1
		}
		lastNum = currNum
	}
	fmt.Println(maxCnt)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text4.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Scan()
	reader.Text()
	reader.Scan()
	var prev int64 = -1
	var maxUp int64 = 0
	var currUp int64 = 0
	for _, v := range strings.Split(reader.Text(), " ") {
		curr, _ := strconv.ParseInt(v, 0, 64)
		if curr > prev {
			currUp++
			if currUp > maxUp {
				maxUp = currUp
			}
		} else {
			currUp = 1
		}
		prev = curr
	}
	fmt.Println(maxUp)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

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

func main() {
	reader := getReader()
	reader.Scan()
	reader.Text()
	reader.Scan()
	var prev = 0
	var maxUp = 0
	var currUp = 0
	for _, v := range strings.Split(reader.Text(), " ") {
		curr, _ := strconv.Atoi(v)
		if curr > prev {
			prev = curr
			currUp++
		} else {
			prev = curr
			if currUp > maxUp {
				maxUp = currUp
			}
			currUp = 1
		}
	}
	if currUp > maxUp {
		maxUp = currUp
	}
	fmt.Println(maxUp)
}

func getReader() *bufio.Scanner {
	if isOnline() {
		return bufio.NewScanner(os.Stdin)
	}
	file, _ := os.Open("text3.txt")
	return bufio.NewScanner(file)
}

func isOnline() bool {
	env := os.Getenv("ONLINE_JUDGE")
	return env != "false"
}

package main

import (
	"bufio"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strconv"
	// "sort"
	// "strings"
)

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

func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)
	log.SetOutput(ioutil.Discard)
	// log.SetOutput(os.Stderr)

	n := nextInt()
	ans, maxLengthNow := 0, 1
	pre := nextInt()

	for i := 1; i < n; i++ {
		a := nextInt()

		if a > pre {
			maxLengthNow++
		} else {
			maxLengthNow = 1
		}

		if maxLengthNow > ans {
			ans = maxLengthNow
		}

		pre = a
	}

	println(ans)
}

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

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

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

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

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

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 64)

	if n <= 1 {
		fmt.Println(n)
		fmt.Println("early exit")
		os.Exit(0)
	}

	nums := make([]int64, 0)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Fprintln(os.Stderr, maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 32)
	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	if len(nums) <= 1 {
		fmt.Println(len(nums))
		os.Exit(0)
	}

	maxsofar := 1
	for i := 1; i < len(nums); i++ {
		if nums[i-1] >= nums[i] {
			maxsofar = 1
		} else {
			maxsofar++
		}
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 64)

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0)

	scanner.Scan()
	input := scanner.Text()
	if n == 10000 {
		fmt.Println(input)
	}
	ns := strings.Split(input, " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 0
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Fprintln(os.Stderr, maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 32)

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Println(maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 32)
	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	if len(nums) <= 1 {
		fmt.Println(len(nums))
		os.Exit(0)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i-1] >= nums[i] {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		} else {
			maxrn++
		}
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 64)

	if n <= 1 {
		fmt.Println(n)
		log.Println("early exit")
		os.Exit(0)
	}

	nums := make([]int64, 0)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Fprintln(os.Stderr, maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

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

	text, _, err := reader.ReadLine()
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}

	n, err := strconv.ParseInt(string(text), 10, 64)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0)

	input, _, _ := reader.ReadLine()

	ns := strings.Split(string(input), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 0
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 32)

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0, n)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 1
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Fprintln(os.Stderr, maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.ParseInt(scanner.Text(), 10, 64)

	if n <= 1 {
		fmt.Println(n)
		os.Exit(0)
	}

	nums := make([]int64, 0)

	scanner.Scan()
	ns := strings.Split(scanner.Text(), " ")

	for _, num := range ns {
		nn, _ := strconv.ParseInt(num, 10, 64)
		nums = append(nums, nn)
	}

	var maxsofar int64 = 0
	var maxrn int64 = 1
	for i := 1; i < len(nums); i++ {
		if nums[i] > nums[i-1] {
			maxrn++
		} else {
			if maxrn > maxsofar {
				maxsofar = maxrn
			}
			maxrn = 1
		}
		fmt.Fprintln(os.Stderr, maxrn)
	}
	if maxrn > maxsofar {
		maxsofar = maxrn
	}
	fmt.Println(maxsofar)
}


You are given an array of $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$. After you watched the amazing film "Everything Everywhere All At Once", you came up with the following operation.In one operation, you choose $$$n-1$$$ elements of the array and replace each of them with their arithmetic mean (which doesn't have to be an integer). For example, from the array $$$[1, 2, 3, 1]$$$ we can get the array $$$[2, 2, 2, 1]$$$, if we choose the first three elements, or we can get the array $$$[\frac{4}{3}, \frac{4}{3}, 3, \frac{4}{3}]$$$, if we choose all elements except the third.Is it possible to make all elements of the array equal by performing a finite number of such operations?

The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 200$$$)  — the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$3 \le n \le 50$$$)  — the number of integers. The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 100$$$).

For each test case, if it is possible to make all elements equal after some number of operations, output $$$\texttt{YES}$$$. Otherwise, output $$$\texttt{NO}$$$. You can output $$$\texttt{YES}$$$ and $$$\texttt{NO}$$$ in any case (for example, strings $$$\texttt{yEs}$$$, $$$\texttt{yes}$$$, $$$\texttt{Yes}$$$ will be recognized as a positive response).

NoteIn the first test case, all elements are already equal.In the second test case, you can choose all elements except the third, their average is $$$\frac{1 + 2 + 4 + 5}{4} = 3$$$, so the array will become $$$[3, 3, 3, 3, 3]$$$.It's possible to show that it's impossible to make all elements equal in the third and fourth test cases.

package main

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

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

func ReadInt() int {
	var x int
	fmt.Fscan(in, &x)
	return x
}

func ReadString() string {
	var x string
	fmt.Fscan(in, &x)
	return x
}

func WritelnString(x string) {
	fmt.Fprintln(out, x)
}

func WriteString(x string) {
	fmt.Fprint(out, x)
}

func WritelnInt(x int) {
	fmt.Fprintln(out, "%d", x)
}

func WriteInt(x int) {
	fmt.Fprint(out, "%d ", x)
}

func Solve() string {

	var a []int
	sum := 0

	n := ReadInt()
	for i := 0; i < n; i++ {
		x := ReadInt()
		a = append(a, x)
		sum += x
	}

	for _, each := range a {
		if each*n == sum {
			return "YES"
		}
	}
	return "NO"

}

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

	T := ReadInt()
	for i := 0; i < T; i++ {
		WritelnString(Solve())
	}
}

package main
// github.com/jamesgrimard/codeforces
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		list:= make([]int,n)
		for j:=0;j<n;j++{
			fmt.Fscan(in,&list[j])
		}
		for j:=0;j<n;j++{
			sum:=0
			for k:=0;k<n;k++{
				if k == j {
					continue
				}
				sum+=list[k]
			}
			if float64(sum)/float64(n-1) == float64(list[j]) {
				fmt.Fprintln(out,"YES")
				goto out
			}
		}
		fmt.Fprintln(out,"NO")
		out:
	}
}

package main

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

func main() {
	scanner := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var ntests int
	fmt.Fscan(scanner, &ntests)
outer:
	for iter := 0; iter < ntests; iter++ {
		var n int
		fmt.Fscan(scanner, &n)
		slice := make([]int, n)
		sum := 0
		for i := 0; i < n; i++ {
			fmt.Fscan(scanner, &slice[i])
			sum += slice[i]
		}
		for i := 0; i < n; i++ {
			tmp := sum - slice[i]
			if (tmp%(n-1) == 0) && (tmp/(n-1) == slice[i]) {
				fmt.Fprintln(writer, "YES")
				continue outer
			}
		}
		fmt.Fprintln(writer, "NO")
	}
}

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)
var bufferedStdout = bufio.NewWriter(os.Stdout)

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

func solve() {
	var n int
	_, _ = fmt.Fscan(bufferedStdin, &n)
	m := make(map[int]bool)
	sum := 0
	for i := 0; i < n; i++ {
		var a int
		_, _ = fmt.Fscan(bufferedStdin, &a)
		m[a] = true
		sum += a
	}
	if _, exists := m[sum/n]; exists && sum%n == 0 {
		_, _ = fmt.Fprint(bufferedStdout, "YES\n")
	} else {
		_, _ = fmt.Fprint(bufferedStdout, "NO\n")
	}
}

func main() {
	var t int
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for i := 0; i < t; i++ {
		solve()
	}
	_ = bufferedStdout.Flush()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)
var wrtr = bufio.NewWriterSize(os.Stdout, 10_000_000)
var rdr = bufio.NewScanner(os.Stdin)
func gs() string  { rdr.Scan(); return rdr.Text() }
func gi() int     { i,e := strconv.Atoi(gs()); if e != nil {panic(e)}; return i }
func gi2() (int,int) { return gi(),gi() }
func gi3() (int,int,int) { return gi(),gi(),gi() }
func gi4() (int,int,int,int) { return gi(),gi(),gi(),gi() }
func gis(n int) []int  { res := make([]int,n); for i:=0;i<n;i++ { res[i] = gi() }; return res }
func gf() float64 { f,e := strconv.ParseFloat(gs(),64); if e != nil {panic(e)}; return f }
func gbs() []byte { return []byte(gs()) }
func gfs(n int) []float64  { res := make([]float64,n); for i:=0;i<n;i++ { res[i] = gf() }; return res }
func gss(n int) []string  { res := make([]string,n); for i:=0;i<n;i++ { res[i] = gs() }; return res }
func ia(m int) []int { return make([]int,m) }
func iai(m int,v int) []int { a := make([]int,m); for i:=0;i<m;i++ { a[i] = v }; return a }
func twodi(n int,m int,v int) [][]int {
	r := make([][]int,n); for i:=0;i<n;i++ { x := make([]int,m); for j:=0;j<m;j++ { x[j] = v }; r[i] = x }; return r
}
func fill2(m int) ([]int,[]int) { a,b := ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i] = gi(),gi()}; return a,b }
func fill3(m int) ([]int,[]int,[]int) { a,b,c := ia(m),ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i],c[i] = gi(),gi(),gi()}; return a,b,c }
func fill4(m int) ([]int,[]int,[]int,[]int) { a,b,c,d := ia(m),ia(m),ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i],c[i],d[i] = gi(),gi(),gi(),gi()}; return a,b,c,d }
func abs(a int) int { if a < 0 { return -a }; return a }
func rev(a []int) { i,j := 0,len(a)-1; for i < j { a[i],a[j] = a[j],a[i]; i++; j-- } }
func max(a,b int) int { if a > b { return a }; return b }
func min(a,b int) int { if a > b { return b }; return a }
func tern(cond bool, a int, b int) int { if cond { return a }; return b }
func terns(cond bool, a string, b string) string { if cond { return a }; return b }
func maxarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa > ans { ans = aa } }; return ans }
func minarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa < ans { ans = aa } }; return ans }
func sumarr(a []int) int { ans := 0; for _,aa := range(a) { ans += aa }; return ans }
func zeroarr(a []int) { for i:=0; i<len(a); i++ { a[i] = 0 } }
func powmod(a,e,mod int) int { res, m := 1, a; for e > 0 { if e&1 != 0 { res = res * m % mod }; m = m * m % mod; e >>= 1 }; return res }
func powint(a,e int) int { res, m := 1, a; for e > 0 { if e&1 != 0 { res = res * m }; m = m * m; e >>= 1 }; return res }
func gcd(a,b int) int { for b != 0 { t:=b; b=a%b; a=t }; return a }
func gcdExtended(a,b int) (int,int,int) { if a == 0 { return b,0,1 }; gcd,x1,y1 := gcdExtended(b%a,a); return gcd, y1-(b/a)*x1,x1 }
func modinv(a,m int) (int,bool) { g,x,_ := gcdExtended(a,m); if g != 1 { return 0,false }; return (x % m + m) % m,true  }
func makefact(n int,mod int) ([]int,[]int) {
	fact,factinv := make([]int,n+1),make([]int,n+1)
	fact[0] = 1; for i:=1;i<=n;i++ { fact[i] = fact[i-1] * i % mod }
	factinv[n] = powmod(fact[n],mod-2,mod); for i:=n-1;i>=0;i-- { factinv[i] = factinv[i+1] * (i+1) % mod }
	return fact,factinv
}
func vecintstring(a []int) string { astr := make([]string,len(a)); for i,a := range a { astr[i] = strconv.Itoa(a) }; return strings.Join(astr," ") }
func main() {
	//f1, _ := os.Create("cpu.prof"); pprof.StartCPUProfile(f1); defer pprof.StopCPUProfile()
	defer wrtr.Flush()
	infn := ""; if infn == "" && len(os.Args) > 1 {	infn = os.Args[1] }
	if infn != "" {	f, e := os.Open(infn); if e != nil { panic(e) }; rdr = bufio.NewScanner(f) }
	rdr.Split(bufio.ScanWords); rdr.Buffer(make([]byte,1024),1_000_000_000)
	// PROGRAM STARTS HERE
	T := gi()
	for tt:=1;tt<=T;tt++ {
		N := gi(); A := gis(N)
		sa := sumarr(A); ans := "NO"
		for _,a := range A { if sa == a*N { ans = "YES" } }
		fmt.Fprintln(wrtr,ans)
	}
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1686A
Date: 1/06/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1686/A
Problem: CF1686A
**/
func (in *CF1686A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		arr := make([]int, n)
		mapa := map[int]bool{}
		sum := 0
		for i := 0; i < n; i++ {
			arr[i] = in.NextInt()
			mapa[arr[i]] = true
			sum += arr[i]
		}

		ans := "NO"

		if len(mapa) == 1 {
			ans = "YES"
		} else {
			for i := 0; i < n; i++ {
				val := sum - arr[i]
				if val%(n-1) == 0 && int(val/(n-1)) == arr[i] {
					ans = "YES"
				}

			}
		}
		fmt.Println(ans)

	}
}

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

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

package main

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

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

	var testCases int
	Fscan(in, &testCases)

	for c := 0; c < testCases; c++ {
		var n int
		Fscan(in, &n)
		nums := make([]int, n)
		for i := 0; i < n; i++ {
			Fscan(in, &nums[i])
		}

		Fprintln(out, solveA(nums))
	}

}

func solveA(nums []int) string {
	n := len(nums)

	sum := 0
	for i := range nums {
		sum += nums[i]
	}

	for i := range nums {
		rem := sum - nums[i]
		avg := float32(rem) / float32(n-1)
		if float32(avg) == float32(nums[i]) {
			return "YES"
		}
	}
	return "NO"
}

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

		arr := make([]int, n)
		var sum int
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &arr[i])
			sum += arr[i]
		}

		if sum/n*n != sum {
			fmt.Fprintln(out, "NO")
		} else {
			x := sum / n
			var f bool
			for _, v := range arr {
				if x == v {
					f = true
					break
				}
			}

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

package main

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

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

func ReadInt() int {
	var x int
	fmt.Fscan(in, &x)
	return x
}

func ReadString() string {
	var x string
	fmt.Fscan(in, &x)
	return x
}

func WritelnString(x string) {
	fmt.Fprintln(out, x)
}

func WriteString(x string) {
	fmt.Fprint(out, x)
}

func WritelnInt(x int) {
	fmt.Fprintln(out, "%d", x)
}

func WriteInt(x int) {
	fmt.Fprint(out, "%d ", x)
}

func Solve() string {

	var n, sum int
	var a []int
	sum = 0

	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		var x int
		fmt.Scanf("%d", &x)
		a = append(a, x)
		sum += x
	}

	for _, each := range a {
		if each*n == sum {
			return "YES"
		}
	}
	return "NO"

}

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

	T := ReadInt()
	for i := 0; i < T; i++ {
		WritelnString(Solve())
	}
}

package main

import (
	"fmt"
)

func solve() string {

	var n, sum int
	var a []int
	sum = 0

	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		var x int
		fmt.Scanf("%d", &x)
		a = append(a, x)
		sum += x
	}

	for _, each := range a {
		if each*n == sum {
			return "YES"
		}
	}
	return "NO"

}

func main() {

	var test int
	fmt.Scanf("%d", &test)
	for i := 0; i < test; i++ {
		fmt.Println(solve())
	}

}

package main
// github.com/jamesgrimard/codeforces
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		var sum,yes uint
		for j:=0;j<n;j++{
			var x uint
			fmt.Fscan(in,&x)
			if sum==x {yes=1}
			sum|=x
		}
		if yes==1 {fmt.Fprintln(out,"YES")} else {fmt.Fprintln(out,"NO")}
	}
}


This is an interactive problem.Little Dormi was faced with an awkward problem at the carnival: he has to guess the edges of an unweighted tree of $$$n$$$ nodes! The nodes of the tree are numbered from $$$1$$$ to $$$n$$$.The game master only allows him to ask one type of question: Little Dormi picks a node $$$r$$$ ($$$1 \le r \le n$$$), and the game master will reply with an array $$$d_1, d_2, \ldots, d_n$$$, where $$$d_i$$$ is the length of the shortest path from node $$$r$$$ to $$$i$$$, for all $$$1 \le i \le n$$$.Additionally, to make the game unfair challenge Little Dormi the game master will allow at most $$$\lceil\frac{n}{2}\rceil$$$ questions, where $$$\lceil x \rceil$$$ denotes the smallest integer greater than or equal to $$$x$$$.Faced with the stomach-churning possibility of not being able to guess the tree, Little Dormi needs your help to devise a winning strategy!Note that the game master creates the tree before the game starts, and does not change it during the game.

The first line of input contains the integer $$$n$$$ ($$$2 \le n \le 2\,000$$$), the number of nodes in the tree. You will then begin interaction.

When your program has found the tree, first output a line consisting of a single "!" followed by $$$n-1$$$ lines each with two space separated integers $$$a$$$ and $$$b$$$, denoting an edge connecting nodes $$$a$$$ and $$$b$$$ ($$$1 \le a, b \le n$$$). Once you are done, terminate your program normally immediately after flushing the output stream. You may output the edges in any order and an edge $$$(a,b)$$$ is considered the same as an edge $$$(b,a)$$$. Answering is not considered as a query.

NoteHere is the tree from the first example.  Notice that the edges can be output in any order.Additionally, here are the answers for querying every single node in example $$$1$$$: $$$1$$$: $$$[0,1,2,2]$$$  $$$2$$$: $$$[1,0,1,1]$$$  $$$3$$$: $$$[2,1,0,2]$$$  $$$4$$$: $$$[2,1,2,0]$$$Below is the tree from the second example interaction.  Lastly, here are the answers for querying every single node in example $$$2$$$: $$$1$$$: $$$[0,4,1,3,2]$$$  $$$2$$$: $$$[4,0,3,1,2]$$$  $$$3$$$: $$$[1,3,0,2,1]$$$  $$$4$$$: $$$[3,1,2,0,1]$$$  $$$5$$$: $$$[2,2,1,1,0]$$$

package main

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

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

type edge struct {
	x, y int
}

func ask(i int, n int) []int {
	if i < 0 {
		panic(fmt.Sprintln(out, "Incorrect value for ask"))
	}
	fmt.Fprintln(out, "?", i+1)
	out.Flush()
	d := make([]int, n)
	for i := range d {
		fmt.Fscan(in, &d[i])
	}
	return d
}

func printEdges(edges []edge) {
	fmt.Fprintln(out, "!")
	for i := range edges {
		fmt.Fprintln(out, edges[i].x+1, edges[i].y+1)
	}
}

func main() {

	defer out.Flush()

	solve := func(Case int) {
		var n int
		fmt.Fscan(in, &n)
		d := ask(0, n)
		cnt := [2]int{0, 0}
		for i := 1; i < n; i++ {
			cnt[d[i]&1]++
		}
		color := 0
		if cnt[0] > cnt[1] {
			color = 1
		}
		edges := []edge{}
		dNew := d
		for i, val := range d {
			if val&1 == color {
				if i != 0 {
					dNew = ask(i, n)
				}
				for j, val := range dNew {
					if val == 1 {
						edges = append(edges, edge{i, j})
					}
				}
			}
		}
		printEdges(edges)
	}

	T := 1
	//fmt.Fscan(in, &T) //
	for Case := 1; Case <= T; Case++ {
		solve(Case)
	}
}

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

func min(a []int) int {
	mn := int(1e9)
	for i := range a {
		if a[i] < mn {
			mn = a[i]
		}
	}
	return mn
}
func gcd(x, y int) int {
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func reverse(s []byte) []byte {
	a := []byte(s)
	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
		a[i], a[j] = a[j], a[i]
	}
	return a
}

package main

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

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

type edge struct {
	x, y int
}

func ask(i int, n int) []int {
	if i < 0 {
		panic(fmt.Sprintln(out, "Incorrect value for ask"))
	}
	fmt.Fprintln(out, "?", i+1)
	out.Flush()
	d := make([]int, n)
	for i := range d {
		fmt.Fscan(in, &d[i])
	}
	return d
}

func printEdges(edges []edge) {
	fmt.Fprintln(out, "!")
	for i := range edges {
		fmt.Fprintln(out, edges[i].x+1, edges[i].y+1)
	}
}

func main() {

	defer out.Flush()

	solve := func(Case int) {
		var n int
		fmt.Fscan(in, &n)
		d := ask(0, n)
		cnt := [2]int{0, 0}
		for _, val := range d {
			cnt[val&1]++
		}
		color := 0
		if cnt[0] > cnt[1] {
			color = 1
		}
		edges := []edge{}
		dNew := d
		for i, val := range d {
			if val&1 == color {
				if i != 0 {
					dNew = ask(i, n)
				}
				for j, val := range dNew {
					if val == 1 {
						edges = append(edges, edge{i, j})
					}
				}
			}
		}
		printEdges(edges)
	}

	T := 1
	//fmt.Fscan(in, &T) //
	for Case := 1; Case <= T; Case++ {
		solve(Case)
	}
}

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

func min(a []int) int {
	mn := int(1e9)
	for i := range a {
		if a[i] < mn {
			mn = a[i]
		}
	}
	return mn
}
func gcd(x, y int) int {
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func reverse(s []byte) []byte {
	a := []byte(s)
	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
		a[i], a[j] = a[j], a[i]
	}
	return a
}

package main

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

var (
	N     int
	depth [][]int
	memo  []int
	sc    *Scanner
	edges map[edge]bool
)

func f(n int) int {
	if n >= N-1 {
		return 0
	}
	if memo[n] == -1 {
		memo[n] = Min(len(depth[n])+f(n+1), len(depth[n+1])+f(n+2))
	}
	return memo[n]
}

type edge struct {
	a, b int
}

func ask(d int) {
	for _, v := range depth[d] {
		fmt.Printf("? %d\n", v)
		ans := sc.NextInts(N)
		for i, dist := range ans {
			if dist == 1 {
				edges[edge{Min(i+1, v), Max(i+1, v)}] = true
			}
		}
	}
}

func main() {
	sc = NewScanner()

	N = sc.NextInt()
	memo = InitInts1D(N, -1)

	fmt.Println("? 1")
	ans := sc.NextInts(N)
	depth = make([][]int, N)
	for i := 0; i < N; i++ {
		depth[ans[i]] = append(depth[ans[i]], i+1)
	}

	edges = make(map[edge]bool)
	for _, v := range depth[1] {
		edges[edge{1, v}] = true
	}

	d := 1
	for d < N-1 {
		if f(d) == len(depth[d])+f(d+1) {
			ask(d)
			d = d + 1
		} else if f(d) == len(depth[d+1])+f(d+2) {
			ask(d + 1)
			d = d + 2
		}
	}

	fmt.Println("!")
	for e := range edges {
		fmt.Printf("%d %d\n", e.a, e.b)
	}
}

type Scanner struct {
	bScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bScanner := bufio.NewScanner(os.Stdin)
	bScanner.Split(bufio.ScanWords)
	bScanner.Buffer([]byte{}, math.MaxInt32)
	return &Scanner{
		bScanner,
	}
}
func (s *Scanner) Next() string {
	s.bScanner.Scan()
	return s.bScanner.Text()
}
func (s *Scanner) NextInt() int {
	s.bScanner.Scan()
	res, err := strconv.Atoi(s.bScanner.Text())
	if err != nil {
		panic(err)
	}
	return res
}
func (s *Scanner) NextInt64() int64 {
	s.bScanner.Scan()
	res, err := strconv.ParseInt(s.bScanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return res
}
func (s *Scanner) NextFloat() float64 {
	s.bScanner.Scan()
	res, err := strconv.ParseFloat(s.bScanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return res
}
func (s *Scanner) NextInts(N int) []int {
	res := make([]int, N)
	for i := 0; i < N; i++ {
		res[i] = s.NextInt()
	}
	return res
}
func (s *Scanner) NextInt64s(N int) []int64 {
	res := make([]int64, N)
	for i := 0; i < N; i++ {
		res[i] = s.NextInt64()
	}
	return res
}
func Min(nums ...int) int {
	ans := math.MaxInt32
	for _, num := range nums {
		if num < ans {
			ans = num
		}
	}
	return ans
}
func Max(nums ...int) int {
	ans := math.MinInt32
	for _, num := range nums {
		if num > ans {
			ans = num
		}
	}
	return ans
}

func InitInts1D(n int, val int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = val
	}
	return res
}
func InitInts2D(n, m int, val int) [][]int {
	res := make([][]int, n)
	for i := 0; i < n; i++ {
		res[i] = InitInts1D(m, val)
	}
	return res
}
func InitInts3D(n, m, k int, val int) [][][]int {
	res := make([][][]int, n)
	for i := 0; i < n; i++ {
		res[i] = InitInts2D(m, k, val)
	}
	return res
}

type StepState struct {
	step, dist int
}
type PriorityQueue []*StepState

func (pq PriorityQueue) Len() int { return len(pq) }
func (pq PriorityQueue) Less(i, j int) bool {
	if pq[i].step != pq[j].step {
		return pq[i].step < pq[j].step
	}
	return pq[i].dist < pq[j].dist
}
func (pq PriorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
}
func (pq *PriorityQueue) Push(x interface{}) {
	item := x.(*StepState)
	*pq = append(*pq, item)
}
func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	*pq = old[0 : n-1]
	return item
}

package main

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

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

type edge struct {
	x, y int
}

func ask(i int, n int) []int {
	if i < 0 {
		panic(fmt.Sprintln(out, "Incorrect value for ask"))
	}
	fmt.Fprintln(out, "?", i+1)
	out.Flush()
	d := make([]int, n)
	for i := range d {
		fmt.Fscan(in, &d[i])
	}
	return d
}

func printEdges(edges []edge) {
	fmt.Fprintln(out, "!")
	for i := range edges {
		fmt.Fprintln(out, edges[i].x+1, edges[i].y+1)
	}
}

func main() {

	defer out.Flush()

	solve := func(Case int) {
		var n int
		fmt.Fscan(in, &n)
		d := ask(0, n)
		cnt := [2]int{0, 0}
		for i := range d[1:] {
			cnt[d[i]&1]++
		}
		color := 0
		if cnt[0] > cnt[1] {
			color = 1
		}
		edges := []edge{}
		dNew := d
		for i, val := range d {
			if val&1 == color {
				if i != 0 {
					dNew = ask(i, n)
				}
				for j, val := range dNew {
					if val == 1 {
						edges = append(edges, edge{i, j})
					}
				}
			}
		}
		printEdges(edges)
	}

	T := 1
	//fmt.Fscan(in, &T) //
	for Case := 1; Case <= T; Case++ {
		solve(Case)
	}
}

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

func min(a []int) int {
	mn := int(1e9)
	for i := range a {
		if a[i] < mn {
			mn = a[i]
		}
	}
	return mn
}
func gcd(x, y int) int {
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func reverse(s []byte) []byte {
	a := []byte(s)
	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
		a[i], a[j] = a[j], a[i]
	}
	return a
}


You are given a positive integer $$$n$$$. Let's call some positive integer $$$a$$$ without leading zeroes palindromic if it remains the same after reversing the order of its digits. Find the number of distinct ways to express $$$n$$$ as a sum of positive palindromic integers. Two ways are considered different if the frequency of at least one palindromic integer is different in them. For example, $$$5=4+1$$$ and $$$5=3+1+1$$$ are considered different but $$$5=3+1+1$$$ and $$$5=1+3+1$$$ are considered the same. Formally, you need to find the number of distinct multisets of positive palindromic integers the sum of which is equal to $$$n$$$.Since the answer can be quite large, print it modulo $$$10^9+7$$$.

The first line of input contains a single integer $$$t$$$ ($$$1\leq t\leq 10^4$$$) denoting the number of testcases. Each testcase contains a single line of input containing a single integer $$$n$$$ ($$$1\leq n\leq 4\cdot 10^4$$$) — the required sum of palindromic integers.

For each testcase, print a single integer denoting the required answer modulo $$$10^9+7$$$.

NoteFor the first testcase, there are $$$7$$$ ways to partition $$$5$$$ as a sum of positive palindromic integers:   $$$5=1+1+1+1+1$$$  $$$5=1+1+1+2$$$  $$$5=1+2+2$$$  $$$5=1+1+3$$$  $$$5=2+3$$$  $$$5=1+4$$$  $$$5=5$$$ For the second testcase, there are total $$$77$$$ ways to partition $$$12$$$ as a sum of positive integers but among them, the partitions $$$12=2+10$$$, $$$12=1+1+10$$$ and $$$12=12$$$ are not valid partitions of $$$12$$$ as a sum of positive palindromic integers because $$$10$$$ and $$$12$$$ are not palindromic. So, there are $$$74$$$ ways to partition $$$12$$$ as a sum of positive palindromic integers.

package main

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

type IO struct {
	in  io.Reader
	out io.Writer
}

func NewIO(in io.Reader, out io.Writer) *IO {
	return &IO{in: bufio.NewReader(in), out: out}
}

func (io *IO) ReadInt() int {
	var res int
	_, _ = fmt.Fscanf(io.in, "%d\n", &res)
	return res
}

func (io *IO) ReadPairInt() (int, int) {
	var a, b int
	_, _ = fmt.Fscanf(io.in, "%d %d\n", &a, &b)
	return a, b
}

func (io *IO) ReadString() string {
	var res string
	_, _ = fmt.Fscanf(io.in, "%s\n", &res)
	return res
}

func (io *IO) ReadIntSlice(n int) sort.IntSlice {
	var t int
	res := make(sort.IntSlice, 0, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Fscanf(io.in, "%d", &t)
		res = append(res, t)
	}
	_, _ = fmt.Fscanf(io.in, "\n")
	return res
}

func (io *IO) Println(v ...interface{}) {
	_, _ = fmt.Fprintln(io.out, v...)
}

func (io *IO) Print(v ...interface{}) {
	_, _ = fmt.Fprint(io.out, v...)
}

func (io *IO) Printf(format string, v ...interface{}) {
	_, _ = fmt.Fprintf(io.out, format, v...)
}

func (io *IO) PrintIntSlice(s sort.IntSlice) {
	for _, v := range s {
		io.Printf("%d ", v)
	}
}

func (io *IO) PrintlnIntSlice(s sort.IntSlice) {
	io.PrintIntSlice(s)
	io.Printf("\n")
}

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
}

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

func isPalindrome(i int) bool {
	v, r := i, 0
	for v != 0 {
		r *= 10
		r += v % 10
		v /= 10
	}
	return r == i
}

func main() {
	io := NewIO(os.Stdin, os.Stdout)
	t := io.ReadInt()

	pals := make([]int, 0, 550)
	for i := 1; ; i++ {
		if isPalindrome(i) {
			pals = append(pals, i)
		}
		if len(pals) == 550 {
			break
		}
	}

	var dp [4*1e4 + 100][550]int

	for j := 0; j < 550; j++ {
		dp[1][j] = 1
	}

	for i := 1; i < 4*1e4+100; i++ {
		//for i := 2; i <= 20; i++ {
		//for j := 1; j < 20; j++ {
		for j := 1; j < 550; j++ {
			pal := pals[j-1]
			dp[i][j] = (dp[i][j-1] + dp[max(i-pal, 0)][j]) % (1e9 + 7)
			//fmt.Print(dp[i][j], "(", pal, ") ")
		}
		//fmt.Println()
	}

	for ; t > 0; t-- {
		n := io.ReadInt()
		fmt.Println(dp[n+1][549])
	}
}

package main

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

const mod = 1e9 + 7;
const mn = 4e4;
var (
	p [mn]int
	cnt int = 0
	f [500][mn + 5]int
)

func isPali(x int) bool {

	s := ""
	for x > 0 {

		s = strconv.Itoa(x % 10) + s
		x /= 10
	}

	//fmt.Println(s)

	l := 0
	r := len(s) - 1
	for r - l > 0 {

		if s[l] != s[r] {

			return false;
		}

		l += 1
		r -= 1
	}

	return true
}

func Init() {

	for i := 1; i <= mn; i++ {

		if isPali(i) {

			cnt += 1
			p[cnt] = i
			//fmt.Print(p[cnt - 1], " ")
		}
	}

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

		f[i][0] = 1;
	}

	for i := 1; i <= mn; i++ {

		for j := 1; j <= cnt; j++ {

			if (p[j] <= i) {

				f[j][i] = (f[j-1][i] + f[j][i-p[j]]) % mod
			} else {

				f[j][i] = f[j-1][i]
			}
		}
	}
}

func main() {

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

	Init()
	var t int;
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {

		var n int;
		fmt.Fscan(in, &n)
		fmt.Println(f[cnt][n])
	}

}

package main

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

var a [40003]int64

const md = 1e9 + 7
const N = 40000

func isPalindrome(s string) bool {
	for i := 0; i < len(s)/2; i++ {
		if s[i] != s[len(s)-i-1] {
			return false
		}
	}

	return true
}

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

	a[0] = 1
	for i := 1; i <= N; i++ {
		if !isPalindrome(fmt.Sprintf("%d", i)) {
			continue
		}

		for j := i; j <= N; j++ {
			a[j] = (a[j] + a[j-i]) % md
		}
	}

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

		fmt.Fprintln(out, a[n])
	}
}

package main

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

type IO struct {
	in  io.Reader
	out io.Writer
}

func NewIO(in io.Reader, out io.Writer) *IO {
	return &IO{in: bufio.NewReader(in), out: out}
}

func (io *IO) ReadInt() int {
	var res int
	_, _ = fmt.Fscanf(io.in, "%d\n", &res)
	return res
}

func (io *IO) ReadPairInt() (int, int) {
	var a, b int
	_, _ = fmt.Fscanf(io.in, "%d %d\n", &a, &b)
	return a, b
}

func (io *IO) ReadString() string {
	var res string
	_, _ = fmt.Fscanf(io.in, "%s\n", &res)
	return res
}

func (io *IO) ReadIntSlice(n int) sort.IntSlice {
	var t int
	res := make(sort.IntSlice, 0, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Fscanf(io.in, "%d", &t)
		res = append(res, t)
	}
	_, _ = fmt.Fscanf(io.in, "\n")
	return res
}

func (io *IO) Println(v ...interface{}) {
	_, _ = fmt.Fprintln(io.out, v...)
}

func (io *IO) Print(v ...interface{}) {
	_, _ = fmt.Fprint(io.out, v...)
}

func (io *IO) Printf(format string, v ...interface{}) {
	_, _ = fmt.Fprintf(io.out, format, v...)
}

func (io *IO) PrintIntSlice(s sort.IntSlice) {
	for _, v := range s {
		io.Printf("%d ", v)
	}
}

func (io *IO) PrintlnIntSlice(s sort.IntSlice) {
	io.PrintIntSlice(s)
	io.Printf("\n")
}

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
}

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

func isPalindrome(i int) bool {
	v, r := i, 0
	for v != 0 {
		r *= 10
		r += v % 10
		v /= 10
	}
	return r == i
}

func main() {
	io := NewIO(os.Stdin, os.Stdout)
	t := io.ReadInt()

	pals := make([]int, 0, 500)
	for i := 1; ; i++ {
		if isPalindrome(i) {
			pals = append(pals, i)
		}
		if len(pals) == 500 {
			break
		}
	}

	var dp [4*1e4 + 10][500]int

	for j := 0; j < 500; j++ {
		dp[1][j] = 1
	}

	for i := 1; i <= 4*1e4; i++ {
		//for i := 2; i <= 20; i++ {
		//for j := 1; j < 20; j++ {
		for j := 1; j < 500; j++ {
			pal := pals[j-1]
			dp[i][j] = (dp[i][j-1] + dp[max(i-pal, 0)][j]) % (1e9 + 7)
			//fmt.Print(dp[i][j], "(", pal, ") ")
		}
		//fmt.Println()
	}

	for ; t > 0; t-- {
		n := io.ReadInt()
		fmt.Println(dp[n+1][499])
	}
}

package main

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

type IO struct {
	in  io.Reader
	out io.Writer
}

func NewIO(in io.Reader, out io.Writer) *IO {
	return &IO{in: bufio.NewReader(in), out: out}
}

func (io *IO) ReadInt() int {
	var res int
	_, _ = fmt.Fscanf(io.in, "%d\n", &res)
	return res
}

func (io *IO) ReadPairInt() (int, int) {
	var a, b int
	_, _ = fmt.Fscanf(io.in, "%d %d\n", &a, &b)
	return a, b
}

func (io *IO) ReadString() string {
	var res string
	_, _ = fmt.Fscanf(io.in, "%s\n", &res)
	return res
}

func (io *IO) ReadIntSlice(n int) sort.IntSlice {
	var t int
	res := make(sort.IntSlice, 0, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Fscanf(io.in, "%d", &t)
		res = append(res, t)
	}
	_, _ = fmt.Fscanf(io.in, "\n")
	return res
}

func (io *IO) Println(v ...interface{}) {
	_, _ = fmt.Fprintln(io.out, v...)
}

func (io *IO) Print(v ...interface{}) {
	_, _ = fmt.Fprint(io.out, v...)
}

func (io *IO) Printf(format string, v ...interface{}) {
	_, _ = fmt.Fprintf(io.out, format, v...)
}

func (io *IO) PrintIntSlice(s sort.IntSlice) {
	for _, v := range s {
		io.Printf("%d ", v)
	}
}

func (io *IO) PrintlnIntSlice(s sort.IntSlice) {
	io.PrintIntSlice(s)
	io.Printf("\n")
}

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
}

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

func isPalindrome(i int) bool {
	v, r := i, 0
	for v != 0 {
		r *= 10
		r += v % 10
		v /= 10
	}
	return r == i
}

func main() {
	io := NewIO(os.Stdin, os.Stdout)
	t := io.ReadInt()

	pals := make([]int, 0, 500)
	for i := 1; ; i++ {
		if isPalindrome(i) {
			pals = append(pals, i)
		}
		if len(pals) == 500 {
			break
		}
	}

	var dp [4*1e4 + 10][500]int

	for j := 0; j < 500; j++ {
		dp[1][j] = 1
	}

	for i := 1; i <= 4*1e4; i++ {
		//for i := 2; i <= 20; i++ {
		//for j := 1; j < 20; j++ {
		for j := 1; j < 500; j++ {
			pal := pals[j-1]
			dp[i][j] = dp[i][j-1] + dp[max(i-pal, 0)][j]
			//fmt.Print(dp[i][j], "(", pal, ") ")
		}
		//fmt.Println()
	}

	for ; t > 0; t-- {
		n := io.ReadInt()
		fmt.Println(dp[n+1][499])
	}
}


Guy-Manuel and Thomas are going to build a polygon spaceship. You're given a strictly convex (i. e. no three points are collinear) polygon $$$P$$$ which is defined by coordinates of its vertices. Define $$$P(x,y)$$$ as a polygon obtained by translating $$$P$$$ by vector $$$\overrightarrow {(x,y)}$$$. The picture below depicts an example of the translation:Define $$$T$$$ as a set of points which is the union of all $$$P(x,y)$$$ such that the origin $$$(0,0)$$$ lies in $$$P(x,y)$$$ (both strictly inside and on the boundary). There is also an equivalent definition: a point $$$(x,y)$$$ lies in $$$T$$$ only if there are two points $$$A,B$$$ in $$$P$$$ such that $$$\overrightarrow {AB} = \overrightarrow {(x,y)}$$$. One can prove $$$T$$$ is a polygon too. For example, if $$$P$$$ is a regular triangle then $$$T$$$ is a regular hexagon. At the picture below $$$P$$$ is drawn in black and some $$$P(x,y)$$$ which contain the origin are drawn in colored: The spaceship has the best aerodynamic performance if $$$P$$$ and $$$T$$$ are similar. Your task is to check whether the polygons $$$P$$$ and $$$T$$$ are similar.

The first line of input will contain a single integer $$$n$$$ ($$$3 \le n \le 10^5$$$) — the number of points. The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$x_i, y_i$$$ ($$$|x_i|, |y_i| \le 10^9$$$), denoting the coordinates of the $$$i$$$-th vertex. It is guaranteed that these points are listed in counterclockwise order and these points form a strictly convex polygon.

Output "YES" in a separate line, if $$$P$$$ and $$$T$$$ are similar. Otherwise, output "NO" in a separate line. You can print each letter in any case (upper or lower).

NoteThe following image shows the first sample: both $$$P$$$ and $$$T$$$ are squares. The second sample was shown in the statements.

package main

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

type ll int64
type double float64
type myInt []int

const (
	eps = 1e-8
	mod = 1e9+7
)

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(x, n, mod ll) (res ll) {
	res = 1
	for n > 0 {
		if ((n & 1) == 1) { x = x * x % mod }
		res = res * x % mod
		n >>= 1
	}
	return
}
func (p myInt) Len() int { return len(p) }
func (p myInt) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p myInt) Less(i, j int) bool { return p[i] > p[j] }

type node struct {
	x, y double
}

func solve(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int64) {
		flag := 1
		in.Scan()
		for _, b := range in.Bytes() {
			if b == '-' { flag = -1 } else { x = x*10 + int64(b-'0') }
		}
		x *= int64(flag)
		return
	}
	n := int(read())
	if n % 2 == 1 {
		Fprintf(out, "NO")
		return
	}
	a := make([]node, n, n)
	var midx, midy double
	for i := 0; i < n; i++ {
		a[i].x = double(read())
		a[i].y = double(read())
		midx += a[i].x
		midy += a[i].y
	}
	midx /= double(n)
	midy /= double(n)
	sw := func(now node) (oth node) {
		oth.x = 2 * midx - now.x
		oth.y = 2 * midy - now.y
		return
	}
	flag := true
	for i := 0; i < n; i++ {
		tmp := sw(a[i])
		if !same(a[(i + n / 2) % n].x, tmp.x) || !same(a[(i + n / 2) % n].y, tmp.y) {
			flag = false
			break
		}
	}
	if (flag) {
		Fprintf(out, "YES")
	} else {
		Fprintf(out, "NO")
	}
}

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

package main

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

type ll int64
type double float64
type myInt []int

const (
	eps = 1e-8
	mod = 1e9+7
)

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(x, n, mod ll) (res ll) {
	res = 1
	for n > 0 {
		if ((n & 1) == 1) { x = x * x % mod }
		res = res * x % mod
		n >>= 1
	}
	return
}
func (p myInt) Len() int { return len(p) }
func (p myInt) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p myInt) Less(i, j int) bool { return p[i] > p[j] }

type node struct {
	x, y double
}

func solve(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int) {
		flag := 1
		in.Scan()
		for _, b := range in.Bytes() {
			if b == '-' { flag = -1 }
			x = x*10 + int(b-'0')
		}
		x *= flag
		return
	}
	n := read()
	if n % 2 == 1 {
		Fprintf(out, "NO")
		return
	}
	a := make([]node, n, n)
	var midx, midy double
	for i := 0; i < n; i++ {
		a[i].x = double(read())
		a[i].y = double(read())
		midx += a[i].x
		midy += a[i].y
	}
	midx /= double(n)
	midy /= double(n)
	sw := func(now node) (oth node) {
		oth.x = 2 * midx - now.x
		oth.y = 2 * midy - now.y
		return
	}
	flag := true
	for i := 0; i < n; i++ {
		tmp := sw(a[i])
		if !same(a[(i + n / 2) % n].x, tmp.x) || !same(a[(i + n / 2) % n].y, tmp.y) {
			flag = false
			break
		}
	}
	if (flag) {
		Fprintf(out, "YES")
	} else {
		Fprintf(out, "NO")
	}
}

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

package main

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

type ll int64
type double float64
type myInt []int

func popcount(x int) (res int) {
	for i := 0; i < 32; i++ {
		if 1 == (1 & (x >> uint(i))) { res ++ }
	}
	return
}
func qp(x, n, mod ll) (res ll) {
	res = 1
	for n > 0 {
		if ((n & 1) == 1) { x = x * x % mod }
		res = res * x % mod
		n >>= 1
	}
	return
}
func (p myInt) Len() int { return len(p) }
func (p myInt) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p myInt) Less(i, j int) bool { return p[i] > p[j] }

type node struct {
	x, y double
}

func solve(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int) {
		in.Scan()
		for _, b := range in.Bytes() {
			x = x*10 + int(b-'0')
		}
		return
	}
	n := read()
	if (n % 2 == 1) {
		Fprintf(out, "no")
		return
	}
	a := make([]node, n, n)
	var midx, midy double
	for i := 0; i < n; i++ {
		a[i].x = double(read())
		a[i].y = double(read())
		midx += a[i].x
		midy += a[i].y
	}
	midx /= double(n)
	midy /= double(n)
	sw := func(now node) (oth node) {
		oth.x = 2 * midx - now.x
		oth.y = 2 * midy - now.y
		return
	}
	flag := true
	for i := 0; i < n; i++ {
		if a[(i + n / 2) % n] != sw(a[i]) {
			flag = false
			break
		}
	}
	if (flag) {
		Fprintf(out, "YES")
	} else {
		Fprintf(out, "NO")
	}
}

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

package main

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

type ll int64
type double float64
type myInt []int

const (
	eps = 1e-8
	mod = 1e9+7
)

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(x, n, mod ll) (res ll) {
	res = 1
	for n > 0 {
		if ((n & 1) == 1) { x = x * x % mod }
		res = res * x % mod
		n >>= 1
	}
	return
}
func (p myInt) Len() int { return len(p) }
func (p myInt) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p myInt) Less(i, j int) bool { return p[i] > p[j] }

type node struct {
	x, y double
}

func solve(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int) {
		in.Scan()
		for _, b := range in.Bytes() {
			x = x*10 + int(b-'0')
		}
		return
	}
	n := read()
	if (n % 2 == 1) {
		Fprintf(out, "NO")
		return
	}
	a := make([]node, n, n)
	var midx, midy double
	for i := 0; i < n; i++ {
		a[i].x = double(read())
		a[i].y = double(read())
		midx += a[i].x
		midy += a[i].y
	}
	midx /= double(n)
	midy /= double(n)
	sw := func(now node) (oth node) {
		oth.x = 2 * midx - now.x
		oth.y = 2 * midy - now.y
		return
	}
	flag := true
	for i := 0; i < n; i++ {
		tmp := sw(a[i])
		if !same(a[(i + n / 2) % n].x, tmp.x) || !same(a[(i + n / 2) % n].y, tmp.y) {
			flag = false
			break
		}
	}
	if (flag) {
		Fprintf(out, "YES")
	} else {
		Fprintf(out, "NO")
	}
}

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