#K39452. Determine Game Winner
Determine Game Winner
Determine Game Winner
You are given a list of integers representing numbers removed in a sequential game. In this game, players take turns removing one number from the beginning of the list.
According to the game rules, if the total number of elements n is odd, then the first player (Alice) wins, and if n is even, the game ends in a draw.
Formally, for a given integer \(n\) and a list of \(n\) integers, the winner is determined as follows:
\[ \text{winner} = \begin{cases} \text{ALICE} & \text{if } n \text{ is odd} \\ \text{DRAW} & \text{if } n \text{ is even} \end{cases} \]Your task is to implement the logic to determine the correct outcome.
inputFormat
The input is given via standard input (stdin) and has the following format:
- The first line contains an integer \(n\) representing the number of elements in the list.
- The second line contains \(n\) space-separated integers.
outputFormat
Print a single line to standard output (stdout) containing one of the following strings: "ALICE" or "DRAW".
The output is determined as follows:
\[ \text{output} = \begin{cases} \text{ALICE} & \text{if } n \text{ is odd} \\ \text{DRAW} & \text{if } n \text{ is even} \end{cases} \]## sample5
4 1 2 3 5
ALICE