package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)

func solve() {
	var n, l, r int32
	_, _ = fmt.Fscan(bufferedStdin, &n, &l, &r)
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		if possibleValue < l || possibleValue > r {
			fmt.Print("NO\n")
			return
		}
	}
	fmt.Print("YES\n")
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		fmt.Printf("%d ", possibleValue)
	}
	fmt.Print("\n")
}

func main() {
	var t int32
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for ; t > 0; t-- {
		solve()
	}
}

package main

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

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

func ans() {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	var flag bool = true
	var a []int = make([]int, n)
	for i := 1; i <= n; i++ {
		var pos int = i - 1
		var mod int = l % i
		if mod == 0 {
			a[pos] = l
		} else {
			var result int = l + i - mod
			if result >= l && result <= r {
				a[pos] = l + i - mod
			} else {
				flag = false
				break
			}
		}
	}
	if flag {
		Fprintln(out, "YES")
		for i := 0; i < n; i++ {
			Fprint(out, a[i], " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans()
	}
}

package main

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

func ans(in *bufio.Reader, out *bufio.Writer) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	var flag bool = true
	var a []int = make([]int, n)
	for i := 1; i <= n; i++ {
		var pos int = i - 1
		var mod int = l % i
		if mod == 0 {
			a[pos] = l
		} else {
			var result int = l + i - mod
			if result >= l && result <= r {
				a[pos] = l + i - mod
			} else {
				flag = false
				break
			}
		}
	}
	if flag {
		Fprintln(out, "YES")
		for i := 0; i < n; i++ {
			Fprint(out, a[i], " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out)
	}
}

package main

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

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

func solve() {
	var n, l, r int32
	_, _ = fmt.Fscan(bufferedStdin, &n, &l, &r)
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		if possibleValue < l || possibleValue > r {
			_, _ = fmt.Fprint(bufferedStdout, "NO\n")
			return
		}
	}
	_, _ = fmt.Fprint(bufferedStdout, "YES\n")
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		_, _ = fmt.Fprintf(bufferedStdout, "%d ", possibleValue)
	}
	_, _ = fmt.Fprint(bufferedStdout, "\n")
}

func main() {
	var t int32
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for ; t > 0; t-- {
		solve()
	}
	_ = bufferedStdout.Flush()
}

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)

func solve() {
	var n, l, r int32
	_, _ = fmt.Fscan(bufferedStdin, &n, &l, &r)
	a := make([]int32, n)
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		if possibleValue < l || possibleValue > r {
			fmt.Print("NO\n")
			return
		}
		a[i] = possibleValue
	}
	fmt.Print("YES\n")
	for _, value := range a {
		fmt.Printf("%d ", value)
	}
	fmt.Print("\n")
}

func main() {
	var t int32
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for ; t > 0; t-- {
		solve()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)
var a = [2000010]int64{}
var n, m, k, l, r int64
var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*4
var buf= make([]byte, maxCapacity)
func init()  {
	scanner.Buffer(buf, maxCapacity)
}
func min(a ...int) int{
	ans := a[0]
	for _, val := range a {
		if ans > val {
			ans = val
		}
	}
	return ans
}
func scan(arr []int64) {
	scanner.Scan()
	str := strings.Split(scanner.Text(), " ")
	for i:= 0; i < min(len(str), len(arr)); i++ {
		arr[i], _ = strconv.ParseInt(str[i], 10, 64)
	}
}
func scanf(arr ...*int64) {
	scanner.Scan()
	str := strings.Split(scanner.Text(), " ")
	for i:= 0; i < min(len(str), len(arr)); i++ {
		*arr[i], _ = strconv.ParseInt(str[i], 10, 64)
	}
}

func solve() {
	scanf(&n, &l, &r)
	var get = func(i int64) bool {
		a[i] = l / i * i
		if a[i] < l {a[i]+=i}
		if a[i] > r {return true}
		return false
	}
	for i := n-n+1; i <= n; i++ {
		if get(i) {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
	for _, v := range a[1:n+1] {
		fmt.Printf("%v ", v)
	}
	fmt.Println()
}

func main() {
	scanf(&k)
	for i:=k; i > 0; i-- {
		solve()
	}
}

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

func main() {

    in := bufio.NewReader(os.Stdin)
    testCase := readInt(in)

    for testCase > 0 {
        f := readArrInt64(in)
        n := f[0]
        l := f[1]
        r := f[2]

        mp := make(map[int64]bool)

        hasRes := true
        var res []int64
        var i int64
        i = 1
        for i=1; i<=n; i++ {
            val := ((l-1)/i) + 1

            curVal := val * i
            if curVal > r {
                hasRes = false
                break
            }
            gcd := findGCD(i, curVal)
            if _, v := mp[gcd]; !v {

                mp[gcd] = true
                res = append(res,  curVal)
            } else {
                for true {
                    if curVal + i > r {
                        hasRes = false
                        break
                    }
                    igcd := findGCD(i, curVal + i)
                    if _, iv := mp[igcd]; !iv {
                        mp[igcd] = true
                        res = append(res,  curVal + i)
                        break
                    } else {
                        curVal = curVal + i
                    }

                }
            }
        }
        if hasRes {
            fmt.Println("YES")
            fmt.Printf("%d", res[0])
            for i=1; i<n; i++ {
                fmt.Printf(" %d", res[i])
            }
            fmt.Printf("\n")
        } else  {
            fmt.Println("NO")
        }

        testCase--
    }
}

func findGCD(first, second int64) int64 {
	if first == 0 {
		return second
	}
	// recursively call findGCD
	return findGCD(second % first, first)
}

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

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

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

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

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

package main

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

var (
	reader     = bufio.NewReader(os.Stdin)
	t, n, l, r int
)

func solve(n, l, r int) string {
	var a []string
	var found bool
	for i := 1; i <= n; i++ {
		found = false
		for k := r / i * i; k >= l; k -= i {
			found = true
			break
		}
		if !found {
			return "NO"
		}
		a = append(a, fmt.Sprintf("%d", r/i*i))
	}
	return "YES\n" + strings.Join(a, " ")
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n, &l, &r)
		fmt.Println(solve(n, l, r))
	}
}

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

		aa := make([]int, n+1)
		f := true
		for i := 1; i <= n; i++ {
			if l%i == 0 {
				aa[i] = l
			} else {
				aa[i] = (l/i + 1) * i
			}

			if aa[i] > r {
				f = false
				break
			}
		}

		if !f {
			fmt.Fprintln(out, "NO")
		} else {
			fmt.Fprintln(out, "YES")
			for i := 1; i <= n; i++ {
				fmt.Fprintf(out, "%d ", aa[i])
			}
			fmt.Fprintln(out)
		}
	}
}

package main

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

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

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

	var T int64
	fmt.Fscan(_r, &T)
	for ; T > 0; T-- {
		var n, l, r int64
		fmt.Fscan(_r, &n, &l, &r)
		can := true
		for i := int64(1); i <= n; i++ {
			if r/i*i < l {
				can = false
				break
			}
		}

		if can {
			fmt.Fprintln(_w, "YES")
			for i := int64(1); i <= n; i++ {
				fmt.Fprint(_w, r/i*i, " ")
			}
			fmt.Fprintln(_w)
		} else {
			fmt.Fprintln(_w, "NO")
		}
	}

}

package main

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

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

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

func rw(in io.Reader, out io.Writer) {
	var t int
	fmt.Fscan(in, &t)
	for ti := 0; ti < t; ti++ {
		var n, l, r int
		fmt.Fscan(in, &n, &l, &r)
		w1, w2 := do(n, l, r)
		fmt.Fprint(out, w1)
		for i, v := range w2 {
			if i > 0 {
				fmt.Fprint(out, " ")
			} else {
				fmt.Fprintln(out)
			}
			fmt.Fprint(out, v)
		}
		fmt.Fprintln(out)
	}
}

func do(n, l, r int) (string, []int) {
	a := make([]int, n)
	for i := range a {
		j := i + 1
		if j < l {
			j = l
		}
		x := j % (i + 1)
		if x > 0 {
			x = i + 1 - x
		}
		a[i] = j + x
		if a[i] > r {
			return "NO", nil
		}
	}
	return "YES", a
}

package main

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

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

	testCases := readIntSlice(reader)[0]

	for testCases > 0 {
		testCases--

		constraints := readIntSlice(reader)
		n, l, r := constraints[0], constraints[1], constraints[2]
		possible := true

		arr := make([]string, n)
		for i := range arr {
			divisor := i + 1
			mod := l % divisor
			target := l + (divisor-mod)%divisor
			if target > r {
				possible = false
				break
			}
			arr[i] = strconv.Itoa(target)
		}

		if possible {
			writer.WriteString("YES\n")
			writer.WriteString(strings.Join(arr, " ") + "\n")
		} else {
			writer.WriteString("NO\n")
		}

	}

	writer.Flush()
}

func readIntSlice(reader *bufio.Reader) []int {
	line, _, _ := reader.ReadLine()
	strs := strings.Split(string(line), " ")
	ints := make([]int, len(strs))
	for i, s := range strs {
		ints[i], _ = strconv.Atoi(s)
	}
	return ints
}

package main

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

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

	var buf bytes.Buffer

	tc := readNum(reader)

	for tc > 0 {
		tc--
		n, l, r := readThreeNums(reader)
		res := solve(n, l, r)
		if len(res) == 0 {
			buf.WriteString("NO\n")
		} else {
			buf.WriteString("YES\n")
			for i := 0; i < n; i++ {
				buf.WriteString(fmt.Sprintf("%d ", res[i]))
			}
			buf.WriteByte('\n')
		}
	}

	fmt.Print(buf.String())
}

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

