PROBLEM 4: The More the Merrier [10 points]
This game is just TOO much fun to keep it to ourselves! Let¡¯s let a few other people play.
Input
¡ì Integer N representing the number of players.
¡ì Remaining lines are the same as in Problem 3 with the exception that you should
expect N lines of player hands
Processing
Same as in Problem 3 with the exception that you must consider play of N (as read in from input) players.
Output format
Same as in Problem 3.
HINT: Start from Problem 3 and modify…
10
Sample input
Sample output
New hand after play
4
R2 Y8 G6 G7 G8
R7 Y3 Y6 B2 B4
R6 R8 Y1 B1 B5
R1 R3 R5 Y7 B6
B7
G1 G3 Y2 G2 B8 Y4 … R4G8B3G5Y5
(Note that if ALL of the draw cards have been used. At some point, DRAW and a TAKE TWO act more like skipped turn. Output remains the same.)
0: B7
1: G7
2: R7
3: R8 LOCO R
4: R1
1: R2
2: B2
3: TAKE TWO
4: B6
1: G6
2: Y6
3: Y1
4: Y7
1: Y8 LOCO G
2: DRAW
3: G1
4: DRAW
1: G4 (WINNER)
—
1: R2 Y8 G4 G6 G7
2: R7 Y3 Y6 B2 B4
3: R6 R8 Y1 B1 B5
4: R1 R3 R5 Y7 B6
1: R2 Y8 G6 G8
2: Y3 Y6 B2 B4
3: R6 Y1 G1 G3 B1 B5 4: R3 R5 Y7 B6
1: Y8 G4 G6
2: Y3 Y6 B4
3: R6 Y1 G1 G3 B1 B5 4: R3 R5 Y7
1: Y8 G4
2: Y2 Y3 B4
3: R6 G1 G3 B1 B5
4: R3 R5 G2
1: G4
11