Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pie Description My birthday is coming up and traditionally I ' m serving pie. Not just on e pie, no , I have a number
Pie
Description
My birthday is coming up and traditionally Im serving pie. Not just on e pie, no I have a number of them, of various tastes and of various sizes. of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several small pieces since that looks messy. This piece can be one whole pie thoug h
My friends are very annoying and if one of them gets a bigger piece th an the others, they start complaining. Therefore all of them should get equally sized which is better than spoiling the party Of course, I wan a piece of pie for myself too, and that piece should also be of the sa me size.
What is the largest possible piece size all of us can get? All the pies ar e cylindrical in shape and they all have the same height but the radi of the pies can be different.
Input
One line with a positive integer: the number of test cases. Then for ea ch test case:
One line with two integers and with : the number of pies and the number of friends.
One line with integers with : the radii of he pies.
Output
For each test case, output one line with the largest possible volume such that me and my friends can all get a pie piece of size
The answer should be given as a floating point number with an absolu te error of at most
Sample Input Sample Output
Pie
Description
My birthday is coming up and traditionally Im serving pie. Not just on e pie, no I have a number of them, of various tastes and of various sizes. of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several small pieces since that looks messy. This piece can be one whole pie thoug h
My friends are very annoying and if one of them gets a bigger piece th an the others, they start complaining. Therefore all of them should get equally sized which is better than spoiling the party Of course, I wan a piece of pie for myself too, and that piece should also be of the sa me size.
What is the largest possible piece size all of us can get? All the pies ar e cylindrical in shape and they all have the same height but the radi of the pies can be different.
Input
One line with a positive integer: the number of test cases. Then for ea ch test case:
One line with two integers and with : the number of pies and the number of friends.
One line with integers with : the radii of he pies.
Output
For each test case, output one line with the largest possible volume such that me and my friends can all get a pie piece of size
The answer should be given as a floating point number with an absolu te error of at most
Sample Input Sample Output
Hint
UVa
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started