The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to choose the best point of observation, that is to say the point from where all the three stadiums can be observed. As all the sport competitions are of the same importance, the stadiums should be observed at the same angle. If the number of points meeting the conditions is more than one, the point with the maximum angle of observation is prefered. Would you, please, help the famous Berland commentator G. Berniev to find the best point of observation. It should be noted, that the stadiums do not hide each other, the commentator can easily see one stadium through the other.

The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have common points, and their centers are not on the same line.

Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.

package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"math"
	"os"
)

type V struct {
	x, y float64
}

func dot(a, b V) float64 {
	return a.x*b.x + a.y*b.y
}

func scalar(a float64, v V) V {
	return V{x: v.x * a, y: v.y * a}
}

func add(a, b V) V {
	return V{x: a.x + b.x, y: a.y + b.y}
}
func minus(a, b V) V {
	return V{x: a.x - b.x, y: a.y - b.y}
}

func norm(v V) float64 {
	return math.Sqrt(dot(v, v))
}

func normalize(v V) V {
	n := norm(v)
	return scalar(1/n, v)
}

func max(a, b, c float64) float64 {
	if a > b && a > c {
		return a
	} else if b > a && b > c {
		return b
	} else {
		return c
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewReader(bs)

	var a, b, c V
	var ra, rb, rc float64

	fmt.Fscanf(reader, "%f %f %f\n", &a.x, &a.y, &ra)
	fmt.Fscanf(reader, "%f %f %f\n", &b.x, &b.y, &rb)
	fmt.Fscanf(reader, "%f %f %f\n", &c.x, &c.y, &rc)

	if ra == rc {
		a, ra, b, rb = b, rb, a, ra
	} else if ra == rb {
		a, ra, c, rc = c, rc, a, ra
	}

	a1 := rb*rb - ra*ra
	b1 := minus(scalar(2.0*ra*ra, b), scalar(2.0*rb*rb, a))
	c1 := rb*rb*dot(a, a) - ra*ra*dot(b, b)

	a2 := rc*rc - ra*ra
	b2 := minus(scalar(2.0*ra*ra, c), scalar(2.0*rc*rc, a))
	c2 := rc*rc*dot(a, a) - ra*ra*dot(c, c)

	if ra == rb && ra == rc {
		det := b1.y*b2.x - b1.x*b2.y
		if det == 0.0 {
			return
		}
		fmt.Printf("%.6f %.6f", -(b1.y*c2-b2.y*c1)/det, -(b2.x*c1-b1.x*c2)/det)
		return
	}

	if ra != rb && rc != ra {
		delta1 := dot(b1, b1) - 4.0*a1*c1
		delta2 := dot(b2, b2) - 4.0*a2*c2
		if delta1 < 0 || delta2 < 0 {
			return
		}
		o1 := scalar(-0.5/a1, b1)
		o2 := scalar(-0.5/a2, b2)
		r1 := math.Sqrt(delta1 / (4.0 * a1 * a1))
		r2 := math.Sqrt(delta2 / (4.0 * a2 * a2))

		o1o2 := minus(o2, o1)
		o1o2Norm := norm(o1o2)
		if r1+r2 < o1o2Norm || o1o2Norm < math.Abs(r1-r2) {
			return
		}
		cos := (r1*r1 - r2*r2 + o1o2Norm*o1o2Norm) / (2.0 * r1 * o1o2Norm)
		sin := math.Sqrt(1.0 - cos*cos)
		p := scalar(r1*cos, normalize(o1o2))
		px1 := scalar(r1*sin, normalize(V{x: -p.y, y: p.x}))
		px2 := scalar(r1*sin, normalize(V{x: p.y, y: -p.x}))
		o1p := add(o1, p)
		x1 := minus(o1p, px1)
		x2 := minus(o1p, px2)

		x1Max := max(norm(minus(x1, a)), norm(minus(x1, b)), norm(minus(x1, c)))
		x2Max := max(norm(minus(x2, a)), norm(minus(x2, b)), norm(minus(x2, c)))

		if x1Max < x2Max {
			fmt.Printf("%.6f %.6f\n", x1.x, x1.y)
		} else {
			fmt.Printf("%.6f %.6f\n", x2.x, x2.y)
		}

		//		if x1Valid && (!x2Valid || ra/norm(minus(x1, a)) >= rb/norm(minus(x2, a))) {
		//			fmt.Printf("%.6f %.6f\n", x1.x, x1.y)
		//		} else if x2Valid {
		//			fmt.Printf("%.6f %.6f\n", x2.x, x2.y)
		//		}
	}
}

package main

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

func getRange(ra, rb, c float64) (float64, float64) {
	if ra == rb {
		return c / (ra + rb), 10000
	} else if ra < rb {
		return c / (ra + rb), c / (rb - ra)
	} else {
		return c / (ra + rb), c / (ra - rb)
	}
}

func area(a, b, c float64) float64 {
	p := (a + b + c) / 2.0
	return math.Sqrt(p * (p - a) * (p - b) * (p - c))
}

func dist(x0, y0, x1, y1 float64) float64 {
	dx := x0 - x1
	dy := y0 - y1
	return math.Sqrt(dx*dx + dy*dy)

}

func main() {
	var ax, ay, ar, bx, by, br, cx, cy, cr float64

	s := bufio.NewScanner(os.Stdin)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &ax, &ay, &ar)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &bx, &by, &br)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &cx, &cy, &cr)

	a := dist(bx, by, cx, cy)
	b := dist(ax, ay, cx, cy)
	c := dist(bx, by, ax, ay)

	minra, maxra := getRange(ar, br, a)
	minrb, maxrb := getRange(ar, cr, b)
	minrc, maxrc := getRange(br, ar, c)

	var max, min float64
	if maxra <= maxrb && maxra <= maxrc {
		max = maxra
	} else if maxrb <= maxra && maxrb <= maxrc {
		max = maxrb
	} else {
		max = maxrc
	}
	if minra >= minrb && minra >= minrc {
		min = minra
	} else if minrb >= minra && minrb >= minrc {
		min = minrb
	} else {
		min = minrc
	}

	Sabc := area(a, b, c)

	var coeff float64 = 0.000001
	var eps float64 = 0.0000000000001
	var eps1 float64 = 0.00001

	cal := func() float64 {
		pa, pb, pc := ar*coeff, br*coeff, cr*coeff
		Spab := area(pa, pb, c)
		Spac := area(pa, pc, b)
		Spbc := area(pc, pb, a)
		return Spab + Spac + Spbc - Sabc
	}

	coeff = (max + min) / 2.0

	for {
		result := cal()
		if math.Abs(result) <= eps1 {
			break
		}
		if result > 0 {
			max = coeff
		} else {
			min = coeff
		}
		coeff = (max + min) / 2.0
	}
	ar, br, cr = ar*coeff, br*coeff, cr*coeff

	theta := math.Asin((by - ay) / c)
	minTheta, maxTheta := theta, theta+math.Pi
	var px, py float64
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			maxTheta = midTheta
		} else {
			minTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}

	minTheta, maxTheta = theta-math.Pi, theta
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			maxTheta = midTheta
		} else {
			minTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}
}

