Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. long long maxx(long long x1,long long x2,long long x3,long long x4)
  5. {
  6. long long a,b;
  7. a=max(x1,x2);
  8. b=max(x3,x4);
  9. if(a>b)
  10. {
  11. return a;
  12. }
  13. else return b;
  14. }
  15. long long minn(long long x1,long long x2,long long x3,long long x4)
  16. {
  17. long long a,b;
  18. a=min(x1,x2);
  19. b=min(x3,x4);
  20. if(a>b)
  21. {
  22. return b;
  23. }
  24. else return a;
  25. }
  26. int main()
  27. {
  28. long long x1,x2,x3,x4,y1,y2,y3,y4,a,b,c,d,e=0,f=0,g,h;
  29. cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
  30. a=maxx(x1,x2,x3,x4);
  31. b=minn(x1,x2,x3,x4);
  32. c=maxx(y1,y2,y3,y4);
  33. d=minn(y1,y2,y3,y4);
  34. if(x1==a||x1==b)
  35. {
  36. if(x2==a||x2==b)
  37. {
  38. if(x3==a||x3==b)
  39. {
  40. if(x1==a||x1==b)
  41. {
  42. e=1;
  43. }
  44. }
  45. }
  46. }
  47. if(y1==c||y1==d)
  48. {
  49. if(y2==c||y2==d)
  50. {
  51. if(y3==c||y3==d)
  52. {
  53. if(y1==c||y1==d)
  54. {
  55. f=1;
  56. }
  57. }
  58. }
  59. }
  60. g=a-b;
  61. h=c-d;
  62. if(e==1&&f==1)
  63. {
  64. if(g==h&&g*h!=0) cout<<"TAK";
  65. else cout<<"NIE";
  66. }
  67. else cout<<"NIE";
  68. return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement