Question
Given an integer array and a target, count the non-empty contiguous runs whose values add up to that target. Values may be zero or negative, so a qualifying run can begin and end anywhere.
```python
def solve(raw: str) -> str:
...
def run_case(case: dict) -> str:
return solve(case["stdin"])
```
## Requirements
- The first line holds the element count and the target, separated by a space; the second line holds the values.
- A variant layout puts only the count on the first line, the values on the second, and the target on the third; read the target from whichever position it occupies.
- Count every start and end pair, including single elements and runs whose values are all zero.
- The empty run never counts, and overlapping runs are counted separately.
- Return the count as a decimal string with no other text.
- Prefer one pass with a running total and a tally of earlier totals over trying every pair.
- Do not append a trailing newline to the returned string; return the value exactly once.