fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test \
  4.   int t; \
  5.   cin >> t; \
  6.   while (t--)
  7. #define ll long long
  8. #define endl '\n'
  9. #define cendl cout << endl
  10. #define cyes cout << "YES" << endl
  11. #define cno cout << "NO" << endl
  12. #define InTheNameOfAllah \
  13.   ios_base::sync_with_stdio(0); \
  14.   cin.tie(0);
  15. struct rect {
  16. double x1, x2, y1, y2;
  17. };
  18. int main() {
  19. InTheNameOfAllah
  20. vector<rect>
  21. v;
  22. char c;
  23. while (cin >> c && c != '*') {
  24. rect r;
  25. cin >> r.x1 >> r.y1 >> r.x2 >> r.y2;
  26. v.push_back(r);
  27. }
  28. int cnt = 0;
  29. double x, y;
  30. while (cin >> x >> y && !(x == 9999.9 && y == 9999.9)) {
  31. cnt++;
  32. bool contained = false;
  33. int counter = 0;
  34. for (auto r : v) {
  35. counter++;
  36. if (x > r.x1 && x < r.x2 && y < r.y1 && y > r.y2) {
  37. contained = true;
  38. cout << "Point " << cnt << " is contained in figure " << counter << endl;
  39. }
  40. }
  41. if (!contained)
  42. cout << "Point " << cnt << " is not contained in any figure\n";
  43. }
  44.  
  45. return 0;
  46. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
Standard output is empty