------
## 最终结论
```python
def maxNonOverlapping(nums, target):
    current_sum = 0
    prefix_sums = set([0])
    count = 0
    
    for num in nums:
        current_sum += num
        if (current_sum - target) in prefix_sums:
            count += 1
            current_sum = 0
            prefix_sums = set([0])
        else:
            prefix_sums.add(current_sum)
    
    return count

# Example usage:
print(maxNonOverlapping([1,1,1,1,1], 2)) # Output: 2
print(maxNonOverlapping([-1,3,5,1,4,2,-9], 6)) # Output: 2
print(maxNonOverlapping([-2,6,6,3,5,4,1,2,8], 10)) # Output: 3
print(maxNonOverlapping([0,0,0], 0)) # Output: 3
```