
$O({\rm log}(\min
(k,m)))$
