Statistics

Problem Statement for "BoardGame"

Problem Statement

You are writing software to port a popular family board game to a computer game. The game involves a board with 64 different squares representing positions on the board. The squares are connected in a big loop, so that square 1 connects to square 2, square 2 to square 3, and so on, and square 64 connects to square 1. All players begin the game on square 1.

Players take turns moving. At the beginning of the game, player one moves. Then, player two moves, and so on. After the last player has moved, it is player one's turn to move, and the cycle continues until the end of the game (more on the end of the game later).

  1. On a given turn, the player rolls two dice and moves forward a number of squares equal to the sum of the two dice.
  2. If the number value on both dice are the same, then the player has rolled "doubles". When a player rolls doubles, the player moves forward a number of squares equal to the sum of the two dice as usual. Next, the player rolls both dice a second time and moves forward an additional number of squares equal to the sum of the dice.
  3. If the second roll is again doubles, then the player still moves forward according to the value of the dice but rolls a third time, moving forward again according to the value of the dice.
  4. If on the third roll the player rolls doubles, then the player is immediately teleported to the Hospital square, which is square number 32, and is considered "sick" for running too quickly.

A player who is sick, instead of a normal turn, performs the following during his or her turn:
  1. Roll the dice.
  2. If it is doubles, the player is out of the Hospital and moves forward the number of squares equal to the sum of the dice. The turn is over. That player's next turn is a normal turn.
  3. If it is not a doubles roll, the player remains sick and does not move. The turn is over. That player's next turn is still a hospitalized turn.

Write a method that takes as argument an int[] die1 and int[] die2 representing the values of each die rolled throughout the game. A third argument, numPlayers, is the number of players in the game. The game ends after the last roll, even if it is in the middle of a player's turn (the player still moves forward or goes to the Hospital as a result of the roll). Your output is a int[] containing the square positions of all players. The first element is the position of the first player, the second element is the position of the second player, and so on. The size of the int[] is equal to numPlayers

Definition

Class:
BoardGame
Method:
trackMoves
Parameters:
int[], int[], int
Returns:
int[]
Method signature:
int[] trackMoves(int[] die1, int[] die2, int numPlayers)
(be sure your method is public)

Notes

  • If the game ends in the middle of a player's turn, say after the second doubles roll, the player still moves forward according to the sum of the first two rolls.
  • Players who land in the Hospital square by moving to square 32 are NOT sick; they are just visiting. Treat this as a normal square.

Constraints

  • Each element of die1 and die2 are ints between 1 and 6 inclusive.
  • die1 and die2 must contain between 0 and 50 elements inclusive.
  • die1 and die2 must contain the same number of elements.
  • numPlayers must be an int between 1 and 8 inclusive.

