class Solution:
def minEatingSpeed(self, piles: List[int], h: int) -> int:
left, right = 1, 10**9
while left <= right:
mid = (left + right) // 2
cnt = 0
for pile in piles:
cnt += math.ceil(pile / mid)
if cnt > h:
left = mid + 1
break
else:
right = mid - 1
return left