#P15200. [SWERC 2018] Rounding
[SWERC 2018] Rounding
题目描述
You decided to stay an extra day in Paris visiting favorite places of Parisians around Télécom ParisTech. You want to collect information about these favorite places, but asking people to fill in surveys is less fun than coding. For this reason, you asked the Parisian Agency for Really Imprecise Surveys to do it for you. You sent them a list of the places you were interested in.
After surveying exactly 10000 persons and asking them their favorite place (among these places), the agency has just sent you the results. All persons surveyed answered the question. Unfortunately, the agency rounded the percentage results to the nearest integer, using the following formula: $result = \lfloor original\_value + \frac{1}{2} \rfloor$. In particular, decimal values of .50 are rounded up.
But since 10000 persons were surveyed, you should have been able to get percentage values precise to the second decimal. What a loss of precision! You want to know the range in which each original result could be.
输入格式
The input comprises several lines:
- The first line consists of an integer .
- Each of the following lines consists of the name of a place followed by an integer , separated with a single space.
输出格式
If the results given by the agency are not consistent, print a single line with the word IMPOSSIBLE.
Otherwise the output should consist of lines, each of them should consist of the name of a place followed by a single space and two numbers, the smallest and the largest percentage values that place could have had in the original results, as floating-point numbers with two decimals separated with a single space (each number must have at least one digit before the decimal point, even if it is 0, and exactly 2 decimals, even if the trailing ones are 0). The places must be in the same order as in the input.
4
Catacombes 32
Cite_Universitaire 22
Arenes_de_Lutece 26
Observatoire 19
Catacombes 31.53 32.49
Cite_Universitaire 21.53 22.49
Arenes_de_Lutece 25.53 26.49
Observatoire 18.53 19.49
7
Aqueduc_Medicis 11
Parc_Montsouris 40
Place_Denfert 10
Hopital_Sainte_Anne 4
Butte_aux_cailles 20
Cite_florale 12
Prison_de_la_Sante 0
Aqueduc_Medicis 11.06 11.49
Parc_Montsouris 40.06 40.49
Place_Denfert 10.06 10.49
Hopital_Sainte_Anne 4.06 4.49
Butte_aux_cailles 20.06 20.49
Cite_florale 12.06 12.49
Prison_de_la_Sante 0.06 0.49
2
Catacombes 50
Arenes_de_Lutece 49
IMPOSSIBLE
提示
Limits
- ;
- the name of a place is a string of between 1 and 20 characters among Latin alphabet letters ('A' to 'Z' and 'a' to 'z') and the underscore character ('_');
- no two names are the same;
- .