External Square
题号:NC17382
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

A quadrilateral is a polygon with four edges (or sides) and four vertices or corners.
External square of a quadrilateral is a square that each side of the square contains exactly one vertice of the quadrilateral, and the vertices of square can not coincide with the vertices of the quadrilateral.
Alice gave Bob four points of a quadrilateral, and asked Bob to draw the external square of the quadrilateral. Can you help him determine whether there is an external square of the given quadrilateral?
   

输入描述:

The first line of the input is T(1≤ T ≤ 100), which stands for the number of test cases you need to solve.
Each test case is contained in four lines and each line contains two integer numbers xand yi (-104 ≤ xi, yi ≤ 104). For each test case, no two points coincide, no three points are collinear.

输出描述:

For each test case, print the case number and 'Yes' or 'No', depending on whether there is an external square.
示例1

输入

复制
2
0 1
1 0
0 0
1 1
-2 0
2 0
0 2
0 1

输出

复制
Case 1: Yes
Case 2: No