AGU Computer Engineering Department created a new mathematical game that can be played with two people. In this game, you are given a list of random integers. At each round, the first player takes two numbers from the list and calculates the sum of these numbers. Then, the second player takes two numbers and makes the same calculation. The higher one is going to take the round and increment the score by 1. At the end of the game, who has the better score will win the game.
Here are the rules for the game:
There are always an even number of items on the list
There are two colors for the players: Green and Red
Green starts the game
At each round, green plays and then red plays
The player takes the first and the last numbers
The game can end Tie when the scores are the same.
The game will end when there is no element to take from the list
Your program will simulate the rounds and find out the winner, Green or Red or Tie. The input will be two lines.
Input Format
The first line gives the number of items, n, and the next line includes n integers representing the list.
Constraints
The given n is always an even number
Output Format
The output will be a single line showing the winner color, Red or Green or Tie, and the winner’s score.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more
Recent Comments