class Solution:
    def minEatingSpeed(self, piles: List[int], h: int) -> int:
        l, r = 1, max(piles)
        while l < r:

            m = l+(r-l)//2

            time = sum(math.ceil(p/m) for p in piles)
            # print(l,r,m,time)
            if time > h:
                l = m+1
            else:
                r = m
        return l
