Dp with bitmask, SPOJ SOCOLA problem

I am not able to understand what state should I take in my dp for this question ?
Someone please help me in solving this.
SPOJ.com - Problem SOCOLA .