#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n>>l>>r; vector d(n+1,-1); vector v(3000,n); vector sx(n),sy(n),gx(n),gy(n); for(Int i=0;i>sx[i]>>sy[i]>>gx[i]>>gy[i]; chmax(sx[i],0); d[i]=gy[i]; } for(Int i=0;i ans(n+1,0); for(Int i=l;i<=r;i++) ans[v[i]]=1; for(Int i=0;i