use std::collections::{BTreeSet, HashMap, HashSet, VecDeque}; use proconio::marker::Chars; fn main() { proconio::input! { q: usize, k: usize, } let mut s = Vec::new(); for _ in 0..q { match proconio::read_value!(u64) { 1 => { let val = proconio::read_value!(u64); let p = s.partition_point(|&a| a < val); s.insert(p, val); } 2 => { if s.len() < k { println!("-1"); } else { let val = s.remove(k - 1); println!("{val}"); } } _ => unreachable!(), } } }