#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>

using namespace std;
const int N = 105;
const double eps = 1e-8;
const double offset = 2000;
struct point {
    double x, y;
    bool operator==(const point& rhs) const {
        return fabs(x - rhs.x) < eps && fabs(y - rhs.y) < eps;
    }
}a[N];
int zero(double x) {
    return fabs(x) < eps;
}
double xmul(point p1, point p2, point p0) {
    return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x- p0.x) * (p1.y - p0.y);
}
double dist(point p1, point p2) {
    double x = p1.x - p2.x;
    double y = p1.y - p2.y;
    return sqrt(x * x + y * y);
}
int dot_in(point p, point l1, point l2) {
    return zero(xmul(p, l1, l2)) && (l1.x - p.x) * (l2.x - p.x) < eps && (l1.y - p.y) * (l2.y - p.y) < eps;
}
int dot_ex(point p, point l1, point l2) {
    return dot_in(p, l1, l2) && (!zero(p.x - l1.x) || !zero(p.y - l1.y)) && (!zero(p.x - l2.x) || !zero(p.y - l2.y));
}
int pingxing(point u1, point u2, point v1, point v2) {
    return zero((u1.x - u2.x) * (v1.y - v2.y) - (v1.x - v2.x) * (u1.y - u2.y));
}
point inside(point u1, point u2, point v1, point v2) {
    point ret = u1;
    double t = ((u1.x - v1.x) * (v1.y - v2.y) - (u1.y - v1.y) * (v1.x - v2.x))
            / ((u1.x - u2.x) * (v1.y - v2.y) - (u1.y - u2.y) * (v1.x - v2.x));
    ret.x += (u2.x - u1.x) * t;
    ret.y += (u2.y - u1.y) * t;
    return ret;
}

int inside_polygon(point q, int n, point *p, int on_edge = 1) {
    point q2;
    int i = 0, count;
    while (i < n) {
        for (count = i = 0, q2.x = rand() + offset, q2.y = rand() + offset; i < n; i++) {
            if (zero(xmul(q, p[i], p[(i+1)%n])) && (p[i].x - q.x) * (p[(i+1)%n].x - q.x) < eps
                && (p[i].y - q.y) * (p[(i+1)%n].y - q.y) < eps)
                return on_edge;
            else if (zero(xmul(q, q2, p[i])))
                break;
            else if(xmul(q, p[i], q2) * xmul(q, p[(i+1)%n], q2) < -eps &&
                    xmul(p[i], q, p[(i+1)%n]) * xmul(p[i], q2, p[(i+1)%n]) < -eps)
                count++;
        }
    }
    return count & 1;
}
point st, ed;
bool cmp(const point &a, const point &b) {
    if (fabs(a.x - b.x) < eps) {
        return a.y < b.y;
    }
    return a.x < b.x;
}
int main() {
    int n, cs = 0;
    while (scanf("%d", &n) && n) {
        for (int i = 0; i < n; ++i)
            scanf("%lf%lf", &a[i].x, &a[i].y);
        double ans = 0;
        for (int i = 0; i < n; ++i) for (int j = i + 1; j < n; ++j) {
            vector<point> vec;

            vec.push_back(a[i]);
            vec.push_back(a[j]);
            for (int k = 0; k < n; ++k) {
                int s = k, t = (k + 1) % n;
                if (pingxing(a[i], a[j], a[s], a[t])) {
                } else {
                    ed = inside(a[i], a[j], a[s], a[t]);
                    if (dot_in(ed, a[s], a[t]))
                        vec.push_back(ed);
                }
            }

            sort(vec.begin(), vec.end(), cmp);
            int tn = unique(vec.begin(), vec.end()) - vec.begin();
            double tmp = 0.0;
            for (int i = 1; i < tn; ++i) {
                st = vec[i - 1];
                ed = vec[i];
                point mid;
                mid.x = (st.x + ed.x) / 2.0;
                mid.y = (st.y + ed.y) / 2.0;
                if (inside_polygon(mid, n, a)) {
                    tmp += dist(st, ed);
                } else tmp = 0.0;

                ans = max(ans, tmp);
            }
        }
        printf("Case %d: %.12lf\n", ++cs, ans);
    }
    return 0;
}
### Prompt

Please create a solution in Cpp to the following problem:

Mr. KM, the mayor of KM city, decided to build a new elementary school. The site for the school has an awkward polygonal shape, which caused several problems. The most serious problem was that there was not enough space for a short distance racetrack. Your task is to help Mr. KM to calculate the maximum possible length for the racetrack that can be built in the site. The track can be considered as a straight line segment whose width can be ignored. The boundary of the site has a simple polygonal shape without self-intersection, and the track can touch the boundary. Note that the boundary might not be convex.



Input

