def min_eating_speed(piles, h) (1..).bsearch{|i|piles.sum{|k|(k+i-1)/i}<=h} end