dp [ i ] [ j ] stores maximum possible number of people among arr [ 0. . i - 1 ] can vote in j time .
dp = [ [ 0 ] * ( x + 1 ) for _ in range ( n + 1 ) ] NEW_LINE a = a [ : ] NEW_LINE a . append ( 0 ) NEW_LINE