{"extraResources":{"example.01.mu":"TVXzATEgMSA0IDEgNCA0IDEgNA0K","example.02.mu":"TVXzATAgLTEgLTIgMTMgLTMwIDkgLTI4IC01DQo="},"scoring":null,"notes":"","legend":"You are given a rectangle on the plane with vertices at integer points. Calculate the area of the largest ellipse that can fit entirely within this rectangle. Recall that a \\textit{rectangle} is a convex quadrilateral with all right angles, and an \\textit{ellipse} is a figure on the plane defined by two focal points $F_1$ and $F_2$ (not necessarily with integer coordinates; possibly $F_1 = F_2$) and a real number $d > |F_1 F_2|$, consisting of points $P$ on the plane such that $|F_1 P| + |F_2 P| \\le d$.","authorLogin":"imp0","language":"english","timeLimit":1000,"output":"Output a single real number: the largest area of an ellipse that can be drawn inside the rectangle given in the input. The answer is considered correct if its relative or absolute error does not exceed $10^{-6}$.","inputFile":"stdin","outputFile":"stdout","input":"The input consists of a single line containing eight integers $x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4$: the coordinates of four points ($-1000 \\le x_i, y_i \\le 1000$). The points $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$, $(x_4, y_4)$ are the vertices of a rectangle with a positive area, listed in counterclockwise order.","authorName":"Mikhail Ivanov","sampleTests":[{"output":"7.06858347","input":"1 1 4 1 4 4 1 4\r\n","inputFile":"example.01","outputFile":"example.01.a"},{"output":"314.15926536","input":"0 -1 -2 13 -30 9 -28 -5\r\n","inputFile":"example.02","outputFile":"example.02.a"}],"name":"Largest Area","interaction":null,"memoryLimit":1073741824,"tutorial":"{\r\n    \\parindent=1cm\r\n    \\begin{tabular}{l@{\\extracolsep{1cm}}l}\r\n         Idea: & Mikhail Ivanov\\\\\r\n         Development: & Mikhail Ivanov\\\\\r\n     \\end{tabular}\r\n}\r\n\r\nThe largest ellipse that can fit inside a square is a circle. To obtain the answer for an arbitrary rectangle, one must apply an affine transformation to convert the square into a rectangle, which will also transform the circle into an ellipse. Affine transformations preserve area ratios, which implies that the resulting ellipse will have the largest possible area.\r\n\r\nFrom this reasoning, we can conclude that the ratio of the area of the largest ellipse to the area of the rectangle containing it is constant. For a square, this ratio is $\\frac{\\pi}{4}$; thus, the solution to the problem is to calculate the area of the rectangle (for example, using the pseudo-scalar product of the vectors of two of its adjacent sides) and multiply it by $\\frac{\\pi}{4}$."}