#include #include #include using namespace std; using ll = long long; #include ll op(ll a,ll b){ return max(a,b); } ll ee(){ return -1; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); const int B = 500; int n,q; cin>>n>>q; vector a(n),b(n),c(n),d(n),e(n),f(n); for(int i = 0;i>a[i]>>b[i]>>c[i]>>d[i]>>e[i]>>f[i]; auto calc = [&](int i) { ll nx = c[i] - a[i]; ll ny = d[i] - b[i]; ll nnx = e[i] - a[i]; ll nny = f[i] - b[i]; return abs(nx*nny-ny*nnx); }; vector t(q),l(q),r(q),na(q),nb(q),nc(q),nd(q),ne(q),nf(q); for(int i = 0;i>t[i]; if(t[i]==1) cin>>na[i]>>nb[i]>>nc[i]>>nd[i]>>ne[i]>>nf[i]; else cin>>l[i]>>r[i]; } vector ans(q,-1); int cnt = (q+B-1) / B; auto c1 = [&](vector idx) { vector dx; for(int i = 0;i seg(m); vector,pair>> use; for(int i = 0;i idx; for(int j = le;j<=ri;j++) { if(t[j]==2) idx.push_back(j); } for(int j = le;j<=ri;j++) if(t[j]==2){ for(int k = le;k<=j;k++) if(t[k]==1){ if(!(l[j]<=min(min(na[k],nc[k]),ne[k])&&max(max(na[k],nc[k]),ne[k])<=r[j])) continue; ll nx = nc[k] - na[k]; ll ny = nd[k] - nb[k]; ll nnx = ne[k] - na[k]; ll nny = nf[k] - nb[k]; ans[j] = max(ans[j],abs(nx*nny-ny*nnx)); } } c1(idx); for(int j = le;j<=ri;j++) if(t[j]==1){ a.push_back(na[j]);; b.push_back(nb[j]); c.push_back(nc[j]); d.push_back(nd[j]); e.push_back(ne[j]); f.push_back(nf[j]); n++; } } for(int i = 0;i