AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

BAPC18-060.Janitor Troubles

Medium · 1 s · 256 MB

  • icpc
  • bapc
  • 2018

While working a night shift at the university as a janitor, you absent-mindedly erase a blackboard covered with equations, only to realize afterwards that these were no ordinary equations! They were the notes of the venerable Professor E. I. N. Stein who earlier in the day solved the elusive maximum quadrilateral problem! Quick, you have to redo his work so no one noticed what happened.

The maximum quadrilateral problem is quite easy to state: given four side lengths s1,s2,s3s_1, s_2, s_3s1​,s2​,s3​ and s4s_4s4​, find the maxiumum area of any quadrilateral that can be constructed using these lengths. A quadrilateral is a polygon with four vertices.

Giriş formatı

The input consists of a single line with four positive integers, the four side lengths s1s_1s1​, s2s_2s2​, s3s_3s3​, and s4s_4s4​.

It is guaranteed that 2si<∑j=14sj2s_i < \sum_{j=1}^4 s_j2si​<∑j=14​sj​, for all iii, and that 1≤si≤10001 \leq s_i \leq 10001≤si​≤1000.

Çıxış formatı

Output a single floating point number, the maximal area as described above. Your answer must be accurate to an absolute or relative error of at most 10−610^{-6}10−6.

Qeyd

Source: Benelux Algorithm Programming Contest 2018 · Author: <author name> · License: CC BY-SA 4.0 · Original: https://bapc.eu · Statement adapted for AlgoLens and shared under the same license.

Nümunələr

Giriş #1

3 3 3 3

Çıxış #1

9

Giriş #2

1 2 1 1

Çıxış #2

1.299038105676658

Giriş #3

2 2 1 4

Çıxış #3

3.307189138830738