Mr. Vulchan is a football statistician and his daily job is to watch football matches, collect the results and prepare a table of the league. Unfortunately, one day he fell off a cliff and hit his head badly. From that day he can’t remember any numbers and he needs some help with them. Your task is to prepare the league table for him. Since you are very good at programming, you decide to make a program to do this.
You should make a league table only for one of the leagues. It consists of 8 teams: Arsenal, Chelsea, Manchester City, Manchester United, Liverpool, Everton, Southampton and Tottenham.
You are given a string in the format ″team1 outcome team2″ separated by one or more whitespaces. The outcome of the match will be one of the characters [1, X, 2]. The character ′1′ represents a win for team1, the character ′2′ represents a win for team2 and ′X′ represents draw.
When one of the teams wins, it receives 3 points. The other team receives 0 points.
In case of a draw the both teams receive 1 point.
Mr. Vulchan will pay you N euros for every match. You should evaluate how much money you will obtain for this job and print it on the console in leva. Assume that 1 euro is 1.94lv.
The input data should be read from the console.
On the first line you will receive the payment for every match.
On the next N lines you are given several input lines holding the match and its result. When you receive the command “End of the league.” the program should stop.
The input data will always be valid and in the format described. There is no need to check it explicitly.
The output data should be printed on the console.
On the first line you should print the evaluated price for all matches in the league in leva rounded to two digits after the decimal point.
On the next 8 lines you should print all the teams in alphabetical order, each on a separate line, together with the points, they have gained.
The payment will be a floating point number in the range (-7.9 x 1028 to 7.9 x 1028) / (100 to 1028)
Allowed working time for your program: 0.1 seconds.
Allowed memory: 16 MB.
Hint: The teams with more than one word are represented without spacing in Pascal case.