func normalize(s string) string {

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

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

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

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

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

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

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

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

	return i
}

func solve(n int, l int, r int) []int {
	res := make([]int, n)

	for i := n; i > 0; i-- {
		// A[i] % i = 0
		x := r / i * i
		if x < l {
			return nil
		}
		res[i-1] = x
	}

	return res
}

package main

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

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

func Print(a ...interface{})   { _, _ = fmt.Fprint(writer, a...) }
func Println(a ...interface{}) { _, _ = fmt.Fprintln(writer, a...) }

func main() {
	defer func() {
		_ = writer.Flush()
	}()

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

func Solve() {
	n, l, r := ReadInt(), ReadInt(), ReadInt()
	list := make([]int, 0)
	for i := 1; i <= n; i++ {
		val := (l + i - 1) / i * i
		if val <= r {
			list = append(list, val)
		} else {
			Println("NO")
			return
		}
	}
	Println("YES")
	for i, val := range list {
		Print(val)
		if i == len(list)-1 {
			Println()
		} else {
			Print(" ")
		}
	}
}

func ReadInt() (value int) {
	_, _ = fmt.Fscan(reader, &value)
	return
}

package main

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

const cf = true

func solve() {
	var n, l, r int
	fmt.Fscan(in, &n, &l, &r)
	ans := make([]int, n)
	for i := range ans {
		num := ((l-1)/(i+1) + 1) * (i + 1)
		if num > r {
			fmt.Fprintln(out, "NO")
			return
		}
		ans[i] = num
	}
	fmt.Fprintln(out, "YES")
	for _, item := range ans {
		fmt.Fprint(out, item, " ")
	}
	fmt.Fprintln(out)
}

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

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

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

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

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

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

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

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

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

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

var exists = struct{}{}

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

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

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

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

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

type Ordered interface {
	Integer | Float | ~string
}

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

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

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

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

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

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

package main

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

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, l, r, left, right int
		var a []int
		fmt.Fscan(in, &n, &l, &r)
		for j := 1; j <= n; j++ {

			if l % j != 0 {

				left = l / j + 1
			} else {

				left = l / j
			}
			right = r / j
			if left > right {

				fmt.Fprintln(out, "NO")
				break
			} else {

				a = append(a, j * left)
			}

		}
		if len(a) == n {

			fmt.Fprintln(out, "YES")
			for _, val := range a {

				fmt.Fprint(out, val, " ")
			}
			fmt.Fprintln(out)
		}

	}
}

package main

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

const mod = 998244353
const mx = int64(1e9 + 7)

func solve(in *bufio.Reader, out *bufio.Writer) {
	defer out.Flush()
	var n, l, r int64
	Fscan(in, &n, &l, &r)
	var ans []int64
	if r < n {
		Fprintln(out, "NO")
		return
	}
	for i := int64(1); i <= n; i++ {
		if l%i == 0 {
			ans = append(ans, l)
			continue
		}
		add := (l + i) - (l+i)%i
		if add > r {
			Fprintln(out, "NO")
			return
		}
		ans = append(ans, add)
	}
	Fprintln(out, "YES")
	for _, v := range ans {
		Fprintf(out, "%d ", v)
	}
	Fprintln(out)
}

func abs(a int64) int64 {
	if a > 0 {
		return a
	}
	return -a
}
func sum(a, b int64) int64 {
	return (b + a) * (b - a + 1) / 2
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func gcd(a, b int) int {
	if a%b == 0 {
		return b
	}
	return gcd(b, a%b)
}

func main() {
	stdin := os.Stdin
	stdout := os.Stdout
	in := bufio.NewReader(stdin)
	out := bufio.NewWriter(stdout)
	n := 1
	Fscan(in, &n)
	for i := 0; i < n; i++ {
		solve(in, out)
	}
}

package main

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

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

func main() {
	defer writer.Flush()

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

		ok := true
		a := make([]int, n+1)
		for i := 1; i <= n; i++ {
			var d int = (l + i - 1) / i
			if i*d > r {
				ok = false
				break
			} else {
				a[i] = i * d
			}
		}

		if ok {
			fmt.Fprintf(writer, "%s\n", "YES")
			for i := 1; i <= n; i++ {
				fmt.Fprintf(writer, "%d ", a[i])
			}
			fmt.Fprint(writer, "\n")
		} else {
			fmt.Fprintf(writer, "%s\n", "NO")
		}
	}
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	loops, _ := strconv.Atoi(scanner.Text())
outer:
	for lnum := 0; lnum < loops; lnum++ {
		scanner.Scan()
		t := scanner.Text()
		nlr := strings.Split(t, " ")
		n, _ := strconv.Atoi(nlr[0])
		l, _ := strconv.Atoi(nlr[1])
		r, _ := strconv.Atoi(nlr[2])
		var res strings.Builder

		for i := 1; i <= n; i++ {
			var elem int
			if (l % i) == 0 {
				elem = l
			} else {
				elem = (l/i)*i + i
			}
			if elem > r {
				fmt.Println("NO")
				continue outer
			}
			res.WriteString(strconv.Itoa(elem))
			res.WriteString(" ")
		}
		fmt.Println("YES")
		fmt.Println(res.String())
	}
}

// 00
package main

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

func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var n, l, r int
		fmt.Fscan(reader, &n, &l, &r)
		ans := []interface{}{}
		ok := true
		for i := 1; i <= n; i++ {
			if l%i == 0 {
				ans = append(ans, l)
			} else {
				prev := l - (l % i)
				prev += i
				if prev <= r {
					ans = append(ans, prev)
				} else {
					ok = false
					break
				}
			}
		}
		if ok {
			fmt.Println("YES")
			fmt.Println(ans...)
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func A1() {
	_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 n, l, r int

		Fscan(in, &n, &l, &r)
		ans := []int{}
		for i := n; i >= 1; i-- {
			b := r / i
			if b <= 0 {
				Fprintln(out, "NO")
				return
			}
			if b*i < l {
				Fprintln(out, "NO")
				return
			}
			ans = append(ans, b*i)
		}
		Fprintln(out, "Yes")
		for i := n - 1; i >= 0; i-- {
			Fprint(out, ans[i], " ")
		}
		Fprintln(out)
	}
	// Coding...ove!
	for i := 0; i < cas; i++ {
		sol()
	}
}
func main() { A1() }

package main

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

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

func slove() {
	var n, l, r int
	fmt.Fscan(rr, &n, &l, &r)
	ans := make([]int, n)
	for i:=1;i<=n;i++ {
		if l/i==r/i && l%i!=0 && r%i != 0 {
			fmt.Fprintln(ww, "NO")
			return
		} else if l % i == 0{
			ans[i-1] = l
		} else {
			ans[i-1] = l/i*i + i
		}
	}
	fmt.Fprintln(ww, "YES")
	for i:=0;i<len(ans);i++ {
		fmt.Fprintf(ww, "%d ", ans[i])
	}
	fmt.Fprintln(ww)
}

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

package main

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

