High School Programming League 2008/2009

Cutting out rectangles

Problem 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.

Picture 1

Input

Standard 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.

Output

Write 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.

Example

Input:

11 10 3 6
12 10 2 4
0 0 0 0


Output:
28.00
37.733333

Scoring

For solving this problem you will score 10 points.


Added by:Adam Dzedzej
Date:2009-10-17
Time limit:1s
Source limit:50000B
Languages:SED C99 strict C++ 4.0.0-8 C++ 4.3.2 TCL SCALA NICE NEM BASH PHP SCM guile LISP sbcl LISP clisp ERL TECS TEXT DOC PDF PS PERL 6 JS
Resource:High School Programming League (thanks to Talent Association)
SPOJ System © 2010 Sphere Research Labs. All Rights Reserved.