fork(1) download
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5.  
  6. public class Main {
  7. public static void main(String[] args) throws IOException{
  8.  
  9. String linia =br.readLine();
  10.  
  11. int zestawy = Integer.parseInt(linia);
  12. int x, y, x1, y1, x2, y2;
  13.  
  14. while (zestawy > 0) {
  15. linia = br.readLine();
  16. String[] tab = linia.trim().split("\\s+");
  17.  
  18. x = Integer.parseInt(tab[0]);
  19. y = Integer.parseInt(tab[1]);
  20. x1 = Integer.parseInt(tab[2]);
  21. y1 = Integer.parseInt(tab[3]);
  22. x2 = Integer.parseInt(tab[4]);
  23. y2 = Integer.parseInt(tab[5]);
  24.  
  25.  
  26. if ((x1 - x) * (y2 - y) == (y1 - y) * (x2 -x))
  27. System.out.println("TAK");
  28. else
  29. System.out.println("NIE");
  30.  
  31. zestawy--;
  32. }
  33. }
  34. }
Success #stdin #stdout 0.15s 48460KB
stdin
6
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
100 200 300 400 500 600
stdout
TAK
TAK
NIE
TAK
TAK
TAK