package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"math"
	"os"
)

type V struct {
	x, y float64
}

func dot(a, b V) float64 {
	return a.x*b.x + a.y*b.y
}

func scalar(a float64, v V) V {
	return V{x: v.x * a, y: v.y * a}
}

func add(a, b V) V {
	return V{x: a.x + b.x, y: a.y + b.y}
}
func minus(a, b V) V {
	return V{x: a.x - b.x, y: a.y - b.y}
}

func norm(v V) float64 {
	return math.Sqrt(dot(v, v))
}

func normalize(v V) V {
	n := norm(v)
	return scalar(1/n, v)
}

func max(a, b, c float64) float64 {
	if a > b && a > c {
		return a
	} else if b > a && b > c {
		return b
	} else {
		return c
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewReader(bs)

	var a, b, c V
	var ra, rb, rc float64

	fmt.Fscanf(reader, "%f %f %f\n", &a.x, &a.y, &ra)
	fmt.Fscanf(reader, "%f %f %f\n", &b.x, &b.y, &rb)
	fmt.Fscanf(reader, "%f %f %f\n", &c.x, &c.y, &rc)

	if ra == rc {
		a, ra, b, rb = b, rb, a, ra
	} else if ra == rb {
		a, ra, c, rc = c, rc, a, ra
	}

	a1 := rb*rb - ra*ra
	b1 := minus(scalar(2.0*ra*ra, b), scalar(2.0*rb*rb, a))
	c1 := rb*rb*dot(a, a) - ra*ra*dot(b, b)

	a2 := rc*rc - ra*ra
	b2 := minus(scalar(2.0*ra*ra, c), scalar(2.0*rc*rc, a))
	c2 := rc*rc*dot(a, a) - ra*ra*dot(c, c)

	if ra == rb && ra == rc {
		det := b1.y*b2.x - b1.x*b2.y
		if det == 0.0 {
			return
		}
		fmt.Printf("%.6f %.6f", -(b1.y*c2-b2.y*c1)/det, -(b2.x*c1-b1.x*c2)/det)
		return
	}

	if ra != rb && rc != ra {
		delta1 := dot(b1, b1) - 4.0*a1*c1
		delta2 := dot(b2, b2) - 4.0*a2*c2
		if delta1 < 0 || delta2 < 0 {
			return
		}
		o1 := scalar(-0.5/a1, b1)
		o2 := scalar(-0.5/a2, b2)
		r1 := math.Sqrt(delta1 / (4.0 * a1 * a1))
		r2 := math.Sqrt(delta2 / (4.0 * a2 * a2))

		o1o2 := minus(o2, o1)
		o1o2Norm := norm(o1o2)
		if r1+r2 < o1o2Norm {
			return
		}
		cos := (r1*r1 - r2*r2 + o1o2Norm*o1o2Norm) / (2.0 * r1 * o1o2Norm)
		sin := math.Sqrt(1.0 - cos*cos)
		p := scalar(r1*cos, normalize(o1o2))
		px1 := scalar(r1*sin, normalize(V{x: -p.y, y: p.x}))
		px2 := scalar(r1*sin, normalize(V{x: p.y, y: -p.x}))
		o1p := add(o1, p)
		x1 := minus(o1p, px1)
		x2 := minus(o1p, px2)

		x1Max := max(norm(minus(x1, a)), norm(minus(x1, b)), norm(minus(x1, c)))
		x2Max := max(norm(minus(x2, a)), norm(minus(x2, b)), norm(minus(x2, c)))

		if x1Max < x2Max {
			fmt.Printf("%.6f %.6f\n", x1.x, x1.y)
		} else {
			fmt.Printf("%.6f %.6f\n", x2.x, x2.y)
		}

		//		if x1Valid && (!x2Valid || ra/norm(minus(x1, a)) >= rb/norm(minus(x2, a))) {
		//			fmt.Printf("%.6f %.6f\n", x1.x, x1.y)
		//		} else if x2Valid {
		//			fmt.Printf("%.6f %.6f\n", x2.x, x2.y)
		//		}
	}
}

package main

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

func getRange(ra, rb, c float64) (float64, float64) {
	if ra == rb {
		return c / (ra + rb), 10000
	} else if ra < rb {
		return c / (ra + rb), c / (rb - ra)
	} else {
		return c / (ra + rb), c / (ra - rb)
	}
}

func area(a, b, c float64) float64 {
	p := (a + b + c) / 2.0
	return math.Sqrt(p * (p - a) * (p - b) * (p - c))
}

func dist(x0, y0, x1, y1 float64) float64 {
	dx := x0 - x1
	dy := y0 - y1
	return math.Sqrt(dx*dx + dy*dy)

}

func main() {
	var ax, ay, ar, bx, by, br, cx, cy, cr float64

	s := bufio.NewScanner(os.Stdin)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &ax, &ay, &ar)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &bx, &by, &br)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &cx, &cy, &cr)

	a := dist(bx, by, cx, cy)
	b := dist(ax, ay, cx, cy)
	c := dist(bx, by, ax, ay)

	minra, maxra := getRange(cr, br, a)
	minrb, maxrb := getRange(ar, cr, b)
	minrc, maxrc := getRange(br, ar, c)

	var max, min float64
	if maxra <= maxrb && maxra <= maxrc {
		max = maxra
	} else if maxrb <= maxra && maxrb <= maxrc {
		max = maxrb
	} else {
		max = maxrc
	}
	if minra >= minrb && minra >= minrc {
		min = minra
	} else if minrb >= minra && minrb >= minrc {
		min = minrb
	} else {
		min = minrc
	}

	Sabc := area(a, b, c)

	var coeff float64 = 0.000001
	var eps float64 = 0.0000000000001
	var eps1 float64 = 0.00001

	cal := func() float64 {
		pa, pb, pc := ar*coeff, br*coeff, cr*coeff
		Spab := area(pa, pb, c)
		Spac := area(pa, pc, b)
		Spbc := area(pc, pb, a)
		return Spab + Spac + Spbc - Sabc
	}

	coeff = (max + min) / 2.0

	for {
		result := cal()
		if math.Abs(result) <= eps1 {
			break
		}
		if result > 0 {
			max = coeff
		} else {
			min = coeff
		}
		if math.Abs(max-min) < eps {
			return
		}
		coeff = (max + min) / 2.0
	}
	ar, br, cr = ar*coeff, br*coeff, cr*coeff

	theta := math.Asin((by - ay) / c)
	minTheta, maxTheta := theta, theta+math.Pi
	var px, py float64
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			maxTheta = midTheta
		} else {
			minTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}

	minTheta, maxTheta = theta-math.Pi, theta
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			minTheta = midTheta
		} else {
			maxTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}
}

