// ---------- begin scannner ---------- #[allow(dead_code)] mod scanner { use std::str::FromStr; pub struct Scanner<'a> { it: std::str::SplitWhitespace<'a>, } impl<'a> Scanner<'a> { pub fn new(s: &'a String) -> Scanner<'a> { Scanner { it: s.split_whitespace(), } } pub fn next(&mut self) -> T { self.it.next().unwrap().parse::().ok().unwrap() } pub fn next_bytes(&mut self) -> Vec { self.it.next().unwrap().bytes().collect() } pub fn next_chars(&mut self) -> Vec { self.it.next().unwrap().chars().collect() } pub fn next_vec(&mut self, len: usize) -> Vec { (0..len).map(|_| self.next()).collect() } } } // ---------- end scannner ---------- use std::io::Write; fn main() { use std::io::Read; let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); let mut sc = scanner::Scanner::new(&s); let out = std::io::stdout(); let mut out = std::io::BufWriter::new(out.lock()); run(&mut sc, &mut out); } fn run(sc: &mut scanner::Scanner, out: &mut std::io::BufWriter) { let n: usize = sc.next(); let q: usize = sc.next(); let mut p = vec![]; for _ in 0..n { let a = sc.next::(); let b = sc.next::(); let c = sc.next::(); let d = sc.next::(); let e = sc.next::(); let f = sc.next::(); let l = a.min(c).min(e); let r = a.max(c).max(e); let c = c - a; let d = d - b; let e = e - a; let f = f - b; let s = (c as i64 * f as i64 - d as i64 * e as i64).abs(); p.push((l as u32, r as u32, s as u64)); } for _ in 0..q { let op: u8 = sc.next(); if op == 1 { let a = sc.next::(); let b = sc.next::(); let c = sc.next::(); let d = sc.next::(); let e = sc.next::(); let f = sc.next::(); let l = a.min(c).min(e); let r = a.max(c).max(e); let c = c - a; let d = d - b; let e = e - a; let f = f - b; let s = (c as i64 * f as i64 - d as i64 * e as i64).abs(); p.push((l as u32, r as u32, s as u64)); } else { let x = sc.next::(); let y = sc.next::(); let ans = p.iter() .filter(|p| x <= p.0 && p.1 <= y) .map(|p| p.2) .max() .unwrap_or(!0); writeln!(out, "{}", ans as i64).ok(); } } }