Problem B. Pizza Hub

时间限制 3000 ms   内存限制 128 MB

Coffee Chicken has started a new restaurant named Pizza Hu...b! It provides various styles of pizzas, hamburgers, sandwiches, coffee, chickens and many other awesome Western cuisines. Welcome to Pizza Hub after this Multi-University Training Contest!

Since the pizzas are so exquisite, it is never a bad thing to design nice paper pads for them. The pizzas provided in Pizza Hub are sliced into triangles. The rectangular-shaped paper pads are cut from a paper strip of fixed width which is long enough. The pizza should be placed entirely on the pad; however, their borders are allowed to touch. Also, you are allowed to rotate the pizza.

As the customized paper strip is rather expensive, minimizing the size of the pizza pad can save a lot of money. Can you determine the minimum possible height of the pizza pad, given the width of the paper strip? The following picture illustrates the first sample test case.

 

输入数据

The first line of the input is a single integer $T$ $(1 \leq T \leq 50000)$, the number of test cases.

Each test case is a single line of seven integers $x_1, y_1, x_2, y_2, x_3, y_3$ $(0 \leq x_1, y_1, x_2, y_2, x_3, y_3 \leq 10000)$ and $w$ $(1 \leq w \leq 10000)$, where $(x_1, y_1)$, $(x_2, y_2)$ and $(x_3, y_3)$ are Cartesian coordinates of the vertices of the pizza, and $w$ is the width of the strip. It is guaranteed that the three vertices are not collinear.
 

输出数据

For each test case, display the minimum height of the pizza pad with an absolute or relative error of no more than $10^{-6}$. If it is impossible to make a pizza pad, display $\texttt{impossible}$ instead.
 

样例输入

复制
2
0 0 3 0 0 4 10
0 0 3 0 0 4 1

样例输出

复制
2.400000000
impossible

提交

请先 登录

© 2025 FAQs Contact About