func main() var n: int :: cui@inputInt() var k: int :: cui@inputInt() var a: []int :: #[n]int for i(0, n - 1) do a[i] :: cui@inputInt() end for var dic: dict :: #dict for i(0, n - 1) var key: int :: a[i] var val: int :: dic.get(key, &) do dic.add(key, val + 1) end for var nums: []int :: #[0]int var valueList: List :: #List class List() +var li: list *func ctor() do me.li :: #list end func end class do dic.forEach(callback, valueList $ kuin@Class) func callback(key: int, value: int, data: kuin@Class): bool do (data $ List).li.add(value) ret true end func var values: []int :: valueList.li.toArray() var ans: int :: 0 do values.sort() do values.reverse() for i(0, ^values - 1) do ans :+ 1 do k :- values[i] if(k <= 0) break i end if end for do cui@print("\{ans}\n") end func