|
|||||||||||||||||||
|
SPOJ time: 2012-02-09 02:00:14 |
Cutting out rectanglesProblem code: HS09CUT
We are given some scrap gold pieces shaped as in Picture 1. Dimensions A,B,C,D are given in millimeters. A rectangle, having the largest possible area, is now cut out from this piece. Calculate the area which is left after cutting out such a rectangle.
InputStandard input contains N (2 ≤ N ≤ 20 000) lines, each containing four values A,B,C,D (0 ≤ C ≤ A ≤ 100 000 000, 0 ≤ D ≤ B ≤ 100 000 000) separated by spaces. In line N+1 there are four zeros separated by spaces. Do not process this test case. OutputWrite N lines to standard output. Each should contain a single number, equal to the area in square millimeters which is left after cutting out the largest rectangle possible. The relative error of your result should not exceed 0.000001. ExampleInput: ScoringFor solving this problem you will score 10 points.
|
||||||||||||||||||
| |||||||||||||||||||