Separate the pile
Two players are engaged in the game "Split the Pile". Initially, there is a pile consisting of n candies. A player can split any pile into two smaller piles, provided the sizes of these two piles are different. The player who cannot make a move loses the game. Determine the number of ways the first player can make an initial move and still win, assuming both players play optimally.
Input
The first line contains the number of games t (1 ≤ t ≤ 10^4
). Each of the following t lines describes a game with a single integer n (1 ≤ n ≤ 10^4
), representing the number of candies in the initial pile.
Output
For each game, output the number of ways the first player can make the first move and still win, assuming both players play optimally. If the first player is destined to lose, output 0.