For the New Year, Polycarp decided to send postcards to all his $$$n$$$ friends. He wants to make postcards with his own hands. For this purpose, he has a sheet of paper of size $$$w \times h$$$, which can be cut into pieces.Polycarp can cut any sheet of paper $$$w \times h$$$ that he has in only two cases:   If $$$w$$$ is even, then he can cut the sheet in half and get two sheets of size $$$\frac{w}{2} \times h$$$;  If $$$h$$$ is even, then he can cut the sheet in half and get two sheets of size $$$w \times \frac{h}{2}$$$; If $$$w$$$ and $$$h$$$ are even at the same time, then Polycarp can cut the sheet according to any of the rules above.After cutting a sheet of paper, the total number of sheets of paper is increased by $$$1$$$.Help Polycarp to find out if he can cut his sheet of size $$$w \times h$$$ at into $$$n$$$ or more pieces, using only the rules described above.

The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of one line containing three integers $$$w$$$, $$$h$$$, $$$n$$$ ($$$1 \le w, h \le 10^4, 1 \le n \le 10^9$$$) — the width and height of the sheet Polycarp has and the number of friends he needs to send a postcard to.

For each test case, output on a separate line:    "YES", if it is possible to cut a sheet of size $$$w \times h$$$ into at least $$$n$$$ pieces;  "NO" otherwise.  You can output "YES" and "NO" in any case (for example, the strings yEs, yes, Yes and YES will be recognized as positive).

NoteIn the first test case, you can first cut the $$$2 \times 2$$$ sheet into two $$$2 \times 1$$$ sheets, and then cut each of them into two more sheets. As a result, we get four sheets $$$1 \times 1$$$. We can choose any three of them and send them to our friends.In the second test case, a $$$3 \times 3$$$ sheet cannot be cut, so it is impossible to get two sheets.In the third test case, you can cut a $$$5 \times 10$$$ sheet into two $$$5 \times 5$$$ sheets.In the fourth test case, there is no need to cut the sheet, since we only need one sheet.In the fifth test case, you can first cut the $$$1 \times 4$$$ sheet into two $$$1 \times 2$$$ sheets, and then cut each of them into two more sheets. As a result, we get four sheets $$$1 \times 1$$$.

