#K14076. Determine the Winner in a Card Battle Game

    ID: 24054 Type: Default 1000ms 256MiB

Determine the Winner in a Card Battle Game

Determine the Winner in a Card Battle Game

In this problem, two players face off in a card battle game. Each player starts with a health value of 100. The game consists of n rounds. In each round, both players choose a card which has an attack and a defense value. The rules for each round are as follows:

  • If Player 1's attack is greater than Player 2's attack, then Player 2 receives damage equal to \(\max(0,\, a_1 - d_2)\), where \(a_1\) is Player 1's attack and \(d_2\) is Player 2's defense.
  • If Player 1's attack is less than Player 2's attack, then Player 1 receives damage equal to \(\max(0,\, a_2 - d_1)\), where \(a_2\) is Player 2's attack and \(d_1\) is Player 1's defense.
  • If both attacks are equal, neither player receives damage.

After all rounds, the player with the higher remaining health wins. If both players have equal health, the game is declared a draw.

Your task is to simulate the game and determine the winner, ensuring that the program reads from stdin and writes the result to stdout.

inputFormat

The first line of the input contains an integer \(n\) indicating the number of rounds.

The following \(n\) lines each contain two space-separated integers representing the attack and defense values of Player 1's cards, in order.

The next \(n\) lines each contain two space-separated integers representing the attack and defense values of Player 2's cards, in order.

outputFormat

Print a single line to stdout that is either "Player 1 wins", "Player 2 wins", or "Draw" depending on the outcome of the game.

## sample
3
10 5
6 8
4 7
9 6
6 7
3 9
Player 1 wins