[C] sample to O(1) find-min