#C1868. Score Comparison Between Two Participants
Score Comparison Between Two Participants
Score Comparison Between Two Participants
You are given the scores of two participants across multiple categories. Your task is to calculate the total score for each participant and determine the winner. The input starts with an integer (n) which represents the number of scoring categories. This is followed by (n) lines, each containing two integers: the score for Participant 1 and the score for Participant 2 in that category. The program should sum these scores and then output the total scores, followed by a message indicating the winner. The winner message should be formatted as follows: if Participant 1 wins, output "Participant 1 is the winner!"; if Participant 2 wins, output "Participant 2 is the winner!"; and if the total scores are equal, output "It's a tie!".
inputFormat
Input Format:
The first line contains a single integer (n), representing the number of scoring categories.
The next (n) lines each contain two space-separated integers (s_1) and (s_2), representing the scores for Participant 1 and Participant 2 respectively.
outputFormat
Output Format:
Print three lines:
1. The total score of Participant 1.
2. The total score of Participant 2.
3. A message indicating the winner. The message should be "Participant 1 is the winner!", "Participant 2 is the winner!", or "It's a tie!" as appropriate.## sample
4
45 40
38 40
50 48
42 45
175
173
Participant 1 is the winner!
</p>