The input consists of multiple test cases, followed by a line containing "0". Each test case has the following format. The first line contains an integer N (3 \leq N \leq 100). Each of the following N lines contains two integers x_i and y_i (-1,000 \leq x_i, y_i \leq 1,000), which describe the coordinates of a vertex of the polygonal border of the site, in counterclockwise order.

Output

For each test case, print its case number and the maximum possible length of the track in a line. The answer should be given as a floating point number with an absolute error of at most 10^{-6}.

Example

Input

4
0 0
10 0
10 10
0 10
3
0 0
1 0
0 1
0


Output

Case 1: 14.142135624
Case 2: 1.41421356

### Response

```cpp
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>

using namespace std;
const int N = 105;
const double eps = 1e-8;
const double offset = 2000;
struct point {
    double x, y;
    bool operator==(const point& rhs) const {
        return fabs(x - rhs.x) < eps && fabs(y - rhs.y) < eps;
    }
}a[N];
int zero(double x) {
    return fabs(x) < eps;
}
double xmul(point p1, point p2, point p0) {
    return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x- p0.x) * (p1.y - p0.y);
}
double dist(point p1, point p2) {
    double x = p1.x - p2.x;
    double y = p1.y - p2.y;
    return sqrt(x * x + y * y);
}
int dot_in(point p, point l1, point l2) {
    return zero(xmul(p, l1, l2)) && (l1.x - p.x) * (l2.x - p.x) < eps && (l1.y - p.y) * (l2.y - p.y) < eps;
}
int dot_ex(point p, point l1, point l2) {
    return dot_in(p, l1, l2) && (!zero(p.x - l1.x) || !zero(p.y - l1.y)) && (!zero(p.x - l2.x) || !zero(p.y - l2.y));
}
int pingxing(point u1, point u2, point v1, point v2) {
    return zero((u1.x - u2.x) * (v1.y - v2.y) - (v1.x - v2.x) * (u1.y - u2.y));
}
point inside(point u1, point u2, point v1, point v2) {
    point ret = u1;
    double t = ((u1.x - v1.x) * (v1.y - v2.y) - (u1.y - v1.y) * (v1.x - v2.x))
            / ((u1.x - u2.x) * (v1.y - v2.y) - (u1.y - u2.y) * (v1.x - v2.x));
    ret.x += (u2.x - u1.x) * t;
    ret.y += (u2.y - u1.y) * t;
    return ret;
}

int inside_polygon(point q, int n, point *p, int on_edge = 1) {
    point q2;
    int i = 0, count;
    while (i < n) {
        for (count = i = 0, q2.x = rand() + offset, q2.y = rand() + offset; i < n; i++) {
            if (zero(xmul(q, p[i], p[(i+1)%n])) && (p[i].x - q.x) * (p[(i+1)%n].x - q.x) < eps
                && (p[i].y - q.y) * (p[(i+1)%n].y - q.y) < eps)
                return on_edge;
            else if (zero(xmul(q, q2, p[i])))
                break;
            else if(xmul(q, p[i], q2) * xmul(q, p[(i+1)%n], q2) < -eps &&
                    xmul(p[i], q, p[(i+1)%n]) * xmul(p[i], q2, p[(i+1)%n]) < -eps)
                count++;
        }
    }
    return count & 1;
}
point st, ed;
bool cmp(const point &a, const point &b) {
    if (fabs(a.x - b.x) < eps) {
        return a.y < b.y;
    }
    return a.x < b.x;
}
int main() {
    int n, cs = 0;
    while (scanf("%d", &n) && n) {
        for (int i = 0; i < n; ++i)
            scanf("%lf%lf", &a[i].x, &a[i].y);
        double ans = 0;
        for (int i = 0; i < n; ++i) for (int j = i + 1; j < n; ++j) {
            vector<point> vec;

            vec.push_back(a[i]);
            vec.push_back(a[j]);
            for (int k = 0; k < n; ++k) {
                int s = k, t = (k + 1) % n;
                if (pingxing(a[i], a[j], a[s], a[t])) {
                } else {
                    ed = inside(a[i], a[j], a[s], a[t]);
                    if (dot_in(ed, a[s], a[t]))
                        vec.push_back(ed);
                }
            }

            sort(vec.begin(), vec.end(), cmp);
            int tn = unique(vec.begin(), vec.end()) - vec.begin();
            double tmp = 0.0;
            for (int i = 1; i < tn; ++i) {
                st = vec[i - 1];
                ed = vec[i];
                point mid;
                mid.x = (st.x + ed.x) / 2.0;
                mid.y = (st.y + ed.y) / 2.0;
                if (inside_polygon(mid, n, a)) {
                    tmp += dist(st, ed);
                } else tmp = 0.0;

                ans = max(ans, tmp);
            }
        }
        printf("Case %d: %.12lf\n", ++cs, ans);
    }
    return 0;
}
```