#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=20000099999900; ll mod=998244353; int main(){ ll n,m; cin >> n >> m; vectorl(n),r(n),x(n),y(n); for (ll i = 0; i < n; i++) { cin >> l[i] >> r[i] >> x[i] >> y[i]; } vectora(m); for (ll i = 0; i < m; i++) { cin >> a[i]; } vector>b(300,vector(300,0)); vectorc(100001,0); vector>>p(m); for (ll i = 0; i < m; i++) { p[i]={a[i],{i,i}}; } for (ll i = 0; i < n; i++) { if (1) { p.push_back({l[i],{-inf,i}}); p.push_back({r[i],{inf,i}}); } } sort(p.begin(),p.end()); vectorans(m,0); for (ll i = 0; i < p.size(); i++) { ll xx=p[i].first; ll yy=p[i].second.first; ll z=p[i].second.second; if (yy==inf) { if (x[z]<300) { b[x[z]][y[z]]--; }else{ ll now=y[z]; while (now