Submit | All submissions | Best solutions | Back to list |
DECFRAC - Exact decimal fraction |
Given two integers x and y (1<=x,y<=1000) print their quotient as exact decimal fraction. A possible period should be marked by underscores in the above line.
Input
In the first line number N (<=100) of tests, then N lines with the numbers x and y separated by a slash.
Output
The decimal fraction in one or two (in case of a period) lines for each test.
Example
Input: 2
1/2
1/3 Output: 0.5
_
0.3
Thanks are given to numerix for his suggestion.
Added by: | HWK |
Date: | 2011-03-03 |
Time limit: | 1.077s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: SCM qobi |
hide comments
2014-05-31 08:09:28 Mitch Schwartz
Cases resulting in an integer apparently don't occur in the input, since for the case "2/1", some of my AC submissions produce "2." and others produce "2.0". (I suppose it's ok to leave the data as it is, since it's not a very interesting class of cases, and changing it would disturb some existing AC solutions.) |
|
2011-04-18 12:25:19 HWK
I don't know why. But it's corrected. |
|
2011-04-17 18:41:50 Daniel Hui
Why are all languages disabled? |
|
2011-03-18 21:17:41 HWK
"2/1" => "2." |
|
2011-03-18 20:38:31 numerix
What is the required output, if x/y results to an integer? |