func ans(in *bufio.Reader, out *bufio.Writer, t int, index int) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	if t == 10000 {
		if index == 1081 - 1 {
			Fprintln(out, ">", n, l, r)
		}
		return
	}
	var flag bool = true
	var a []int = make([]int, n)
	if n <= r - l + 1 {
		for i := 1; i <= n; i++ {
			var pos int = i - 1
			var mod int = l % i
			if mod == 0 {
				a[pos] = l
			} else {
				var result int = l + i - mod
				if result >= l && result <= r {
					a[pos] = l + i - mod
				} else {
					flag = false
					break
				}
			}
		}
	} else {
		flag = false
	}
	if flag {
		Fprintln(out, "YES")
		for i := 0; i < n; i++ {
			Fprint(out, a[i], " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out, t, i)
	}
}

package main

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

func ans(in *bufio.Reader, out *bufio.Writer, t int, index int) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	if t == 100000 {
		if index == 1081 - 1 {
			Fprintln(out, ">", n, l, r)
		}
		return
	}
	var flag bool = true
	var a []int = make([]int, n)
	if n <= r - l + 1 {
		for i := 1; i <= n; i++ {
			var pos int = i - 1
			var mod int = l % i
			if mod == 0 {
				a[pos] = l
			} else {
				var result int = l + i - mod
				if result >= l && result <= r {
					a[pos] = l + i - mod
				} else {
					flag = false
					break
				}
			}
		}
	} else {
		flag = false
	}
	if flag {
		Fprintln(out, "YES")
		for i := 0; i < n; i++ {
			Fprint(out, a[i], " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out, t, i)
	}
}

package main

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

func ans(in *bufio.Reader, out *bufio.Writer, t int, index int) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	if t == 10000 {
		if index != 1081 - 1 {
			Fprintln(out, "> ", n, l, r)
		}
		return
	}
	var flag bool = true
	var a []int = make([]int, n)
	if n <= r - l + 1 {
		for i := 1; i <= n; i++ {
			var pos int = i - 1
			var mod int = l % i
			if mod == 0 {
				a[pos] = l
			} else {
				var result int = l + i - mod
				if result >= l && result <= r {
					a[pos] = l + i - mod
				} else {
					flag = false
					break
				}
			}
		}
	} else {
		flag = false
	}
	if flag {
		Fprintln(out, "YES")
		for i := 0; i < n; i++ {
			Fprint(out, a[i], " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out, t, i)
	}
}

package main

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

func ans(in *bufio.Reader, out *bufio.Writer, t int, index int) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	if t == 100000 {
		if index != 1081 - 1 {
			Fprintln(out, "> ", n, l, r)
		}
		return
	}
	var flag bool = true
	var a []int = make([]int, n)
	if n <= r - l + 1 {
		for i := 1; i <= n; i++ {
			var pos int = i - 1
			var mod int = l % i
			if mod == 0 {
				a[pos] = l
			} else {
				var result int = l + i - mod
				if result >= l && result <= r {
					a[pos] = l + i - mod
				} else {
					flag = false
					break
				}
			}
		}
	} else {
		flag = false
	}
	if flag {
		Fprintln(out, "YES")
		for i := 0; i < n; i++ {
			Fprint(out, a[i], " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out, t, i)
	}
}

package main

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

func ans(in *bufio.Reader, out *bufio.Writer) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	var flag bool = true
	var a []int = make([]int, n)
	if n <= r - l + 1 {
		for i := 1; i <= n; i++ {
		    var pos int = i - 1
			var mod int = l % i
			if mod == 0 {
				a[pos] = l
			} else {
				var result int = l + i - mod
				if result >= l && result <= r {
					a[pos] = l + i - mod
				} else {
					flag = false
					break
				}
			}
		}
	} else {
		flag = false
	}
	if flag {
		Fprintln(out, "YES")
		for i := 0; i < n; i++ {
			Fprint(out, a[i], " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out)
	}
}

package main

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

func ans(in *bufio.Reader, out *bufio.Writer) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	if n <= r - l + 1 {
		Fprintln(out, "YES")
		for i := 1; i <= n; i++ {
			var mod int = l % i
			if mod == 0 {
				Fprint(out, l, " ")
			} else {
				Fprint(out, l + i - mod, " ")
			}
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out)
	}
}

package main

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

func ans(in *bufio.Reader, out *bufio.Writer) {
	var n int
	var l int
	var r int
	Fscan(in, &n, &l, &r)
	if n <= r - l + 1 {
		Fprintln(out, "YES")
		for i := l; i < l + n; i++ {
			Fprint(out, i, " ")
		}
		Fprintln(out)
	} else {
		Fprintln(out, "NO")
	}
}

func main() {
	var in *bufio.Reader = bufio.NewReader(os.Stdin)
	var out *bufio.Writer = bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans(in, out)
	}
}

package main

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

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

func solve() {
	var n, l, r int32
	_, _ = fmt.Fscan(bufferedStdin, &n, &l, &r)
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		if possibleValue < l || possibleValue > r {
			_, _ = fmt.Fprint(bufferedStdout, "NO\n")
			return
		}
	}
	_, _ = fmt.Fprint(bufferedStdout, "YES\n")
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		_, _ = fmt.Fprintf(bufferedStdout, "%d ", possibleValue)
	}
	_, _ = fmt.Fprint(bufferedStdout, "\n")
}

func main() {
	var t int32
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for ; t > 0; t-- {
		solve()
	}
}

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)

func solve() {
	var n, l, r int32
	_, _ = fmt.Fscan(bufferedStdin, &n, &l, &r)
	var a [100000]int32
	for i := int32(0); i < n; i++ {
		possibleValue := r / (i + 1) * (i + 1)
		if possibleValue < l || possibleValue > r {
			fmt.Print("NO\n")
			return
		}
		a[i] = possibleValue
	}
	fmt.Print("YES\n")
	for _, value := range a {
		fmt.Printf("%d ", value)
	}
	fmt.Print("\n")
}

func main() {
	var t int32
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for ; t > 0; t-- {
		solve()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)
var a = [30000010]int64{}
var n, m, k, l, r int64
var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*4
var buf= make([]byte, maxCapacity)
func init()  {
	scanner.Buffer(buf, maxCapacity)
}
func min(a ...int) int{
	ans := a[0]
	for _, val := range a {
		if ans > val {
			ans = val
		}
	}
	return ans
}
func scan(arr []int64) {
	scanner.Scan()
	str := strings.Split(scanner.Text(), " ")
	for i:= 0; i < min(len(str), len(arr)); i++ {
		arr[i], _ = strconv.ParseInt(str[i], 10, 64)
	}
}
func scanf(arr ...*int64) {
	scanner.Scan()
	str := strings.Split(scanner.Text(), " ")
	for i:= 0; i < min(len(str), len(arr)); i++ {
		*arr[i], _ = strconv.ParseInt(str[i], 10, 64)
	}
}

func solve() {
	scanf(&n, &l, &r)
	var get = func(i int64) bool {
		a[i] = l / i * i
		if a[i] < l {a[i]+=i}
		if a[i] > r {return true}
		return false
	}
	for i := n-n+1; i <= n; i++ {
		if get(i) {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
	fmt.Println(a[1:n+1])
}

func main() {
	scanf(&k)
	for i:=k; i > 0; i-- {
		solve()
	}
}

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

func main() {

    in := bufio.NewReader(os.Stdin)
    testCase := readInt(in)

    for testCase > 0 {
        f := readArrInt64(in)
        n := f[0]
        l := f[1]
        r := f[2]

        mp := make(map[int64]bool)

        hasRes := true
        var res []int64
        var i int64
        i = 1
        for i=1; i<=n; i++ {
            val := ((l-1)/i) + 1

            curVal := val * i
            if curVal > r {
                hasRes = false
                break
            }
            if _, v := mp[curVal]; !v {

                mp[curVal] = true
                res = append(res,  curVal)
            } else {
                for true {
                    if curVal + i > r {
                        hasRes = false
                        break
                    }
                    if _, iv := mp[curVal+ i]; !iv {
                        mp[curVal + i] = true
                        res = append(res,  curVal + i)
                        break
                    } else {
                        curVal = curVal + i
                    }

                }
            }
        }
        if hasRes {
            fmt.Println("YES")
            fmt.Printf("%d", res[0])
            for i=1; i<n; i++ {
                fmt.Printf(" %d", res[i])
            }
            fmt.Printf("\n")
        } else  {
            fmt.Println("NO")
        }

        testCase--
    }
}

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

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

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

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

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

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

func main() {

    in := bufio.NewReader(os.Stdin)
    testCase := readInt(in)

    for testCase > 0 {
        f := readArrInt64(in)
        n := f[0]
        l := f[1]
        r := f[2]

        mp := make(map[int64]bool)

        hasRes := true
        var res []int64
        var i int64
        i = 1
        for i=1; i<=n; i++ {
            val := ((l-1)/i) + 1

            curVal := val * i
            if _, v := mp[curVal]; !v {
                mp[curVal] = true
                res = append(res,  curVal)
            } else {
                for true {
                    if curVal + i > r {
                        hasRes = false
                        break
                    }
                    if _, iv := mp[curVal+ i]; !iv {
                        mp[curVal + i] = true
                        res = append(res,  curVal + i)
                        break
                    } else {
                        curVal = curVal + i
                    }

                }
            }
        }
        if hasRes {
            fmt.Println("YES")
            fmt.Printf("%d", res[0])
            for i=1; i<n; i++ {
                fmt.Printf(" %d", res[i])
            }
            fmt.Printf("\n")
        } else  {
            fmt.Println("NO")
        }

        testCase--
    }
}

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

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

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

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

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

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

func main() {

    in := bufio.NewReader(os.Stdin)
    testCase := readInt(in)

    for testCase > 0 {
        f := readArrInt64(in)
        n := f[0]
        l := f[1]
        r := f[2]

        if n > r - l + 1  {
            fmt.Println("NO")
            testCase--
            continue
        }

        mp := make(map[int64]bool)

        hasRes := true
        var res []int64
        var i int64
        i = 1
        for i=1; i<=n; i++ {
            val := ((l-1)/i) + 1

            curVal := val * i
            if _, v := mp[curVal]; !v {
                mp[curVal] = true
                res = append(res,  curVal)
            } else {
                for true {
                    if curVal + i > r {
                        hasRes = false
                        break
                    }
                    if _, iv := mp[curVal+ i]; !iv {
                        mp[curVal + i] = true
                        res = append(res,  curVal + i)
                        break
                    } else {
                        curVal = curVal + i
                    }

                }
            }
        }
        if hasRes {
            fmt.Println("YES")
            fmt.Printf("%d", res[0])
            for i=1; i<n; i++ {
                fmt.Printf(" %d", res[i])
            }
            fmt.Printf("\n")
        } else  {
            fmt.Println("NO")
        }

        testCase--
    }
}

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

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

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

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

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

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

func main() {

    in := bufio.NewReader(os.Stdin)
    testCase := readInt(in)

    fmt.Println(testCase)
    for testCase > 0 {
        f := readArrInt64(in)
        n := f[0]
        l := f[1]
        r := f[2]

        if n > r - l + 1  {
            fmt.Println("NO")
            testCase--
            continue
        }

        mp := make(map[int64]bool)

        hasRes := true
        var res []int64
        var i int64
        i = 1
        for i=1; i<=n; i++ {
            val := ((l-1)/i) + 1

            curVal := val * i
            if _, v := mp[curVal]; !v {
                mp[curVal] = true
                res = append(res,  curVal)
            } else {
                for true {
                    if curVal + i > r {
                        hasRes = false
                        break
                    }
                    if _, iv := mp[curVal+ i]; !iv {
                        mp[curVal + i] = true
                        res = append(res,  curVal + i)
                        break
                    } else {
                        curVal = curVal + i
                    }

                }
            }
        }
        if hasRes {
            fmt.Println("YES")
            fmt.Printf("%d", res[0])
            for i=1; i<n; i++ {
                fmt.Printf(" %d", res[i])
            }
            fmt.Printf("\n")
        } else  {
            fmt.Println("NO")
        }

        testCase--
    }
}

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

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

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

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

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

package main

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

var (
	reader     = bufio.NewReader(os.Stdin)
	t, n, l, r int
)

func solve(n, l, r int) string {
	var a []string
	var found bool
	for i := 1; i <= n; i++ {
		found = false
		for k := l / i * i; k <= r; k += i {
			found = true
			break
		}
		if !found {
			return "NO"
		}
		a = append(a, fmt.Sprintf("%d", r/i*i))
	}
	return "YES\n" + strings.Join(a, " ")
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n, &l, &r)
		fmt.Println(solve(n, l, r))
	}
}

package main

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

var (
	reader     = bufio.NewReader(os.Stdin)
	t, n, l, r int
)

func solve(n, l, r int) string {
	if r-l+1 < n {
		return "NO"
	}
	a := make([]string, n)
	for i := 1; i <= n; i++ {
		a = append(a, fmt.Sprintf("%d", r/i*i))
	}
	return "YES\n" + strings.Join(a, " ")
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n, &l, &r)
		fmt.Println(solve(n, l, r))
	}
}

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

		if r-l+1 < n && n != 1 {
			fmt.Fprintln(out, "NO")
		} else {
			fmt.Fprintln(out, "YES")
			for i := 1; i <= n; i++ {
				for l <= r {
					if l%i == 0 {
						fmt.Fprintf(out, "%d ", l)
						l++
						break
					}
					l++
				}
			}
			fmt.Fprintln(out)
		}
	}
}

