pub fn min_opt(a: Option<i32>, b: Option<i32>) -> Option<i32> {
match (a, b) {
(Some(x), Some(y)) => Some(x.min(y)),
_ => a.or(b),
}
}
pub fn max_opt(a: Option<i32>, b: Option<i32>) -> Option<i32> {
match (a, b) {
(Some(x), Some(y)) => Some(x.max(y)),
_ => a.or(b),
}
}