fork(3) download
  1. /* package whatever; // don't place package name! */
  2. import java.io.BufferedReader;
  3. import java.io.IOException;
  4. import java.io.InputStreamReader;
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main(String[] args) throws IOException {
  9. int t = Integer.parseInt(br.readLine());
  10. String input[];
  11. int x,y,x1,y1,x2,y2,score;
  12. while(t-->0){
  13. score = 0;
  14. input = br.readLine().trim().split(" ");
  15. x = Integer.parseInt(input[0]);
  16. y = Integer.parseInt(input[1]);
  17. x1 = Integer.parseInt(input[2]);
  18. y1 = Integer.parseInt(input[3]);
  19. x2 = Integer.parseInt(input[4]);
  20. y2 = Integer.parseInt(input[5]);
  21. score = x * y1 + x1 * y2 + y * x2 - y1 * x2 - x * y2 - y * x1;
  22. if(score==0){
  23. System.out.println("TAK");
  24. }else{
  25. System.out.println("NIE");
  26. }
  27. }
  28. }
  29. }
Success #stdin #stdout 0.04s 4386816KB
stdin
5
1 2 3 4 5 6
1 3 1 4 1 -3
1 2 -3 4 3 9
2 -1 3 -1 -4 -1
0 0 0 0 0 0
stdout
TAK
TAK
NIE
TAK
TAK