Cannons and Civilians
Toto's favourite English team, Arsenal, is doing very well in the English champions league. They have scored the most points and they are heading for the ultimate win of the championship.
As the last few rounds approach, Totos is getting more and more nervous. He would like to know whether Arsenal is a definite winner of the championship or if there is a chance that they will tie or loose, to Manchester City. This could only happen if Arsenal loses all the next matches (they don't get any extra points) and Manchester City wins all the next matches (getting points for each win).
Totos wants to write a program that calculates Manchester City's final points, assuming they are going to win all their next matches. Also, it should make a decision on whether or not Arsenal is ultimately going to win the championship.
The program will read from the input STDIN
positive integers separated by a line break character ('\n'
), with the first integer indicating the number of upcoming matches, the second integer indicating the points Arsenal has accumulated so far, and the third integer indicating the points Manchester City has accumulated so far.
The program will print lines in the STDOUT
output: the first line will contain the total points that Manchester City scored by winning each subsequent match and the second line will contain the word Champion, if Arsenal finally secured the championship or Pending, if the championship is not yet decided.
Examples
1st
STDIN
3
52
47
STDOUT
56
Pending
Επεξήγηση του 1ου παραδείγματος:
The number on the first line of input, indicates that there are matches left, which we asume are won by Manchester City.
This means that this team will gain more points, resulting in total points.
Arsenal's points () are less than Manchester City's (), according to the initial assumption that Manchester City won all their games.
That means, that the game results can't be predetermined and Totos has to wait for the final matches to be completed to find out the results :(.
2nd
STDIN
1
89
78
STDOUT
81
Champion
Επεξήγηση του 2ου παραδείγματος:
The number on the first line of input, indicates that there is match left, which we asume is won by Manchester City.
This means that this team will gain more points, resulting in total points.
Arsenal's points () are more than Manchester City's (), according to the initial assumption that Manchester City won all their games.
That means that Arsenal is a definite winner.
Comments