Old Solution Methods

시간 제한1초메모리 제한2048 MB

요약
고정된 점 A, B, C를 지나는 세 직선을 같은 각도만큼 회전시킬 때 세 교점이 이루는 삼각형 넓이의 최댓값을 구한다.
난이도

어려움10점 중 8점

유형
기하, 수학, 구현, 완전 탐색
정답자
아직 제출이 없습니다

문제

There are 66 distinct points AA, BB, CC, DD, EE, FF on the plane. Points AA, BB, and CC are not collinear.

Svetozar drew a line aa through points AA and DD, a line bb through points BB and EE, and a line cc through points CC and FF. It turned out that none of these lines are parallel. Now he wants to rotate line aa around point AA, line bb around point BB, and line cc around point CC counterclockwise by the same angle, then find the intersection points of the resulting lines, and then draw a triangle with vertices at the obtained three points (if they are not collinear).

Svetozar wants to obtain a triangle with the largest possible area. If it is not possible to form a triangle, Svetozar considers the area to be zero. Find this area.

입력

The first line contains a single integer TT (1≤T≤1051 \leq T \leq 10^5), denoting the number of test cases.

Then TT descriptions of test cases follow. Each description consists of 66 lines, describing points AA, BB, CC, DD, EE, FF respectively. Each point description consists of two integers xx and yy (−20≤x,y≤20-20 \leq x, y \leq 20): the coordinates of the point.

It is guaranteed that in each test case all points are distinct, points AA, BB, and CC are not collinear, and the lines ADAD, BEBE, and CFCF are pairwise not parallel.

출력

For each test case, output a single real number with an absolute or relative error not exceeding 10−610^{-6}: the largest possible area of the triangle. It is guaranteed that in none of the tests this area exceeds 10710^7.

힌트

In the example, the maximum possible area is achieved by rotating the lines by an angle approximately equal to 104.036∘104.036^\circ. The triangle with the largest area has sides equal to 17\sqrt{17}, 17\sqrt{17}, 34\sqrt{34}, and vertices at points (a,b)(a, b), (a−1,b+4)(a - 1, b + 4), and (a+4,b+1)(a + 4, b + 1), where a≈3.8235a \approx 3.8235, b≈1.7059b \approx 1.7059.

In the illustration below, the original lines are marked with dashed lines, and the lines after rotation are marked with solid lines:

예제1

  1. 예제 1

    입력
    1
    1 1
    4 1
    4 5
    1 2
    5 1
    5 6
    
    예상 출력
    8.500000000