Advertisement
Guest User

pororopororo

a guest
Oct 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7.  
  8.  
  9.  
  10. int main()
  11. {
  12. int N, M, K;
  13. //N по оси OX; M по оси OY; K количество окон
  14. int window[100][4];
  15. cin >> N >> M >> K;
  16. for (int i = 0; i < K; i++)
  17. {
  18. for (int j = 0; j < 4; j++)
  19. {
  20. cin >> window[i][j];
  21. }
  22. }
  23. for (int i = 0; i < K; i++)
  24. {
  25. if (window[i][1] > N)
  26. {
  27. cout << "broken";
  28. return 0;
  29. }
  30. if (window[i][3] > M)
  31. {
  32. cout << "broken";
  33. return 0;
  34. }
  35. }
  36. for (int i = 0; i < K; i++)
  37. {
  38. for (int j = 0; j < K; j++)
  39. {
  40. if ((window[i][0] < window[j][0] && window[j][0] < window[i][1]) || (window[i][0] < window[j][1] && window[j][1] < window[i][1]))
  41. {
  42. cout << "broken";
  43. return 0;
  44. }
  45. else if ((window[i][2] < window[j][2] && window[j][2] < window[i][3]) || (window[i][2] < window[j][3] && window[j][3] < window[i][3]))
  46. {
  47. cout << "broken";
  48. return 0;
  49. }
  50. else
  51. {
  52. cout << "correct";
  53. return 0;
  54. }
  55. }
  56. }
  57.  
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement