Division is the inverse to multiplication, such that if a * b = c, then c / a = b.
In this case c would be called the dividend, a would be the divisor,
and b would be the quotient.
To calculate a quotient, we first draw a symbol called a division bracket,
placing the dividend c to the right, and the divisor a to the left, and leaving a
space for the quotient above. Regarding the decimal point, count the quantity of
digits after the decimal point in the divisor, then shift the decimal in the
dividend to the right by that quantity of digits.
c, take as many digits as necessary to form the number d, such that d > a.a to yield a product less than d. Write that digit as the next digit in the quotient and write that product below.d that product to yield a new value for d.c to d. If d is still less than a, append another digit and write a 0 as the next digit in the quotient.Then count the total quantity of decimal places present to the left of the decimal point for both the dividend and the divisor, and place the decimal point in the quotient after that quantity of digits.
Here is an example, dividing 1.2 by 3.4. Only the first six digits are calculated.
00352941 => 0.352941
________
34)12000000
- 102
-----
180
- 170
-----
100
- 68
-----
320
- 306
-----
140
- 136
-----
40
- 34
----
6
You will be given several pairs of numbers. Divide one into the other and return the quotient.
Input Data
First line will be Q, the quantity of testcases.
Q lines will then follow, each with two space-separated values in the format
c a being the dividend and divisor respectively.
Answer
Should consist of Q values, being the quotient of each given testcase.
Round each answer to 50 digits after the decimal point.
Remove all trailing zeroes.
Example
input data:
2
67 5
131 107
answer:
13.4 1.22429906542056074766355140186915887850467289719626