COCI '16 Contest 5 #2 Pareto
View as PDFPareto's principle, also known as the "80/20 rule", states that in many situations  of results come from 
 of (the most important) causes. For instance, Microsoft found that, by fixing 
 of most commonly reported bugs, they would eliminate 
 of downtime in their systems. In the business world, it is often said that 
 of income comes from 
 of the most important clients. In the world of mobile games, when it comes to games with free basic functionality, 
 of profit comes from 
 of players. Some say that 
 of your success will come from 
 of your activities.
It is a known fact that  of the world's goods is owned by 
 of (the richest) people. Your task is to check the validity of this rule based on the bank accounts owned by clients of a single bank. Is it true that 
 of accounts hold 
 of the total money? Does a stronger claim hold, for instance, that only 
 of accounts hold 
 of the total money?
More precisely: based on the given account balances of  bank clients, your task is to find numbers 
 and 
 with the maximal difference 
 such that we can say that precisely 
 of accounts hold 
 of the total money of all clients of the bank.
Input Specification
The first line of input contains the integer  
, the number of clients in the bank.
The following line contains  integers from the interval 
, the balances of bank accounts in euros.
Output Specification
In two lines, you must output two real numbers from the task,  and 
, omitting the percentage sign. The solution with the greatest 
 difference will be unique. A deviation from the official solution for less than 
 will be tolerated.
Sample Input 1
2
100 200
Sample Output 1
50.0
66.66666666666666
Explanation for Sample Output 1
 of accounts (one account, the one with 
 euros), contains two thirds, 
 of the total money.
Sample Input 2
8
100100 10 100 1000 1 10100 90100 100100
Sample Output 2
37.5
96.28172769816027
Comments