------
## 最终结论
```python
def minEatingSpeed(piles, H):
    min_speed = 1
    max_speed = max(piles)

    while min_speed < max_speed:
        mid_speed = (min_speed + max_speed) // 2
        if time_to_eat(piles, mid_speed) <= H:
            max_speed = mid_speed  # Try a smaller speed
        else:
            min_speed = mid_speed + 1  # Increase speed

    return min_speed

def time_to_eat(piles, K):
    total_time = 0
    for pile in piles:
        total_time += (pile + K - 1) // K  # Calculate the time for each pile
    return total_time

# Example usage
piles = [3, 6, 7, 11]
H = 8
print(minEatingSpeed(piles, H))  # Output: 4
```