PROBLEM:

*Alice and Bob are playing a game: n cards are laid out in a row, the number Ai
is written on the i-th card. In one move, you can take one, two or three cards from the right end of the row. The game
ends when there are no more cards. The winner is the one with the maximum sum of numbers on
the cards at the end of the game. Who will win if played optimally?*

Kindly someone say what are the system variables and how to proceed;

I searched for similar problems but hard luck for me;

Kindly help!