#C12898. Dice Roll Showdown

    ID: 42375 Type: Default 1000ms 256MiB

Dice Roll Showdown

Dice Roll Showdown

In this problem, two players each roll a six-sided die 10 times. The results of the rolls are provided as input: the first line contains 10 space-separated integers representing the outcomes for Player 1, and the second line contains 10 space-separated integers for Player 2. The total score for a player is given by (S = \sum_{i=1}^{10} r_i), where (r_i) is the result of the i-th roll. Your task is to simulate the game by reading the input, calculating the total score for each player, and then outputting the rolls, the total scores, and the result of the game. A blank line should separate the sections for each player. The winner is determined by comparing the total scores: if one player's total is higher than the other's, that player wins; otherwise, the game is a draw.

inputFormat

The input consists of two lines:

  • The first line contains 10 space-separated integers representing Player 1's dice rolls.
  • The second line contains 10 space-separated integers representing Player 2's dice rolls.

outputFormat

Print the game simulation details in the following format:

  1. A line displaying "Player 1 rolls: [a, b, ..., j]" where a, b, ..., j are the dice rolls for Player 1.
  2. A line displaying "Player 1 total score: X" where X is the sum of Player 1's rolls.
  3. A blank line.
  4. A line displaying "Player 2 rolls: [a, b, ..., j]" where a, b, ..., j are the dice rolls for Player 2.
  5. A line displaying "Player 2 total score: Y" where Y is the sum of Player 2's rolls.
  6. A blank line.
  7. A line displaying "Winner: Player 1" or "Winner: Player 2" or "Winner: Draw" based on the comparison of the totals.## sample
6 6 6 6 6 6 6 6 6 6
1 1 1 1 1 1 1 1 1 1
Player 1 rolls: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6]

Player 1 total score: 60

Player 2 rolls: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] Player 2 total score: 10

Winner: Player 1

</p>