Submit | All submissions | Best solutions | Back to list |
GARDENAR - Area of a Garden |
One rich person decided to make himself a great garden. The garden should have a from of equilateral triangle. There should be a gazebo inside the garden. The gazebo will be connected with the triangle vertexes by roads. The lengths of all three roads are known. Those numbers are sacred for this rich man. The expense of building such a garden will depend on the area of the garden. Help the rich man by calculating what will be the area of his garden.
Input
The first line of the input contains number t – the amount of tests. Then t test descriptions follow. Each test consist of three integers a, b, c - the lengths of the roads. It is guaranteed that it's possible to build such a garden.
Constraints
1 <= t <= 1000
1 <= a, b, c <= 1000
Output
For each test print the area of the garden rounded to two decimal places.
Example
Input: 1 3 4 5 Output: 19.83
Added by: | Spooky |
Date: | 2009-11-07 |
Time limit: | 0.204s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 NODEJS OBJC PERL6 SQLITE VB.NET |
Resource: | Advancement Autumn 2009, http://sevolymp.uuuq.com/, author: Alexey Shchepin |
hide comments
|
||||||
2010-05-21 21:02:38 Sergey Ushacov
Can anybody help me? Im trying to solve this problem with binary search, using Heron's formula and S= x^2*sqrt(3)/4. the range of search is limited with the minimum and maximum posible length of the triangle side( |a1-a2|<x<a1+a2 )but i still get WA, i tried about a thousand tests and got right answers but spoj gives me WA(this is true, there on the site pointed in the problem is the file with tests),i don't know what to do. Can anybody help me? Last edit: 2010-05-21 21:10:00 |
||||||
2010-04-30 00:34:28 Priyank
This question confused me a lot .. :( the roads are inside the garden and the gazebo will be the point of intersection of the roads! |
||||||
2010-04-12 17:11:33 Nivash
hey....i get the ansas given in the test cases and for the worst case.....ut for the 2 test cases given by nthrgeek i dont get the correct ans.....plz help |
||||||
2010-04-10 16:57:26 Iqram Mahmud
This problem gives tons of ugly WAs if you try to solve it with binary search. :( |
||||||
2009-12-09 20:36:12 Spooky
yeah... it should be a point... the triangle should be unique as I know... |
||||||
2009-12-09 17:35:18 যোবায়ের
What is a gezebo? Shouldn't I consider it a point? If so, the triangle shouldn't be unique. Am I right? Last edit: 2009-12-09 17:35:39 |
||||||
2009-11-12 18:29:50 Tomasz Tretkowski
@nthrgeek: Case "23 45 67" is invalid. There's no triangle that satisfies it. |
||||||
2009-11-11 13:43:52 Sudharssun
Im getting right answers.. but i think there is a problem in round off to two decimal digits. |
||||||
2009-11-09 21:01:22 nthrgeek
Hints for deriving the direct formula: 1.Congruence of Triangles SAS /* S = Side; A = Angle */ 2.Congruence of triangles SSS 3.Heron's formula of area of a triangle 4.Formula of the area of an equilateral triangle: Formula of the area of an equilateral triangle. More test cases: 3 6 7 8 12 7 8 62.76 96.00 More test cases hardly matters here,you have to derive the formula correctly. Thanks for the correction Tomasz Tretkowski. Last edit: 2009-11-12 21:34:52 |