P22139 [CodeChef] KEPLERSLAW
普及-
题目描述

Kepler’s Law states that the planets move around the sun in elliptical orbits with the sun at one focus. Kepler's 3rd law is The Law of Periods, according to which:

The square of the time period of the planet is directly proportional to the cube of the semimajor axis of its orbit.

You are given the Time periods (T_{1}, T_{2}) and Semimajor Axes (R_{1}, R_{2}) of two planets orbiting the same star.

Please determine if the Law of Periods is satisfied or not, i.e, if the [constant of proportionality] of both planets is the same.

Print "Yes" (without quotes) if the law is satisfied, else print "No".

------ Input Format ------

  • The first line of input contains a single integer T, denoting the number of test cases. The description of T test cases follows.
  • Each test case consists a single line of input, containing four space-separated integers T_{1}, T_{2}, R_{1}, R_{2}.

------ Output Format ------

For each test case, output a single line containing one string — "Yes" or "No" (without quotes); the answer to the problem.

You may print each character of the answer in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).

------ Constraints ------

$1 ≤ T ≤ 10^{4}$
$1 ≤ T_{1},T_{2} ≤ 10$
$1 ≤ R_{1},R_{2} ≤ 10$

------ subtasks ------

Subtask 1(100 points): Original constraints

----- Sample Input 1 ------
3
1 1 1 1
1 2 3 4
1 8 2 8
----- Sample Output 1 ------
Yes
No
Yes
----- explanation 1 ------
- Test Case $1$: $1^{2}/1^{3} = 1^{2}/1^{3}$
- Test Case $2$: $1^{2}/3^{3} \neq 2^{2}/4^{3}$
- Test Case $3$: $1^{2}/2^{3} = 8^{2}/8^{3}$

输入格式

见题面

输出格式

见题面

样例输入
3 1 1 1 1 1 2 3 4 1 8 2 8
样例输出
Yes No Yes