#include

#include

using namespace std;

int main()

{

long int n,k,a,b,c,x,y;

cin>>k;

if (1<=k && k<=100)

{

```
int h[k];
for (int i=1;i<=k;i++)
{
cin>>a;
cin>>b;
cin>>c;
cin>>x;
cin>>y;
if (1<=a<=100 && 1<=b<=100 && 1<=c<=100 && 1<=x<=100 &&1<=y<=100 )
{
int d=0;
d=abs(y-c);
int l=a-d;
int c=b+l;
if (c==x && abs(b-x)==l)
h[i]=1;
else
h[i]=0;
}
}
for (int i=1;i<=k;i++)
if (h[i]==1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
```

}