Alice and Bob play the following game. At the start, n stones lie on one straight line on a table. The players take turns, and on a turn the player picks one of the remaining stones and removes it. The game ends when two stones are left on the line, and those two are called the result stones. Alice wants the result stones to end up as far apart as possible, and Bob wants them as close together as possible.
You are given the coordinates of the stones and the name of the player who takes the first turn. Both players play as well as they can. Compute the distance between the result stones at the end of the game.