I was trying to solve SPOJ BALIFE question. As I couldn't make sense of the question much and the test cases, I read the comments and also tried Google to find some explanation. But all I came to know was that this question is solved using prefix-sum technique. Can someone please explain how this question uses that approach and also the step by step explanation of how the the test cases are working? More specifically, maybe someone can explain using the below sample test case given in the question itself:
16 17 15 0 20 1 1 2
I would appreciate your help.