use std::io::{self, Read};
fn main() {
let mut buf = String::new();
io::stdin().read_to_string(&mut buf).unwrap();
let buf: Vec<&str> = buf.trim().split('\n').collect();
let a: Vec<i64> = buf
.last()
.unwrap()
.split(' ')
.map(|x| x.parse().unwrap())
.collect();
let (a, b): (i64, i64) = (a[0], a[1]);
for i in (1..buf.len() - 1).rev() {
let x: Vec<i64> = buf[i].split(' ').map(|x| x.parse().unwrap()).collect();
if x[0] <= a && a <= x[0] + x[2] && x[1] <= b && b <= x[1] + x[3] {
println!("{}", i);
break;
}
if i == 1 {
println!("-1");
}
}
return;
}
本地能跑。
