Under construction

Still being built. Things may change

Hockey Goal

Time limit2sMemory limit1024 MB

Summary
Given the height, width, and two depths of a hockey goal frame, find the minimum netting area needed to cover its back, sides, and top.
Level

Medium5 of 10

Topics
Geometry, Math
Solved
No attempts yet

Problem

The Flatland Minister of Family, Youth and Sports wants hockey to become a national sport. He has ordered hockey rinks built in every locality, ice palaces built in every city, and all necessary equipment bought (for example, goals, sticks, and pucks). A market survey showed that hockey goals are very expensive, so the ministry decided to make them in-house. There is one problem: nobody knows the area of the netting that must be stretched over one goal.

The goal looks as follows:

The height of the goal is HH meters, the width is WW meters, the small depth is w1w_1 meters, and the large depth is w2w_2 meters. The net is stretched over the back, the sides, and the top of the goal. To save money, the net is stretched so that its area is minimal.

The first Flatland Games will start soon, and Flatland mathematicians still cannot estimate the cost of the goals. The minister heard of your programming skills and asked you to write a program that solves this problem.

Input

The only line contains four real numbers HH, WW, w1w_1, w2w_2 (0<H,W≤20 < H, W \le 2, 0≤w1≤w2≤20 \le w_1 \le w_2 \le 2).

Output

Print to the output file a single number: the total area of netting needed for one hockey goal, with precision 10−510^{-5}.

Examples2

  1. Example 1

    Input
    1.22 1.83 1 1.5
    
    Expected output
    7.29283
    
  2. Example 2

    Input
    2 1.5 1 1.5
    
    Expected output
    9.59233