#include #define rep(i,a,b) for(int i=a;i<(b);++i) #define erep(i,a,b) for(int i=a;i<=(int)(b);++i) #define per(i,a,b) for(int i=(a);i>(b);--i) #define eper(i,a,b) for(int i=(a);i>=b;--i) #define pb push_back #define mp make_pair #define INF (1<<31)-1 #define MOD 1000000007 #define all(x) (x).begin(),(x).end() #define vii vector #define vll vector using namespace std; typedef long long ll; typedef pair Pii; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> n >> xlb >> xrb; rep(i, 0, n) cin >> lx[i] >> yu[i] >> rx[i] >> yd[i]; vii ans(n); erep(i, xlb, xrb) { vector a; rep(j, 0, n) { if (lx[j] <= i && i <= rx[j]) a.pb(mp(-yd[j], j)); } sort(all(a)); if (!a.empty()) ans[a[0].second] = 1; } rep(i, 0, n) { cout << ans[i] << endl; } return 0; }