In duplicate bridge, when cards are shuffled and dealt, they are
placed in boards so that different teams can play exactly the same deals,
greatly reducing the role of luck in the game.
The boards and teams move around in an intricate pattern called a movement,
designed in such a way that teams never play the same board twice.
The Mitchell movement is one of the most commonly used movements.
In a Mitchell movement for N tables, there are N NorthSouth teams,
numbered from 1 to N, and N EastWest teams, also numbered from 1 to N.
Each NorthSouth team K sits at table K, and does not move for the duration
of the tournament. Each EastWest team K starts at table K and moves to the next
higher table at the conclusion of each round, with the EastWest team at table N
moving to table 1.
In each round, three boards are played at each table. The boards are numbered from 1 to 3N,
and are initially placed in numerical order, starting at table 1. In other words, boards 13 start at
table 1, boards 46 start at table 2, and so on. At the conclusion of each round, each board is moved
to the next lower table, with the boards at table 1 being moved to table N.
There is one complication to this simple story. When there are an even number of tables, the EastWest
teams would start seeing boards they've already played halfway through the tournament. To prevent this,
a skip is called after each team has played half the boards. When the skip is called, each EastWest
teams moves up two tables instead of one table, wrapping around from the highnumbered tables to the lownumbered
tables as necessary. The tournament is then halted when the EastWest teams return to their original tables, which
means that each team will have played all but three of the boards. Keep in mind that skips are not called when there
are an odd number of tables.
Given the number of tables N, a round number, and a board number, you must determine
which NorthSouth team and which EastWest team play that board in that round. Return the team numbers
in a int[] with two elements, first the NorthSouth team number and then the EastWest team number.
Note that the rounds are numbered starting with 1.
