Link- SUPW

This is my code for SUPW in python-

```
n = int(input())
c = list(map(int,input().strip().split()))
if n <= 3:
print(min(c))
else:
cost = [c[0],c[1],c[2]]
for i in range(3,n):
cost.append(c[i] + min(cost[i-3:i]))
print(min(cost[n-3:]))
```

This is giving accepted for all test cases except for test case 2 in which it is giving Runtime Error. Can someone tell me the reason or provide a test case where it fails.

So what I have done is that-

```
Cost[i] = min time if we work that day.
So cost[0] = c[0],
cost[1] = c[1],
cost[2] = c[2]
And for the rest it is c[i] + min of the previous 3 elements.
And the answer is the min of the last 3 elements.
```