import java.util.*;
import java.util.regex.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;
import java.text.*;
class Main
{
public static void main (String args[]) // entry point from OS
{
Main myWork = new Main(); // create a dinamic instance
myWork.Begin(); // the true entry point
}
void Begin()
{
Scanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter pr=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
Line2D ll=new Line2D.Double();
Rectangle2D rl=new Rectangle2D.Double();
long n;
double lx1,ly1,lx2,ly2,rx1,ry1,rx2,ry2;
n=sc.nextLong();
for(long l=0;l<n;l++)
{
lx1=sc.nextDouble();
ly1=sc.nextDouble();
lx2=sc.nextDouble();
ly2=sc.nextDouble();
rx1=sc.nextDouble();
ry1=sc.nextDouble();
rx2=sc.nextDouble();
ry2=sc.nextDouble();
ll=new Line2D.Double(lx1,ly1,lx2,ly2);
rl.setFrameFromDiagonal(rx1, ry1, rx2, ry2);
if(rl.intersectsLine(ll))
{
pr.printf("T\n");
}
else
{
pr.printf("F\n");
}
}
pr.close();
sc.close();
}
}
No comments:
Post a Comment