IMMERSED - Fantastic Discovery

no tags 

A fantastic discovery is about to happen in the biology field, and you are part of the team making the research. The research is about measuring the cells growth in an environment oxygen less and in presence of a toxic substance. The team came to a curious hypothesis, the analyzed data tells them that: the growth, the number of days and the toxicity; are related by this formula:

P = N*NcN

where P is the growth measured in thousands of cells.

N is the elapsed number of days.

and c is the constant that relates to the toxicity level of the experiment.

Your biology partners need to takeout some tissues from the cells when these cells reach a specific growth. They require you to write a program that tells them the exact time when this will happen, given a toxicity level and the growth required.

Input

The first line is T (1 ≤ T ≤ 40,000), the number of test cases, then T test cases follow.

Each test case is a line with 2 integers (P c) separated by a space.

P (1 ≤ P ≤ 1015)

c (1 ≤ c ≤ 5)

Output

For each test case you have to output the expected time in decimal format.

Example

Input:
3
1 1
3 4
100 1
Output:
1.000000
1.207384
3.086308

Note 1: your output must contain at least 6 decimal places.

Note 2: numerical problem. Output generated by submitted program should be exactly the same as test case with accuracy of 0.000001.


hide comments
mastik5h_1998: 2017-04-16 13:27:01

same as "BLCONE"..

karan_batra: 2016-08-29 21:16:00

Nice question. :D

zio_bob: 2015-11-02 23:09:41

why this: <snip> is considered wrong answer?

Last edit: 2022-08-11 17:06:03
:): 2012-06-16 04:52:58

hey my 1 and 3 test case match but 2nd is coming to be 1.207383
plx help......i am doing x+=0.000001 it should be right

:D: 2011-10-02 10:05:20

If you're wondering if that "standard" approach will be enough here (considering expensive operations and high T), then I can tell you it will be :)


Added by:Olson Ortiz
Date:2010-12-10
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:C CSHARP C++ 4.3.2 CPP JAVA
Resource:Used in 1st Programming contest PUCMM ACM-ISC 2010