Basketball Games (APCS 2019-06 Beginner)

Points 100 1.0s 256M

APCS held a basketball league. Each game has a home team and an away team. Your task is to summarize the information of each game into a short message.

Each game is played in four quarters, and a team's score for a game is the sum of its scores across the four quarters. There are two games in total. You need to determine the winner of each game based on the teams' total scores, and then summarize the overall result of the two games.

Input

There are four lines of numbers representing two games, with four numbers per line representing the scores of four quarters:

  • The first line is the home team's scores in the four quarters of game 1
  • The second line is the away team's scores in the four quarters of game 1
  • The third line is the home team's scores in the four quarters of game 2
  • The fourth line is the away team's scores in the four quarters of game 2

Constraints:

  • All scores are integers between \(0\) and \(100\)
  • It is guaranteed that no game ends in a tie (equal totals); both games have a clear winner

Output

For each game, output one line with the score of the home team and the away team, in the format home_total:away_total (separated by a single half-width colon :).

Then output one final line representing the overall result of the two games:

  • If the home team won both games, output Win
  • If the away team won both games, output Lose
  • If each team won one game (a draw overall), output Tie

Scoring

The time limit for each test case is \(1\) second; your score is the sum over the test cases you pass.

Sample Input

87 87 87 87
78 78 78 78
87 87 87 87
78 78 78 78

Sample Output

348:312
348:312
Win

Sample Explanation

In both games the home team totals \(87 \times 4 = 348\) and the away team totals \(78 \times 4 = 312\). The home team wins both games, so the final output is Win.

Source

APCS programming exam, June 2019, Problem 1.

Problem page help

Keyboard shortcuts

Main features

  • Sample tests — Runs the sample cases bundled with the problem and auto-compares against the expected output.
  • Custom test — Run your code with your own stdin. Optionally tick the "Compare with expected (diff)" box to verify against expected output line-by-line.
  • Template — Paste the default code template you set on your profile page.
  • Collab — Edit this problem together with classmates in real time.
  • Auto-draft — Editor contents auto-save to your browser every 1.5 seconds (per account / problem / language).
  • Submit — Send your code to the judge for grading; returns AC / WA / TLE etc.

Limits

  • Source code: at most 65,536 characters
  • Custom test stdin and expected output: at most 1 MB each (≈1 million characters)
  • Custom test and sample test share the sandbox; about 1 request per 3 s per user (sample test: 1 per 1 s)
  • Custom test and sample test both have a 15 second wall-clock cap (the official judge still uses the problem time limit)
  • Interactive problems do not offer custom test (cannot simulate interaction with the judge).
  • Submitting has no rate limit, but rapid repeated submissions on the same problem are treated as score farming.