package main

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

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

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

	var T int64
	fmt.Fscan(_r, &T)
	for ; T > 0; T-- {
		var n, l, r int64
		fmt.Fscan(_r, &n, &l, &r)
		can := true
		if r / n * n  < l {
			can = false
		}

		if can {
			fmt.Fprintln(_w, "YES")
			for i := int64(1); i <= n; i++ {
				fmt.Fprintln(_w, r/i*i)
			}
		} else {
			fmt.Fprintln(_w, "NO")
		}
	}

}

package main

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

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

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

func rw(in io.Reader, out io.Writer) {
	var t int
	fmt.Fscan(in, &t)
	for ti := 0; ti < t; ti++ {
		var n, l, r int
		fmt.Fscan(in, &n, &l, &r)
		w1, w2 := do(n, l, r)
		fmt.Fprint(out, w1)
		for i, v := range w2 {
			if i > 0 {
				fmt.Fprint(out, " ")
			} else {
				fmt.Fprintln(out)
			}
			fmt.Fprint(out, v)
		}
		fmt.Fprintln(out)
	}
}

func do(n, l, r int) (string, []int) {
	if r-l+1 < n {
		return "NO", nil
	}
	a := make([]int, n)
	for i := range a {
		a[i] = l + i
	}
	return "YES", a
}

package main

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

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

	testCases := readIntSlice(reader)[0]

	for testCases > 0 {
		testCases--

		constraints := readIntSlice(reader)
		n, l, r := constraints[0], constraints[1], constraints[2]
		possible := true

		arr := make([]string, n)
		for i := range arr {
			divisor := i + 1
			mod := l % divisor
			target := l + (divisor-mod)%divisor
			if target > r {
				possible = false
				break
			}
			arr[i] = strconv.Itoa(target)
		}

		if possible {
			writer.WriteString(strings.Join(arr, " ") + "\n")
		} else {
			writer.WriteString("NO\n")
		}

	}

	writer.Flush()
}

func readIntSlice(reader *bufio.Reader) []int {
	line, _, _ := reader.ReadLine()
	strs := strings.Split(string(line), " ")
	ints := make([]int, len(strs))
	for i, s := range strs {
		ints[i], _ = strconv.Atoi(s)
	}
	return ints
}


package main

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

func main() {
	N := 1000
	var n int
	fmt.Scanf("%d\n", &n)
	d1 := make([]int64, 2 * N + 1)
	d2 := make([]int64, 2 * N + 1)

	reader := bufio.NewReader(os.Stdin)
	for i := 0; i < n; i++ {
		str, _ := reader.ReadString('\n')
		spaceIdx := strings.Index(str, " ")
		x, _ := strconv.Atoi(str[0:spaceIdx])
		y, _ := strconv.Atoi(strings.TrimSpace(str[spaceIdx:]))

		d1[x + y] += 1
		d2[x - y + N] += 1
	}

	var result int64 = 0
	for i := 0; i < 2 * N + 1; i++ {
		if d1[i] > 0 {
			result += d1[i] * (d1[i] - 1) / 2
		}
		if d2[i] > 0 {
			result += d2[i] * (d2[i] - 1) / 2
		}
	}

	fmt.Printf("%d\n", result)
}

package main

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

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

	reader := bufio.NewReader(os.Stdin)
	re := regexp.MustCompile(`\r?\n`)

	diagonals := make(map[[2]int]int)

	for i := 0; i < n; i++ {
		if _in, err := reader.ReadString('\n'); err != nil {
			if err == io.EOF {
				break
			} else {
				return
			}
		} else {
			xy := strings.Split(re.ReplaceAllString(_in, ""), " ")
			if len(xy) != 2 {
				return
			}
			x, err := strconv.Atoi(xy[0])
			if err != nil {
				return
			}
			y, err := strconv.Atoi(xy[1])
			if err != nil {
				return
			}

			bp := y - x
			bn := y + x
			diagonals[[2]int{1, bp}] += 1
			diagonals[[2]int{-1, bn}] += 1
		}
	}

	res := 0
	for _, c := range diagonals {
		if c > 1 {
			res += c * (c - 1) / 2
		}
	}
	fmt.Println(res)
}

package main

import (
	"fmt"
)

func main() {
	var n int
	N := 1000
	fmt.Scanf("%d", &n)
	d1 := make([]int, 2 * N)
	d2 := make([]int, 2 * N)
	for i := 0; i < n; i++ {
		var x, y int
		fmt.Scanf("%d %d\n", &x, &y)
		d1[x + y] += 1
		d2[x - y + N] += 1
	}

	var result int64 = 0
	for i := 0; i < 2 * N; i++ {
		if d1[i] > 0 {
			result += int64(d1[i] * (d1[i] - 1) / 2)
		}
		if d2[i] > 0 {
			result += int64(d2[i] * (d2[i] - 1) / 2)
		}
	}

	fmt.Printf("%d\n", result)
}


package main

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

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

type writerImpl struct {
    *bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
    return &writerImpl{Writer: bufio.NewWriter(writer)}
}

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

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

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

type wordScannerImpl struct {
    *bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
    s := bufio.NewScanner(reader)
    s.Split(bufio.ScanWords)
    // adjust the following size as needed
    // 2 << 17 is good enough to scan strings of len 2*10^5
    // it could go as high as 2 << 26 before cf judge breaks
    size := 2 << 20
    buf := make([]byte, size)
    s.Buffer(buf, size)
    return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
    impl.Scan()
    bb := impl.Bytes()
    i := 0
    if bb[0] == '-' {
        for _, b := range bb[1:] {
            i *= 10
            i -= int(b - '0')
        }
        return i
    }
    for _, b := range bb {
        i *= 10
        i += int(b - '0')
    }
    return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
    impl.Scan()
    bb := impl.Bytes()
    i := int64(0)
    if bb[0] == '-' {
        for _, b := range bb[1:] {
            i *= 10
            i -= int64(b - '0')
        }
        return i
    }
    for _, b := range bb {
        i *= 10
        i += int64(b - '0')
    }
    return i
}

func (impl *wordScannerImpl) NextString() string {
    impl.Scan()
    return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
    defer writer.Flush()
    t := reader.NextInt64()
    for ; t > 0; t-- {
        n := reader.NextInt64()
        aa := []int64{}
        bb := []int64{}
        for i := int64(0); i < n; i++ {
            aa = append(aa, reader.NextInt64())
        }
        for i := int64(0); i < n; i++ {
            bb = append(bb, reader.NextInt64())
        }
        writer.Printf("%s\n", sol(aa, bb))
    }
}

func sol(aa, bb []int64) string {
    seenPlus := false
    seenMinus := false
    for p := 0; p < len(aa); p++ {
        if seenPlus && bb[p] > aa[p] {
            // do nothing
        } else if seenMinus && bb[p] < aa[p] {
            // do nothing
        } else if aa[p] == bb[p] {
            // do nothing
        } else {
            return "NO"
        }
        seenPlus = seenPlus || aa[p] == 1
        seenMinus = seenMinus || aa[p] == -1
    }
    return "YES"
}

package main

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

func main() {
	var t int
	var A, B [100000]int
	var N [10000]int
	var JOG [10000]bool
	var bo1, bo2, bo3 bool

	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	s.Scan()
	t, _ = strconv.Atoi(s.Text())
	for i := 0; i < t; i++ {
		s.Scan()
		N[i], _ = strconv.Atoi(s.Text())
		for j := 0; j < N[i]; j++ {
			s.Scan()
			A[j], _ = strconv.Atoi(s.Text())
		}
		bo1 = false
		bo2 = false
		bo3 = true
		for j := 0; j < N[i]; j++ {
			s.Scan()
			B[j], _ = strconv.Atoi(s.Text())
			if A[j] > B[j] && !bo1 {
				bo3 = false
			}
			if A[j] < B[j] && !bo2 {
				bo3 = false
			}
			if A[j] < 0 {
				bo1 = true
			}
			if A[j] > 0 {
				bo2 = true
			}
		}
		JOG[i] = bo3
	}
	w := bufio.NewWriter(os.Stdout)
	for i := 0; i < t; i++ {
		if JOG[i] {
			fmt.Fprintln(w, "YES")
		} else {
			fmt.Fprintln(w, "NO")
		}
	}
	w.Flush()
}

package main

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

func main() {
	Solve()
}

