Find the longest straight segment that fits inside a simple polygon given in counterclockwise order.
Medium7GeometryBrute forceNo attempts yetTime limit1sMemory limit512 MBMr. KM, the mayor of KM City, decided to build a new elementary school. The site for the school has an awkward polygonal shape, and that caused several problems. The most serious one is that there is not enough room for a short distance running lane. Compute the maximum length of a lane that fits inside the site.
The lane is a straight line segment whose width can be ignored. The boundary of the site is a simple polygon that does not intersect itself, and the lane may touch the boundary. The boundary is not necessarily convex.
The input holds several test cases and ends with a line containing a single 0. The first line of each test case has an integer N (3≤N≤100). Each of the next N lines has two integers xi and yi (−1000≤xi,yi≤1000), the coordinates of one vertex of the polygonal boundary, given in counterclockwise order.
For each test case print one line in the form Case k: L. Here k is the test case number starting at 1, and L is the maximum lane length rounded to six digits after the decimal point. Always print exactly six digits after the decimal point. In every test case the answer is far enough from a rounding boundary.