package main

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

func getRange(ra, rb, c float64) (float64, float64) {
	if ra == rb {
		return c / (ra + rb), 10000
	} else if ra < rb {
		return c / (ra + rb), c / (rb - ra)
	} else {
		return c / (ra + rb), c / (ra - rb)
	}
}

func area(a, b, c float64) float64 {
	p := (a + b + c) / 2.0
	return math.Sqrt(p * (p - a) * (p - b) * (p - c))
}

func dist(x0, y0, x1, y1 float64) float64 {
	dx := x0 - x1
	dy := y0 - y1
	return math.Sqrt(dx*dx + dy*dy)

}

func main() {
	var ax, ay, ar, bx, by, br, cx, cy, cr float64

	s := bufio.NewScanner(os.Stdin)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &ax, &ay, &ar)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &bx, &by, &br)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &cx, &cy, &cr)

	a := dist(bx, by, cx, cy)
	b := dist(ax, ay, cx, cy)
	c := dist(bx, by, ax, ay)

	minra, maxra := getRange(cr, br, a)
	minrb, maxrb := getRange(ar, cr, b)
	minrc, maxrc := getRange(br, ar, c)

	var max, min float64
	if maxra <= maxrb && maxra <= maxrc {
		max = maxra
	} else if maxrb <= maxra && maxrb <= maxrc {
		max = maxrb
	} else {
		max = maxrc
	}
	if minra >= minrb && minra >= minrc {
		min = minra
	} else if minrb >= minra && minrb >= minrc {
		min = minrb
	} else {
		min = minrc
	}

	Sabc := area(a, b, c)

	var coeff float64 = 0.000001
	var eps float64 = 0.0000000000000001
	var eps1 float64 = 0.00001

	cal := func() float64 {
		pa, pb, pc := ar*coeff, br*coeff, cr*coeff
		Spab := area(pa, pb, c)
		Spac := area(pa, pc, b)
		Spbc := area(pc, pb, a)
		return Spab + Spac + Spbc - Sabc
	}

	coeff = (max + min) / 2.0

	for i := 0; i < 100000; i++ {
		result := cal()
		if math.Abs(result) <= eps1 {
			break
		}
		if result > 0 {
			max = coeff
		} else {
			min = coeff
		}
		if math.Abs(max-min) < eps {
			break
		}
		coeff = (max + min) / 2.0
	}
	if math.Abs(cal()) > eps1 {
		return
	}
	ar, br, cr = ar*coeff, br*coeff, cr*coeff

	theta := math.Asin((by - ay) / c)
	minTheta, maxTheta := theta, theta+math.Pi
	var px, py float64
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			maxTheta = midTheta
		} else {
			minTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}

	minTheta, maxTheta = theta-math.Pi, theta
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			minTheta = midTheta
		} else {
			maxTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}
}

package main

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

func getRange(ra, rb, c float64) (float64, float64) {
	if ra == rb {
		return c / (ra + rb), 10000
	} else if ra < rb {
		return c / (ra + rb), c / (rb - ra)
	} else {
		return c / (ra + rb), c / (ra - rb)
	}
}

func area(a, b, c float64) float64 {
	p := (a + b + c) / 2.0
	return math.Sqrt(p * (p - a) * (p - b) * (p - c))
}

func dist(x0, y0, x1, y1 float64) float64 {
	dx := x0 - x1
	dy := y0 - y1
	return math.Sqrt(dx*dx + dy*dy)

}

func main() {
	var ax, ay, ar, bx, by, br, cx, cy, cr float64

	s := bufio.NewScanner(os.Stdin)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &ax, &ay, &ar)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &bx, &by, &br)
	s.Scan()
	fmt.Sscanf(s.Text(), "%f %f %f", &cx, &cy, &cr)

	a := dist(bx, by, cx, cy)
	b := dist(ax, ay, cx, cy)
	c := dist(bx, by, ax, ay)

	minra, maxra := getRange(ar, br, a)
	minrb, maxrb := getRange(ar, cr, b)
	minrc, maxrc := getRange(br, ar, c)

	var max, min float64
	if maxra <= maxrb && maxra <= maxrc {
		max = maxra
	} else if maxrb <= maxra && maxrb <= maxrc {
		max = maxrb
	} else {
		max = maxrc
	}
	if minra >= minrb && minra >= minrc {
		min = minra
	} else if minrb >= minra && minrb >= minrc {
		min = minrb
	} else {
		min = minrc
	}

	Sabc := area(a, b, c)

	var coeff float64 = 0.000001
	var eps float64 = 0.0000000000001
	var eps1 float64 = 0.00001

	cal := func() float64 {
		pa, pb, pc := ar*coeff, br*coeff, cr*coeff
		Spab := area(pa, pb, c)
		Spac := area(pa, pc, b)
		Spbc := area(pc, pb, a)
		return Spab + Spac + Spbc - Sabc
	}

	coeff = (max + min) / 2.0

	for {
		result := cal()
		if math.Abs(result) <= eps1 {
			break
		}
		if result > 0 {
			max = coeff
		} else {
			min = coeff
		}
		if max == min {
			return
		}
		coeff = (max + min) / 2.0
	}
	ar, br, cr = ar*coeff, br*coeff, cr*coeff

	theta := math.Asin((by - ay) / c)
	minTheta, maxTheta := theta, theta+math.Pi
	var px, py float64
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			maxTheta = midTheta
		} else {
			minTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}

	minTheta, maxTheta = theta-math.Pi, theta
	for {
		midTheta := (minTheta + maxTheta) / 2.0
		px = ax + ar*math.Cos(midTheta)
		py = ay + ar*math.Sin(midTheta)
		result := dist(px, py, bx, by) - br

		if math.Abs(result) < eps {
			break
		}
		if minTheta == maxTheta {
			break
		}
		if result > 0 {
			minTheta = midTheta
		} else {
			maxTheta = midTheta
		}
	}
	if math.Abs(dist(px, py, cx, cy)-cr) < eps1 {
		fmt.Printf("%0.5f %0.5f", px, py)
		return
	}
}


