eolymp
bolt
Try our new interface for solving problems

Wires

Time limit 1 second
Memory limit 128 MiB

Connoisseur of sound Vova decided to update his equipment. One of the ways to improve the sound is to use point-to-point wiring with heavy wires, and the wires must be as short as possible to diminish the resistance. It is clear how to connect two terminals, it is also easy to find an optimal wiring for three terminals. But what about four terminals?

There are four terminals on a circuit board. You should connect them (there must be a contact between each pair of terminals). It is permitted to add at most three auxiliary terminals and to connect terminals with wire pieces. The goal is to minimize the total length of the wires.

Input data

First line contains the number of tests n (1n100). Each test consists of 4 lines that contain (x[i], y[i]) coordinates of terminals (-200x[i], y[i]200, 1i4). Any two points out of four do not match. Tests are separated with an empty line.

Output data

For each test, you should print a line containing the minimal possible length of the wires. The number must be given with at least four fractional digits.

Examples

Input example #1
2
0 0
2 0
2 1
3 0

0 0
0 1
1 0
1 1
Output example #1
3.9093
2.7321
Source 2006 Ural SU Contest, Petrozavodsk Winter Session, January 30, Problem B