eolymp
bolt
Try our new interface for solving problems
Problems

Rating Hazard

Rating Hazard

\includegraphics{https://static.e-olymp.com/content/69/690a539f4badaa057a3717d85ed5e031b84bb7da.jpg} \includegraphics{https://static.e-olymp.com/content/a2/a271bfe91a259dae0e9f9c2f323fe4beb504ace4.jpg} A very important aspect of web portals is customer reviews. The customers can rate any product in the web portal. Generally, a customer can rate a product from one star to five star. Based on the rating of all the customers the average customer rating for a product is shown. Look at the figure on the left to get a clear idea. For example if three customers rate a product as\textbf{3} star, \textbf{4} star and \textbf{4} star respectively then the average rating will be \textbf{(3+4+4)/3 = 3.67} (Rounded to two digits after the decimal point). In the figure on the left 847 customers have rated a product and \textbf{597}, \textbf{189}, \textbf{26}, \textbf{11} and \textbf{24} customers have rated the product as \textbf{5} star, \textbf{4} star, \textbf{3} star,\textbf{2} star and \textbf{1} star respectively. So the average rating is: (Rounded to eight digits after the decimal point). Most web portals display the total number of people who have rated the product (As more people rates the product the more reliable the rating is) but do not display the numeric value of the average rating. In the web portal of warzone (A renowned web portal) the total number of customers that have rated a product (In the figure above the total \textbf{847 }customers have rated the product) and the average rating is stored in two different tables. The average rating is stored, rounded to \textbf{n} (\textbf{0} < \textbf{n} < \textbf{9}) digits after the decimal point so its value is not always the exact average value. Unfortunately, the table that stored the total number of people that rated different products somehow got corrupted. All information available in the database now is the average rating (rounded to at most eight digits after the decimal point). They do not want to lose the huge number of customer ratings they have received throughout \textbf{10}-\textbf{15} years but also they cannot cheat with their customers by guessing the number of raters or voters. So from the average rating they want to determine the minimum possible number of people that rated that product. You have to help them find it out by writing a program. \InputFile The input file can contain up to \textbf{2000} lines of inputs. Each line contains a non-negative floating-point number \textbf{v} (\textbf{1} ≤ \textbf{v }≤ \textbf{5}). This number will have minimum one digit and maximum eight digits after the decimal point. If this number has \textbf{n}digits after the decimal point then you have to assume that the value of the average is given rounded to \textbf{n} digits after the decimal point. Input is terminated by a line containing a negative number. \OutputFile For each line of input produce one line of output. This line contains the serial of output followed by an integer \textbf{T} which denotes the minimum number of voter that is required for this average rating.
Time limit 1 second
Memory limit 256 MiB
Input example #1
1.15
4.56316411
4.56316
3.67
3.66
-1.00
Output example #1
Case 1: 13
Case 2: 847
Case 3: 190
Case 4: 3
Case 5: 29