## Solution

Given that the length of the sides are `{a,b,c,d}`, the Maximal Quadrilateral Area is given by the following equation: where semiperimeter `s` can be defined as follows. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 let getMaxQuadrilateralArea (a,b,c,d) = let s = 0.50 *(a+b+c+d) System.Math.Sqrt((s-a)*(s-b)*(s-c)*(s-d)) let solveSpoj2716() = let parseLine() = let l = System.Console.ReadLine().Split() (l.|>float,l.|>float,l.|>float,l.|>float) let rec runTests currentTest maxAvailableTests = if currentTest < maxAvailableTests then parseLine() |> getMaxQuadrilateralArea |> printfn "%f" runTests (currentTest+1) maxAvailableTests in match System.Console.ReadLine() |> System.Int32.TryParse with | (true, i) when i > 0 -> runTests 0 i | _ -> () solveSpoj2716()
view raw QUADAREA.fs hosted with ❤ by GitHub