```python
def take_back(values: list, target: int) -> int:
    if not values or sum(values) < target:
        return -1

    total = 0
    for i in range(len(values) - 1, -1, -1):
        total += values[i]
        if total >= target:
            return len(values) - 1 - i
    return len(values) - 1
```