func Solve() {
	inBuf := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscanf(inBuf,"%d\n", &t)

	for i := 0; i < t; i++ {
		var n int
		fmt.Fscanf(inBuf, "%d\n", &n)

		format := "%d"
		var valuesAInCase []int64
		for j := 0; j < n; j++ {
			var num int64
			fmt.Fscanf(inBuf, format, &num)
			valuesAInCase = append(valuesAInCase, num)
			format = " %d"
		}
		fmt.Fscanf(inBuf, "\n", nil)

		format = "%d"
		var valuesBInCase []int64
		for j := 0; j < n; j++ {
			var num int64
			fmt.Fscanf(inBuf, format, &num)
			valuesBInCase = append(valuesBInCase, num)
			format = " %d"
		}
		fmt.Fscanf(inBuf, "\n", nil)

		is := IsPossibleToComputeBFromA(valuesAInCase, valuesBInCase)
		fmt.Println(is)
	}
}

func IsPossibleToComputeBFromA(arrA, arrB []int64) string {
	firstOne := getFirstItem(1, arrA)
	firstMinusOne := getFirstItem(-1, arrA)

	for i := len(arrA)-1; i >= 0; i-- {
		if arrA[i] < arrB[i] {
			if firstOne >= i {
				return "NO"
			}
		} else if arrA[i] > arrB[i] {
			if firstMinusOne >= i {
				return "NO"
			}
		}
	}
	return "YES"
}

func getFirstItem(a int64, list []int64) int {
	for i, b := range list {
		if b == a {
			return i
		}
	}
	return len(list)+1
}

package main

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

func newScanner() *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	return scanner
}

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

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

func scanString() string {
	if sc.Scan() {
		return sc.Text()
	}
	panic(sc.Err())
}

var sc = newScanner()

func main() {
	for t := scanInt(); t > 0; t-- {
		n := scanInt()
		a := scanInts(n)
		b := scanInts(n)
		minus, plus := false, false
		for i := n - 1; i >= 0; i-- {
			if a[i] < 0 {
				minus = false
			} else if a[i] > 0 {
				plus = false
			}
			if a[i] > b[i] {
				minus = true
			} else if a[i] < b[i] {
				plus = true
			}
		}
		if minus || plus {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
// https://www.codementor.io/@tucnak/using-golang-for-competitive-programming-h8lhvxzt3

func main() {
	var T int
	scanf("%d\n", &T)
	for tt := 0; tt < T; tt++ {
		var N int
		scanf("%d\n", &N)

		A := make([]int, N)
		B := make([]int, N)

		var a int
		for i := 0; i < N; i++ {
			if i != N - 1 {
				scanf("%d ", &a)
			} else {
				scanf("%d\n", &a)
			}
			A[i] = a
		}

		for i := 0; i < N; i++ {
			if i != N - 1 {
				scanf("%d ", &a)
			} else {
				scanf("%d\n", &a)
			}
			B[i] = a
		}

		has_seen_one := false
		has_seen_neg := false

		possible := true

		for i := 0; i < N; i++ {
			ok := false
			if A[i] == B[i] {
				ok = true
			} else if A[i] < B[i] {
				ok = has_seen_one
			} else {
				ok = has_seen_neg
			}

			if !ok {
				possible = false
				break
			}

			if A[i] == 1 {
				has_seen_one = true
			} else if A[i] == -1 {
				has_seen_neg = true
			}
		}

		defer writer.Flush()
		if !possible {
			printf("NO\n")
		} else {
			printf("YES\n")
		}
	}
}

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 min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

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

func 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()
	a := make([]int, 100010)
	for t := 0; t < T; t++ {
		n := NextInt()

		for i := 0; i < n; i++ {
			a[i] = NextInt()
		}

		neg, pos, ok := false, false, true
		for i := 0; i < n; i++ {
			b := NextInt() - a[i]
			if b < 0 {
				ok = ok && neg
			} else if b > 0 {
				ok = ok && pos
			}
			if a[i] < 0 {
				neg = true
			} else if a[i] > 0 {
				pos = true
			}
		}
		if ok {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}

}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A [100000]int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			if j < n-1 {
				fmt.Scanf("%d", &A[j])
			} else {
				fmt.Scanf("%d", &A[j])
			}
		}
		fmt.Println()
		bo1, bo2, bo3 := false, false, true
		for j := 0; j < n; j++ {
			if j < n-1 {
				fmt.Scanf("%d", &m)
			} else {
				fmt.Scanf("%d", &m)
			}
			if A[j] > m && !bo1 {
				bo3 = false
			}
			if A[j] < m && !bo2 {
				bo3 = false
			}
			if A[j] < 0 {
				bo1 = true
			}
			if A[j] > 0 {
				bo2 = true
			}
		}
		if bo3 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A [100000]int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			if j < n-1 {
				fmt.Scanf("%d ", &A[j])
			} else {
				fmt.Scanf("%d\n", &A[j])
			}
		}
		fmt.Println()
		bo1, bo2, bo3 := false, false, true
		for j := 0; j < n; j++ {
			if j < n-1 {
				fmt.Scanf("%d ", &m)
			} else {
				fmt.Scanf("%d\n", &m)
			}
			if A[j] > m && !bo1 {
				bo3 = false
			}
			if A[j] < m && !bo2 {
				bo3 = false
			}
			if A[j] < 0 {
				bo1 = true
			}
			if A[j] > 0 {
				bo2 = true
			}
		}
		if bo3 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A [100000]int
	var rn rune
	fmt.Scanf("%d%c", &t, &rn)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Scanf("%d%c", &n, &rn)
		for j := 0; j < n; j++ {
			fmt.Scanf("%d%c", &A[j], &rn)
		}
		bo1, bo2, bo3 := false, false, true
		for j := 0; j < n; j++ {
			fmt.Scanf("%d%c", &m, &rn)
			if A[j] > m && !bo1 {
				bo3 = false
			}
			if A[j] < m && !bo2 {
				bo3 = false
			}
			if A[j] < 0 {
				bo1 = true
			}
			if A[j] > 0 {
				bo2 = true
			}
		}
		if bo3 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A [100000]int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Scanf("%d\n", &n)
		for j := 0; j < n; j++ {
			if j < n-1 {
				fmt.Scanf("%d", &A[j])
			} else {
				fmt.Scanf("%d", &A[j])
			}
		}
		fmt.Println()
		bo1, bo2, bo3 := false, false, true
		for j := 0; j < n; j++ {
			if j < n-1 {
				fmt.Scanf("%d", &m)
			} else {
				fmt.Scanf("%d", &m)
			}
			if A[j] > m && !bo1 {
				bo3 = false
			}
			if A[j] < m && !bo2 {
				bo3 = false
			}
			if A[j] < 0 {
				bo1 = true
			}
			if A[j] > 0 {
				bo2 = true
			}
		}
		if bo3 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A, B [100][100]int
	var N [100000]int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d\n", &N[i])
		for j := 0; j < N[i]; j++ {
			fmt.Scanf("%d", &A[i][j])
		}
		for j := 0; j < N[i]; j++ {
			fmt.Scanf("%d", &B[i][j])
		}
		// bo1, bo2, bo3 := false, false, true
		// for j := 0; j < n; j++ {
		// 	m = B[j]
		// 	if A[j] > m && !bo1 {
		// 		bo3 = false
		// 	}
		// 	if A[j] < m && !bo2 {
		// 		bo3 = false
		// 	}
		// 	if A[j] < 0 {
		// 		bo1 = true
		// 	}
		// 	if A[j] > 0 {
		// 		bo2 = true
		// 	}
		// }
		// if bo3 {
		// 	fmt.Println("YES")
		// } else {
		// 	fmt.Println("NO")
		// }
	}

	fmt.Printf("t=%d\n", t)
	for i := 0; i < t; i++ {
		fmt.Printf("n=%d\n", N[i])
		for j := 0; j < N[i]; j++ {
			fmt.Printf("%d ", A[i][j])
		}
		fmt.Println()
		for j := 0; j < N[i]; j++ {
			fmt.Printf("%d ", B[i][j])
		}
		fmt.Println()
		fmt.Println()
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A, B [100][100]int
	var N [100000]int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d\n", &N[i])
		for j := 0; j < N[i]; j++ {
			if j == N[i]-1 {
				fmt.Scanf("%d\n", &A[i][j])
			} else {
				fmt.Scanf("%d", &A[i][j])
			}
		}
		for j := 0; j < N[i]; j++ {
			if j == N[i]-1 {
				fmt.Scanf("%d\n", &B[i][j])
			} else {
				fmt.Scanf("%d", &B[i][j])
			}
		}
		// bo1, bo2, bo3 := false, false, true
		// for j := 0; j < n; j++ {
		// 	m = B[j]
		// 	if A[j] > m && !bo1 {
		// 		bo3 = false
		// 	}
		// 	if A[j] < m && !bo2 {
		// 		bo3 = false
		// 	}
		// 	if A[j] < 0 {
		// 		bo1 = true
		// 	}
		// 	if A[j] > 0 {
		// 		bo2 = true
		// 	}
		// }
		// if bo3 {
		// 	fmt.Println("YES")
		// } else {
		// 	fmt.Println("NO")
		// }
	}

	fmt.Printf("t=%d\n", t)
	for i := 0; i < t; i++ {
		fmt.Printf("n=%d\n", N[i])
		for j := 0; j < N[i]; j++ {
			fmt.Printf("%d ", A[i][j])
		}
		fmt.Println()
		for j := 0; j < N[i]; j++ {
			fmt.Printf("%d ", B[i][j])
		}
		fmt.Println()
		fmt.Println()
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A, B [100000]int
	var rn rune
	fmt.Scanf("%d%c", &t, &rn)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Scanf("%d%c", &n, &rn)
		for j := 0; j < n; j++ {
			fmt.Scanf("%d%c", &A[j], &rn)
			fmt.Printf("%d ", A[j])
		}
		fmt.Println()
		for j := 0; j < n; j++ {
			fmt.Scanf("%d%c", &B[j], &rn)
			fmt.Printf("%d ", B[j])
		}
		bo1, bo2, bo3 := false, false, true
		for j := 0; j < n; j++ {
			m = B[j]
			// fmt.Scanf("%d%c", &m, &rn)
			if A[j] > m && !bo1 {
				bo3 = false
			}
			if A[j] < m && !bo2 {
				bo3 = false
			}
			if A[j] < 0 {
				bo1 = true
			}
			if A[j] > 0 {
				bo2 = true
			}
		}
		if bo3 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	var A, B [100000]int
	var rn rune
	fmt.Scanf("%d%c", &t, &rn)
	fmt.Printf("t=%d\n", t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Scanf("%d%c", &n, &rn)
		fmt.Printf("n=%d\n", n)
		for j := 0; j < n; j++ {
			fmt.Scanf("%d%c", &A[j], &rn)
			fmt.Printf("%d ", A[j])
		}
		fmt.Println()
		for j := 0; j < n; j++ {
			fmt.Scanf("%d%c", &B[j], &rn)
			fmt.Printf("%d ", B[j])
		}
		fmt.Println()
		bo1, bo2, bo3 := false, false, true
		for j := 0; j < n; j++ {
			m = B[j]
			// fmt.Scanf("%d%c", &m, &rn)
			if A[j] > m && !bo1 {
				bo3 = false
			}
			if A[j] < m && !bo2 {
				bo3 = false
			}
			if A[j] < 0 {
				bo1 = true
			}
			if A[j] > 0 {
				bo2 = true
			}
		}
		if bo3 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

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

type writerImpl struct {
    *bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
    return &writerImpl{Writer: bufio.NewWriter(writer)}
}

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

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

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

type wordScannerImpl struct {
    *bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
    s := bufio.NewScanner(reader)
    s.Split(bufio.ScanWords)
    // adjust the following size as needed
    // 2 << 17 is good enough to scan strings of len 2*10^5
    // it could go as high as 2 << 26 before cf judge breaks
    size := 2 << 20
    buf := make([]byte, size)
    s.Buffer(buf, size)
    return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
    impl.Scan()
    bb := impl.Bytes()
    i := 0
    if bb[0] == '-' {
        for _, b := range bb[1:] {
            i *= 10
            i -= int(b - '0')
        }
        return i
    }
    for _, b := range bb {
        i *= 10
        i += int(b - '0')
    }
    return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
    impl.Scan()
    bb := impl.Bytes()
    i := int64(0)
    if bb[0] == '-' {
        for _, b := range bb[1:] {
            i *= 10
            i -= int64(b - '0')
        }
        return i
    }
    for _, b := range bb {
        i *= 10
        i += int64(b - '0')
    }
    return i
}

func (impl *wordScannerImpl) NextString() string {
    impl.Scan()
    return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
    defer writer.Flush()
    t := reader.NextInt64()
    for ; t > 0; t-- {
        n := reader.NextInt64()
        aa := []int64{}
        bb := []int64{}
        for i := int64(0); i < n; i++ {
            aa = append(aa, reader.NextInt64())
        }
        for i := int64(0); i < n; i++ {
            bb = append(bb, reader.NextInt64())
        }
        writer.Printf("%s\n", sol(aa, bb))
    }
}

func sol(aa, bb []int64) string {
    seenPlus := false
    seenMinus := false
    for p := 0; p < len(aa); p++ {
        if seenPlus && bb[p] > aa[p] {
            // do nothing
        } else if seenMinus && bb[p] < aa[p] {
            // do nothing
        } else if aa[p] == bb[p] {
            // do nothing
        } else {
            return "NO"
        }
        seenPlus = aa[p] == 1
        seenMinus = aa[p] == -1
    }
    return "YES"
}


package main

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

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

func ans() {
	var n int
	Fscan(in, &n)
	var a []int64 = make([]int64, n)
	sum := int64(0)
	ans := int64(0)
	for i := 0; i < n; i++ {
		Fscan(in, &a[i])
	}
	for i := 0; i < n; i++ {
		if a[i] != 0 {
			sum += a[i]
			continue
		}
		if i+1 == n || a[i+1] == 0 {
			a[i] = -sum
			sum = 0
			continue
		}
		r := i + 1
		var cnt map[int64]int = make(map[int64]int)
		mx := 0
		who := int64(-1)
		old_sum := sum
		cnt[sum] = 1
		for ; r < n; r++ {
			sum += a[r]
			cnt[sum]++
			if cnt[sum] > mx {
				mx = cnt[sum]
				who = sum
			}
			if a[r] == 0 {
				break
			}
		}
		sum = old_sum
		a[i] = -who
		sum += a[i]
	}
	sum = int64(0)
	for i := 0; i < n; i++ {
		sum += a[i]
		if sum == 0 {
			ans++
		}
	}
	Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans()
	}
}

package main

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

func get_max(freq map[int64]int) int {
	max := 0
	for _, f := range freq {
		if max < f {
			max = f
		}
	}
	return max
}

func main() {
	r := bufio.NewReader(os.Stdin)
	var T int
	fmt.Fscan(r, &T)
	for t := 0; t < T; t += 1 {
		var N int
		fmt.Fscan(r, &N)
		a := make([]int64, N)
		for i := 0; i < N; i += 1 {
			fmt.Fscan(r, &a[i])
		}
		var sum int64
		ans := 0
		i := 0
		for ; i < N && a[i] != 0; i += 1 {
			sum += a[i]
			if sum == 0 {
				ans += 1
			}
		}
		freq := make(map[int64]int)
		for ; i < N; i += 1 {
			if a[i] == 0 {
				ans += get_max(freq)
				freq = make(map[int64]int)
			}
			sum += a[i]
			freq[sum] += 1
		}
		ans += get_max(freq)
		fmt.Println(ans)
	}
}

package main

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

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

func ans() {
	var n int
	Fscan(in, &n)
	var a []int64 = make([]int64, n)
	sum := int64(0)
	ans := int64(0)
	for i := 0; i < n; i++ {
		Fscan(in, &a[i])
	}
	for i := 0; i < n; i++ {
		if a[i] != 0 {
			sum += a[i]
			continue
		}
		if i+1 == n || a[i+1] == 0 {
			a[i] = -sum
			sum = 0
			continue
		}
		r := i + 1
		var cnt map[int64]int = make(map[int64]int)
		mx := 0
		who := int64(-1)
		old_sum := sum
		for ; r < n; r++ {
			sum += a[r]
			cnt[sum]++
			if cnt[sum] > mx {
				mx = cnt[sum]
				who = sum
			}
			if a[r] == 0 {
				break
			}
		}
		sum = old_sum
		a[i] = -who
		sum += a[i]
	}
	sum = int64(0)
	for i := 0; i < n; i++ {
		sum += a[i]
		if sum == 0 {
			ans++
		}
	}
	Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	var t int
	Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans()
	}
}


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

