题目描述
每个箱子都有长宽高,我们需要判断一个箱子能否放入另一个箱子中。
例如有箱子A的尺寸是 3 x 4 x 5,箱子B的尺寸 是 5 x 6 x 4,经过比较判断,可以知道箱子A能够放入箱子B中,我们就说箱子A匹配箱子B。
注意,当两个箱子尺寸相等,我们也认为它们匹配。
输入
第一行输入参数T,表示有T个测试实例
第二行输入第1组实例的箱子A的长、宽、高,输入数值为小于1000的自然数
第三行输入第1组实例的箱子B的长、宽、高,输入数值为小于1000的自然数
以此类推
输出
如果两个箱子匹配,输出yes,否则输出no。逐行输出每一组的箱子匹配结果。
样例输入:
3
3 4 5
5 6 4
5 6 4
3 4 5
5 6 7
7 4 7
样例输出:
yes
yes
no
t=int(input())
while t:
t = t - 1
a,b,c=map(int,input().split(' '))
q,w,e=map(int,input().split(' '))
if a>c>b: a,b,c=a,c,b
if b>a>c: a,b,c=b,a,c
if c>a>b: a,b,c=c,a,b
if c>b>a: a,b,c=c,b,a
if b>c>a: a,b,c=b,c,a
if q>e>w: q,w,e=q,e,w
if w>e>q: q,w,e=w,e,q
if w>q>e: q,w,e==w,q,e
if e>q>w: q,w,e=e,q,w
if e>w>q: q,w,e=e,w,q
if q>=a and w>=b and e>=c:
print("yes")
elif a>=q and b>=w and c>=e:
print("yes")
else: print("no")