------
## 最终结论
```python
def maxSatisfied(customers, grumpy, X):
    total_satisfied = 0
    for i in range(len(customers)):
        if grumpy[i] == 0:
            total_satisfied += customers[i]

    extra_satisfied = 0
    max_extra_satisfied = 0

    for i in range(len(customers)):
        if grumpy[i] == 1:
            extra_satisfied += customers[i]
        
        if i >= X:
            if grumpy[i - X] == 1:
                extra_satisfied -= customers[i - X]
        
        max_extra_satisfied = max(max_extra_satisfied, extra_satisfied)

    return total_satisfied + max_extra_satisfied
```