ZYB has a so-called smart brain: He can always point out the keypoint in a complex problem.
There are two parallel lines AB and CD in a plane. {A,B,C,D}A,B,C,D are all distinct points.
You only know the Euclidean Distances between {AC,AD,BC,BD}AC,AD,BC,BD. but you don’t know the exact order of points. (i.e. You don’t know whether it’s AB \parallel CDAB∥CD or AB \parallel DCAB∥DC).
链接:https://ac.nowcoder.com/acm/contest/5669/F
来源:牛客网
Could you determine the order of points quickly, like the ZYB does?
输入描述:
The input contains multiple cases. The first line of the input contains a single integer T\ (1 \le T \le 100)T (1≤T≤100), the number of cases.
For each case, there are four integers a,b,c,d(1 \le a,b,c,d \le 1000)a,b,c,d(1≤a,b,c,d≤1000) in a line, indicating the distances between {AC,AD,BC,BD}AC,AD,BC,BD.
It is guaranteed that each case corresponds to a valid solution.
输出描述:
For each case, output ‘AB//CD’ (Quotation marks) if AB \parallel CDAB∥CD, or output ‘AB//DC’ (Quotation marks) if AB \parallel DCAB∥DC.
示例1
输入
复制
2
3 5 5 3
5 3 3 5
输出
复制
AB//CD
AB//DC
#include<iostream>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<queue>
#include<stdio.h>
#include<string.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a > c) {
if (b < d) {
cout << "AB//DC" << endl;
}
else {
if (b < a) {
cout << "AB//DC" << endl;
}
else {
cout << "AB//CD" << endl;
} } }
else {
if (b>d) {
cout << "AB//CD" << endl;
}
else {
if (d>c) {
cout << "AB//DC" << endl;
}
else {
cout << "AB//CD" << endl;
} } } }
return 0;
}