John and Circles
All submissions for this problem are available.
You are a mathematics student living in Flatland.Unlike Earth, the people in Flatland still believe that their planet is a flat circle(2 Diemensional) and not a sphere as Earth is.
Also, the only curve they are aware of is the Circle.They have zero knowledge about the existence of other curves like elliptical, straight line, etc.Everything on flatland is circle
ne fine day, you attend the birthday party of your friend Bill.You witness a large cake in front of you, circular in shape.The cakes are cut in circular shape and served to
everyone.However, the radii of the cake pieces is different.You find out that the first piece of the cake is reserved for the man of the hour,Bill, and that he gets a cake piece
of radius Rb for him.(Note that the circles with radii Rb fit well within the cake.).Bill, being mathematician himself,is smart and cuts the cake in such a way that it his portion
touches the boundary of the cake(to make sure there are enough left for others too).The remaining cake is left in open for everyone to cut a piece of it and enjoy.
In Flatland,people show their wishes to the birthday boy by cutting a circular piece of the cake in such a way that their piece of cake and that of Bill makes a contact at
circumference.Everyone, being greedy, tries to cut the largest possible circular piece for them.Also,everyone being in hurry, cut their piece of cake in the region where the
previous guy took his cake from.
In short, your circular piece of cake should touch the circumference of Bill and your immediate predecessor.
You find out that there are 'K' people in front of you.(Excluding the birthday boy).Given the radius of the cake, Rb, K calculate the largest radius you can get.
Note:Bill gets the cake with largest radii for obvious reasons.Bill's best friend accompanies him and takes the largest piece available ahead of the K people waiting.
- The first line of input contains T, the number of testcases.Then Tlines follow.Each line of the input consists of 3 space separated integers Rc Rb and K, indicating the radius of the cake, the radius of the piece your friend Bill, is about to get and the number of people before you.
- For each testcase, print K lines, where line i contains the largest radii ith person can get.
- 1 ≤ T ≤ 1000
- 1 ≤ Rb ≤ Rc≤10000
- 1 ≤ K ≤ 1000
The answer will be accepted if the absolute or relative error of the answer should not exceed 10e-5.
Input: 1 4 2 2 Output: 1.333333 0.666667
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.