Magical Box
Submissions: 306   Accuracy:

13.44%

  Difficulty: Medium   Marks: 4

You love doing magic a lot and as a step towards your passion, you discover a new magic trick. But for that you need to have a cuboidal magic box  (12 edges : 6 sides).  You have a glittering strings of "P" cm and a special kind of illusion paper - "S" cm2. The string will be used to cover all the edges and the paper to cover all the sides. You have to make the most optimized use of the material to prepare the box. But you don't know how to use it efficiently, so you ask your friend to prepare the box.

Example : 
Input : 

The first line of input contains an integer T denoting the Test cases. Then T test cases follow. 
The second line of each test case contains an integer P denoting the length of the glittering string 
The third line of each test case contains an integer S denoting the area of the illusion paper

Output : 
For each test case in a new line print the maximum Volume of the magicial box that your friend can prepare. 

Constraints :
1 ≤ T ≤ 100
1 ≤ P ≤ 109
1 ≤ S ≤ 109

Input : 
2
22 15
20 5

Output : 
3.02408
0.33020

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Mohit Gupta...OMG :)
Author: Mohit Gupta 4


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.