fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int ile_testow=0;
  8. int ax,ay,bx,by,cx,cy= {0};
  9. cin>>ile_testow;
  10. while(ile_testow)
  11. {
  12. cin>>ax>>ay>>bx>>by>>cx>>cy;
  13. int temp=0;
  14. int temp2=0;
  15. int a=0;
  16. a=bx-ax;
  17. if(a==0)
  18. {
  19. temp=0;
  20. }
  21. else
  22. {
  23. temp=((by-ay)/a);
  24. }
  25. a=cx-ax;
  26. if(a==0)
  27. {
  28. temp2=0;
  29. }
  30. else
  31. {
  32. temp2=((cy-ay)/a);
  33. }
  34. if(temp==temp2)
  35. {
  36. cout<<"TAK"<<endl;
  37. }
  38. else
  39. cout<<"NIE"<<endl;
  40.  
  41. ax,ay,bx,by,cx,cy= {0};
  42. ile_testow--;
  43. }
  44.  
  45. return 0;
  46. }
  47.  
Success #stdin #stdout 0s 4548KB
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