Examples

  1. {1,2,6,6,6,6,1,1,1,6,6,5}

    {3,1,4,6,6,5,1,1,1,6,6,3}

    2

    Returns: { 32, 7 }

    Player 1 goes first, and moves forward 3+1=4 squares, putting him at square 5. Player 2 goes next, and moves forward 2+1=3 squares, putting him at square 4. Player 1 then rolls 10 (6+4), and goes to square 15. Player 2 rolls two 6's, and moves forward 12 to square 16, and then rolls again. Player 2 rolls another two 6's, and moves forward 12 more to square 28, and then rolls again. Player 2 rolls a 6 and a 5, moving him ahead 11 to square 39. Player 1 then rolls two 1's, three times in a row, putting him in the hospital. Player 2 then rolls two 6's putting him at square 51. He then rolls again, and gets two more 6's, moving him to square 63. Next, he rolls an 8 (5+3), and wraps around the board to square 7. Thus at the end of the game, player 1 is in the hospital at square 32, and player 2 is at square 7.

  2. {1,2,3,4,5,6,1,2,3,4,5,6}

    {1,2,3,4,5,6,1,2,3,4,5,6}

    2

    Returns: { 32, 48 }

  3. {1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6}

    {6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6}

    8

    Returns: { 26, 29, 39, 30, 33, 30, 20, 29 }

    Note that the final player to roll moves 12 squares due to the 6 doubles. The game ends with the 12 square movement even though he never finishes the rest of his turn.

  4. {1}

    {1}

    1

    Returns: { 3 }

    The player moves two squares and the game ends.

  5. {5,5,5}

    {5,5,5}

    8

    Returns: { 32, 1, 1, 1, 1, 1, 1, 1 }

    The first player rolls three doubles and goes to the Hospital. Immediately afterwards, the game is over, so all of the other players are still on square 1.

  6. {5,5,5,1,1,1,2,3,2,3,2,2}

    {5,5,5,1,1,1,3,2,3,3,5,3}

    2

    Returns: { 32, 43 }

  7. {5,5,5,5,5,5,5,5}

    {3,3,3,3,3,3,3,2}

    1

    Returns: { 64 }

  8. {}

    {}

    5

    Returns: { 1, 1, 1, 1, 1 }

    The game ended as soon as it began, because there are no dice rolls. Everyone begins the game on square 1.

  9. {1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6}

    {3,3,3,4,4,4,3,3,3,4,4,4,3,3,3,2,2,2,3,3,3,1,3,1}

    7

    Returns: { 20, 21, 37, 30, 12, 14, 28 }

  10. {1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,5,5,6,4,6}

    {1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,1,2,1,2,1,2,1,2,1,2,3}

    5

    Returns: { 31, 31, 29, 37, 30 }

  11. {6,2,4,5,6,2,3,4,5,1,4,1,3,2,4,5,6,1,2,3,5,1,3,4,1,2,3,5,1}

    {6,1,3,4,3,2,4,6,4,3,5,3,5,1,6,3,2,2,3,6,4,1,5,2,4,2,4,2,1}

    4

    Returns: { 59, 44, 55, 37 }

  12. {1,5,1,5,3,4,3,1,5,6,1,6,5,4,2,3,4,1,5,3,6,4,6,1,5,3,4,5,2}

    {1,6,3,4,3,5,2,1,5,1,6,4,2,5,4,6,4,5,1,3,6,4,6,1,2,4,6,1,5}

    2

    Returns: { 32, 47 }

  13. {1,5,1,5,3,4,3,1,5,6,1,6,5,4,2,3,4,1,5,3,6,4,6,1,5,3,4,5,2}

    {2,5,1,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,1,2,4,6,5,1,5,6,3,4,5}

    2

    Returns: { 56, 31 }

  14. {1,1,1,1,1,1,1,1,1,5,1,3,6,4,6,5,1,3,5,4,6,1,5,4,6,3,5,2,1,5}

    {1,1,1,1,1,1,1,1,1,4,6,5,5,1,5,1,3,4,5,6,5,1,2,3,4,3,5,1,6,5}

    3

    Returns: { 6, 32, 42 }

  15. {5,4,4,3,5,6,5,3,2,5,6,5,3,2}

    {6,6,6,6,6,6,6,6,6,6,6,6,6,6}

    1

    Returns: { 15 }

    Note that even though the player does land on the square 32, the Hospital square, the player is not counted as sick and is only visiting the hospital.

  16. {5,1,4,1,4,1,1,1}

    {6,2,6,2,6,1,1,1}

    2

    Returns: { 32, 32 }

    On turn one, player one lands on square 12 by moving 11 squares from the start. Player two lands on square 4 by moving 3 squares from the start. The positions are: {12, 4} At the end of turn two, the positions are {22,7} At the end of turn three, player one moves 10 more squares to square 32 while player two rolls 3 doubles and gets sick.

  17. {1,2,3,4,5,6,1,2,3,4,5,6}

    {6,5,4,3,2,1,6,5,4,3,2,1}

    2

    Returns: { 43, 43 }

  18. {2, 5, 1}

    {5, 1, 2}

    5

    Returns: { 8, 7, 4, 1, 1 }

    5

  19. {6, 6, 1}

    {5, 6, 6}

    1

    Returns: { 31 }

  20. {4, 2, 2, 2, 4, 4, 5, 6, 6, 4, 1, 3, 1, 4, 4, 6, 4, 5, 1, 2, 3, 1, 6, 6, 6, 6, 6, 5, 2, 1, 2, 6, 3, 6, 6, 2, 4, 5, 6}

    {1, 1, 6, 2, 2, 2, 5, 1, 2, 3, 4, 1, 3, 5, 5, 5, 3, 5, 2, 2, 3, 2, 6, 2, 2, 4, 5, 5, 5, 4, 5, 5, 2, 1, 2, 1, 3, 1, 1}

    4

    Returns: { 64, 21, 54, 8 }

  21. {2, 1, 4, 4, 3, 5, 1, 2, 2, 4, 6, 3, 6, 3, 5, 1, 1, 3, 3, 5, 2, 2, 3, 3, 2, 3}

    {4, 2, 5, 4, 5, 6, 5, 2, 2, 1, 2, 4, 4, 2, 4, 3, 5, 1, 4, 2, 4, 4, 2, 5, 1, 3}

    7

    Returns: { 22, 24, 27, 28, 27, 16, 28 }

  22. {4, 4, 1, 5, 4, 4, 3, 2}

    {4, 4, 3, 1, 2, 3, 1, 2}

    5

    Returns: { 25, 7, 7, 8, 5 }

  23. {2, 3, 6, 1, 4, 2, 6, 5, 2, 5, 4, 2, 4, 4, 6, 2, 4, 3, 4, 4, 1, 6, 6}

    {5, 1, 1, 2, 3, 2, 4, 2, 4, 5, 3, 4, 2, 1, 3, 1, 5, 4, 5, 4, 4, 6, 6}

    6

    Returns: { 48, 14, 34, 17, 23, 33 }

  24. {4, 1, 2, 6, 3, 6, 5, 2, 3, 6, 4, 5, 5, 4, 4, 4, 4, 5, 3, 6, 1, 6, 1, 1, 2, 2, 4, 4, 5, 6, 5, 4, 6, 5, 4, 5, 3, 3, 5, 3}

    {1, 4, 3, 3, 6, 4, 5, 4, 5, 5, 6, 1, 1, 3, 3, 3, 2, 1, 6, 3, 2, 4, 1, 5, 6, 3, 6, 2, 3, 5, 1, 6, 4, 6, 5, 2, 6, 6, 4, 6}

    2

    Returns: { 33, 22 }

  25. {4, 1, 5, 6, 6, 2, 2, 5, 3, 6, 3, 1, 5, 6, 4, 2, 5, 2, 2, 4, 3, 4, 2, 1, 6, 2, 4, 6, 5, 3, 6, 2, 2, 4, 3, 5, 4, 4, 1, 2, 3, 2, 2, 2, 5, 6, 2, 3, 5, 1}

    {2, 4, 4, 3, 4, 2, 5, 3, 5, 5, 5, 3, 3, 1, 2, 3, 2, 1, 1, 2, 5, 5, 2, 5, 3, 5, 5, 6, 2, 6, 1, 6, 2, 4, 5, 4, 3, 2, 4, 4, 1, 2, 1, 2, 6, 6, 2, 6, 1, 6}

    3

    Returns: { 41, 52, 64 }

  26. {5, 4, 1, 6, 1, 3, 5, 2, 3, 6, 3, 5, 5}

    {4, 3, 6, 1, 3, 3, 1, 4, 1, 6, 2, 5, 4}

    6

    Returns: { 16, 12, 25, 27, 5, 13 }

  27. {1, 1, 6, 6, 3, 2, 6, 5}

    {4, 2, 3, 5, 4, 3, 3, 2}

    6

    Returns: { 15, 11, 10, 12, 8, 6 }

  28. {5, 4, 6, 6, 1, 1, 3, 6, 1, 2, 6, 5, 6, 1, 4}

    {4, 5, 4, 2, 2, 6, 4, 1, 5, 6, 1, 1, 1, 3, 3}

    6

    Returns: { 24, 21, 24, 17, 11, 14 }

  29. {5, 1, 3, 5, 1}

    {1, 2, 6, 1, 6}

    8

    Returns: { 7, 4, 10, 7, 8, 1, 1, 1 }

  30. {3, 2, 6, 4, 5, 4, 6, 3, 5, 5, 3, 5, 5, 3, 3, 4, 4, 6, 2}

    {1, 3, 2, 4, 1, 1, 4, 5, 6, 6, 3, 3, 2, 4, 4, 5, 1, 2, 1}

    7

    Returns: { 21, 25, 26, 22, 13, 18, 18 }

  31. {2, 5, 5}

    {6, 3, 3}

    5

    Returns: { 9, 9, 9, 1, 1 }

  32. {}

    {}

    2

    Returns: { 1, 1 }

  33. {1, 5, 1, 5, 4, 6, 3, 1, 2, 4, 2, 1, 2, 2, 2, 4, 4, 4, 2, 4, 1, 6, 2, 4, 5, 2, 6, 5, 1, 3, 4, 5, 6, 5, 6, 3, 1, 5, 4, 5, 4, 2, 3, 1}

    {4, 2, 5, 5, 6, 4, 2, 1, 2, 6, 5, 3, 4, 4, 5, 4, 3, 3, 3, 5, 3, 4, 5, 1, 3, 6, 6, 1, 3, 5, 5, 6, 5, 4, 3, 3, 2, 2, 1, 1, 6, 5, 6, 6}

    7

    Returns: { 42, 57, 37, 52, 39, 43, 53 }

  34. {4, 3, 3, 5, 1, 6, 4, 2, 3, 2, 5, 5, 4}

    {6, 3, 6, 5, 3, 4, 4, 5, 4, 5, 6, 3, 1}

    8

    Returns: { 19, 21, 15, 11, 16, 8, 8, 12 }

  35. {5, 1, 1, 1, 4, 5, 6, 3, 1, 4, 5, 4, 2, 2, 1, 3, 5, 6, 1, 5, 4, 5, 3, 2, 5, 5, 6, 2, 6, 4, 4, 2, 1, 4, 1, 6, 5, 1, 6, 2, 2, 2, 6}

    {2, 5, 6, 1, 2, 1, 1, 5, 5, 2, 2, 4, 3, 4, 6, 4, 6, 2, 6, 2, 2, 5, 1, 4, 3, 5, 3, 3, 2, 1, 2, 6, 5, 6, 2, 2, 5, 6, 4, 3, 5, 4, 6}

    3

    Returns: { 31, 51, 32 }

  36. {2, 2, 1, 4, 5, 4, 1, 6, 4, 3, 5, 1, 3, 6, 6, 5, 5, 4, 5, 1, 2, 4, 4, 3, 3, 6, 3, 5, 3, 3, 6, 3, 3, 4, 6, 5, 3, 1, 1, 2, 5, 3, 6, 4, 2, 6}

    {3, 1, 6, 2, 4, 1, 1, 2, 2, 4, 1, 2, 6, 4, 6, 2, 6, 2, 5, 5, 6, 6, 3, 1, 4, 2, 6, 4, 5, 1, 5, 6, 4, 1, 2, 5, 3, 6, 3, 5, 2, 4, 6, 2, 5, 4}

    4

    Returns: { 36, 22, 9, 16 }

  37. {1, 2, 5, 4, 4, 6, 3, 5, 6, 3, 4, 1, 4, 3, 3, 3, 4, 1, 1, 2, 3, 5, 1, 6, 1}

    {3, 3, 4, 2, 2, 3, 3, 2, 1, 2, 6, 1, 5, 5, 3, 6, 3, 1, 4, 6, 2, 4, 4, 5, 1}

    1

    Returns: { 35 }

  38. {1, 3, 3, 3, 2, 1, 4, 6, 3, 1, 5, 1, 5, 2, 6, 5, 1, 4, 6, 6, 6, 4, 1}

    {6, 4, 4, 4, 3, 1, 1, 2, 2, 5, 1, 1, 1, 4, 2, 4, 3, 1, 5, 1, 3, 2, 3}

    3

    Returns: { 51, 52, 42 }

  39. {2}

    {6}

    4

    Returns: { 9, 1, 1, 1 }

  40. {3, 5, 5, 3, 3, 2, 5, 5, 5, 2, 2, 6, 3, 4, 1, 5, 5, 6, 6, 1, 1, 2, 3, 3, 3, 1, 4, 3, 3, 5, 4, 5, 2, 4, 4, 3, 2, 4, 5}

    {4, 3, 6, 6, 2, 4, 1, 6, 5, 4, 3, 3, 4, 1, 5, 1, 5, 1, 5, 4, 1, 2, 1, 4, 1, 5, 1, 2, 2, 3, 6, 1, 5, 6, 4, 2, 6, 5, 2}

    8

    Returns: { 49, 34, 41, 30, 22, 29, 31, 42 }

  41. {3, 5, 6, 6, 3, 2, 4, 5, 6, 3, 3, 1, 4, 4, 1, 4, 3, 6, 4, 2, 3, 1, 4, 4, 6, 1, 4, 4, 5, 2, 2, 6, 4, 1, 6, 2, 5, 2}

    {2, 3, 6, 6, 3, 1, 6, 1, 6, 1, 6, 4, 4, 3, 5, 6, 3, 5, 6, 2, 2, 4, 6, 2, 5, 3, 2, 3, 5, 5, 6, 5, 3, 6, 5, 6, 4, 1}

    4

    Returns: { 63, 8, 34, 61 }

  42. {2, 1, 4, 4, 3, 3, 4, 4, 4, 4, 5, 6, 4, 5, 5, 2, 1, 4, 2, 1, 2, 5, 2, 4, 4, 2, 2, 4, 1, 6, 4, 2, 4, 2, 6, 4, 5, 4, 2, 1, 4, 5, 2, 1, 4, 1, 1, 5, 4}

    {5, 6, 5, 4, 3, 1, 1, 4, 1, 3, 4, 5, 6, 5, 5, 1, 3, 5, 1, 1, 2, 2, 5, 5, 6, 3, 4, 4, 5, 4, 2, 3, 4, 2, 5, 3, 3, 4, 1, 4, 4, 3, 3, 2, 1, 2, 2, 3, 5}

    7

    Returns: { 53, 57, 39, 14, 27, 40, 39 }

  43. {3, 2, 5, 1, 1, 6, 4, 5, 2, 3, 6, 3, 4, 1, 4, 2}

    {5, 3, 4, 1, 3, 6, 2, 4, 1, 4, 6, 5, 6, 5, 4, 1}

    4

    Returns: { 47, 25, 19, 25 }

  44. {1, 3, 5, 4, 1, 4, 3, 2, 6, 1, 1, 5, 3, 3, 2, 2, 5, 6, 6, 3}

    {5, 4, 4, 5, 6, 3, 6, 6, 2, 5, 2, 6, 4, 3, 2, 1, 6, 6, 1, 3}

    6

    Returns: { 23, 29, 29, 35, 17, 19 }

  45. {2, 3, 2, 2, 5, 5}

    {3, 6, 3, 3, 1, 1}

    1

    Returns: { 37 }

  46. {6, 3, 1, 1, 3, 3, 1, 4, 2, 5, 6, 1, 4, 4, 5, 4, 2, 6, 3, 2, 3, 5, 1, 1, 2, 4, 1, 3, 1, 3, 2, 3, 5, 6, 4, 3, 2, 6, 4, 4, 6, 5, 2, 1, 3}

    {1, 5, 3, 4, 2, 6, 6, 4, 5, 5, 6, 1, 6, 6, 5, 5, 5, 3, 6, 1, 1, 3, 2, 3, 3, 2, 5, 5, 5, 2, 6, 1, 3, 5, 1, 1, 1, 1, 5, 3, 4, 2, 3, 5, 1}

    2

    Returns: { 32, 28 }

  47. {4, 6, 2, 3, 4, 5, 2, 1, 5, 6, 1, 5, 2, 1, 4, 1, 6, 3, 2}

    {6, 3, 2, 4, 3, 5, 3, 2, 1, 1, 2, 3, 6, 4, 3, 3, 3, 4, 2}

    3

    Returns: { 46, 48, 32 }

  48. {5, 3, 3, 4, 3, 5, 6, 1, 1, 3, 1, 4, 5, 6, 1, 5, 4, 3, 4, 4, 2, 4, 1, 4, 3, 3, 4, 4, 1, 4, 6, 2, 6, 3, 3, 2, 6, 1, 2, 5, 5, 1, 2, 6, 2, 5, 4}

    {4, 1, 5, 4, 4, 6, 2, 3, 3, 5, 5, 3, 6, 4, 5, 3, 4, 6, 1, 5, 6, 6, 5, 6, 3, 2, 3, 2, 4, 6, 2, 2, 6, 4, 1, 2, 3, 1, 6, 2, 4, 4, 6, 3, 6, 1, 4}

    2

    Returns: { 47, 40 }

  49. {1, 3, 5, 2, 5, 2, 6, 2, 3, 1, 5, 6}

    {5, 5, 4, 1, 2, 6, 3, 1, 5, 2, 5, 5}

    1

    Returns: { 22 }

  50. {6, 5, 4, 5, 1, 5, 4, 4, 1, 1, 1, 5, 6, 4, 3, 2, 3}

    {1, 6, 4, 5, 5, 2, 4, 6, 1, 5, 5, 2, 3, 6, 4, 5, 5}

    5

    Returns: { 23, 25, 40, 17, 29 }

  51. {1, 5, 3, 2, 4, 1, 2, 6, 5, 2, 6, 4, 1, 5, 3, 6, 1, 2, 1, 4, 5, 1, 1, 5, 5, 1, 1, 1, 6, 3, 4, 4, 3, 1, 2, 6, 3, 5, 1, 3, 5, 6, 1, 4, 3}

    {5, 5, 6, 3, 2, 4, 3, 5, 5, 2, 3, 1, 5, 6, 4, 2, 4, 3, 5, 5, 3, 3, 3, 3, 2, 6, 5, 4, 1, 1, 1, 4, 6, 2, 1, 2, 3, 2, 6, 1, 1, 3, 6, 5, 5}

    5

    Returns: { 53, 11, 13, 60, 41 }

  52. {1, 2, 2, 4, 6, 3, 3, 2, 3, 5, 5, 4, 3, 5, 2, 4, 2, 4, 3, 1}

    {1, 1, 3, 3, 2, 5, 6, 1, 1, 1, 2, 6, 2, 6, 1, 4, 6, 1, 3, 1}

    4

    Returns: { 39, 25, 37, 23 }

  53. {6, 5, 1, 1, 6, 6, 6, 4, 5, 4, 1, 1, 2, 6, 3, 1, 1, 4, 2, 1, 1, 3, 2, 6, 4, 5, 2, 1, 1, 6, 6}

    {4, 6, 3, 4, 3, 1, 4, 3, 2, 3, 3, 2, 5, 6, 1, 3, 2, 3, 2, 6, 4, 4, 5, 1, 6, 5, 2, 3, 3, 5, 3}

    1

    Returns: { 19 }

  54. {}

    {}

    4

    Returns: { 1, 1, 1, 1 }

  55. {3}

    {1}

    1

    Returns: { 5 }

  56. {4, 4, 3, 5, 6, 3, 5, 2, 3, 4, 5, 6, 5, 1, 1, 5, 6, 6, 4, 5, 3, 5, 5, 2, 5, 1, 1, 4, 2, 4, 3, 4, 3, 3, 4, 6, 2, 3, 6}

    {5, 1, 3, 2, 1, 3, 5, 1, 5, 4, 4, 6, 5, 6, 1, 1, 1, 2, 6, 3, 4, 2, 4, 6, 4, 3, 2, 2, 6, 5, 3, 1, 3, 1, 6, 3, 1, 3, 4}

    2

    Returns: { 24, 63 }

  57. {3, 2, 5, 4, 3, 5, 4, 3, 5, 1, 3, 5, 3, 4, 6, 6, 1, 4, 5, 3, 1, 1, 2, 4, 2, 2, 5, 6, 4, 6, 1, 4, 4, 6, 4, 5, 1, 1, 2, 2, 3}

    {2, 4, 1, 3, 2, 4, 6, 1, 3, 6, 1, 1, 6, 1, 3, 2, 4, 1, 1, 2, 6, 2, 1, 5, 6, 3, 6, 6, 1, 5, 3, 5, 4, 2, 6, 6, 5, 5, 6, 5, 2}

    3

    Returns: { 45, 19, 32 }

  58. {6, 2, 6, 2, 2, 3, 6, 3, 1, 1, 3, 6}

    {4, 3, 3, 5, 3, 5, 4, 1, 6, 4, 1, 2}

    8

    Returns: { 18, 11, 14, 16, 6, 9, 11, 5 }

  59. {3, 3, 2, 5, 2, 4, 6, 1, 1, 2, 6, 5, 3, 3, 2, 4, 6, 2, 2, 2, 5, 2, 4, 1}

    {6, 3, 1, 2, 3, 5, 5, 4, 6, 1, 5, 5, 5, 2, 2, 4, 5, 4, 1, 3, 1, 2, 6, 2}

    7

    Returns: { 20, 18, 25, 38, 18, 35, 12 }

  60. {2, 3, 5, 6, 1, 4, 4, 4, 5, 6, 3, 2, 2, 5, 3}

    {4, 2, 6, 1, 3, 5, 3, 1, 5, 5, 6, 2, 1, 3, 3}

    4

    Returns: { 38, 24, 26, 21 }

  61. {2, 3, 1, 1, 2, 3, 3, 3}

    {6, 5, 5, 2, 2, 3, 2, 3}

    3

    Returns: { 12, 24, 13 }

  62. {4, 3, 1, 6, 1, 1, 2, 1, 5, 5, 6, 2, 6, 5, 4, 6, 1, 2, 5, 1, 4, 3, 1, 4, 6, 3, 1, 4, 4, 2, 1, 6, 5, 4, 6}

    {6, 6, 1, 3, 1, 4, 4, 4, 3, 2, 6, 3, 4, 6, 2, 5, 5, 2, 2, 1, 3, 2, 2, 5, 5, 1, 2, 5, 5, 2, 2, 2, 3, 5, 2}

    8

    Returns: { 40, 31, 40, 34, 30, 15, 29, 26 }

  63. {1, 4, 6, 4, 3, 5, 2, 3, 2, 6, 5, 5, 3, 5, 2, 2, 5, 3, 4, 1, 1, 1, 6, 4, 4, 1, 6, 1, 5, 6, 4, 2, 3, 4, 4, 3, 1, 4}

    {6, 5, 1, 3, 3, 3, 4, 2, 2, 5, 4, 2, 2, 6, 2, 6, 2, 4, 2, 5, 5, 4, 1, 1, 1, 2, 2, 3, 1, 4, 4, 6, 1, 5, 1, 5, 5, 6}

    2

    Returns: { 51, 16 }

  64. {4, 5, 2, 3, 2, 5, 2, 4, 5, 5, 1}

    {3, 1, 4, 5, 3, 5, 3, 1, 2, 1, 2}

    4

    Returns: { 19, 25, 12, 16 }

  65. {5, 2, 2, 3, 6, 5, 5, 1, 4, 4, 1, 6, 6, 1, 5, 2, 6, 4}

    {5, 4, 1, 4, 4, 4, 2, 5, 2, 6, 5, 2, 2, 1, 6, 1, 3, 2}

    8

    Returns: { 27, 10, 16, 19, 23, 11, 16, 13 }

  66. {2, 6, 5, 1, 2, 5, 5, 6, 4, 1, 2, 4, 2, 2, 5, 2, 1, 4, 2, 2, 5, 2, 5, 5, 2, 6}

    {2, 3, 2, 1, 5, 1, 1, 5, 1, 4, 2, 5, 6, 2, 6, 1, 4, 6, 1, 2, 2, 4, 1, 3, 3, 4}

    6

    Returns: { 32, 28, 36, 26, 28, 21 }

  67. {1, 2, 6, 1, 5, 1, 3, 2, 1, 3, 2, 4, 6, 3, 3, 6, 1, 3, 2, 6, 4, 6, 4, 2, 4, 3, 2, 4, 5}

    {3, 3, 1, 6, 4, 1, 5, 1, 1, 4, 2, 6, 3, 4, 2, 4, 4, 6, 1, 4, 1, 3, 2, 2, 4, 4, 1, 1, 6}

    2

    Returns: { 43, 15 }

  68. {6, 4, 6, 5, 5, 6, 6, 4, 1, 3, 3, 6, 1, 1, 4, 4, 3, 5, 6, 1, 6}

    {5, 6, 1, 1, 6, 3, 1, 3, 2, 6, 1, 5, 1, 4, 5, 5, 3, 3, 2, 1, 1}

    4

    Returns: { 41, 47, 28, 39 }

  69. {1,1,1,1,1,1}

    {1,1,1,2,1,1}

    2

    Returns: { 34, 6 }

    Note that you don't go again after getting out of the hospital on doubles.

  70. { 1, 1, 1, 1 }

    { 4, 3, 2, 5 }

    4

    Returns: { 6, 5, 4, 7 }

  71. { 1, 1, 1, 1, 1, 1 }

    { 1, 1, 1, 2, 1, 1 }

    2

    Returns: { 34, 6 }

  72. { 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6 }

    { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 2, 3, 4, 5, 6, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 2, 3, 6, 6, 6, 6, 6, 3, 4, 5, 6 }

    8

    Returns: { 32, 51, 44, 34, 1, 59, 46, 38 }

  73. { 1, 2, 6, 6, 6, 6, 1, 1, 1, 6, 6, 5 }

    { 3, 1, 4, 6, 6, 5, 1, 1, 1, 6, 6, 3 }

    2

    Returns: { 32, 7 }

  74. { 3, 3, 3, 3, 3, 3, 3 }

    { 6, 6, 6, 6, 6, 6, 6 }

    1

    Returns: { 64 }

  75. { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }

    { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }

    1

    Returns: { 31 }

  76. { 6, 6, 6, 5, 4, 3, 2, 1, 5 }

    { 6, 6, 6, 1, 2, 3, 4, 5, 5 }

    1

    Returns: { 60 }

  77. { 1, 1, 1, 3, 2 }

    { 1, 1, 1, 3, 4 }

    1

    Returns: { 44 }

  78. { }

    { }

    4

    Returns: { 1, 1, 1, 1 }

  79. { 1, 1, 1, 1, 1, 1 }

    { 1, 1, 1, 3, 3, 3 }

    1

    Returns: { 32 }

  80. { 5, 5, 5, 5, 5, 5, 5, 5 }

    { 3, 3, 3, 3, 3, 3, 3, 2 }

    1

    Returns: { 64 }

  81. { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }

    { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }

    1

    Returns: { 37 }

  82. { 6, 6, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6 }

    { 6, 6, 3, 6, 6, 2, 6, 6, 2, 6, 6, 3 }

    2

    Returns: { 64, 1 }

  83. { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5 }

    { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4 }

    1

    Returns: { 32 }

  84. { 6, 6, 6, 6, 6, 6, 6 }

    { 4, 4, 4, 4, 4, 4, 4 }

    1

    Returns: { 7 }

  85. { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1 }

    { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 }

    1

    Returns: { 64 }

  86. { 1, 1, 1, 1, 1 }

    { 1, 1, 1, 1, 1 }

    1

    Returns: { 36 }

  87. { 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2 }

    { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }

    2

    Returns: { 29, 22 }

  88. { 1, 1, 1, 6, 4 }

    { 1, 1, 1, 5, 3 }

    2

    Returns: { 32, 12 }

  89. { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }

    { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }

    1

    Returns: { 49 }

  90. { 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 }

    { 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1 }

    2

    Returns: { 45, 13 }

  91. { 1, 2, 6, 6, 6, 6, 1, 1, 1, 6, 6, 5, 3, 2, 2, 2, 3, 4 }

    { 1, 2, 6, 6, 6, 6, 1, 1, 1, 6, 6, 5, 1, 2, 4, 2, 3, 4 }

    2

    Returns: { 32, 54 }

  92. { 1, 1, 1, 1, 1 }

    { 1, 1, 1, 2, 2 }

    2

    Returns: { 32, 4 }

  93. { 5, 5, 5, 5, 5, 5 }

    { 6, 6, 6, 6, 6, 3 }

    1

    Returns: { 64 }

  94. { 6, 6, 6, 2 }

    { 4, 4, 5, 4 }

    1

    Returns: { 38 }

  95. { 1, 1, 1, 6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }

    { 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }

    2

    Returns: { 48, 25 }

  96. { 1, 1, 1, 1, 1, 1, 1 }

    { 1, 1, 1, 1, 1, 1, 1 }

    1

    Returns: { 32 }

  97. { 6, 6, 6, 1, 2 }

    { 6, 6, 6, 2, 3 }

    2

    Returns: { 32, 4 }

  98. { 5, 5, 5, 1, 5, 1, 1 }

    { 5, 5, 5, 2, 5, 2, 2 }

    2

    Returns: { 45, 7 }


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: