#include #include #include struct Data { int lx, rx, y, id; Data(int lx, int rx, int y, int id) : lx(lx), rx(rx), y(y), id(id) {} }; constexpr int X = 1280; void solve() { int n, lbx, rbx; std::cin >> n >> lbx >> rbx; std::vector hit(X + 1, false); for (int x = lbx; x <= rbx; ++x) hit[x] = true; std::vector ps; for (int i = 0; i < n; ++i) { int lx, ly, rx, ry; std::cin >> lx >> ly >> rx >> ry; lx = std::max(lx, 0); rx = std::min(rx, X); ps.emplace_back(lx, rx, ry, i); } std::sort(ps.begin(), ps.end(), [](auto lhs, auto rhs) { return lhs.y > rhs.y; }); std::vector ans(n, false); for (auto p : ps) { for (int x = p.lx; x <= p.rx; ++x) { if (hit[x]) ans[p.id] = true; hit[x] = false; } } for (auto a : ans) std::cout << a << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }