{"raw_statement":[{"iden":"statement","content":"John is a successful farmer and he would like to expand his business. For this reason he is going to buy a new plot of land to grow even more crops (and earn even more money). Currently there are _T_ (0 ≤ T ≤ 1000) plots on sale and John wants to find the best deal. He considers deal the best if the price per area unit is the lowest. Can you help him by coding a solution that computes price per area unit?\n\nFirst line contains the number of plots _T_ (0 ≤ T ≤ 1000). Each plot defined is as a quadrilateral by 4 integer points on the 2D plane (in clockwise or counterclockwise order), meaning there are 8 integers (32-bit) in total which describe geometry and location of the plot. Last number on the line represents the price of plot.\n\nFor each plot output a line “_Case #tc: x_”, where _tc_ is plot’s sequence number (starting from 1) and _x_ is price per unit for the _tc_-th plot rounded to two decimal places.\n\n"},{"iden":"input","content":"First line contains the number of plots _T_ (0 ≤ T ≤ 1000). Each plot defined is as a quadrilateral by 4 integer points on the 2D plane (in clockwise or counterclockwise order), meaning there are 8 integers (32-bit) in total which describe geometry and location of the plot. Last number on the line represents the price of plot."},{"iden":"output","content":"For each plot output a line “_Case #tc: x_”, where _tc_ is plot’s sequence number (starting from 1) and _x_ is price per unit for the _tc_-th plot rounded to two decimal places."},{"iden":"examples","content":"Input10 0 0 10 10 10 10 0 100OutputCase #1: 1.00"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of plots, with $ 0 \\leq T \\leq 1000 $.  \nFor each plot $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ P_k = \\{(x_{k,1}, y_{k,1}), (x_{k,2}, y_{k,2}), (x_{k,3}, y_{k,3}), (x_{k,4}, y_{k,4})\\} $ be the four vertices of a quadrilateral in order (clockwise or counterclockwise), where $ x_{k,i}, y_{k,i} \\in \\mathbb{Z} $.  \n- Let $ p_k \\in \\mathbb{R} $ be the price of plot $ k $.  \n\n**Constraints**  \n1. $ 0 \\leq T \\leq 1000 $  \n2. For each $ k \\in \\{1, \\dots, T\\} $:  \n   - $ x_{k,i}, y_{k,i} \\in \\mathbb{Z} $, representable as 32-bit integers.  \n   - $ p_k \\geq 0 $  \n\n**Objective**  \nFor each plot $ k $, compute the area $ A_k $ of the quadrilateral $ P_k $ using the shoelace formula:  \n$$\nA_k = \\frac{1}{2} \\left| \\sum_{i=1}^{4} (x_{k,i} y_{k,i+1} - x_{k,i+1} y_{k,i}) \\right|, \\quad \\text{where } (x_{k,5}, y_{k,5}) = (x_{k,1}, y_{k,1})\n$$  \nThen compute the price per unit area:  \n$$\nr_k = \\frac{p_k}{A_k}, \\quad \\text{if } A_k > 0\n$$  \nOutput $ r_k $ rounded to two decimal places for each plot $ k $ as \"Case #k: r_k\".","simple_statement":"John wants to buy the land plot with the lowest price per unit area.  \nGiven T plots, each defined by 4 points (8 integers) forming a quadrilateral and a price,  \ncalculate the price per unit area for each plot and output it rounded to 2 decimal places.","has_page_source":false}