Game, Game Everywhere

Limits: 1s, 512 MB

Binary and Ternary are playing a game. In this game, they initially choose an array with N elements. Let the array elements be:


This is a companion discussion topic for the original entry at https://toph.co/p/game-game-everywhere