[Login|Register]
Problems

Status

Rank

Problem 1166
OCD
Time Limit: 1000ms
Memory Limit: 65536kb
Description
YY is a lovely boy with a brilliant mind. He can calculate the decimal addition at a tremendous speed. Owing to this ability, he has suffered from a kind of OCD(Obsessive-compulsive disorder) for a long time. ^_^
Strange as usual, if he has two positive decimals (for example: d1, d2, specially 0<d1<d2<1), no matter how close the two numbers are, he must add each decimal respectively for k times(i.e. he gets d1*k and d2*k), until there is an integer X satisfying d1*k < X < d2*k. In this way, he is enjoying great happiness…as well as pain.
As the decimal d1 and d1 can be extremely close, you must help him out of humanitarianism.
Just write a program to please him and help YY get rid of OCD.~~~
Input
There are multiple test cases. The first line of input is an integer T ≤ 100 indicating the number of test cases.
Each test case consists of two decimals formatting like:
0.36
0.29
The lengths of the decimals will be less than 50.
Output
For each test case, output two integers X K in two separated lines.
Sample Input
1
0.0822
0.0823
Sample Output
13
158
Source
Yifan Wang@USTC
University of Science and Technology of China
Online Judge for ACM/ICPC
Processed in 1.2ms with 1 query(s).