You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that each stick can be used in only one rectangle. Each stick should be used as a side, you cannot break the stick or use it not to the full length.You want to all rectangles to have equal area. The area of the rectangle with sides $$$a$$$ and $$$b$$$ is $$$a \cdot b$$$.Your task is to say if it is possible to create exactly $$$n$$$ rectangles of equal area or not.You have to answer $$$q$$$ independent queries.

The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, a_{4n}$$$ ($$$1 \le a_i \le 10^4$$$), where $$$a_i$$$ is the length of the $$$i$$$-th stick.

For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".

package main

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

func main() {

	var (
		q int
		n int
	)
	input := bufio.NewReader(os.Stdin)

	//input, err := os.Open("input.txt")

	// if err != nil {
	// 	panic(err)
	// }
	reader := bufio.NewReader(input)
	fmt.Fscanf(reader, "%d\n", &q)

	for i := 0; i < q; i++ {
		fmt.Fscanf(reader, "%d\n", &n)

		iter := 4 * n
		nums := make([]int, 4*n)
		for i := 0; i < iter; i++ {
			fmt.Fscanf(reader, "%d", &nums[i])
		}
		fmt.Fscanf(reader, "\n")
		sort.Ints(nums)

		area := nums[0] * nums[iter-1]
		ok := true
		for i := 0; i < n; i++ {
			l := 2 * i
			r := 4*n - 2*i - 1
			if nums[l] == nums[l+1] && nums[r] == nums[r-1] && nums[l]*nums[r] == area {
				continue
			} else {
				ok = false
				break
			}
		}
		if ok {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

//https://codeforces.com/problemset/problem/1203/B
package main

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

func main() {
	var output bytes.Buffer
	in := bufio.NewReader(os.Stdin)
	q := 0
	n := 0
	completeSideArray := make([]int, 400)
	fmt.Fscan(in, &q)

	for ; q > 0; q-- {
		fmt.Fscan(in, &n)
		sideArray := completeSideArray[0 : 4*n]
		for i := 0; i < 4*n; i++ {
			fmt.Fscan(in, &sideArray[i])
		}

		sort.Ints(sideArray)
		i := 0
		j := 4*n - 1

		st := "YES"
		area := sideArray[0] * sideArray[j]
		for i < j {
			if sideArray[i] != sideArray[i+1] || sideArray[j-1] != sideArray[j] || sideArray[i]*sideArray[j] != area {
				st = "NO"
				break
			}
			i += 2
			j -= 2
		}
		output.WriteString(st + "\n")
	}
	fmt.Println(output.String())
}

package main

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

/* solution */

func solve() {

	t := readInt()
	for i := 0; i < t; i++ {
		solveOne()
	}

}

func solveOne() {
	n := readInt()
	a := make([]int, 4*n)
	for i := 0; i < 4*n; i++ {
		a[i] = readInt()
	}
	sort.Ints(a)
	square := -1
	ok := true
	for i := 0; ok && i < n; i++ {
		ok = ok && a[2*i] == a[2*i+1] && a[4*n-2*i-1] == a[4*n-2*i-2]
		if ok && square == -1 {
			square = a[2*i] * a[4*n-2*i-1]
		}
		ok = ok && square == a[2*i]*a[4*n-2*i-1]
	}
	if ok {
		print("YES")
	} else {
		print("NO")
	}
}

/* stubs */

func main() {

	var f *os.File
	if runtime.GOROOT() == "C:\\Soft\\Go" {
		f, _ = os.Open("input.txt")
		defer f.Close()
	} else {
		f = os.Stdin
	}

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

	reader = bufio.NewScanner(f)
	reader.Split(bufio.ScanWords)

	solve()

}

var reader *bufio.Scanner
var writer *bufio.Writer

func read() string {
	reader.Scan()
	return reader.Text()
}

func readInt() int {
	reader.Scan()
	ret, _ := strconv.Atoi(reader.Text())
	return ret
}

func print(s string) {
	writer.WriteString(s)
	writer.WriteString("\n")
}

func printInt(i int) {
	print(strconv.Itoa(i))
}

package main

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

func main() {
	var n, q, cnt, x, area int

	scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Fscanln(scr, &q)

	for i := 0; i < q; i++ {
		fmt.Fscanln(scr, &n)
		cnt = 0
		m := make(map[int]int)

		for i := 0; i < 4*n; i++ {
			fmt.Fscanf(scr, "%d", &x)
			m[x]++
		}
		fmt.Fscanln(scr, &x)

		a := make([]int, 0)
		for x, y := range m {

			for i := 0; i < y/2; i++ {
				a = append(a, x)
			}
			if y%2 != 0 {
				cnt = 7
				break
			}
		}

		sort.Ints(a)

		if n > 1 && cnt != 7 {
			area = a[0] * a[len(a)-1]
			for i := 0; i < len(a)/2; i++ {
				if area != a[i]*a[len(a)-i-1] {
					cnt = 7
					break
				}
			}
		}

		if cnt == 7 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

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

	var (
		total int
		n     int
	)

	_, _ = fmt.Fscan(input, &total)

	for t := 0; t < total; t += 1 {
		_, _ = fmt.Fscan(input, &n)

		stick := make([]int, n*4)
		count := make(map[int]int)
		for i := 0; i < n*4; i += 1 {
			_, _ = fmt.Fscan(input, &stick[i])
			count[stick[i]] += 1
		}

		isFound := true
		hasErr := false
		newSide := make([]int, 0)
		for k, v := range count {
			if v%2 != 0 {
				hasErr = true
				break
			}
			c := v / 2
			for i := 0; i < c; i++ {
				newSide = append(newSide, k)
			}
		}

		if hasErr {
			fmt.Println("NO")
			continue
		}

		sort.Ints(newSide)
		sum := newSide[0] * newSide[len(newSide)-1]
		for i, j := 0, len(newSide)-1; i < j; i, j = i+1, j-1 {
			if sum != newSide[i]*newSide[j] {
				isFound = false
				break
			}
		}

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

}

package main

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

func main() {
	input := bufio.NewReader(os.Stdin)
	var testCase int

	_, err := fmt.Fscanf(input, "%d\n", &testCase)
	if err != nil {
	}

	for testCase > 0 {
		testCase--

		var n int
		_, err := fmt.Fscanf(input, "%d\n", &n)
		if err != nil {
		}
		n *= 4
		var a = make([]int, n)
		for i := 0; i < n; i++ {
			_, err := fmt.Fscanf(input, "%d", &a[i])
			if err != nil {
			}
		}
		_, err = fmt.Fscanf(input, "\n")
		if err != nil {
		}
		sort.Sort(sort.IntSlice(a))
		var h1 int
		var h2 int
		var w1 int
		var w2 int
		var area int
		area = a[0] * a[n - 1]
		var result bool
		result = true
		for i := 0; i < n / 2 + 1; i += 2 {
			//fmt.Printf("%d %d %d %d\n", i, i + 1, n - i - 1, n - i - 2)
			h1 = a[i]
			h2 = a[i + 1]
			w1 = a[n - i - 1]
			w2 = a[n - i - 2]
			if h1 == h2 && w1 == w2 && h1 * w1 == area {
				continue
			} else {
				result = false
				break
			}
		}
		if result {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

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

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

	var Q int
	fmt.Fscanf(input, "%d\n", &Q)
	for q := 0; q < Q; q++ {
		var N int
		fmt.Fscanf(input, "%d\n", &N)
		P := make([]int, 4*N)
		for n := 0; n < 4*N; n++ {
			fmt.Fscanf(input, "%d", &P[n])
		}
		fmt.Fscanf(input, "\n")

		Ls := make(map[int]int)
		for n := 0; n < len(P); n++ {
			Ls[P[n]]++
		}
		ans := "YES"
		for _, count := range Ls {
			if count%2 != 0 {
				ans = "NO"
			}
		}
		if ans == "YES" {
			sort.Ints(P)
			l := 0
			r := len(P) - 1
			area := P[l] * P[r]
			l += 2
			r -= 2
			for l < r {
				if P[l]*P[r] != area {
					ans = "NO"
					break
				}
				l += 2
				r -= 2
			}
		}
		fmt.Println(ans)
	}
}

package main

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

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

	q, n := 0, 0
	fmt.Fscanf(input, "%d\n", &q)

	for ;q > 0; q-- {
		fmt.Fscanf(input, "%d\n", &n)
		l := n * 4
		a := make([]int, l)
		for j := 0; j < l; j++ {
			fmt.Fscanf(input, "%d", &a[j])
		}
		fmt.Fscanf(input, "\n")
		sort.Ints(a)
		area := a[0] * a[l - 1]
		ok := true
		for i := 0; i < l/2 + 1; i+=2 {
			ha := a[i]
			hb := a[i + 1]
			wa := a[l - i - 1]
			wb := a[l - i - 2]
			if ha == hb && wa == wb && ha * wa == area {
				continue
			}
			ok = false
			break
		}
		if ok {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	input := bufio.NewReader(os.Stdin)
	var testCase int

	_, err := fmt.Fscan(input, &testCase)
	if err != nil {
	}

	for testCase > 0 {
		testCase--

		var x int
		_, err := fmt.Fscan(input, &x)
		if err != nil {
		}

		var a = make([]int, 4*x)
		var l = make([]int, 0)
		var lMap = make(map[int]int)

		for i := 0; i < 4*x; i++ {
			_, err := fmt.Fscan(input, &a[i])
			if err != nil {
			}
			_, ok := lMap[a[i]]
			if ok {
				lMap[a[i]] ++
			} else {
				lMap[a[i]] = 1
			}
		}

		var result = true
		for k, v := range lMap {
			if v%2 != 0 {
				result = false
				break
			}
			for i := 0; i < v/2; i++ {
				l = append(l, k)
			}
		}

		if result == false {
			fmt.Println("NO")
			continue
		}
		sort.Ints(l)
		r := l[0] * l[2*x-1]
		for i := 1; i < x; i++ {
			if l[i]*l[2*x-i-1] != r {
				result = false
				break
			}
		}

		if result == false {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}

}

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

var dat [][]int

func resolve(x int) []int{
	var cnt []int
	for i:=2; i*i<=x; i++ {
		for ; x%i==0; x/=i {
			cnt = append(cnt, i)
		}
	}
	if x!=1 {
		cnt = append(cnt, x)
	}
	return cnt
}

func main(){

	input := bufio.NewReader(os.Stdin)

	dat = make([][]int, 10001)
	for i:=1; i<=10000; i++ {
		dat[i] = resolve(i)
	}

	var T int
	fmt.Fscanf(input, "%d\n", &T)
	for t:=1; t<=T; t++ {
	var n int
	fmt.Fscanf(input, "%d\n", &n)
	arr := make([]int, 4*n+1)
	cnt := make([]int, 10001)
	left := make([]int, 10001)
	for i:=1; i<=4*n; i++ {
		fmt.Fscanf(input, "%d", &arr[i])
		left[arr[i]]++
		for _, j := range dat[arr[i]] {
			cnt[j]++
		}
	}
	fmt.Fscanf(input, "\n");
	ans := true
	for i:=1; i<=10000; i++ {
		if left[i]%2!=0 {
			fmt.Println("NO")
			ans = false
			break
		}
		left[i]*=2
	}
	if !ans {
		continue
	}
	prod := 1
	for i:=1; i<=10000; i++ {
		if cnt[i]%(2*n)!=0 {
			fmt.Println("NO")
			ans = false
			break
		}
		cnt[i]/=(2*n)
		for j:=1; j<=cnt[i]; j++ {
			prod*=i
		}
	}
	if !ans {
		continue
	}
	for i:=1; i<=4*n; i++ {
		if left[arr[i]]==0 {
			fmt.Println("NO")
			ans = false
			break
		}
		left[arr[i]]--
		if prod%arr[i]==0 && left[prod/arr[i]]>=1 {
			left[prod/arr[i]]--
		} else {
			fmt.Println("NO")
			ans = false
		}
	}
	if !ans {
		continue
	}
	fmt.Println("YES")
	}

}

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

var input *bufio.Reader
var dat [][]int

func resolve(x int) []int{
	var cnt []int
	for i:=2; i*i<=x; i++ {
		for ; x%i==0; x/=i {
			cnt = append(cnt, i)
		}
	}
	if x!=1 {
		cnt = append(cnt, x)
	}
	return cnt
}

func solve() {
	var n int
	fmt.Fscanf(input, "%d\n", &n)
	arr := make([]int, 4*n+1)
	cnt := make([]int, 10001)
	left := make([]int, 10001)
	for i:=1; i<=4*n; i++ {
		fmt.Fscanf(input, "%d", &arr[i])
		left[arr[i]]++
		for _, j := range dat[arr[i]] {
			cnt[j]++
		}
	}
	fmt.Fscanf(input, "\n");
	prod := 1
	for i:=1; i<=10000; i++ {
		if cnt[i]%(2*n)!=0 || left[i]%2!=0 {
			fmt.Println("NO")
			return
		}
		cnt[i]/=(2*n)
		left[i]*=2
		for j:=1; j<=cnt[i]; j++ {
			prod*=i
		}
	}
	for i:=1; i<=4*n; i++ {
		if left[arr[i]]==0 {
			fmt.Println("NO")
			return
		}
		left[arr[i]]--
		if prod%arr[i]==0 && left[prod/arr[i]]>=1 {
			left[prod/arr[i]]--
		} else {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}

func init() {
	input = bufio.NewReader(os.Stdin)
	dat = make([][]int, 10001)
	for i:=1; i<=10000; i++ {
		dat[i] = resolve(i)
	}
}

func main(){
	var T int
	fmt.Fscanf(input, "%d\n", &T)
	for t:=1; t<=T; t++ {
		solve()
	}
}

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

func resolve(x int) []int{
	var cnt []int
	for i:=2; i*i<=x; i++ {
		for ; x%i==0; x/=i {
			cnt = append(cnt, i)
		}
	}
	if x!=1 {
		cnt = append(cnt, x)
	}
	return cnt
}

func main(){

	input := bufio.NewReader(os.Stdin)

	dat := make([][]int, 10001)
	for i:=1; i<=10000; i++ {
		dat[i] = resolve(i)
	}

	var T int
	fmt.Fscanf(input, "%d\n", &T)
	for t:=1; t<=T; t++ {
		var n int
		fmt.Fscanf(input, "%d\n", &n)
		arr := make([]int, 4*n+1)
		cnt := make([]int, 10001)
		left := make([]int, 10001)
		for i:=1; i<=4*n; i++ {
			fmt.Fscanf(input, "%d", &arr[i])
			left[arr[i]]++
			for _, j := range dat[arr[i]] {
				cnt[j]++
			}
		}
		fmt.Fscanf(input, "\n");
		ans := true
		for i:=1; i<=10000; i++ {
			if left[i]%2!=0 {
				fmt.Println("NO")
				ans = false
				break
			}
			left[i]*=2
		}
		if !ans {
			continue
		}
		prod := 1
		for i:=1; i<=10000; i++ {
			if cnt[i]%(2*n)!=0 {
				fmt.Println("NO")
				ans = false
				break
			}
			cnt[i]/=(2*n)
			for j:=1; j<=cnt[i]; j++ {
				prod*=i
			}
		}
		if !ans {
			continue
		}
		for i:=1; i<=4*n; i++ {
			if left[arr[i]]==0 {
				fmt.Println("NO")
				ans = false
				break
			}
			left[arr[i]]--
			if prod%arr[i]==0 && left[prod/arr[i]]>=1 {
				left[prod/arr[i]]--
			} else {
				fmt.Println("NO")
				ans = false
			}
		}
		if !ans {
			continue
		}
		fmt.Println("YES")
	}

}

//https://codeforces.com/problemset/problem/1203/B
package main

import (
	"fmt"
	"sort"
)

func main() {
	q := 0
	n := 0
	fmt.Scanf("%d", &q)

	for ; q > 0; q-- {
		fmt.Scanf("%d", &n)
		sideArray := make([]int, 4*n)
		for i := 0; i < 4*n; i++ {
			fmt.Scanf("%d", &sideArray[i])
		}

		sort.Ints(sideArray)
		i := 0
		j := 4*n - 1

		mp := make(map[int]bool)
		st := "YES"
		for i < j {
			if sideArray[i] != sideArray[i+1] || sideArray[j-1] != sideArray[j] {
				st = "NO"
				break
			}
			area := sideArray[i] * sideArray[j]
			mp[area] = true
			i += 2
			j -= 2
		}
		if len(mp) != 1 {
			st = "NO"
		}
		fmt.Println(st)
	}
}

//https://codeforces.com/problemset/problem/1203/B
package main

import (
	"fmt"
	"sort"
)

func main() {
	q := 0
	n := 0
	fmt.Scanf("%d", &q)

	for ; q > 0; q-- {
		fmt.Scanf("%d", &n)
		sideArray := make([]int, 4*n)
		for i := 0; i < 4*n; i++ {
			fmt.Scanf("%d", &sideArray[i])
		}
		sort.Ints(sideArray)
		i := 0
		j := 4*n - 1

		mp := make(map[int]bool)
		st := "YES"
		for i < j {
			if sideArray[i] != sideArray[i+1] || sideArray[j-1] != sideArray[j] {
				st = "NO"
				break
			}
			area := sideArray[i] * sideArray[j]
			mp[area] = true
			i += 2
			j -= 2
		}
		if len(mp) > 1 {
			st = "NO"
		}
		fmt.Println(st)
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, q, cnt, x, sum, area int

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := 0; i < q; i++ {
		fmt.Scanln(&n)
		cnt = 0

		m := make(map[int]int)

		for i := 0; i < 4*n; i++ {
			fmt.Scanf("%d", &x)
			m[x]++
		}
		fmt.Scanln(&x)

		a := make([]int, 0)
		for x, y := range m {

			for i := 0; i < y/2; i++ {
				a = append(a, x)
			}
			if y%2 != 0 {
				cnt = 7
				break
			}
			sum += y
		}

		if cnt != 7 && sum%4 != 0 {
			cnt = 7
		}

		sort.Ints(a)

		if n > 1 && cnt != 7 {
			area = a[0] * a[len(a)-1]
			for i := 0; i < len(a)/2; i++ {
				if area != a[i]*a[len(a)-i-1] {
					cnt = 7
					break
				}
			}
		}

		if cnt == 7 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, q, cnt, x, sum, area int

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := 0; i < q; i++ {
		fmt.Scanln(&n)
		cnt = 0

		m := make(map[int]int)

		for i := 0; i < 4*n; i++ {
			fmt.Scanf("%d", &x)
			m[x]++
		}
		fmt.Scanln(&x)

		a := make([]int, 0)
		for x, y := range m {

			for i := 0; i < y/2; i++ {
				a = append(a, x)
			}
			if y%2 != 0 {
				cnt = 7
				break
			}
			sum += y
		}

		if cnt != 7 && sum%4 != 0 {
			cnt = 7
		}

		if cnt != 7 {
			area = a[0] * a[len(a)-1]
			for i := 0; i < len(a)/2; i++ {
				if area != a[i]*a[len(a)-i-1] {
					cnt = 7
					break
				}
			}
		}

		if cnt == 7 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, q, cnt, x, sum, area int

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := 0; i < q; i++ {
		fmt.Scanln(&n)
		cnt = 0

		m := make(map[int]int)

		for i := 0; i < 4*n; i++ {
			fmt.Scanf("%d", &x)
			m[x]++
		}
		fmt.Scanln(&x)

		a := make([]int, 0)
		for x, y := range m {

			for i := 0; i < y/2; i++ {
				a = append(a, x)
			}
			if y%2 != 0 {
				cnt = 7
				break
			}
			sum += y
		}

		if cnt != 7 && sum%4 != 0 {
			cnt = 7
		}

		if n > 1 && cnt != 7 {
			area = a[0] * a[len(a)-1]
			for i := 0; i < len(a)/2; i++ {
				if area != a[i]*a[len(a)-i-1] {
					cnt = 7
					break
				}
			}
		}

		if cnt == 7 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, q, cnt, x, sum int

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := 0; i < q; i++ {
		fmt.Scanln(&n)
		cnt = 0

		m := make(map[int]int)

		for i := 0; i < 4*n; i++ {
			fmt.Scanf("%d", &x)
			m[x]++
		}
		fmt.Scanln(&x)

		a := make([]int, 0)
		for x, y := range m {

			for i := 0; i < y/2; i++ {
				a = append(a, x)
			}
			if y%2 != 0 {
				cnt = 7
				break
			}
			sum += y
		}

		if cnt != 7 && sum%4 != 0 {
			cnt = 7
		}

		if cnt != 7 {
			area := a[0] * a[len(a)-1]
			for i := 0; i < len(a); i++ {
				if area != a[i]*a[len(a)-i-1] {
					cnt = 7
					break
				}
			}
		}

		if cnt == 7 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

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

	var (
		total int
		n     int
	)

	_, _ = fmt.Fscan(input, &total)

	for t := 0; t < total; t += 1 {
		_, _ = fmt.Fscan(input, &n)

		stick := make([]int, n*4)
		count := make(map[int]int)
		for i := 0; i < n*4; i += 1 {
			_, _ = fmt.Fscan(input, &stick[i])
			count[stick[i]] += 1
		}

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

		isFound := true
		hasErr := false
		newSide := make([]int, 0)
		for k, v := range count {
			if v%2 != 0 {
				hasErr = true
				break
			}
			c := v / 2
			for i := 0; i < c; i++ {
				newSide = append(newSide, k)
			}
		}

		if hasErr {
			fmt.Println("NO")
			continue
		}

		sort.Ints(newSide)
		sum := newSide[0] * newSide[len(newSide)-1]
		for i, j := 0, len(newSide)-1; i < j; i, j = i+1, j-1 {
			if sum != newSide[i]*newSide[j] {
				isFound = false
				break
			}
		}

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

}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	q, n := 0, 0
	fmt.Scan(&q)

	for ;q > 0; q-- {
		fmt.Scan(&n)
		m := map[int]int{}
		for j := 0; j < n * 4; j++ {
			var a int
			fmt.Scan(&a)
			m[a]++
		}
		m2 := map[int]int{}
		for k, v := range m {
			t := v/2
			if t > 0 {
				m2[k] = t
			}
		}
		p := []int{}
		for k, v := range m2 {
			for i := 0; i < v; i++ {
				p = append(p, k)
			}
		}
		//fmt.Println(n)
		//fmt.Println(p)
		l := len(p)
		t := [][]int{}
		for i := 0; i < l; i++ {
			a := []int{}
			for j := 0; j < l; j++ {
				if j != i {
					a = append(a, p[i] * p[j])
				} else {
					a = append(a, 0)
				}
			}
			t = append(t, a)
		}
		//fmt.Println(t)
		m3 := map[int]int{}
		for i := 0; i < l; i++ {
			m4 := map[int]bool{}
			for j := 0; j < l; j++ {
				if i != j {
					if _, ok := m4[t[i][j]]; !ok {
						m3[t[i][j]]++
						m4[t[i][j]] = true
					}
				}
			}
		}
		//fmt.Println(m3)
		ok := false
		for _, v := range m3 {
			if v >= n * 2 {
				ok = true
				fmt.Println("YES")
				break
			}
		}
		if !ok {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	q, n := 0, 0
	fmt.Scan(&q)

	for ;q > 0; q-- {
		fmt.Scan(&n)
		m := map[int]int{}
		for j := 0; j < n * 4; j++ {
			var a int
			fmt.Scan(&a)
			m[a]++
		}
		m2 := map[int]int{}
		for k, v := range m {
			t := v/2
			if t > 0 {
				m2[k] = t
			}
		}
		p := []int{}
		for k, v := range m2 {
			for i := 0; i < v; i++ {
				p = append(p, k)
			}
		}
		l := len(p)
		rows := make([]map[int]bool, l)
		cols := make([]map[int]bool, l)
		m3 := map[int]int{}
		for i := 0; i < l; i++ {
			for j := i + 1; j < l; j++ {
				if i != j {
					_, oki := rows[i][p[i] * p[j]]
					_, okj := cols[j][p[i] * p[j]]
					if !oki && !okj {
						if rows[i] == nil {
							rows[i] = map[int]bool{}
						}
						rows[i][p[i] * p[j]] = true
						if cols[j] == nil {
							cols[j] = map[int]bool{}
						}
						cols[j][p[i] * p[j]] = true
						m3[p[i] * p[j]]++
						if m3[p[i] * p[j]] >= n {
							fmt.Println("YES")
							goto done
						}
					}
				}
			}
		}
		fmt.Println("NO")
done:
	}
}

package main

import (
	"fmt"
)

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	q, n := 0, 0
	fmt.Scan(&q)

	for ;q > 0; q-- {
		fmt.Scan(&n)
		m := map[int]int{}
		for j := 0; j < n * 4; j++ {
			var a int
			fmt.Scan(&a)
			m[a]++
		}
		m2 := map[int]int{}
		for k, v := range m {
			t := v/2
			if t > 0 {
				m2[k] = t
			}
		}
		p := []int{}
		for k, v := range m2 {
			for i := 0; i < v; i++ {
				p = append(p, k)
			}
		}
		//fmt.Println(n)
		//fmt.Println(p)
		l := len(p)
		t := [][]int{}
		for i := 0; i < l; i++ {
			a := []int{}
			for j := 0; j < l; j++ {
				if j != i {
					a = append(a, p[i] * p[j])
				} else {
					a = append(a, 0)
				}
			}
			t = append(t, a)
		}
		//fmt.Println(t)
		m3 := map[int]struct{i, j, v int}{}
		for i := 0; i < l; i++ {
			for j := 0; j < l; j++ {
				if i != j {
					tmp := m3[t[i][j]]
					if tmp.i != i + 1 && tmp.j != j + 1 {
						tmp.i = i + 1
						tmp.j = j + 1
						tmp.v++
						m3[t[i][j]] = tmp
					}
				}
			}
		}
		//fmt.Println(m3)
		ok := false
		for _, v := range m3 {
			if v.v >= n * 2 {
				ok = true
				fmt.Println("YES")
				break
			}
		}
		if !ok {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	q, n := 0, 0
	fmt.Scan(&q)

	for ;q > 0; q-- {
		fmt.Scan(&n)
		m := map[int]int{}
		for j := 0; j < n * 4; j++ {
			var a int
			fmt.Scan(&a)
			m[a]++
		}
		m2 := map[int]int{}
		for k, v := range m {
			t := v/2
			if t > 0 {
				m2[k] = t
			}
		}
		p := []int{}
		for k, v := range m2 {
			for i := 0; i < v; i++ {
				p = append(p, k)
			}
		}
		//fmt.Println(n)
		//fmt.Println(p)
		l := len(p)
		t := [][]int{}
		for i := 0; i < l; i++ {
			a := []int{}
			for j := 0; j < l; j++ {
				if j != i {
					a = append(a, p[i] * p[j])
				} else {
					a = append(a, 0)
				}
			}
			t = append(t, a)
		}
		fmt.Println()
		rows := make([]map[int]bool, l)
		cols := make([]map[int]bool, l)
		m3 := map[int]int{}
		for i := 0; i < l/2; i++ {
			for j := l/2; j < l; j++ {
				if i != j {
					_, oki := rows[i][t[i][j]]
					_, okj := cols[j][t[i][j]]
					if !oki && !okj {
						if rows[i] == nil {
							rows[i] = map[int]bool{}
						}
						rows[i][t[i][j]] = true
						if cols[j] == nil {
							cols[j] = map[int]bool{}
						}
						cols[j][t[i][j]] = true
						m3[t[i][j]]++
						if m3[t[i][j]] >= n {
							fmt.Println("YES")
							goto done
						}
					}
				}
			}
		}
		fmt.Println("NO")
done:
	}
}

package main

import (
	"fmt"
)

func main() {
	q, n := 0, 0
	fmt.Scan(&q)

	for ;q > 0; q-- {
		fmt.Scan(&n)
		m := map[int]int{}
		for j := 0; j < n * 4; j++ {
			var a int
			fmt.Scan(&a)
			m[a]++
		}
		m2 := map[int]int{}
		for k, v := range m {
			t := v/2
			if t > 0 {
				m2[k] = t
			}
		}
		p := []int{}
		for k, v := range m2 {
			for i := 0; i < v; i++ {
				p = append(p, k)
			}
		}
		//fmt.Println(n)
		//fmt.Println(p)
		l := len(p)
		t := [][]int{}
		for i := 0; i < l; i++ {
			a := []int{}
			for j := 0; j < l; j++ {
				if j != i {
					a = append(a, p[i] * p[j])
				} else {
					a = append(a, 0)
				}
			}
			t = append(t, a)
		}
		//fmt.Println(t)
		m3 := map[int]int{}
		for i := 0; i < l; i++ {
			m4 := map[int]bool{}
			for j := 0; j < l; j++ {
				if i != j {
					if _, ok := m4[t[i][j]]; !ok {
						m3[t[i][j]]++
						m4[t[i][j]] = true
					}
				}
			}
		}
		//fmt.Println(m3)
		ok := false
		for _, v := range m3 {
			if (n%2 == 0 && v >= n * 2) || (n%2 != 0 && v >= n * 2 - 1) {
				ok = true
				fmt.Println("YES")
				break
			}
		}
		if !ok {
			fmt.Println("NO")
		}
	}
}