SP4000 GALLUP - GALLUP
Description
Often, we see results of gallups, like this: Prefer red: 3.5% Prefer green: 4.5% Prefer yellow: 22.0% Prefer blue: 70.0% and you begin to wonder: how many people did they really ask? If the numbers are simple, like 20%, 40%, and 40%, you know that they asked 5 people (or 10, or 15, or more, but we are interested in the minimum number of people). Your task is to write a program that reads sets of percentages and calculates the smallest number of people that could produce the given percentages. We know that this number is always less than 10 000.
Input Format
The input is a set of percentages. Each set is on a line of its own. Every line starts with an integer n (0
Output Format
For each set of data, print a line starting with “Case i :”, where “i” is the data set’s number. Then follows a space and an integer giving the computed number of people. If no legal answer in the range 1–9999 exists, print “error” instead of the number.