National Olympiad in Informatics, China, 2004
Little H vowed to become the greatest mathematician of the 21st century. He believed that being a mathematician is like being a pop star - the first step is to focus on appearances, otherwise, no matter how much talent you have, you still won't be able to sell it. Knowing this, he decided to put work into his domicile, so that anybody at a glance will be able to tell that a "great future mathematician" lives inside it.
For the sake of clarity, we let east be represented by the positive
Little H believes that only through the combination of symmetry and
asymmetry can "mathematical beauty" be achieved. Thus, along the north
wall there needs to be
Since little H does not currently have a substantial income, he must minimize the total cost of creating the grass patches. He intends to do so by ensuring that the total area occupied by the grass is as small as possible. Can you write a program that helps him resolve this dilemma?
Input Specification
The input will consist of a single line containing
Output Specification
The output should consist of one real number, representing the minimum
possible area of the ground occupied by the grass. This must be within an absolute error of
Constraints
- The north and south walls are really far apart. There will not be a scenario where grass patches from the north and south walls overlap.
Sample Input
0.5 0.2 2 4
Sample Output
3000.0
Problem translated to English by .
Comments