func main(){
	read := bufio.NewReader(os.Stdin)
	write := bufio.NewWriter(os.Stdout)

	defer write.Flush()

	var tc int

	for Fscan (read, &tc); tc > 0; tc -- {
		var n int
		Fscan (read, &n)
		min, max, min_ind, max_ind := 1 << 30, 0, -1, -1

		for i := 1; i <= n; i++ {
			var val int
			Fscan (read, &val)
			if val < min {
				min, min_ind = val, i
			}
			if val > max {
				max, max_ind = val, i
			}
		}
		Fprintln(write, min_ind, max_ind)
	}
}

package main

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

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

	var tc int
	_, _ = fmt.Fscan(r, &tc)

	for i := 0; i < tc; i++ {
		var n int
		_, _ = fmt.Fscan(r, &n)

		numbers := make([]int, n)
		for i := range numbers {
			_, _ = fmt.Fscan(r, &numbers[i])
		}

		answer1, answer2 := goodPairs(numbers)

		fmt.Println(answer1, answer2)
	}
}

func goodPairs(numbers []int) (int, int) {
	numIdxMap := make(map[int]int)
	for i, number := range numbers {
		numIdxMap[number] = i
	}

	sort.Ints(numbers)

	return numIdxMap[numbers[0]] + 1, numIdxMap[numbers[len(numbers)-1]] + 1
}

package main

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

var (
	input = bufio.NewReader(os.Stdin)
	ouput = bufio.NewWriter(os.Stdout)
)

func main() {
	var t, n, x int
	fmt.Fscan(input, &t)
	for i := 0; i < t; i++ {
		var max, min, lmin, lmax int = -1000000001, 1000000001, -1, -1
		fmt.Fscan(input, &n)
		for j := 1; j <= n; j++ {
			fmt.Fscan(input, &x)
			if x > max {
				max = x
				lmax = j
			}
			if x < min {
				min = x
				lmin = j
			}
		}
		if lmin < lmax {
			fmt.Printf("%d %d\n", lmin, lmax)
		} else {
			fmt.Printf("%d %d\n", lmax, lmin)
		}

	}
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1656A
Date: 11/04/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1656/A
Problem: CF1656A
**/
func (in *CF1656A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		min , max := 0, 0
		indexmin , indexmax := 0, 0
		for i:=0;i<n;i++{
			val := in.NextInt()
			if i == 0{
				min = val
				max = val
				indexmax = i+1
				indexmin = i+1
			}

			if val < min {
				min = val
				indexmin = i+1
			}

			if val > max {
				max = val
				indexmax = i+1
			}
		}
		fmt.Println(indexmin,indexmax)
	}
}

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

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

