#K86172. Pyramidal Incantation Winner
Pyramidal Incantation Winner
Pyramidal Incantation Winner
You are given a game called the Pyramidal Incantation game. In this game, you start with an array of n integers. A sequence is called pyramidal if it satisfies the condition
$$a_i = a_0 + i \quad \text{for } i = 0, 1, \dots, n-1. $$The rules of the game are as follows:
- If the given array is a pyramidal sequence, then if n is even, Alice wins; if n is odd, Bob wins.
- If the array does not form a pyramidal sequence, then Alice wins.
Your task is to determine and print the winner of the game.
inputFormat
The input is given via standard input and consists of two lines:
- The first line contains a single integer n representing the number of elements in the array.
- The second line contains n space-separated integers representing the elements of the array.
outputFormat
Print a single line to standard output: either Alice
or Bob
indicating the winner of the game.
5
1 2 3 4 5
Bob