CNVRSN - CONVERSIONS

no tags 

You are given two positive integers P and Q. What is the value of P/Q?

Isn’t that a very easy problem? We know that solving a very easy problem isn’t enjoyable much. Let’s make the problem a little harder. What if given you the answer of P/Q and asked to retrieve the values of P and Q? Can you do it? Let’s try!!!

Input

First line contains an integer T – number of test cases. Following T lines contains a floating point number.

Output

For each case output in the following format:

Case #X: P/Q

Where “X” is the case number starting from 1.“P” and “Q” are the values described above. Print “P” and “Q” in their reduced form (Greatest Common Divisor of “P” and “Q” will be 1).

Example

Input:
5
0.50
0.5
123.123
0.66655
0.7

Output:
Case #1: 1/2
Case #2: 1/2
Case #3: 123123/1000
Case #4: 13331/20000
Case #5: 7/10

hide comments
MD. Tanveer Zilani: 2015-09-24 12:45:09

what are the limits of test cases and the given number?


Added by:Raihat Zaman Neloy
Date:2015-09-24
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU JS-MONKEY