Category

Similar Problems

0795. Droopy and Black hole

Time limit : 1000 ms
Memory limit : 64 mb

            Once upon a time the world famous heroDroopy decided to relax in the village. He has a garden of the triangular shape with sides a, b and c in his country site. The hero often released his sheep to walk there: unlike characters of some programming problems, the sheep of Droopy was perfectly trained and didn't touch the grass and the vegetables in the garden.

Everything was changed when the new experiment of the hero transmuted the sheep into the black hole which had the shape of circle with a fixed radius r. Unlike the sheep, the black hole was absorbing all the plants it touched while moving along the garden. Fortunately, Droopy has immediately figured out to set the innovative energy barriers along the perimeter of the garden. These barriers were designed so that no point of the black hole can cross them.

You are to calculate Droopy's losses. Find what part of the garden could be absorbed by the black hole in the worst case.

Input: The only line contains 4 integers a, b, c and r (1 ≤ a, b, c, r ≤ 104) — the lengths of the garden's sides and the radius of the black hole. It is guaranteed that there exists a no degenerate triangle with sides a, b and c, and that the black hole can actually fit in the garden.

Output: Output a single real number — the biggest part of the garden that could be absorbed by the black hole. Round this number to 4 places after the decimal point.

Sample input

Sample output

1

3 4 5 1

0.5236

2

6 8 10 1

0.8809

 

 

Was prepared: Yo'ldoshboy Sultonov