package main
import (
	"fmt"
	//"math"
)
func main() {
	var n int
	fmt.Scan(&n)
	for i:=0;i<n;i++{
		var w,h,s int
		fmt.Scan(&w,&h,&s)
		counter:=1
		if w%2==0{
			for w%2==0{
				w= w/2
				counter*=2
			}
		}
		if h%2==0{
			for h%2==0{
				h= h/2
				counter*=2
			}
		}
		if counter >= s {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

func main() {
	defer writer.Flush()
	giveAnswer()
}
func countIt(a int) int {
	var original int
	original = a
	for true {
		if a%2 == 0 {
			a = a / 2
		} else {
			return original / a
		}
	}
	return a / a
}
func giveAnswer() {

	var t, first, second, n int

	scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		scanf("%d %d %d\n", &first, &second, &n)
		answer := countIt(first) * countIt(second)
		if answer >= n {
			printf("%s\n", "YES")
		} else {
			printf("%s\n", "NO")
		}
	}
}

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

func main() {
	defer writer.Flush()
	giveAnswer()

}
func countIt(a int) int {
	original := a
	for true {
		if a%2 == 0 {
			a = a / 2
		} else {
			return original / a
		}
	}
	return a / a
}
func giveAnswer() {

	var t, first, second, n int

	scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		scanf("%d %d %d\n", &first, &second, &n)
		answer := countIt(first) * countIt(second)
		if answer >= n {
			printf("%s\n", "YES")
		} else {
			printf("%s\n", "NO")
		}
	}
}

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

func main() {
	defer writer.Flush()
	answers := giveAnswer()
	for _, v := range answers {
		printf("%s\n", v)
	}
}
func countIt(a int) int {
	original := a
	for true {
		if a%2 == 0 {
			a = a / 2
		} else {
			return original / a
		}
	}
	return a / a
}
func giveAnswer() []string {

	var t, first, second, n int

	scanf("%d\n", &t)
	answers := make([]string, 0)
	for i := 0; i < t; i++ {
		scanf("%d %d %d\n", &first, &second, &n)
		answer := countIt(first) * countIt(second)
		if answer >= n {
			answers = append(answers, "YES")
		} else {
			answers = append(answers, "NO")
		}
	}
	return answers
}

package main

import "fmt"

func main() {
	answers := giveAnswer()
  for _,v := range answers{
    fmt.Println(v)
  }
}
func countIt(a int) int{
  original := a
  for true{
    if a%2==0{
      a=a/2
    }else{
      return original/a
    }
  }
  return a/a
}
func giveAnswer() []string{
  t := 0
  first := 0
  second := 0
  n := 0
  fmt.Scanln(&t)
  answers := make([]string,0)
  for i:=0;i<t;i++{
    fmt.Scanln(&first,&second,&n)
    answer := countIt(first)*countIt(second)
    if answer>=n{
      answers=append(answers,"YES")
    }else{
      answers=append(answers,"NO")
    }
  }
  return answers
}

package main

import "fmt"

func main() {
	var totalTests int
	_, _ = fmt.Scanf("%d\n", &totalTests)

	//resultArr := make([]string, 0)
	for i := 0; i < totalTests; i++ {
		var w, h, n int
		_, _ = fmt.Scanf("%d %d %d\n", &w, &h, &n)
		count1, count2 := 1, 1
		for w > 1 && w % 2 == 0 {
			count1 *= 2
			w = w / 2
		}

		for h > 1 && h % 2 == 0 {
			count2 *= 2
			h = h / 2
		}

		//fmt.Printf("%d %d ", count1, count2)

		if count2 * count1 >= n {
			//resultArr = append([]string{"YES"}, resultArr...)
			fmt.Printf("YES\n")
		}else {
			//resultArr = append([]string{"NO"}, resultArr...)
			fmt.Printf("NO\n")
		}
	}

	//for _, val := range resultArr {
	//	fmt.Printf("%s\n", val)
	//}
}

package main

import (
	"fmt"
)

func main() {

	T := 0
	fmt.Scan(&T)
	for ; T > 0; T-- {
		var w, h, n = 0, 0, 0
		fmt.Scan(&w, &h, &n)

		var total = 1
		for w%2 == 0 {
			w /= 2
			total *= 2
		}

		for h%2 == 0 {
			h /= 2
			total *= 2
		}

		if total >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import (
	"fmt"
)

func main() {

	T := 0
	fmt.Scan(&T)
	for ; T > 0; T-- {
		var w, h, n = 0, 0, 0
		fmt.Scan(&w, &h, &n)

		var total = 0

		var x, y = w, h

		var countA = 1
		for x%2 == 0 {
			x /= 2
			countA *= 2
		}

		var countB = 1
		for y%2 == 0 {
			y /= 2
			countB *= 2
		}

		total = countA * countB

		if total >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import (
	"fmt"
)

func main() {

	T := 0
	fmt.Scan(&T)
	for ; T > 0; T-- {
		var w, h, n int64 = 0, 0, 0
		fmt.Scan(&w, &h, &n)

		var total int64 = 0

		var x, y = w, h

		var countA int64 = 1
		for x%2 == 0 {
			x/=2
			countA*=2
		}

		var countB int64 = 1
		for y%2 == 0 {
			y/=2
			countB*=2
		}

		total = countA * countB

		if total >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

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

func main() {

	reader := bufio.NewReader(os.Stdin)

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

	//fmt.Println(cc)
	count, err := strconv.ParseInt(strings.Trim(string(cc),"\n"), 10, 64)
	if err != nil {
		os.Exit(-3)
	}
	//fmt.Println(count)
	for i := 0; i < int(count); i++ {
		allb, _, _ := reader.ReadLine()
		//fmt.Println("Read:",all)
		all := strings.Trim(string(allb), "\n")
		allList := strings.Split(all, " ")
		if len(allList) != 3 {
			os.Exit(-4)
		}

		//fmt.Println("Read:",allList)

		w, _ := strconv.ParseInt(allList[0], 10, 64)
		h, _ := strconv.ParseInt(allList[1], 10, 64)
		n, _ := strconv.ParseInt(allList[2], 10, 64)

		if checkCard(w, h, n) {
			_, _ = os.Stdout.WriteString("yes\n")
		} else {
			_, _ = os.Stdout.WriteString("no\n")
		}
	}

}
func checkCard(w, h, n int64) bool {
	//fmt.Println("W:",w,"H:",h,"N:",n)
	var wCount int64 = 1
	for {
		if w&0x1 == 0 {
			//fmt.Println("IS EVEN w",w)
			w = w / 2
			wCount *= 2
		} else {
			break
		}
	}

	var hCount int64 = 1
	for {
		if h&0x1 == 0 {
			//fmt.Println("IS EVEN h",h)
			h = h / 2
			hCount *= 2
		} else {
			break
		}
	}

	//fmt.Println("WC :",wCount," HC ",hCount)
	return wCount*hCount >= n
}

package main

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

func main() {
	preCalc := make([]int, int(10e4)+1)
	for i := 1; i < len(preCalc); i++ {
		a := i
		pieces := 1
		preCalc[i] = 1
		for a%2 == 0 {
			preCalc[i] += pieces
			a = a / 2
			pieces *= 2
		}
	}
	reader := bufio.NewReader(os.Stdin)
	line, _ := reader.ReadString('\n')
	line = strings.ReplaceAll(line, "\n", "")
	line = strings.ReplaceAll(line, "\r", "")
	t, err := strconv.Atoi(line)
	if err != nil {
		fmt.Println(err)
	}
	for i := 0; i < t; i++ {
		line, _ := reader.ReadString('\n')
		line = strings.ReplaceAll(line, "\n", "")
		line = strings.ReplaceAll(line, "\r", "")
		factor := strings.Split(line, " ")
		w, _ := strconv.Atoi(factor[0])
		h, _ := strconv.Atoi(factor[1])
		n, _ := strconv.Atoi(factor[2])
		if preCalc[w]*preCalc[h] >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func ReadInt() int32 {
	var x int32
	_, _ = fmt.Scanf("%d", &x)
	return x
}

func main() {
     var t int32
	fmt.Scanf("%d\n", &t)
	for ; t > 0; t-- {
	     var w, h, n int32
	     fmt.Scanf("%d %d %d\n", &w, &h, &n)
	     var m int64 = 1
		for w % 2 == 0 {
			m *= 2
			w /= 2
		}
		for h % 2 == 0 {
			m *= 2
			h /= 2
		}
		if int64(n) <= m {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

import (
	"fmt"
	"math"
)

func main() {
	var (
		t int
		w int
		h int
		n int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d %d %d\n", &w, &h, &n)
		c1 := 0
		for w%2 == 0 {
			w /= 2
			c1++
		}
		c2 := 0
		for h%2 == 0 {
			h /= 2
			c2++
		}
		if int(math.Pow(2, float64(c1)))*int(math.Pow(2, float64(c2))) < n {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

func printResult(width, height int, n int64) string {
	var total int64
	total = 1
	for width%2 == 0 {
		width /= 2
		total *= 2
	}

	for height%2 == 0 {
		height /= 2
		total *= 2
	}

	if total >= n {
		return "YES"
	} else {
		return "NO"
	}
}

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

	var t, width, height int
	var n int64
	for fmt.Fscan(r, &t); t > 0; t-- {
		fmt.Fscan(r, &width, &height, &n)
		fmt.Println(printResult(width, height, n))
	}

}

package main

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

func DFS(w, h int) int {
	if w%2 == 0 {
		return 2 * DFS(w/2, h)
	} else if h%2 == 0 {
		return 2 * DFS(w, h/2)
	} else {
		return 1
	}
}

func Solve() {
	w, h, n := ri(), ri(), ri()
	if DFS(w, h) >= n {
		println("YES")
	} else {
		println("NO")
	}
}

func main() {
	T := 0 // 如果是多组样例，请讲 T := 1 改为 T := 0
	in, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	if T == 0 {
		scan(&T)
	}
	for t := 0; t < T; t++ {
		Solve()
	}
	out.Flush()
}

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

// ri 将直接读入并返回一个 int
func ri() (x int) {
	scan(&x)
	return x
}

// ri64 将直接读入并返回一个 int64
func ri64() (x int64) {
	scan(&x)
	return x
}

//rs 将直接读入并返回一个 string
func rs() (s string) {
	scan(&s)
	return s
}

//scan 用法与 fmt.scan() 相似，可以传入多个变量的地址进行读入操作
func scan(a ...interface{}) { Fscan(in, a...) }

//print 用法与 fmt.print() 相似，可以传入多个变量进行输出。
//注意，这个函数不会换行，多个变量之间有空格
func print(a ...interface{}) { Fprint(out, a...) }

//println 用法与 fmt.println() 相似，可以传入多个变量进行输出。
//这个函数会换行，多个变量之间有空格
func println(a ...interface{}) { Fprintln(out, a...) }

//min 可以传入多个 int 变量，求出这些变量的最小值
func min(a ...int) int {
	ans := a[0]
	for i := 1; i < len(a); i++ {
		if a[i] < ans {
			ans = a[i]
		}
	}
	return ans
}

//min64 可以传入多个 int64 变量，求出这些变量的最小值
func min64(a ...int64) int64 {
	ans := a[0]
	for i := 1; i < len(a); i++ {
		if a[i] < ans {
			ans = a[i]
		}
	}
	return ans
}

//max 可以传入多个 int 变量，求出这些变量的最大值
func max(a ...int) int {
	ans := a[0]
	for i := 1; i < len(a); i++ {
		if a[i] > ans {
			ans = a[i]
		}
	}
	return ans
}

//max64 可以传入多个 int64 变量，求出这些变量的最大值
func max64(a ...int64) int64 {
	ans := a[0]
	for i := 1; i < len(a); i++ {
		if a[i] > ans {
			ans = a[i]
		}
	}
	return ans
}

//sum 可以传入多个 int 变量，求出这些变量的总和，并返回总和。
//你可以使用 ... 运算符打散数组，使得 sum 函数可以求出数组的和。
func sum(a ...int) int {
	ans := 0
	for _, x := range a {
		ans += x
	}
	return ans
}

//sum64 可以传入多个 int64 变量，求出这些变量的总和，并返回总和。
//你可以使用 ... 运算符打散数组，使得 sum 函数可以求出数组的和。
func sum64(a ...int64) int64 {
	ans := int64(0)
	for _, x := range a {
		ans += x
	}
	return ans
}

//reverse 用于翻转 int 切片，所有元素将会变成原切片的倒序
func reverse(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]
	}
}

//reverse64 用于翻转 int64 切片，所有元素将会变成原切片的倒序
func reverse64(a []int64) {
	for l, r := 0, len(a)-1; l < r; l, r = l+1, r-1 {
		a[l], a[r] = a[r], a[l]
	}
}

//lowerBound 类似于 C++ 中的 lower_bound。
//用于二分查找 int 切片中，第一个大于等于 k 的元素在切片中的位置。
//如果元素不存在，则返回切片的长度。
//注意，lowerBound 作用的 int 切片必须升序。
func lowerBound(a []int, k int) int {
	l, r, pos := 0, len(a)-1, len(a)
	for l <= r {
		mid := (l + r) >> 1
		if a[mid] < k {
			l = mid + 1
		} else {
			pos, r = mid, mid-1
		}
	}
	return pos
}

//lowerBound64 类似于 C++ 中的 lower_bound。
//用于二分查找 int64 切片中，第一个大于等于 k 的元素在切片中的位置。
//如果元素不存在，则返回切片的长度。
//注意，lowerBound 作用的 int64 切片必须升序。
func lowerBound64(a []int64, k int64) int {
	l, r, pos := 0, len(a)-1, len(a)
	for l <= r {
		mid := (l + r) >> 1
		if a[mid] < k {
			l = mid + 1
		} else {
			pos, r = mid, mid-1
		}
	}
	return pos
}

//upperBound 类似于 C++ 中的 upper_bound。
//用于二分查找 int 切片中，第一个大于 k 的元素在切片中的位置。
//如果元素不存在，则返回切片的长度。
//注意，upperBound 作用的 int 切片必须升序。
func upperBound(a []int, k int) int {
	l, r, pos := 0, len(a)-1, len(a)
	for l <= r {
		mid := (l + r) >> 1
		if a[mid] <= k {
			l = mid + 1
		} else {
			pos, r = mid, mid-1
		}
	}
	return pos
}

//upperBound64 类似于 C++ 中的 upper_bound。
//用于二分查找 int64 切片中，第一个大于 k 的元素在切片中的位置。
//如果元素不存在，则返回切片的长度。
//注意，upperBound 作用的 int64 切片必须升序。
func upperBound64(a []int64, k int64) int {
	l, r, pos := 0, len(a)-1, len(a)
	for l <= r {
		mid := (l + r) >> 1
		if a[mid] <= k {
			l = mid + 1
		} else {
			pos, r = mid, mid-1
		}
	}
	return pos
}

type Stack struct {
	s []int
}

func (st *Stack) top() int   { return st.s[len(st.s)-1] }
func (st *Stack) size() int  { return len(st.s) }
func (st *Stack) pop()       { st.s = st.s[:len(st.s)-1] }
func (st *Stack) push(x int) { st.s = append(st.s, x) }

type Queue struct {
	que chan int
}

func MakeQueue(size int) Queue {
	var q Queue
	q.que = make(chan int, size)
	return q
}

package main

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

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

func out(x ...interface{}) {
	fmt.Fprint(wr, x...)
}

func nextInt() int {
	i, e := strconv.Atoi(next())
	if e != nil {
		panic(e)
	}
	return i
}

func nextInt64() int64 {
	i, e := strconv.ParseInt(next(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

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

func main() {
	defer wr.Flush()
	sc.Buffer(make([]byte, 0), 1000000009)
	sc.Split(bufio.ScanWords)

	t := nextInt()
	for i := 0; i < t; i++ {
		solve()
	}
}

func solve() {
	w := nextInt()
	h := nextInt()
	n := nextInt()

	res := 1

	for w%2 == 0 {
		w /= 2
		res *= 2
	}
	for h%2 == 0 {
		h /= 2
		res *= 2
	}

	if res >= n {
		out("YES\n")
	} else {
		out("NO\n")
	}
}

package main

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

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

func out(x ...interface{}) {
	fmt.Fprint(wr, x...)
}

func nextInt() int {
	i, e := strconv.Atoi(next())
	if e != nil {
		panic(e)
	}
	return i
}

func nextInt64() int64 {
	i, e := strconv.ParseInt(next(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

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

func main() {
	defer wr.Flush()
	sc.Buffer(make([]byte, 0), 1000000009)
	sc.Split(bufio.ScanWords)

	t := nextInt()
	for i := 0; i < t; i++ {
		solve()
	}
}

func solve() {
	w := nextInt()
	h := nextInt()
	n := nextInt()

	a := 1
	b := 1

	for w%2 == 0 {
		w /= 2
		a *= 2
	}
	for h%2 == 0 {
		h /= 2
		b *= 2
	}

	if a*b >= n {
		out("YES\n")
	} else {
		out("NO\n")
	}
}

package main

import "fmt"

func main() {
    var i,t,n,w,h,ans uint64
    fmt.Scanln(&t)
    for i=0;i<t;i++ {
        ans = 1
        fmt.Scanln(&w,&h,&n)
        for w%2 == 0 {
            ans *= 2
            w = w/2
        }
        for h%2 == 0 {
            ans *= 2
            h = h/2
        }
        if ans < n {
            fmt.Println("NO")
        } else {
            fmt.Println("YES")
        }
    }
}

package main

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

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(input, &t)

	for o := 0; o < t; o++ {
		var w, h, n int
		fmt.Fscan(input, &w)
		fmt.Fscan(input, &h)
		fmt.Fscan(input, &n)

		MIN := w * h
		Count := 0
		for MIN > 0 {
			if MIN%2 == 0 {
				MIN = MIN / 2
				Count = Count + 1
			} else {
				break
			}
		}
		if Count == 0 {
			if n > 1 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
			}
		} else {
			k := 1
			for j := 1; j < Count+1; j++ {
				k = k * 2
			}
			if k >= n {
				fmt.Println("YES")
			} else {
				fmt.Println("NO")
			}
		}
	}
}

package main

import (
	"fmt"
	"os"
)

func canBeSplit(w, h, n int) bool {
	pcs := 1
	for w%2 == 0 {
		pcs *= 2
		w /= 2
	}
	for h%2 == 0 {
		pcs *= 2
		h /= 2
	}
	return pcs >= n
}

func main() {
	var N int
	_, err := fmt.Scanf("%d\n", &N)
	if err != nil {
		panic(err)
	}
	results := make([]string, N)
	for i := 0; i < N; i++ {
		var h, w, n int
		_, err := fmt.Scanf("%d %d %d\n", &w, &h, &n)
		if err != nil {
			panic(err)
		}
		if canBeSplit(w, h, n) {
			results = append(results, "YES")
		} else {
			results = append(results, "NO")
		}
	}
	for _, result := range results {
		fmt.Fprintf(os.Stdout, "%s\n", result)
	}
}

package main

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

var t int

func lvl(q int) int {
	p := 1

	for i := 1; i <= q; i++ {
		p *= 2
	}

	return p
}

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)

	fmt.Fscan(input, &t)

	for o := 0; o < t; o++ {
		var w, h, n int
		fmt.Fscan(input, &w, &h, &n)

		ww := 0
		for i := 1; true; i++ {
			if w%2 == 0 {
				ww++
			} else {
				break
			}

			w /= 2
		}

		dr := lvl(ww)

		hh := 0
		for i := 1; true; i++ {
			if h%2 == 0 {
				hh++
			} else {
				break
			}

			h /= 2
		}

		rr := lvl(hh)

		sum := dr * rr

		if sum >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

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

func main() {
	defer _w.Flush()
	t := ReadInt()
	for i := 0; i < t; i++ {
		if solve(ReadInt(), ReadInt(), ReadInt()) {
			println("YES")
		} else {
			println("NO")
		}
	}
}

func solve(w, h, n int) bool {
	if n == 1 {
		return true
	}
	ans := 1
	for w > 0 && w%2 == 0 {
		ans *= 2
		if ans >= n {
			return true
		}
		w /= 2
	}
	for h > 0 && h%2 == 0 {
		ans *= 2
		if ans >= n {
			return true
		}
		h /= 2
	}
	return false
}

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func print(a ...interface{})            { fmt.Fprint(_w, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(_w, f, a...) }
func println(a ...interface{})          { fmt.Fprintln(_w, a...) }
func printInts(a ...int)                { s := fmt.Sprint(a); println(s[1 : len(s)-1]) }
func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(_r, a...); err != nil {
		panic(err)
	}
}
func ReadString() (s string) { Scan(&s); return }
func ReadInt() (i int)       { Scan(&i); return }
func ReadInts(n int) (a []int) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt())
	}
	return
}
func ReadInt64() (i int64) { Scan(&i); return }
func ReadInt64s(n int) (a []int64) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt64())
	}
	return
}

// 1472A. Cards for Friends
package main

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

func get_count(w int, h int) int {
	if w%2 == 0 {
		return 2 * get_count(w/2, h)
	} else if h%2 == 0 {
		return 2 * get_count(w, h/2)
	} else {
		return 1
	}
}
func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var w, h, n int
		fmt.Fscan(reader, &w, &h, &n)
		if get_count(w, h) < n {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}

	}
}

package main

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

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

	test := parseInt(getString(reader))

	for ; test > 0; test-- {
		WHN := getIntln(reader)
		cuts := getPow2(WHN[0]) + getPow2(WHN[1])
		if 1<<cuts >= WHN[2] {
			writer.WriteString("YES\n")
		} else {
			writer.WriteString("NO\n")
		}
	}
	writer.Flush()
}

func getPow2(n int) int {
	if n == 0 {
		return 0
	}

	for i := 0; ; i++ {
		if ((n >> i) & 1) == 1 {
			return i
		}
	}
}

func getIntln(in *bufio.Reader) []int {
	b := strings.Split(getString(in), " ")
	res := make([]int, len(b))
	for k, v := range b {
		res[k] = parseInt(v)
	}
	return res
}
func getString(in *bufio.Reader) string {
	res, _ := in.ReadString('\n')
	res = strings.ReplaceAll(res, "\n", "")
	res = strings.ReplaceAll(res, "\r", "")
	res = strings.TrimSpace(res)
	return res
}

func parseInt(str string) int {
	var res int
	size := len(str)
	for i := 0; i < size; i++ {
		digit := int(str[i] - '0')
		for j := (i + 1); j < size; j++ {
			digit = digit<<3 + digit<<1
		}
		res += digit
	}
	return res
}

package main

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

var sc = bufio.NewScanner(os.Stdin)

func scan() string {
	for sc.Scan() {
		break
	}
	return sc.Text()
}

func scanInt() int {
	i, err := strconv.Atoi(scan())
	if err != nil {
		panic(err)
	}
	return i
}

func scanInt8() int8 {
	i, err := strconv.ParseInt(scan(), 10, 8)
	if err != nil {
		panic(err)
	}
	return int8(i)
}

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

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

func min(ints ...int) int {
	a := ints[0]
	n := len(ints)
	for i := 1; i < n; i++ {
		if ints[i] < a {
			a = ints[i]
		}
	}
	return a
}

func max(ints ...int) int {
	a := ints[0]
	n := len(ints)
	for i := 1; i < n; i++ {
		if ints[i] > a {
			a = ints[i]
		}
	}
	return a
}

type Noop struct{}

var noop = Noop{}

func proc() {
	w, h, n := scanInt64(), scanInt64(), scanInt64()
	var ans int64 = 1
	for w%2 == 0 && ans < n {
		w /= 2
		ans += ans
	}
	for h%2 == 0 && ans < n {
		h /= 2
		ans += ans
	}
	if ans >= n {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	t := scanInt()
	for i := 0; i < t; i++ {
		proc()
	}
}

package main

import (
	"fmt"
)

func solve() {
	nums := readIntN(3)
	w, h, n := nums[0], nums[1], nums[2]
	if n == 1 {
		fmt.Println("YES")
		return
	}
	wp := 1
	for w%2 == 0 {
		w /= 2
		wp *= 2
	}
	hp := 1
	for h%2 == 0 {
		h /= 2
		hp *= 2
	}
	if hp*wp >= n {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func main() {
	n := readInt()
	for i := 0; i < n; i++ {
		solve()
	}
}

func readInt() int {
	var n int
	fmt.Scan(&n)
	return n
}
func readIntN(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&arr[i])
	}
	return arr
}

func readIntNN(n, m int) [][]int {
	arr := make([][]int, n)
	for i := 0; i < n; i++ {
		arr[i] = readIntN(m)
	}
	return arr
}

func min(a ...int) int {
	min := a[0]
	for _, v := range a {
		if v < min {
			min = v
		}
	}
	return min
}
func max(a ...int) int {
	max := a[0]
	for _, v := range a {
		if v > max {
			max = v
		}
	}
	return max
}

func minMax(a ...int) (min int, max int) {
	min, max = a[0], a[0]
	for _, v := range a {
		if v < min {
			min = v
		}
		if v > max {
			max = v
		}
	}
	return
}

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

package main

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

var (
	reader     = bufio.NewReader(os.Stdin)
	t, w, h, n int
)

func highestDivisiblePowerOf2(x int) int {
	y := 1
	for ; x%2 == 0; x /= 2 {
		y *= 2
	}
	return y
}

func solve(w, h, n int) string {
	if highestDivisiblePowerOf2(w)*highestDivisiblePowerOf2(h) < n {
		return "NO"
	}
	return "YES"
}

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

package main

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

func getSheets(n int32) int32 {
	sheets := int32(1)
	for n%2 == 0 {
		sheets *= 2
		n /= 2
	}
	return sheets
}

func solve(w int32, h int32, n int32) string {
	horizontalSheets := getSheets(w)
	verticalSheets := getSheets(h)
	if n <= horizontalSheets*verticalSheets {
		return "YES"
	} else {
		return "NO"
	}
}

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

	tt := int32(0)
	fmt.Fscanf(in, "%d\n", &tt)
	for tt > 0 {
		w := int32(0)
		h := int32(0)
		n := int32(0)
		fmt.Fscanf(in, "%d %d %d\n", &w, &h, &n)
		fmt.Fprintf(out, "%s\n", solve(w, h, n))
		tt--
	}
	out.Flush()
}

package main

import (
	"fmt"
)

func main() {

	T := 0
	fmt.Scan(&T)
	for ; T > 0; T-- {
		var w, h, n = 0, 0, 0
		fmt.Scan(&w, &h, &n)

		var total = 1
		for w%2 == 0 {
			w /= 2
			total *= 2
		}

		for h%2 == 0 {
			h /= 2
			total *= 2
		}

		if total >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

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

var bytes []byte

func nextByte() byte {
	b := bytes[0]
	bytes = bytes[1:]
	return b
}

func scanInt64() int64 {
	var negative bool
	var result int64

	b := nextByte()

	for ; b < '0' || b > '9'; b = nextByte() {
		if b == '-' {
			negative = true
		}
	}

	for ; '0' <= b && b <= '9'; b = nextByte() {
		result = (result << 3) + (result << 1) + int64(b-'0')
	}

	if negative {
		return -result
	} else {
		return result
	}
}

func scanInt() int {
	return int(scanInt64())
}

func init() {
	f, err := os.Open("in.txt")

	if err == nil {
		defer f.Close()
	} else {
		f = os.Stdin
	}

	bytes, _ = ioutil.ReadAll(bufio.NewReader(f))
}

func main() {
	for t := scanInt(); t > 0; t-- {
		w, h, n := scanInt(), scanInt(), scanInt()
		wc, hc := 1, 1

		for w%2 == 0 {
			w /= 2
			wc *= 2
		}

		for h%2 == 0 {
			h /= 2
			hc *= 2
		}

		if wc*hc >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	var t, n, w, h int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &w, &h, &n)
		count := 1
		for w%2 == 0 || h%2 == 0 {
			if w%2 == 0 {
				count *= 2
				w /= 2
			}
			if h%2 == 0 {
				count *= 2
				h /= 2
			}
		}
		if count >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var T, w, h, n int
	var p, w1, h1 = 1, 1, 1
	var c string = "NO"
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &w)
		Fscan(in, &h)
		Fscan(in, &n)
		for i := 1; w%2 == 0; i++ {
			w1 *= 2
			w /= 2
		}
		for i := 1; h%2 == 0; i++ {
			h1 *= 2
			h /= 2
		}
		p = h1 * w1
		if p >= n {
			c = "YES"
		}
		Fprintln(out, c)
		c = "NO"
		h1, w1 = 1, 1
	}
}

package main

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

func main() {
	defer writer.Flush()
	var t, w, h, n int
	scanf("%d\n", &t)
	for ; t > 0; t-- {
		scanf("%d %d %d\n", &w, &h, &n)
		num := 1
		for num < n {
			if w % 2 == 0 {
				num *= 2
				w /= 2
				continue
			}
			if h % 2 == 0 {
				num *= 2
				h /= 2
				continue
			}
			break
		}
		if num >= n {
			printf("YES\n")
		} else {
			printf("NO\n")
		}
	}
}

package main

import (
  "fmt"
)

func main() {
  var t int
  fmt.Scanf("%d\n", &t)
  for i:=0; i<t; i++ {
    var w, h, n uint64
    fmt.Scanf("%d %d %d\n", &w, &h, &n)
    var f uint64
    f = 1
    for (w % 2 == 0) || (h % 2 == 0) {
      f *= 2
      if f >= n { break }

      if w % 2 == 0 {
        w /= 2
      } else if h % 2 == 0 {
        h /= 2
      }
    }
    if f >= n {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

package main

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

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

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

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

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

func suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

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

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

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		w, h, n := sint64(), sint64(), sint64()
		printf("%s\n", sol(w, h, n))
	}
}

func sol(w, h, n int64) string {
	wc := int64(1)
	hc := int64(1)
	for w&1 == 0 {
		w /= 2
		wc *= 2
	}
	for h&1 == 0 {
		h /= 2
		hc *= 2
	}
	if hc*wc >= n {
		return "YES"
	}
	return "NO"
}

package main

import "fmt"

func main() {

	var w, h, n, t int
	fmt.Scanln(&t)

	for i := 1; i <= t; i++ {
		fmt.Scanln(&w, &h, &n)
		res := 1
		for w > 0 {
			if w%2 == 0 {
				w = w / 2
				res = res * 2
			} else {
				break
			}
		}

		for h > 0 {
			if h%2 == 0 {
				h = h / 2
				res = res * 2
			} else {
				break
			}
		}

		if res >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

var (
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
	t   int
	w   int
	h   int
	n   int
)

func main() {

	defer out.Flush()

	fmt.Fscan(in, &t)

	for ; t > 0; t-- {

		fmt.Fscan(in, &w, &h, &n)

		solve(w, h, n)

	}

}

func solve(w int, h int, n int) {

	piece := 1
	add := 1

	for w%2 == 0 {
		w /= 2
		piece += add
		add *= 2
	}

	for h%2 == 0 {
		h /= 2
		piece += add
		add *= 2
	}

	if piece >= n {
		fmt.Fprintln(out, "YES")
	} else {
		fmt.Fprintln(out, "NO")
	}

}

package main

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

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

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

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

func solve() int {
	var w, h, n int
	scanf("%d %d %d\n", &w, &h, &n)

	var cards int64 = 1

	for w%2 == 0 {
		cards *= 2
		w /= 2
	}

	for h%2 == 0 {
		cards *= 2
		h /= 2
	}

	if cards >= int64(n) {
		printf("YES\n")
	} else {
		printf("NO\n")
	}

	return 0
}

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

package main

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

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

func main() {
	t := ReadInt()
	for i := 0; i < t; i++ {
		s := ReadIntSliceln(3)
		fmt.Println(process(s[0], s[1], s[2]))
	}
}
func process(w, l, n int) string {
	c1 := findZeros(w)
	c2 := findZeros(l)
	width, length := 1, 1
	if c1 != 0 {
		width = int(math.Pow(2, float64(c1)))
	}
	if c2 != 0 {
		length = int(math.Pow(2, float64(c2)))
	}
	total := width * length
	//fmt.Println(total, width, length)
	if total >= n {
		return "YES"
	}
	return "NO"
}

func findZeros(v int) int {
	ans := 0
	for v&1 == 0 {
		ans++
		v = v >> 1
	}
	return ans
}

// ReadInt Read a single integer followed by a space
func ReadInt() (v int) {
	fmt.Fscan(reader, &v)
	return v
}

// ReadIntSliceln reads a line of integers into a slice.
func ReadIntSliceln(size int) []int {
	a := make([]int, size)
	for i := range a {
		fmt.Fscan(reader, &a[i])
	}
	//fmt.Scanf("\n")
	return a
}

package main

import (
    "fmt"
)

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

    for ; t > 0; t-- {
        var w, h, n int
        fmt.Scan(&w, &h, &n)

        if n == 1 {
            fmt.Println("YES")
            continue
        }

        count := 1
        for w % 2 == 0 {
            w = w / 2
            count = count * 2
        }

        for h % 2 == 0 {
            h = h / 2
            count = count * 2
        }

        if (count >= n) {
            fmt.Println("YES")
        } else {
            fmt.Println("NO")
        }
    }
}

package main

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

func getDivs(v int64) int64 {
	for v > 0 {
		if v%2 == 1 {
			return v
		}
		v /= 2
	}
	panic("")
}

func main() {
	sc := NewScanner()
	t := sc.NextInt()
	for i := 0; i < t; i++ {
		w, h, n := sc.NextInt64(), sc.NextInt64(), sc.NextInt64()

		if (w/getDivs(w))*(h/getDivs(h)) >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

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

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

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

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

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

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

	return mp
}

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

package main

import (
	"bufio"
	"fmt"
	"os"
)
var (
    input = bufio.NewReader(os.Stdin)
    output = bufio.NewWriter(os.Stdout)
)

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
func main() {
    var t int
	fmt.Fscan(input, &t)
    for t > 0 {
        t--
        solve()
    }
    output.Flush()
}

func solve() {
    var w, h, n int
    fmt.Fscan(input, &w, &h, &n)
    cw, ch := 1, 1
    for w > 0 && w & 1 == 0 {
        cw<<=1
        w>>=1
    }
    for h > 0 && h & 1 == 0 {
        ch<<=1
        h>>=1
    }
    if ch * cw < n {
        fmt.Fprintln(output, "No")
    } else {
        fmt.Fprintln(output, "Yes")
    }

}

package main

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

func main () {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t,w,h,n int
	Fscan(in, &t)
	for tt := 0; tt < t ; tt++ {
		Fscan(in, &w, &h, &n)
		now := 1
		for w%2 == 0 {
			now *= 2
			w /= 2
		}
		for h%2 == 0 {
			now *= 2
			h /= 2
		}
		ans := "NO\n"
		if now >= n {
			ans = "YES\n"
		}
		out.WriteString(ans)
	}
}

package main

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

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

	solve := func(Case int) {
		var w,h,n int
		Fscan(in, &w, &h, &n)
		c1 := 1
		for w&1==0 {
			c1*=2
			w/=2
		}
		c2 := 1
		for h&1==0 {
			c2*=2
			h/=2
		}
		if c1*c2 >= n {
			Fprintln(out, "YES")
		} else {
			Fprintln(out, "NO")
		}
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

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

package main
import (
	"fmt"
	"math"
)
func main() {
	var n int
	fmt.Scan(&n)
	for i:=0;i<n;i++{
		var w,h,s int
		fmt.Scan(&w,&h,&s)
		counter:=0
		if w%2==0{ // width even
			var w_u float64 = float64(w)
			for j:=1;j<=w;j++{
				counter+=2
				w_u= w_u/2
				if math.Mod(w_u,2) != 0.0 {
					break
				}
			}
		}
		if h%2==0{	// height even  1 4 4
			var h_u float64 = float64(h)
			for j:=1;j<=h;j++{
				counter+=2
				h_u= h_u/2
				if math.Mod(h_u,2) != 0.0 {
					break
				}
			}
		}
		if h%2!=0 && w%2!=0 {
			counter++
		}
		if counter >= s {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main
import (
	"fmt"
	"math"
)
func main() {
	var n int
	fmt.Scan(&n)
	for i:=0;i<n;i++{
		var w,h,s int
		fmt.Scan(&w,&h,&s)
		if w%2 == 0 && h%2 == 0 { // even x even
			if w == h {
				counter:=4
				for {
					if counter >= s {
							fmt.Println("YES")
							break
					}
					if math.Mod(float64(h/2),2) == 0.0 {
						counter+=4
						h= h/2
					} else {
						if counter >= s {
							fmt.Println("YES")
							break
						} else {
							fmt.Println("NO")
							break
						}
					}
				}
			} else { // ie 2 x 4
				counter:=2
				for {
					if counter >= s {
							fmt.Println("YES")
							break
					}
					if math.Mod(float64(w/2),2) == 0.0 {
						counter+=2
						w= w/2
					} else {
						if counter >= s {
							fmt.Println("YES")
							break
						} else {
							break
						}
					}
				}
				for {
					if counter >= s {
							fmt.Println("YES")
							break
					}
					if math.Mod(float64(w/2),2) == 0.0 {
						counter+=2
						w= w/2
					} else {
						if counter >= s {
							fmt.Println("YES")
							break
						} else {
							fmt.Println("NO")
							break
						}
					}
				}
			}
		} else if w%2 == 0 { // even x odd
			counter:=2
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(w/2),2) == 0.0 {
					counter+=2
					w= w/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else if h%2 == 0{ // odd x even
			counter:=2
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(h/2),2) == 0.0 {
					counter+=2
					h= h/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else { // odd x odd
			if s > 1 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
			}
		}
	}
}

package main
import (
	"fmt"
	"math"
)
func main() {
	var n int
	fmt.Scan(&n)
	for i:=0;i<n;i++{
		var w,h,s int
		fmt.Scan(&w,&h,&s)
		if w == 0 || h == 0 {
			fmt.Println("NO")
			break
		}
		if w%2 == 0 && h%2 == 0 { // even x even
			counter:=4
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(h/2),2) == 0.0 {
					counter+=4
					h= h/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else if w%2 == 0 { // even x odd
			counter:=2
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(h/2),2) == 0.0 {
					counter+=2
					h= h/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else if h%2 == 0{ // odd x even
			counter:=2
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(h/2),2) == 0.0 {
					counter+=2
					h= h/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else { // odd x odd
			if s > 1 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
			}
		}
	}
}

package main
import (
	"fmt"
	"math"
)
func main() {
	var n int
	fmt.Scan(&n)
	for i:=0;i<n;i++{
		var w,h,s int
		fmt.Scan(&w,&h,&s)
		if w%2 == 0 && h%2 == 0 { // even x even
			counter:=4
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(h/2),2) == 0.0 {
					counter+=4
					h= h/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else if w%2 == 0 { // even x odd
			counter:=2
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(h/2),2) == 0.0 {
					counter+=2
					h= h/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else if h%2 == 0{ // odd x even
			counter:=2
			for {
				if counter >= s {
						fmt.Println("YES")
						break
				}
				if math.Mod(float64(h/2),2) == 0.0 {
					counter+=2
					h= h/2
				} else {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else { // odd x odd
			if s > 1 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
			}
		}
	}
}

package main
import (
	"fmt"
	"math"
)
func main() {
	var n int
	fmt.Scan(&n)
	for i:=0;i<n;i++{
		var w,h,s int
		fmt.Scan(&w,&h,&s)
		if w%2 == 0 && h%2 == 0 { // even x even
			counter:=0
			for {
				counter+=4
				h-= h/2
				if math.Mod(float64(h),2) != 0.0 {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else if w%2 == 0 { // even x odd
			counter:=0
			for {
				counter+=2
				h-= h/2
				if math.Mod(float64(h),2) != 0.0 {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else if h%2 == 0{ // odd x even
			counter:=0
			for {
				counter+=2
				h-= h/2
				if math.Mod(float64(h),2) != 0.0 {
					if counter >= s {
						fmt.Println("YES")
						break
					} else {
						fmt.Println("NO")
						break
					}
				}
			}
		} else { // odd x odd
			if s > 1 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
			}
		}
	}
}

package main

import "fmt"

func main() {
	giveAnswer()
}
func countIt(a int) int{
  original := 1
  for true{
    if a%2==0{
      a=a/2
    }else{
      return original/a
    }
  }
  return original/a
}
func giveAnswer(){
  t := 0
  first := 0
  second := 0
  n := 0
  fmt.Scanln(&t)

  for i:=0;i<t;i++{
    fmt.Scanln(&first)
    fmt.Scanln(&second)
    fmt.Scanln(&n)
    answer := countIt(first)*countIt(second)
    if answer>=n{
      fmt.Println("YES")
    }else{
      fmt.Println("NO")
    }
  }
}

package main

import "fmt"

func main() {

  fmt.Println(giveAnswer())
}
func countIt(a int) int{
  original := 1
  for true{
    if a%2==0{
      a=a/2
    }else{
      return original/a
    }
  }
  return original/a
}
func giveAnswer() []string{
  t := 0
  first := 0
  second := 0
  n := 0
  fmt.Scanln(&t)
  answers:= make([]string,t)
  for i:=0;i<t;i++{
    fmt.Scanln(&first)
    fmt.Scanln(&second)
    fmt.Scanln(&n)
    answer := countIt(first)*countIt(second)
    if answer>=n{
      answers=append(answers,"YES")
    }else{
      answers=append(answers,"NO")
    }
  }
  return answers
}

package main

import "fmt"

func main() {
	var totalTests int
	_, _ = fmt.Scanf("%d\n", &totalTests)

	//resultArr := make([]string, 0)
	for i := 0; i < totalTests; i++ {
		var w, h, n int
		_, _ = fmt.Scanf("%d %d %d\n", &w, &h, &n)
		count1, count2 := 1, 1
		for w > 1 && w % 2 == 0 {
			count1 *= 2
			w = w / 2
		}

		for h > 1 && h % 2 == 0 {
			count2 *= 2
			h = h / 2
		}

		fmt.Printf("%d %d ", count1, count2)

		if count2 * count1 >= n {
			//resultArr = append([]string{"YES"}, resultArr...)
			fmt.Printf("YES\n")
		}else {
			//resultArr = append([]string{"NO"}, resultArr...)
			fmt.Printf("NO\n")
		}
	}

	//for _, val := range resultArr {
	//	fmt.Printf("%s\n", val)
	//}
}

package main

import "fmt"

func main() {
	var totalTests int
	_, _ = fmt.Scanf("%d\n", &totalTests)

	resultArr := make([]string, 0)
	for i := 0; i < totalTests; i++ {
		var w, h, n int
		_, _ = fmt.Scanf("%d %d %d\n", &w, &h, &n)
		count1, count2 := 1, 1
		for w > 1 && w % 2 == 0 {
			count1 *= 2
			w = w / 2
		}

		for h > 1 && h % 2 == 0 {
			count2 *= 2
			h = h / 2
		}

		//fmt.Printf("%d %d ", count1, count2)

		if count2 * count1 >= n {
			resultArr = append([]string{"YES"}, resultArr...)
			//fmt.Printf("YES\n")
		}else {
			resultArr = append([]string{"NO"}, resultArr...)
			//fmt.Printf("NO\n")
		}
	}

	for _, val := range resultArr {
		fmt.Printf("%s\n", val)
	}
}

package main

import "fmt"

func main() {
	var totalTests int
	_, _ = fmt.Scanf("%d", &totalTests)

	for i := 0; i < totalTests; i++ {
		var w, h, n int
		_, _ = fmt.Scanf("%d %d %d", &w, &h, &n)
		count1, count2 := 1, 1
		for w > 1 && w % 2 == 0 {
			count1 *= 2
			w = w / 2
		}

		for h > 1 && h % 2 == 0 {
			count2 *= 2
			h = h / 2
		}

		//fmt.Printf("%d %d ", count1, count2)

		if count2 * count1 >= n {
			fmt.Printf("YES\n")
		}else {
			fmt.Printf("NO\n")
		}
	}
}

package main

import "fmt"

func main() {
	var totalTests int
	_, _ = fmt.Scanf("%d", &totalTests)

	resultArr := make([]string, 0)
	for i := 0; i < totalTests; i++ {
		var w, h, n int
		_, _ = fmt.Scanf("%d %d %d", &w, &h, &n)
		count1, count2 := 1, 1
		for w > 1 && w % 2 == 0 {
			count1 *= 2
			w = w / 2
		}

		for h > 1 && h % 2 == 0 {
			count2 *= 2
			h = h / 2
		}

		//fmt.Printf("%d %d ", count1, count2)

		if count2 * count1 >= n {
			resultArr = append([]string{"YES"}, resultArr...)
			//fmt.Printf("YES\n")
		}else {
			resultArr = append([]string{"NO"}, resultArr...)
			//fmt.Printf("NO\n")
		}
	}

	for _, val := range resultArr {
		fmt.Printf("%s\n", val)
	}
}

package main

import "fmt"

func main() {
	var totalTests int
	_, _ = fmt.Scanf("%d", &totalTests)

	resultArr := make([]string, 0)
	for i := 0; i < totalTests; i++ {
		var w, h, n int
		_, _ = fmt.Scanf("%d %d %d", &w, &h, &n)
		count1, count2 := 1, 1
		for w > 1 && w % 2 == 0 {
			count1 *= 2
			w = w / 2
		}

		for h > 1 && h % 2 == 0 {
			count2 *= 2
			h = h / 2
		}

		//fmt.Printf("%d %d ", count1, count2)

		if count2 * count1 >= n {
			resultArr = append(resultArr, "YES")
			//fmt.Printf("YES\n")
		}else {
			resultArr = append(resultArr, "NO")
			//fmt.Printf("NO\n")
		}
	}

	for _, val := range resultArr {
		fmt.Printf("%s\n", val)
	}
}

package main

import (
	"fmt"
)

func main() {

	T := 0
	fmt.Scan(&T)
	for ; T > 0; T-- {
		var w, h, n int64 = 0, 0, 0
		fmt.Scan(&w, &h, &n)

		var total int64 = 0

		if w%2 == 0 && h%2 == 0 {
			if w%3 == 0 && w > 3 {
				w--
			}
			if h%3 == 0 && h > 3 {
				h--
			}
			total = w * h
		} else if w%2 == 0 {
			if w%3 == 0 && w > 3 {
				w--
			}
			total = w
		} else if h%2 == 0 {
			if h%3 == 0 && h > 3 {
				h--
			}
			total = h
		} else {
			total = 1
		}

		if total >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import (
	"fmt"
)

func main() {

	T := 0
	fmt.Scan(&T)
	for ; T > 0; T-- {
		var w, h, n int64 = 0, 0, 0
		fmt.Scan(&w, &h, &n)

		var total int64 = 0

		if w%2 == 0 && h%2 == 0 {
			total = w * h
		} else if w%2 == 0 {
			total = w
		} else if h%2 == 0 {
			total = h
		} else {
			total = 1
		}

		if total >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import (
	"fmt"
)

func main() {

	T := 0
	fmt.Scan(&T)
	for ; T > 0; T-- {
		w, h, n := 0, 0, 0
		fmt.Scan(&w, &h, &n)

		total := 0

		if w%2 == 0 && h%2 == 0 {
			total = w * h
		} else if w%2 == 0 {
			total = w
		} else if h%2 == 0 {
			total = h
		} else {
			total = 1
		}

		if total >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

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

func main() {

	reader := bufio.NewReader(os.Stdin)

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

	//fmt.Println(cc)
	count, err := strconv.ParseInt(strings.Trim(string(cc),"\n"), 10, 64)
	if err != nil {
		os.Exit(-3)
	}
	//fmt.Println(count)
	for i := 0; i < int(count); i++ {
		allb, _, _ := reader.ReadLine()
		//fmt.Println("Read:",all)
		all := strings.Trim(string(allb), "\n")
		allList := strings.Split(all, " ")
		if len(allList) != 3 {
			os.Exit(-4)
		}

		//fmt.Println("Read:",allList)

		w, _ := strconv.ParseInt(allList[0], 10, 64)
		h, _ := strconv.ParseInt(allList[1], 10, 64)
		n, _ := strconv.ParseInt(allList[2], 10, 64)

		if checkCard(w, h, n) {
			_, _ = os.Stdout.WriteString("yes")
		} else {
			_, _ = os.Stdout.WriteString("no")
		}
	}

}
func checkCard(w, h, n int64) bool {
	//fmt.Println("W:",w,"H:",h,"N:",n)
	var wCount int64 = 1
	for {
		if w&0x1 == 0 {
			//fmt.Println("IS EVEN w",w)
			w = w / 2
			wCount *= 2
		} else {
			break
		}
	}

	var hCount int64 = 1
	for {
		if h&0x1 == 0 {
			//fmt.Println("IS EVEN h",h)
			h = h / 2
			hCount *= 2
		} else {
			break
		}
	}

	//fmt.Println("WC :",wCount," HC ",hCount)
	return wCount*hCount >= n
}

package main

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

func main() {

	reader := bufio.NewReader(os.Stdin)

	cc, _ := reader.ReadString('\n')
	fmt.Println(cc)

	count, _ := strconv.ParseInt(cc, 10, 64)
	for i := 0; i < int(count); i++ {
		all, _ := reader.ReadString('\n')
		allList := strings.Split(all, " ")
		if len(allList) != 3 {
			panic("error")
		}

		w, _ := strconv.ParseInt(allList[0], 10, 64)
		h, _ := strconv.ParseInt(allList[1], 10, 64)
		n, _ := strconv.ParseInt(allList[2], 10, 64)

		if checkCard(w, h, n) {
			_, _ = os.Stdout.WriteString("yes")
		}
	}

}
func checkCard(w, h, n int64) bool {
	var count int64 = 0
	for {
		if w&0x1 == 0 {
			w = w / 2
			count += 1
		} else {
			break
		}
	}

	for {
		if h&0x1 == 0 {
			h = h / 2
			count += 1
		} else {
			break
		}
	}

	return count > n
}

package main

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

func main() {
	preCalc := make([]int, int(10e4)+1)
	for i := 1; i < len(preCalc); i++ {
		a := i
		for a%2 == 0 {
			preCalc[i]++
			a = a / 2
		}
	}
	reader := bufio.NewReader(os.Stdin)
	line, _ := reader.ReadString('\n')
	line = strings.ReplaceAll(line, "\n", "")
	line = strings.ReplaceAll(line, "\r", "")
	t, err := strconv.Atoi(line)
	if err != nil {
		fmt.Println(err)
	}
	for i := 0; i < t; i++ {
		line, _ := reader.ReadString('\n')
		line = strings.ReplaceAll(line, "\n", "")
		line = strings.ReplaceAll(line, "\r", "")
		factor := strings.Split(line, " ")
		w, _ := strconv.Atoi(factor[0])
		h, _ := strconv.Atoi(factor[1])
		n, _ := strconv.Atoi(factor[2])
		if preCalc[w]+preCalc[h]+1 >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	preCalc := make([]int, int(10e4)+1)
	for i := 1; i < len(preCalc); i++ {
		a := i
		for a%2 == 0 {
			preCalc[i]++
			a = a / 2
		}
	}
	reader := bufio.NewReader(os.Stdin)
	line, _ := reader.ReadString('\n')
	line = strings.ReplaceAll(line, "\n", "")
	t, err := strconv.Atoi(line)
	if err != nil {
		fmt.Println(err)
	}
	for i := 0; i < t; i++ {
		line, _ := reader.ReadString('\n')
		line = strings.ReplaceAll(line, "\n", "")
		factor := strings.Split(line, " ")
		w, _ := strconv.Atoi(factor[0])
		h, _ := strconv.Atoi(factor[1])
		n, _ := strconv.Atoi(factor[2])
		if preCalc[w]+preCalc[h]+1 >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	preCalc := make([]int, int(10e4)+1)
	for i := 1; i < len(preCalc); i++ {
		a := i
		for a%2 == 0 {
			preCalc[i]++
			a = a / 2
		}
	}
	reader := bufio.NewReader(os.Stdin)
	line, _ := reader.ReadString('\n')
	t, _ := strconv.Atoi(line)
	for i := 0; i < t; i++ {
		line, _ := reader.ReadString('\n')
		factor := strings.Split(line, " ")
		w, _ := strconv.Atoi(factor[0])
		h, _ := strconv.Atoi(factor[1])
		n, _ := strconv.Atoi(factor[2])
		if preCalc[w]+preCalc[h]+1 >= n {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
     var t int32
	fmt.Scanf("%d\n", &t)
	for ; t > 0; t-- {
	     var w, h, n int32
	     fmt.Scanf("%d %d %d\n", &w, &h, &n)
		for w % 2 == 0 {
			n /= 2
			w /= 2
		}
		for h % 2 == 0 {
			n /= 2
			h /= 2
		}
		if n <= 1 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

import (
	"fmt"
)

func main() {
	var (
		t int
		w int
		h int
		n int
	)
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d %d %d\n", &w, &h, &n)
		c1 := 1
		for w%2 == 0 {
			w /= 2
			c1++
		}
		c2 := 1
		for h%2 == 0 {
			h /= 2
			c2++
		}
		if c1*c2 < n {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

func printResult(width, height int, n int64) string {
	if n == 1 {
		return "YES"
	}

	for {
		if width%2 == 0 {
			n -= 2
			width /= 2
		}

		if height%2 == 0 {
			n -= 2
			height /= 2
		}

		if n <= 0 {
			return "YES"
		}

		if width%2 == 1 && height%2 == 1 {
			return "NO"
		}
	}
}

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

	var t, width, height int
	var n int64
	for fmt.Fscan(r, &t); t > 0; t-- {
		fmt.Fscan(r, &width, &height, &n)
		fmt.Println(printResult(width, height, n))
	}

}

package main

import "fmt"

func main() {
    var i,t,n,w,h,ans uint64
    fmt.Scanln(&t)
    for i=0;i<t;i++ {
        ans = 1
        fmt.Scanln(&w,&h,&n)
        for w%2 == 0 {
            ans *= 2
            w = w/2
        }
        for h%2 == 0 {
            ans *= 2
            h = h/2
        }
        fmt.Println(ans)
        if ans < n {
            fmt.Println("NO")
        } else {
            fmt.Println("YES")
        }
    }
}

package main

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

var t int

func lvl(q int) int {
	p := 1

	for i := 1; i <= q; i++ {
		p *= 2
	}

	return p
}

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)

	fmt.Fscan(input, &t)

	for o := 0; o < t; o++ {
		var w, h, n int
		fmt.Fscan(input, &w, &h, &n)

		ww := 0
		for i := 1; true; i++ {
			if w%2 == 0 {
				ww++
			} else {
				break
			}

			w /= 2
		}

		dr := lvl(ww)

		hh := 0
		for i := 1; true; i++ {
			if h%2 == 0 {
				hh++
			} else {
				break
			}

			h /= 2
		}

		rr := lvl(hh)

		sum := dr * rr

		if sum >= n {
			fmt.Println("YES", sum)
		} else {
			fmt.Println("NO")
		}

	}
}

package main

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

func main() {
	defer _w.Flush()
	t := ReadInt()
	for i := 0; i < t; i++ {
		println(solve(ReadInt(), ReadInt(), ReadInt()))
	}
}

func solve(w, h, n int) int {
	ans := 1
	for w > 0 && w%2 == 0 {
		ans++
		w /= 2
	}
	for h > 0 && h%2 == 0 {
		ans++
		h /= 2
	}
	return ans
}

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func print(a ...interface{})            { fmt.Fprint(_w, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(_w, f, a...) }
func println(a ...interface{})          { fmt.Fprintln(_w, a...) }
func printInts(a ...int)                { s := fmt.Sprint(a); println(s[1 : len(s)-1]) }
func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(_r, a...); err != nil {
		panic(err)
	}
}
func ReadString() (s string) { Scan(&s); return }
func ReadInt() (i int)       { Scan(&i); return }
func ReadInts(n int) (a []int) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt())
	}
	return
}
func ReadInt64() (i int64) { Scan(&i); return }
func ReadInt64s(n int) (a []int64) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt64())
	}
	return
}


Christmas is coming, Icy has just received a box of chocolates from her grandparents! The box contains $$$n$$$ chocolates. The $$$i$$$-th chocolate has a non-negative integer type $$$a_i$$$.Icy believes that good things come in pairs. Unfortunately, all types of chocolates are distinct (all $$$a_i$$$ are distinct). Icy wants to make at least one pair of chocolates the same type. As a result, she asks her grandparents to perform some chocolate exchanges. Before performing any chocolate exchanges, Icy chooses two chocolates with indices $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le n$$$, $$$x \ne y$$$).In a chocolate exchange, Icy's grandparents choose a non-negative integer $$$k$$$, such that $$$2^k \ge a_x$$$, and change the type of the chocolate $$$x$$$ from $$$a_x$$$ to $$$2^k - a_x$$$ (that is, perform $$$a_x := 2^k - a_x$$$).The chocolate exchanges will be stopped only when $$$a_x = a_y$$$. Note that other pairs of equal chocolate types do not stop the procedure.Icy's grandparents are smart, so they would choose the sequence of chocolate exchanges that minimizes the number of exchanges needed. Since Icy likes causing trouble, she wants to maximize the minimum number of exchanges needed by choosing $$$x$$$ and $$$y$$$ appropriately. She wonders what is the optimal pair $$$(x, y)$$$ such that the minimum number of exchanges needed is maximized across all possible choices of $$$(x, y)$$$.Since Icy is not good at math, she hopes that you can help her solve the problem.

The first line of the input contains a single integer $$$n$$$ ($$$2 \le n \le 2 \cdot 10^5$$$) — the number of chocolates. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 \le a_i \le 10^9$$$). It is guaranteed that all $$$a_i$$$ are distinct.

Output three integers $$$x$$$, $$$y$$$, and $$$m$$$. $$$x$$$ and $$$y$$$ are indices of the optimal chocolates to perform exchanges on. Your output must satisfy $$$1 \le x, y \le n$$$, $$$x \ne y$$$. $$$m$$$ is the number of exchanges needed to obtain $$$a_x = a_y$$$. We can show that $$$m \le 10^9$$$ for any pair of chocolates. If there are multiple solutions, output any.

NoteIn the first test case, the minimum number of exchanges needed to exchange a chocolate of type $$$6$$$ to a chocolate of type $$$9$$$ is $$$5$$$. The sequence of exchanges is as follows: $$$6 \rightarrow 2 \rightarrow 0 \rightarrow 1 \rightarrow 7 \rightarrow 9$$$.In the second test case, the minimum number of exchanges needed to exchange a chocolate of type $$$4$$$ to a chocolate of type $$$8$$$ is $$$2$$$. The sequence of exchanges is as follows: $$$4 \rightarrow 0 \rightarrow 8$$$.

package main

import (
	. "fmt"
	"math/bits"
	"syscall"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	_i, buf := 1<<12, make([]byte, 1<<12)
	rc := func() byte {
		if _i == 1<<12 {
			syscall.Read(syscall.Stdin, buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x uint32) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + uint32(b&15)
		}
		return
	}

	a := make([]uint32, r())
	mx := int8(-1)
	p := 0
	for i := range a {
		v := r()
		a[i] = v
		c := int8(0)
		for v > 0 {
			v = 1<<bits.Len32(v-1) - v
			c++
		}
		if c > mx {
			mx = c
			p = i
		}
	}

	base := a[p]
	mx = -1
	q := 0
	for i, v := range a {
		c := int8(0)
		w := base
		for v != w {
			if v < w {
				v, w = w, v
			}
			v = 1<<bits.Len32(v-1) - v
			c++
		}
		if c > mx {
			mx = c
			q = i
		}
	}
	Println(p+1, q+1, mx)
}

package main

import (
	. "fmt"
	"math/bits"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	_i, buf := 1<<12, make([]byte, 1<<12)
	rc := func() byte {
		if _i == 1<<12 {
			os.Stdin.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x uint32) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + uint32(b&15)
		}
		return
	}

	a := make([]uint32, r())
	mx := int8(-1)
	p := 0
	for i := range a {
		v := r()
		a[i] = v
		c := int8(0)
		for v > 0 {
			v = 1<<bits.Len32(v-1) - v
			c++
		}
		if c > mx {
			mx = c
			p = i
		}
	}

	mx = -1
	base := a[p]
	q := 0
	for i, v := range a {
		if i != p {
			c := int8(0)
			w := base
			for v != w {
				if v < w {
					v, w = w, v
				}
				v = 1<<bits.Len32(v-1) - v
				c++
			}
			if c > mx {
				mx = c
				q = i
			}
		}
	}
	Println(p+1, q+1, mx)
}

package main
import("bufio";."fmt";"math/bits";"os")

// github.com/EndlessCheng/codeforces-go
func f(v,w uint)(c int){
	for v!=w{
		if v<w{v,w=w,v}
		v=1<<bits.Len(v-1)-v
		c++
	}
	return
}

func main() {
	in:=bufio.NewReader(os.Stdin)
	var n,p,q int
	Fscan(in, &n)
	a:=make([]uint,n)
	for i:=range a{Fscan(in,&a[i])}
	mx:=-1
	for i:=1;i<n;i++{
		c:=f(a[i],a[0])
		if c>mx{mx,p=c,i}
	}
	mx=-1
	for i,v:=range a{
		c:=f(v,a[p])
		if i!=p&&c>mx{mx,q=c,i}
	}
	Print(p+1,q+1,mx)
}

package main

import (
	. "fmt"
	"math/bits"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func f(v, w uint32) (c int8) {
	for v != w {
		if v < w {
			v, w = w, v
		}
		v = 1<<bits.Len32(v-1) - v
		c++
	}
	return
}

func main() {
	_i, buf := 1<<12, make([]byte, 1<<12)
	rc := func() byte {
		if _i == 1<<12 {
			os.Stdin.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x uint32) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + uint32(b&15)
		}
		return
	}

	p := 0
	n := r()
	a := make([]uint32, n)
	mx := int8(-1)
	for i := range a {
		a[i] = r()
		if i != 0 {
			c := f(a[i], a[0])
			if c > mx {
				mx, p = c, i
			}
		}
	}

	mx = -1
	base := a[p]
	q := 0
	for i, v := range a {
		if i != p {
			c := f(v, base)
			if c > mx {
				mx, q = c, i
			}
		}
	}
	Println(p+1, q+1, mx)
}

package main

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

// github.com/EndlessCheng/codeforces-go
func f(v, w uint32) (c int) {
	for v != w {
		if v < w {
			v, w = w, v
		}
		v = 1<<bits.Len32(v-1) - v
		c++
	}
	return
}

func CF1617E(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n, p, q int
	Fscan(in, &n)
	a := make([]uint32, n)
	for i := range a {
		Fscan(in, &a[i])
	}

	base := a[0]
	mx := -1
	for i := 1; i < n; i++ {
		c := f(a[i], base)
		if c > mx {
			mx, p = c, i
		}
	}

	base = a[p]
	mx = -1
	for i, v := range a {
		if i != p {
			c := f(v, base)
			if c > mx {
				mx, q = c, i
			}
		}
	}
	Fprintln(out, p+1, q+1, mx)
}

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

package main

import (
	"bufio"
	. "fmt"
	"io"
	"math/bits"
	"os"
	"runtime/debug"
)

// github.com/EndlessCheng/codeforces-go
func CF1617E(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n, v int
	Fscan(in, &n)
	id := make(map[int]int, n)
	g := make(map[int]map[int]struct{}, n*30)
	add := func(v, w int) {
		if g[v] == nil {
			g[v] = map[int]struct{}{}
		}
		g[v][w] = struct{}{}
	}
	for i := 1; i <= n; i++ {
		Fscan(in, &v)
		id[v] = i
		for v := v; v > 0; {
			w := 1<<bits.Len(uint(v-1)) - v
			add(v, w)
			add(w, v)
			v = w
		}
	}

	maxD, u := -1, 0
	var f func(v, fa, d int)
	f = func(v, fa, d int) {
		if d > maxD && id[v] > 0 {
			maxD, u = d, v
		}
		for w := range g[v] {
			if w != fa {
				f(w, v, d+1)
			}
		}
	}
	f(v, -1, 0)
	dv := u
	maxD = -1
	f(u, -1, 0)
	Fprint(out, id[dv], id[u], maxD)
}

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

func init() { debug.SetGCPercent(-1) }

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1617E(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n, v int
	Fscan(in, &n)
	id := make(map[int]int, n)
	g := make(map[int]map[int]struct{}, n*30)
	add := func(v, w int) {
		if g[v] == nil {
			g[v] = map[int]struct{}{}
		}
		g[v][w] = struct{}{}
	}
	for i := 1; i <= n; i++ {
		Fscan(in, &v)
		id[v] = i
		for v := v; v > 0; {
			w := 1<<bits.Len(uint(v-1)) - v
			add(v, w)
			add(w, v)
			v = w
		}
	}

	maxD, u := -1, 0
	var f func(v, fa, d int)
	f = func(v, fa, d int) {
		if d > maxD && id[v] > 0 {
			maxD, u = d, v
		}
		for w := range g[v] {
			if w != fa {
				f(w, v, d+1)
			}
		}
	}
	f(v, -1, 0)
	dv := u
	maxD = -1
	f(u, -1, 0)
	Fprint(out, id[dv], id[u], maxD)
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1617E(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n, v int
	Fscan(in, &n)
	id := make(map[int]int, n)
	g := map[int]map[int]struct{}{}
	add := func(v, w int) {
		if g[v] == nil {
			g[v] = map[int]struct{}{}
		}
		g[v][w] = struct{}{}
	}
	for i := 1; i <= n; i++ {
		Fscan(in, &v)
		id[v] = i
		for v := v; v > 0; {
			w := 1<<bits.Len(uint(v-1)) - v
			add(v, w)
			add(w, v)
			v = w
		}
	}

	maxD, u := -1, 0
	var f func(v, fa, d int)
	f = func(v, fa, d int) {
		if d > maxD && id[v] > 0 {
			maxD, u = d, v
		}
		for w := range g[v] {
			if w != fa {
				f(w, v, d+1)
			}
		}
	}
	f(v, -1, 0)
	dv := u
	maxD = -1
	f(u, -1, 0)
	Fprint(out, id[dv], id[u], maxD)
}

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

package main

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

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

type Trie struct {
	id   int
	sons map[int]*Trie
}

func NewTrie() *Trie {
	return &Trie{
		id:   -1,
		sons: make(map[int]*Trie),
	}
}

func (t *Trie) add(values []int, id int) {
	for i := len(values) - 1; i >= 0; i-- {
		var v = values[i]
		if t.sons[v] == nil {
			t.sons[v] = NewTrie()
		}
		t = t.sons[v]
	}
	t.id = id
}

var trie = NewTrie()
var tree [][]int
var treeNodes int

func addTreeEdge(a, b int) {
	tree[a] = append(tree[a], b)
	tree[b] = append(tree[b], a)
}

func (t *Trie) buildTee() {
	for _, son := range t.sons {
		if son.id == -1 {
			son.id = treeNodes
			tree = append(tree, []int{})
			treeNodes += 1
		}
		addTreeEdge(t.id, son.id)
		son.buildTee()
	}
}

var dist []int

func furthest(startNode int, maxNode int) int {
	for i := 0; i < treeNodes; i++ {
		dist[i] = -1
	}
	var queue []int = []int{startNode}
	dist[startNode] = 0

	var furthest = -1
	for len(queue) > 0 {
		var node = queue[0]
		if node > 0 && node <= maxNode {
			furthest = node
		}
		queue = queue[1:]
		for _, newNode := range tree[node] {
			if dist[newNode] == -1 {
				dist[newNode] = dist[node] + 1
				queue = append(queue, newNode)
			}
		}
	}
	return furthest
}

func main() {
	var n int
	fmt.Fscan(in, &n)
	trie.id = 0
	for i := 0; i < n; i++ {
		var x int
		fmt.Fscan(in, &x)
		var a []int
		var p2 = 1
		for p2 < x {
			p2 *= 2
		}
		for x > 0 {
			a = append(a, x)
			for p2/2 >= x {
				p2 /= 2
			}
			x = p2 - x
		}
		a = append(a, 0)
		trie.add(a, i+1)
	}

	treeNodes = n + 1
	tree = make([][]int, n+1)
	trie.buildTee()

	dist = make([]int, treeNodes)
	a := furthest(0, n)
	b := furthest(a, n)

	fmt.Fprintf(out, "%d %d %d\n", a, b, dist[b])
	out.Flush()
}

package main

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

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

type Trie struct {
	id   int
	sons map[int]*Trie
}

func NewTrie() *Trie {
	return &Trie{
		id:   -1,
		sons: make(map[int]*Trie),
	}
}

func (t *Trie) add(values []int, id int) {
	for i := len(values) - 1; i >= 0; i-- {
		var v = values[i]
		if t.sons[v] == nil {
			t.sons[v] = NewTrie()
		}
		t = t.sons[v]
	}
	t.id = id
}

var trie = NewTrie()
var tree [][]int
var treeNodes int

func addTreeEdge(a, b int) {
	tree[a] = append(tree[a], b)
	tree[b] = append(tree[b], a)
}

func (t *Trie) buildTee() {
	for _, son := range t.sons {
		if son.id == -1 {
			son.id = treeNodes
			tree = append(tree, []int{})
			treeNodes += 1
		}
		addTreeEdge(t.id, son.id)
		son.buildTee()
	}
}

var dist []int

func furthest(startNode int) int {
	for i := 0; i < treeNodes; i++ {
		dist[i] = -1
	}
	var queue []int = []int{startNode}
	dist[startNode] = 0

	var furthest = -1
	for len(queue) > 0 {
		var node = queue[0]
		if node > 0 {
			furthest = node
		}
		queue = queue[1:]
		for _, newNode := range tree[node] {
			if dist[newNode] == -1 {
				dist[newNode] = dist[node] + 1
				queue = append(queue, newNode)
			}
		}
	}
	return furthest
}

func main() {
	var n int
	fmt.Fscan(in, &n)
	trie.id = 0
	for i := 0; i < n; i++ {
		var x int
		fmt.Fscan(in, &x)
		var a []int
		var p2 = 1
		for p2 < x {
			p2 *= 2
		}
		for x > 0 {
			a = append(a, x)
			for p2/2 >= x {
				p2 /= 2
			}
			x = p2 - x
		}
		a = append(a, 0)
		trie.add(a, i+1)
	}

	treeNodes = n + 1
	tree = make([][]int, n+1)
	trie.buildTee()

	dist = make([]int, treeNodes)
	a := furthest(0)
	b := furthest(a)

	fmt.Fprintf(out, "%d %d %d\n", a, b, dist[b])
	out.Flush()
}

package main

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

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

type Trie struct {
	id   int
	sons map[int]*Trie
}

func NewTrie() *Trie {
	return &Trie{
		id:   -1,
		sons: make(map[int]*Trie),
	}
}

func (t *Trie) add(values []int, id int) {
	for i := len(values) - 1; i >= 0; i-- {
		var v = values[i]
		if t.sons[v] == nil {
			t.sons[v] = NewTrie()
		}
		t = t.sons[v]
	}
	t.id = id
}

var trie = NewTrie()
var tree [][]int
var treeNodes int

func addTreeEdge(a, b int) {
	tree[a] = append(tree[a], b)
	tree[b] = append(tree[b], a)
}

func (t *Trie) buildTee() {
	for _, son := range t.sons {
		if son.id == -1 {
			son.id = treeNodes
			tree = append(tree, []int{})
			treeNodes += 1
		}
		addTreeEdge(t.id, son.id)
		son.buildTee()
	}
}

var dist []int

func furthest(startNode int) int {
	for i := 0; i < treeNodes; i++ {
		dist[i] = -1
	}
	var queue []int = []int{startNode}
	dist[startNode] = 0

	var node int
	for len(queue) > 0 {
		node = queue[0]
		queue = queue[1:]
		for _, newNode := range tree[node] {
			if dist[newNode] == -1 {
				dist[newNode] = dist[node] + 1
				queue = append(queue, newNode)
			}
		}
	}
	return node
}

func main() {
	var n int
	fmt.Fscan(in, &n)
	trie.id = 0
	for i := 0; i < n; i++ {
		var x int
		fmt.Fscan(in, &x)
		var a []int
		var p2 = 1
		for p2 < x {
			p2 *= 2
		}
		for x > 0 {
			a = append(a, x)
			for p2/2 >= x {
				p2 /= 2
			}
			x = p2 - x
		}
		a = append(a, 0)
		trie.add(a, i+1)
	}

	treeNodes = n + 1
	tree = make([][]int, n+1)
	trie.buildTee()

	dist = make([]int, treeNodes)
	a := furthest(0)
	b := furthest(a)

	fmt.Fprintf(out, "%d %d %d\n", a, b, dist[b])
	out.Flush()
}


Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a career. Zahar knows about Kostya's idea and wants to present him a rectangular parallelepiped of marble from which he can carve the sphere. Zahar has n stones which are rectangular parallelepipeds. The edges sizes of the i-th of them are ai, bi and ci. He can take no more than two stones and present them to Kostya. If Zahar takes two stones, he should glue them together on one of the faces in order to get a new piece of rectangular parallelepiped of marble. Thus, it is possible to glue a pair of stones together if and only if two faces on which they are glued together match as rectangles. In such gluing it is allowed to rotate and flip the stones in any way. Help Zahar choose such a present so that Kostya can carve a sphere of the maximum possible volume and present it to Zahar.

The first line contains the integer n (1 ≤ n ≤ 105). n lines follow, in the i-th of which there are three integers ai, bi and ci (1 ≤ ai, bi, ci ≤ 109) — the lengths of edges of the i-th stone. Note, that two stones may have exactly the same sizes, but they still will be considered two different stones.

In the first line print k (1 ≤ k ≤ 2) the number of stones which Zahar has chosen. In the second line print k distinct integers from 1 to n — the numbers of stones which Zahar needs to choose. Consider that stones are numbered from 1 to n in the order as they are given in the input data. You can print the stones in arbitrary order. If there are several answers print any of them.

NoteIn the first example we can connect the pairs of stones:  2 and 4, the size of the parallelepiped: 3 × 2 × 5, the radius of the inscribed sphere 1  2 and 5, the size of the parallelepiped: 3 × 2 × 8 or 6 × 2 × 4 or 3 × 4 × 4, the radius of the inscribed sphere 1, or 1, or 1.5 respectively.  2 and 6, the size of the parallelepiped: 3 × 5 × 4, the radius of the inscribed sphere 1.5  4 and 5, the size of the parallelepiped: 3 × 2 × 5, the radius of the inscribed sphere 1  5 and 6, the size of the parallelepiped: 3 × 4 × 5, the radius of the inscribed sphere 1.5 Or take only one stone:  1 the size of the parallelepiped: 5 × 5 × 5, the radius of the inscribed sphere 2.5  2 the size of the parallelepiped: 3 × 2 × 4, the radius of the inscribed sphere 1  3 the size of the parallelepiped: 1 × 4 × 1, the radius of the inscribed sphere 0.5  4 the size of the parallelepiped: 2 × 1 × 3, the radius of the inscribed sphere 0.5  5 the size of the parallelepiped: 3 × 2 × 4, the radius of the inscribed sphere 1  6 the size of the parallelepiped: 3 × 3 × 4, the radius of the inscribed sphere 1.5 It is most profitable to take only the first stone.

package main

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

type Rect struct {
	a, b int
}

type Ppiped struct {
	a, b, c int
}

type IndexLen struct {
	i, l int
}

type ByL []IndexLen

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

func solve() {
	n := readInt()
	p, mp := make([]Ppiped, n), make(map[Rect]map[int]int)
	add := func(a, b, i, l int) {
        r := Rect{min(a, b), max(a, b)}
		_, ok := mp[r]
		if !ok {
			mp[r] = make(map[int]int)
		}
		mp[r][i] = max(mp[r][i], l)
	}

	for i := 0; i < n; i++ {
		a, b, c := readInt(), readInt(), readInt()
		p[i] = Ppiped{a, b, c}
		add(a, b, i, c)
		add(b, c, i, a)
		add(a, c, i, b)
	}

	ans, best := []int{}, 0
	for r, m := range mp {
        c := []IndexLen{}
        for i, l := range m {
            c = append(c, IndexLen{i, l})
        }
		sort.Sort(ByL(c))
        curL, curAns := 0, []int{}
        for i := 0; i < min(len(c), 2); i++ {
            curL += c[i].l
            curAns = append(curAns, c[i].i)
        }
        cur := min(curL, min(r.a, r.b))
        if cur > best {
            best = cur
            ans = curAns
        }
	}

    fmt.Println(len(ans))
    for _, i := range(ans) {
        fmt.Print(i + 1, " ")
    }
}

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

func main() {
	scanner.Split(bufio.ScanWords)
	solve()
}

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

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

func min(x, y int) int {
    return x + y - max(x, y)
}

// IO

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

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

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

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

package main

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

var bufin *bufio.Reader
var bufout *bufio.Writer

type Stone struct {
	id int
	a  []int
}

type StoneSlice []Stone

func (s StoneSlice) Len() int {
	return len(s)
}

func (s StoneSlice) Less(i int, j int) bool {
	k := 0
	for (k < 3) && (s[i].a[k] == s[j].a[k]) {
		k++
	}
	if k == 3 {
		return s[i].id < s[j].id
	}
	return s[i].a[k] > s[j].a[k]
}

func (s StoneSlice) Swap(i int, j int) {
	s[i], s[j] = s[j], s[i]
}

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

func sphere(a int, b int, c int) int {
	d := min(a, b)
	return min(c, d)
}

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

	var n int
	fmt.Fscanf(bufin, "%d\n", &n)

	s := make(StoneSlice, n)
	for i := 0; i < n; i++ {
		s[i].id = i + 1
		s[i].a = make([]int, 3)
		fmt.Fscanf(bufin, "%d %d %d\n", &s[i].a[0], &s[i].a[1], &s[i].a[2])
		sort.Sort(sort.Reverse(sort.IntSlice(s[i].a)))
	}

	sort.Sort(s)

	r := make([]int, 2)
	largest := -1
	k := 0
	for i := 0; i < n; i++ {
		d := sphere(s[i].a[0], s[i].a[1], s[i].a[2])
		if largest < d {
			r[0] = s[i].id
			largest = d
			k = 1
		}
	}

	for i := 0; i+1 < n; i++ {
		if (s[i].a[0] == s[i+1].a[0]) && (s[i].a[1] == s[i+1].a[1]) {
			d := sphere(s[i].a[0], s[i].a[1], s[i].a[2]+s[i+1].a[2])
			if largest < d {
				r[0] = s[i].id
				r[1] = s[i+1].id
				largest = d
				k = 2
			}
		}
	}

	fmt.Fprintf(bufout, "%d\n", k)
	for i := 0; i < k; i++ {
		fmt.Fprintf(bufout, "%d ", r[i])
	}
	fmt.Fprintf(bufout, "\n")
}

package main

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

// github.com/EndlessCheng/codeforces-go
func CF733D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	sort3 := func(a ...int) (int, int, int) {
		sort.Ints(a)
		return a[0], a[1], a[2]
	}
	type pair struct{ sz, i int }

	var n, a, b, c, mx int
	var mxID []interface{}
	Fscan(in, &n)
	mp := map[[2]int]pair{}
	for i := 1; i <= n; i++ {
		Fscan(in, &a, &b, &c)
		a, b, c = sort3(a, b, c)
		if a > mx {
			mx = a
			mxID = []interface{}{i}
		}
		for _, sz := range [3][3]int{{a, b, c}, {a, c, b}, {b, c, a}} {
			a, b, c := sz[0], sz[1], sz[2]
			p, ok := mp[[2]int{a, b}]
			if p.i == i {
				continue
			}
			if ok {
				if a, _, _ := sort3(a, b, p.sz+c); a > mx {
					mx = a
					mxID = []interface{}{p.i, i}
				}
			}
			if c > p.sz {
				mp[[2]int{a, b}] = pair{c, i}
			}
		}
	}
	Fprintln(out, len(mxID))
	Fprint(out, mxID...)
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF733D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	type pair struct{ sz, i int }
	sort3 := func(a ...int) (x, y, z int) { sort.Ints(a); return a[0], a[1], a[2] }

	var n, a, b, c, max int
	var mxID []interface{}
	Fscan(in, &n)
	mp := map[[2]int]pair{}
	for i := 1; i <= n; i++ {
		Fscan(in, &a, &b, &c)
		a, b, c = sort3(a, b, c)
		if a > max {
			max = a
			mxID = []interface{}{i}
		}
		for _, sz := range [3][3]int{{a, b, c}, {a, c, b}, {b, c, a}} {
			a, b, c := sz[0], sz[1], sz[2]
			p, ok := mp[[2]int{a, b}]
			if p.i == i {
				continue
			}
			if ok {
				if a, _, _ := sort3(a, b, c+p.sz); a > max {
					max = a
					mxID = []interface{}{p.i, i}
				}
			}
			if c > p.sz {
				mp[[2]int{a, b}] = pair{c, i}
			}
		}
	}
	Fprintln(out, len(mxID))
	Fprint(out, mxID...)
}

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

package main

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

type Rect struct {
	a, b int
}

type Ppiped struct {
	a, b, c int
}

type IndexLen struct {
	i, l int
}

type ByL []IndexLen

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

func solve() {
	n := readInt()
	p, mp := make([]Ppiped, n), make(map[Rect]map[int]int)
	add := func(a, b, i, l int) {
        r := Rect{min(a, b), max(a, b)}
		_, ok := mp[r]
		if !ok {
			mp[r] = make(map[int]int)
		}
		mp[r][i] = max(mp[r][i], l)
	}

	for i := 0; i < n; i++ {
		a, b, c := readInt(), readInt(), readInt()
		p[i] = Ppiped{a, b, c}
		add(a, b, i, c)
		add(b, c, i, c)
		add(a, c, i, b)
	}

	ans, best := []int{}, 0
	for r, m := range mp {
        c := []IndexLen{}
        for i, l := range m {
            c = append(c, IndexLen{i, l})
        }
		sort.Sort(ByL(c))
        curL, curAns := 0, []int{}
        for i := 0; i < min(len(c), 2); i++ {
            curL += c[i].l
            curAns = append(curAns, c[i].i)
        }
        cur := min(curL, min(r.a, r.b))
        if cur > best {
            best = cur
            ans = curAns
        }
	}

    fmt.Println(len(ans))
    for _, i := range(ans) {
        fmt.Print(i + 1, " ")
    }
}

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

func main() {
	scanner.Split(bufio.ScanWords)
	solve()
}

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

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

func min(x, y int) int {
    return x + y - max(x, y)
}

// IO

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

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

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

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

package main

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

type Rect struct {
	a, b int
}

type Ppiped struct {
	a, b, c int
}

type IndexLen struct {
	i, l int
}

type ByL []IndexLen

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

func solve() {
	n := readInt()
	p, mp := make([]Ppiped, n), make(map[Rect]map[IndexLen]bool)
	add := func(r Rect, i int, l int) {
		_, ok := mp[r]
		if !ok {
			mp[r] = make(map[IndexLen]bool)
		}
		mp[r][IndexLen{i, l}] = true
	}

	for i := 0; i < n; i++ {
		a, b, c := readInt(), readInt(), readInt()
		p[i] = Ppiped{a, b, c}
		add(Rect{a, b}, i, c)
		add(Rect{b, c}, i, c)
		add(Rect{a, c}, i, b)
	}

	ans, best := []int{}, 0
	for r, m := range mp {
        c := []IndexLen{}
        for k := range m {
            c = append(c, k)
        }
		sort.Sort(ByL(c))
        curL, curAns := 0, []int{}
        for i := 0; i < min(len(c), 2); i++ {
            curL += c[i].l
            curAns = append(curAns, c[i].i)
        }
        cur := min(curL, min(r.a, r.b))
        if cur > best {
            best = cur
            ans = curAns
        }
	}

    fmt.Println(len(ans))
    for _, i := range(ans) {
        fmt.Print(i + 1, " ")
    }
}

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

func main() {
	scanner.Split(bufio.ScanWords)
	solve()
}

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

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

func min(x, y int) int {
    return x + y - max(x, y)
}

// IO

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

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

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

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF733D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	sort3 := func(a ...int) (int, int, int) {
		sort.Ints(a)
		return a[0], a[1], a[2]
	}
	type pair struct{ sz, i int }

	var n, a, b, c, mx int
	var mxID []interface{}
	Fscan(in, &n)
	mp := map[[2]int]pair{}
	for i := 1; i <= n; i++ {
		Fscan(in, &a, &b, &c)
		a, b, c = sort3(a, b, c)
		if a > mx {
			mx = a
			mxID = []interface{}{i}
		}
		if p := mp[[2]int{b, c}]; p.sz+a > mx {
			mx = p.sz + a
			mxID = []interface{}{p.i, i}
		}
		for _, p := range [3][3]int{{a, b, c}, {a, c, b}, {b, c, a}} {
			a, b, c := p[0], p[1], p[2]
			if p := mp[[2]int{a, b}]; c > p.sz {
				mp[[2]int{a, b}] = pair{c, i}
			}
		}
	}
	Fprintln(out, len(mxID))
	Fprint(out, mxID...)
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF733D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	sort3 := func(a ...int) (int, int, int) {
		sort.Ints(a)
		return a[0], a[1], a[2]
	}
	type pair struct{ sz, i int }

	var n, a, b, c, mx int
	var mxID []interface{}
	Fscan(in, &n)
	mp := map[[2]int]pair{}
	for i := 1; i <= n; i++ {
		Fscan(in, &a, &b, &c)
		a, b, c = sort3(a, b, c)
		if a > mx {
			mx = a
			mxID = []interface{}{i}
		}
		p := mp[[2]int{b, c}]
		if p.sz+a > mx {
			mx = p.sz + a
			mxID = []interface{}{p.i, i}
		}
		if a > p.sz {
			mp[[2]int{b, c}] = pair{a, i}
		}
	}
	Fprintln(out, len(mxID))
	Fprint(out, mxID...)
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF733D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	mins := func(vals ...int) int {
		ans := vals[0]
		for _, val := range vals[1:] {
			if val < ans {
				ans = val
			}
		}
		return ans
	}
	type pair struct{ sz, i int }

	var n, a, b, c, max int
	var mxID []interface{}
	Fscan(in, &n)
	mp := map[[2]int]pair{}
	for i := 1; i <= n; i++ {
		Fscan(in, &a, &b, &c)
		if sz := mins(a, b, c); sz > max {
			max = sz
			mxID = []interface{}{i}
		}
		for _, sz := range [3][3]int{{a, b, c}, {a, c, b}, {b, c, a}} {
			a, b, c := sz[0], sz[1], sz[2]
			p, ok := mp[[2]int{a, b}]
			if p.i == i {
				continue
			}
			if ok {
				if sz := mins(a, b, c+p.sz); sz > max {
					max = sz
					mxID = []interface{}{p.i, i}
				}
			}
			if c > p.sz {
				mp[[2]int{a, b}] = pair{c, i}
			}
		}
	}
	Fprintln(out, len(mxID))
	Fprint(out, mxID...)
}

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