package main

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

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

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

	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		maxinum := -0x3f3f3f3f
		maxidx := 0
		mininum := 0x3f3f3f3f
		minidx := 0
		for j := 0; j < n; j++ {
			var num int
			fmt.Fscan(in, &num)
			if maxinum < num {
				maxinum = num
				maxidx = j
			}
			if mininum > num {
				mininum = num
				minidx = j
			}
		}
		// solve
		fmt.Fprintln(out, minidx+1, maxidx+1)
	}
}

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

package main

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

func main() {
	in, out := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := 0
	fmt.Fscan(in, &t)
	for ii := 0; ii < t; ii++ {
		var n int
		fmt.Fscan(in, &n)
		nums := make([]int, n)
		min, max := 0, 0
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &nums[i])
			if nums[i] < nums[min] {
				min = i
			}
			if nums[i] > nums[max] {
				max = i
			}
		}
		fmt.Fprintln(out, min+1, max+1)
	}
}

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([]int64, n)
		low, high := 0, 0
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &arr[i])
			if arr[i] < arr[low] {
				low = i
			}

			if arr[i] > arr[high] {
				high = i
			}
		}

		fmt.Fprintln(out, low+1, high+1)
	}
}

package main

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

/*
1
5
1 2 2 1 4
---
1 1
*/

//goland:noinspection GoUnhandledErrorResult
func solve() {
	var n int
	scanf("%d\n", &n)

	a := make([]int, n)

	for i := 0; i < n; i++ {
		scanf("%d", &a[i])
	}
	scanf("\n")

	fmt.Fprintln(writer, minIdx(a...)+1, maxIdx(a...)+1)
}

//goland:noinspection GoUnhandledErrorResult
func main() {
	defer writer.Flush()

	t := 1
	scanf("%d\n", &t)

	for ; t > 0; t-- {
		solve()
	}
}

const maxUint = ^uint(0)

//goland:noinspection GoUnusedConst
const minUint = 0
const maxInt = int(maxUint >> 1)

//goland:noinspection GoUnusedConst
const minInt = -maxInt - 1

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

func scanf(f string, a ...interface{}) {
	if _, err := fmt.Fscanf(reader, f, a...); err != nil {
		panic(err)
	}
}

//goland:noinspection GoUnusedFunction
func reversed(s string) string {
	input := []rune(s)
	li := len(input)
	ret := make([]rune, li)
	for i, r := range input {
		ret[li-i-1] = r
	}
	return string(ret)
}

//goland:noinspection GoUnusedFunction
func divCeil(num, div int64) int64 {
	quot := num / div
	if num%div > 0 {
		quot++
	} else if num%div < 0 {
		quot--
	}
	return quot
}

//goland:noinspection GoUnusedFunction
func minIdx(nums ...int) int {
	minNumIdx := 0
	for i, num := range nums {
		if num < nums[minNumIdx] {
			minNumIdx = i
		}
	}

	return minNumIdx
}

//goland:noinspection GoUnusedFunction
func maxIdx(nums ...int) int {
	maxNumIdx := 0
	for i, num := range nums {
		if num > nums[maxNumIdx] {
			maxNumIdx = i
		}
	}

	return maxNumIdx
}

//goland:noinspection GoUnusedFunction
func abs(num int) int {
	if num < 0 {
		return -num
	}
	return num
}

//goland:noinspection GoUnusedFunction
func isPrime(num int) bool {
	if num == 2 || num == 3 {
		return true
	}

	if num <= 1 || num%2 == 0 || num%3 == 0 {
		return false
	}

	for i := 5; i*i <= num; i += 6 {
		if num%i == 0 || num%(i+2) == 0 {
			return false
		}
	}

	return true
}

//goland:noinspection GoUnusedFunction
func gcd(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

//goland:noinspection GoUnusedFunction
func lcm(a, b int) int {
	return abs(a) / gcd(a, b) * abs(b)
}

// Examples:
//	digitAt(1234, -1) -> panic!
//	digitAt(1234, 0) -> 4
//	digitAt(1234, 1) -> 3
//	digitAt(1234, 2) -> 2
//	digitAt(1234, 3) -> 1
//	digitAt(1234, 4) -> panic!
//goland:noinspection GoUnusedFunction
func digitAt(num, pos int) int {
	if num == 0 {
		return 0
	}

	num = abs(num)

	lenNum := int(math.Log10(float64(num))) + 1
	if pos < 0 || pos >= lenNum {
		err := fmt.Sprintf("Out of bound access for digit. Position passed %d, number %d", pos, num)
		panic(err)
	}

	rem := num % int(math.Pow10(pos+1))
	return rem / int(math.Pow10(pos))
}

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])

		text, _ = reader.ReadString('\n')
		ninps = strings.Fields(text)
		largest := -1
		smallest := math.MaxInt32
		i := 0
		j := 0
		for k, val := range ninps {
			a, _ := strconv.Atoi(val)
			if a < smallest {
				smallest = a
				i = k+1
			}
			if a > largest {
				largest = a
				j = k+1
			}
		}
		fmt.Println(i,j)
	}
}

package main
import "fmt"
import "os"
import "bufio"
var (
	input = bufio.NewReader(os.Stdin)
	ouput = bufio.NewWriter(os.Stdout)
)

func main() {
	count := 0
	fmt.Fscan(input,&count)
	ans := make([][2]int,0,count)
	for count>0 {
		count --
		arrCnt := 0
		fmt.Fscan(input,&arrCnt)
		idx := 0
		minI := -1
		maxI := -1
		maxV := 0
		minV := 0
		for arrCnt>0 {
			arrCnt--
			v := 0
			fmt.Fscan(input,&v)
			if minI==-1 || minV > v {
				minI = idx
				minV = v
			}
			if maxI==-1 ||maxV<v {
				maxV = v
				maxI = idx
			}
			idx ++
		}
		ans = append(ans,[2]int{minI+1,maxI+1})
	}
	for _,a := range ans {
		fmt.Printf("%d  %d\n",a[0],a[1])
	}
}

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 b,s,ib,is int
		for j:=0;j<n;j++{
			var x int
			fmt.Fscan(in,&x)
			if x > b || j == 0 {
				b = x
				ib = j+1
			}
			if x < s || j == 0 {
				s = x
				is = j+1
			}
		}
		if is < ib {
			fmt.Fprintln(out,is,ib)
		} else {
			fmt.Fprintln(out,ib,is)
		}
	}
}

package main

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

func main() {

	reader := bufio.NewReader(os.Stdin)
	writter := bufio.NewWriter(os.Stdout)
	defer writter.Flush()

	t := 0
	fmt.Fscan(reader, &t)

	for t > 0 {
		n := 0
		fmt.Fscan(reader, &n)

		a := make([]int, n)
		for i := range a {
			fmt.Fscan(reader, &a[i])
		}

		result := solve(n, a)

		for i := range result {
			fmt.Fprintf(writter, "%d ", result[i])
		}

		fmt.Fprintln(writter)

		t--
	}

	// n := 3
	// a := []int{5, 2, 7}

	// fmt.Println(solve(n, a))

}

func solve(n int, a []int) []int {

	result := make([]int, 2)
	min, minP, max, maxP := 1000000001, -1, 0, -1

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

		if a[i] > max {
			max = a[i]
			maxP = i
		}
	}

	result[0] = minP + 1
	result[1] = maxP + 1

	// for i := 0; i < n; i++ {
	// 	for j := i; j < n; j++ {
	// 		for k := range a {
	// 			if math.Abs(float64(a[i]-a[k]))+math.Abs(float64(a[k]-a[j])) != math.Abs(float64(a[i]-a[j])) {
	// 				break
	// 			}

	// 			if k == len(a)-1 {
	// 				result[0] = i + 1
	// 				result[1] = j + 1
	// 				return result
	// 			}
	// 		}
	// 	}
	// }

	return result
}

package main
import "fmt"
func main() {
	count := 0
	fmt.Scanf("%d",&count)
	ans := make([][2]int,0,count)
	for count>0 {
		count --
		arrCnt := 0
		fmt.Scanf("%d",&arrCnt)
		arr := make([]int,0,arrCnt)
		for arrCnt>0 {
			arrCnt--
			v := 0
			fmt.Scanf("%d",&v)
			arr = append(arr, v)
		}
		minI := 0
		maxI := 0
		for idx := range arr {
			if arr[idx]<arr[minI] {
				minI = idx
			}
			if arr[idx] > arr[maxI] {
				maxI = idx
			}
		}
		ans = append(ans,[2]int{minI+1,maxI+1})
	}
	for _,a := range ans {
		fmt.Printf("%d  %d\n",a[0],a[1])
	}
}

package main
import "fmt"
func main() {
	count := 0
	fmt.Scanf("%d",&count)
	for count>0 {
		count --
		arrCnt := 0
		fmt.Scanf("%d",&arrCnt)
		arr := make([]int,0,arrCnt)
		for arrCnt>0 {
			arrCnt--
			v := 0
			fmt.Scanf("%d",&v)
			arr = append(arr, v)
		}
		minI := 0
		maxI := 0
		for idx := range arr {
			if arr[idx]<arr[minI] {
				minI = idx
			}
			if arr[idx] > arr[maxI] {
				maxI = idx
			}
		}
		fmt.Printf("%d %d\n", minI+1, maxI+1)
	}
}

