#P10245. Swimming Pool
Swimming Pool
Background
Please note that in quadrilateral , the four points must be in order as . Cases like being a diagonal are not allowed.
Problem Description
Little J wants to build a quadrilateral swimming pool . He wants one pair of opposite sides to be parallel (so it is convenient to hold some family competitions), and the other pair of opposite sides to be not parallel (otherwise it would look too ordinary). In other words, he needs this swimming pool to be a trapezoid.
Given four positive integers , determine whether he can build a swimming pool that satisfies the requirement, such that , , , and .
Input Format
This problem contains multiple test cases. The first line of input contains a positive integer indicating the number of test cases.
The next lines each contain four positive integers separated by spaces.
Output Format
For each test case, output one line. If a trapezoid can be formed, output yes; otherwise output no.
3
20 2 4 8
3 5 3 5
1 2 4 3
no
no
yes
Hint
[Sample Explanation]
In the first test case, it is obviously impossible to form a quadrilateral.
In the second test case, it can only form a parallelogram.
In the third test case, it can indeed form a trapezoid.
[Constraints]
This problem has test points. Note that the points are not evenly distributed.
| Test Point ID | Special Property | Score |
|---|---|---|
| A trapezoid can be formed if and only if a quadrilateral can be formed. | ||
| and | ||
| and | ||
| The input is guaranteed to be able to form a quadrilateral. | ||
| No special property. |
For all data, it is guaranteed that , , and all inputs are positive integers.
Translated by ChatGPT 5