TLE '16 Contest 6 (Mock CCC) S2 - Paper Stapling

Points:10 (partial)
Time limit:2.0s
Memory limit:256M

Problem type

William takes the first page of the CCC (top image) and turns it over (bottom image). Note the missing corner in the top left of the page, caused by the stapling.

The top computer scientists in Canada have just started the Canadian Computing Cancer (CCC), but Jason and William experience a huge problem. As it turns out, the CCC booklets are so poorly stapled that some words on the top left corner of the page cannot be read. Important pieces of info are cut off due to the stapling, such as the name of the problem's protagonist. The CCC cannot provide a PDF version of the problems because those who start late would have an unfair advantage.

Due to this issue, William measures the endpoints of the staples to be at distinct points and where is at the top left corner of the contest package. The x-coordinate increases infinitely as one moves right, and the y-coordinate increases infinitely as one moves down. In order to start the contest, he folds over the first page and makes a crease in a way that maximizes the amount of legible space on the second page. Jason looks at the page and notices that the missing region of the paper forms a right-angled triangle.

What area of paper is left illegible on William's page?

Input Specification

The first line will contain two space-separated integers and .

The second line will contain two space-separated integers and .

The coordinates are distinct points, i.e., .

For 3 of the 15 points, all coordinates will not exceed .

For an additional 3 of the 15 points, and .

Output Specification

Print out the area of paper missing from William's page. An absolute or relative error of will be considered correct.

Sample Input 1

6 1
1 5


Sample Output 1

21.025000000


Sample Input 2

1 1
3 7


Sample Output 2

42.000000000