module Main where

import Text.Printf

main :: IO()
main = interact (showResults . map area . readTestCases)

readTestCases :: String -> [(Float,Float,Float,Float)]
readTestCases = pairUp . (map read) . words

pairUp :: [Float] -> [(Float,Float,Float,Float)]

pairUp (0.0:0.0:0.0:0.0:rest) = []
pairUp (n:m:o:p:rest) = (n,m,o,p): (pairUp rest)
pairUp (_) = []

showResults ::  [Float] -> String
showResults = unlines . (map format)
format a = printf "%.3f" a

area (x,y,z,w) = abs ((x-z) * (y-w))
