Magical Box
Medium Accuracy: 13.55% Submissions: 417 Points: 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 : 
22 15
20 5

Output : 

to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.