4F finding the order

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;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值