nowcoder_Industrial Nuclear Water_几何

nowcoder_Industrial Nuclear Water_几何

//
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;               // int 溢出

int main()
{
    LL t,a1,a2,b1,b2,c1,c2,t1,t2,t3,t4;

    cin>>t;
    while( t-- )
    {
        cin>>a1>>b1>>c1>>a2>>b2>>c2;
                                    // 和累加不等价
        if( a1+a2==0 && b1+b2==0 && c1+c2==0 ) { cout<<"No"<<endl; continue; }

        t1=1000*a1; t2=b1*b1+c1*c1;                     // 函数拆解绝对值
        t3=1000*a2; t4=b2*b2+c2*c2;
        if( t1==t2 || t3==t4 || ( t1>t2 )!=( t3>t4 ) || ( -t1>t2 )!=( -t3>t4 ) ) { cout<<"No"<<endl; continue; }

        t1=1000*b1; t2=a1*a1+c1*c1;
        t3=1000*b2; t4=a2*a2+c2*c2;
        if( t1==t2 || t3==t4 || ( t1>t2 )!=( t3>t4 ) || ( -t1>t2 )!=( -t3>t4 ) ) { cout<<"No"<<endl; continue; }

        t1=1000*c1; t2=a1*a1+b1*b1;
        t3=1000*c2; t4=a2*a2+b2*b2;
        if( t1==t2 || t3==t4 || ( t1>t2 )!=( t3>t4 ) || ( -t1>t2 )!=( -t3>t4 ) ) { cout<<"No"<<endl; continue; }

        cout<<"Yes"<<endl;
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_63173957/article/details/124852032