package main
import "fmt"
func main() {
	count := 0
	fmt.Scanf("%d",&count)
	for count>0 {
		count --
		arrCnt := 0
		fmt.Scanf("%d",&arrCnt)
		arr := make([]int,0,arrCnt)
		for arrCnt>0 {
			arrCnt--
			v := 0
			fmt.Scanf("%d",&v)
			arr = append(arr, v)
		}
		minI := 0
		maxI := 0
		for idx := range arr {
			if arr[idx]<arr[minI] {
				minI = idx
			}
			if arr[idx] > arr[maxI] {
				maxI = idx
			}
		}
		fmt.Println(fmt.Sprintf("%d  %d",minI+1,maxI+1))
	}
}

package main
import "fmt"
func main() {
	count := 0
	fmt.Scanf("%d",&count)
	ans := make([][2]int,0,count)
	for count>0 {
		count --
		arrCnt := 0
		fmt.Scanf("%d",&arrCnt)
		arr := make([]int,0,arrCnt)
		for arrCnt>0 {
			arrCnt--
			v := 0
			fmt.Scanf("%d",&v)
			arr = append(arr, v)
		}
		minI := 0
		maxI := 0
		for idx := range arr {
			if arr[idx]<arr[minI] {
				minI = idx
			}
			if arr[idx] > arr[maxI] {
				maxI = idx
			}
		}
		ans = append(ans,[2]int{minI+1,maxI+1})
	}
	for _,a := range ans {
		fmt.Println(fmt.Sprintf("%d  %d",a[0],a[1]))
	}
}

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)
		a:= make([]int,n)
		for j:=0;j<n;j++{
			fmt.Fscan(in,&a[j])
		}
		if n == 1 {
			fmt.Fprintln(out,1,1)
			continue
		} else if n == 2 {
			fmt.Fprintln(out,1,2)
			continue
		}
		var count int
		for l:=0;l<n-1;l++{
			for j:=l+1;j<n;j++{
				for k:=0;k<n;k++ {
					if abs(a[j]-a[k]) + abs(a[l]-a[k]) == abs(a[j]-a[l]) {
						fmt.Fprintln(out,l+1,j+1)
						goto out
					}
				}
				if count == 0 {
					fmt.Fprintln(out,l+1,j+1)
					goto out
				}
			}
		}
		out:
	}
}

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

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)
		a:= make([]int,n)
		for j:=0;j<n;j++{
			fmt.Fscan(in,&a[j])
		}
		if n == 1 {
			fmt.Fprintln(out,1,1)
			continue
		} else if n == 2 {
			fmt.Fprintln(out,1,2)
			continue
		}
		var count int
		for j:=1;j<n;j++{
			count = 0
			for k:=0;k<n;k++ {
				if abs(a[j]-a[k]) + abs(a[j-1]-a[k]) != abs(a[j]-a[j-1]) {
					count++
					continue
				}
			}
			if count == 0 {
				fmt.Fprintln(out,j,j+1)
				break
			}
		}
	}
}

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

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)
		a:= make([]int,n)
		for j:=0;j<n;j++{
			fmt.Fscan(in,&a[j])
		}
		if n == 1 {
			fmt.Fprintln(out,1,1)
			continue
		} else if n == 2 {
			fmt.Fprintln(out,1,2)
			continue
		}
		for j:=1;j<n;j++{
			for k:=0;k<n;k++ {
				if k != j || k != j-1 {
					if abs(a[j]-a[k]) + abs(a[j-1]-a[k]) == abs(a[j]-a[j-1]) {
						fmt.Fprintln(out,j,j+1)
						goto out
					}
				}
			}
		}
		out:
	}
}

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

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)
		for j:=0;j<n;j++{
			var x int
			fmt.Fscan(in,&x)
		}
		fmt.Fprintln(out,1,1)
	}
}

package main

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

func main() {

	reader := bufio.NewReader(os.Stdin)
	writter := bufio.NewWriter(os.Stdout)
	defer writter.Flush()

	t := 0
	fmt.Fscan(reader, &t)

	for t > 0 {
		n := 0
		fmt.Fscan(reader, &n)

		a := make([]int, n)
		for i := range a {
			fmt.Fscan(reader, &a[i])
		}

		fmt.Fprintln(writter, solve(n, a))

		t--
	}

	// n := 3
	// a := []int{5, 2, 7}

	// fmt.Println(solve(n, a))

}

func solve(n int, a []int) []int {

	result := make([]int, 2)

	for i := 0; i < n; i++ {
		for j := i; j < n; j++ {
			for k := range a {
				if math.Abs(float64(a[i]-a[k]))+math.Abs(float64(a[k]-a[j])) != math.Abs(float64(a[i]-a[j])) {
					break
				}

				if k == len(a)-1 {
					result[0] = i + 1
					result[1] = j + 1
					return result
				}
			}
		}
	}

	return result
}

package main

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

var (
	input = bufio.NewReader(os.Stdin)
	ouput = bufio.NewWriter(os.Stdout)
)

func main() {
	var t, n, x int
	fmt.Fscan(input, &t)
	for i := 0; i < t; i++ {
		var max, min, lmin, lmax int = -1000000001, 1000000001, -1, -1
		fmt.Fscan(input, &n)
		for j := 0; j < n; j++ {
			fmt.Fscan(input, &x)
			if x > max {
				max = x
				lmax = j
			}
			if x < min {
				min = x
				lmin = j
			}
		}
		if lmin < lmax {
			fmt.Fprintf(ouput, "%d %d", lmin, lmax)
		} else {
			fmt.Fprintf(ouput, "%d %d", lmax, lmin)
		}

	}
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		val := ""
		fmt.Scanf("%s\n", &val)
		isZero := false
		isEven := false
		sum := 0
		if val == "0" {
			fmt.Println("red")
		} else {
			for _, ch := range val {
				if (ch-'0')%2 == 0 {
					if !(ch == '0' && !isZero) {
						isEven = true
					}
				}
				if ch == '0' {
					isZero = true
				}

				sum += int(ch - '0')
			}
			if sum%3 == 0 && isZero && isEven {
				fmt.Println("red")
			} else {
				fmt.Println("cyan")
			}
		}
	}
}

package main

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

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

	var t int
	var s []byte
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &s)
		cnt := [10]int{}
		sum := 0
		for _, c := range s {
			c -= '0'
			cnt[c]++
			sum += int(c)
		}
		if sum != 0 && (cnt[0] == 0 || cnt[0] == 1 && cnt[0]+cnt[2]+cnt[4]+cnt[6]+cnt[8] == 1 || sum%3 != 0) {
			Fprintln(out, "cyan")
		} else {
			Fprintln(out, "red")
		}
	}
}

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

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++ {
		s := ""
		fmt.Fscanf(in, "%s\n", &s)
		zero := 0
		evenNotZero := false
		sum := 0
		for i := 0; i < len(s); i++ {
			sum += int(s[i] - '0')
			if s[i] == '0' {
				zero++
			}
			if int(s[i]-'0') > 0 && int(s[i]-'0')%2 == 0 {
				evenNotZero = true
			}
		}
		if zero > 1 {
			evenNotZero = true
		}
		if zero > 0 && sum%3 == 0 && evenNotZero {
			fmt.Fprintf(out, "red\n")
		} else {
			fmt.Fprintf(out, "cyan\n")
		}
	}
	return
}

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

package main

import (
	"fmt"
	"strconv"
)

func main() {
	var n int
	_, _ = fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var number string
		_, _ = fmt.Scanf("%s\n", &number)
		numberRunes := []rune(number)
		isEven := false
		isDivBy3 := false
		hasZero := false
		zeroOnly := true
		firstZero := false
		sum := 0
		for _, numberRune := range numberRunes {
			numberInt, _ := strconv.Atoi(string(numberRune))
			if numberInt == 0 {
				if firstZero {
					isEven = true
				}
				firstZero = true
			}
			if numberInt != 0 {
				zeroOnly = false
			}
			if numberInt%2 == 0 && numberInt != 0 {
				isEven = true
			}
			if numberInt == 0 {
				hasZero = true
			}
			sum += numberInt
		}
		if sum % 3 == 0 {
			isDivBy3 = true
		}
		if (isEven && isDivBy3 && hasZero) || zeroOnly {
			fmt.Printf("red\n")
		} else {
			fmt.Printf("cyan\n")
		}
	}
}

package main

import (
	"fmt"
	"strconv"
)

func main() {
	var n int
	_, _ = fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var number string
		_, _ = fmt.Scanf("%s\n", &number)
		numberRunes := []rune(number)
		isEven := false
		isDivBy3 := false
		hasZero := false
		zeroOnly := true
		sum := 0
		for _, numberRune := range numberRunes {
			numberInt, _ := strconv.Atoi(string(numberRune))
			if numberInt != 0 {
				zeroOnly = false
			}
			if numberInt%2 == 0 && numberInt != 0 {
				isEven = true
			}
			if numberInt == 0 {
				hasZero = true
			}
			sum += numberInt
		}
		if sum % 3 == 0 {
			isDivBy3 = true
		}
		if (isEven && isDivBy3 && hasZero) || zeroOnly {
			fmt.Printf("red\n")
		} else {
			fmt.Printf("cyan\n")
		}
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		val := ""
		fmt.Scanf("%s", &val)
		isZero := false
		isEven := false
		sum := 0
		if val == "0" {
			fmt.Println("red")
		} else {
			for _, ch := range val {
				if (ch-'0')%2 == 0 {
					if !(ch == '0' && !isZero) {
						isEven = true
					}
				}
				if ch == '0' {
					isZero = true
				}

				sum += int(ch - '0')
			}
			if sum%3 == 0 && isZero && isEven {
				fmt.Println("red")
			} else {
				fmt.Println("cyan")
			}
		}
	}
}