please solve this please a competition is going on
Posted Date Unknown sid lewis 0 Comment

Mr.Avantgarde needs to make a cuboid. He has ‘L’ units of a thin cord and ‘A’ unit square of a sheet. He wants to use all the cord and sheet. Cord is to be used to make edges and sheet is to be used to cover all the surface area of the cuboid. What is the maximum possible capacity of any such cuboid than can be made?

 

Constraints :

1 = T = 25

1 = L = 2^15-1

1 = A = 2^14-1

 

INPUT:

The first line contains T, the number of test cases. Then t test cases follow.

Each test case contains two integers L and A in a line. You may assume that there always exists an optimal solution for the given input cases.

 

Output:

 

For each test case, print a real number that is the largest volume of the box that  Mr. Avantgarde  can make, rounded to two decimal places.

 

SAMPLE TEST CASE:

 

Input:

2

20 14

20 16

 

Output:

3.00

4.15

 

Output details:

 

First case:

the dimensions of the largest box may be 3, 1 and 1.

Second case:

the dimensions of the largest box may be 7/3, 4/3 and 4/3.


Note: It is guaranteed that given inputs will have a optimal solution.


See All Responses Below...
Author
Message Rating
Posted on:
Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
   Design  HTML
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

TekTipsDownload
GateExam
Academic Projects
TekTipsExperts



 
Site optimized for IE7, 1280 X 768 and above. Copyright © 2010 - 2018 KTS InfoTech
Site Developed Using KTS WebCloud