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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>

using namespace std;

const int SIZE = 210;
const double eps = 1e-15;

typedef long long ll;
typedef long double ld;

typedef complex<ll> P;
typedef complex<ld> Pd;

inline ll dot(P a, P b){
  return (a * conj(b)).real();
}

inline ll cross(P a, P b){
  return (conj(a) * b).imag();
}

int ccw(P a, P b, P c){
  ll res1 = cross(b-a, c-a);
  if(res1 > 0) return 1; //CCW
  if(res1 < 0) return -1; //CW
  if(dot(b-a, c-a) < 0) return -2; //c -> a -> b
  if(dot(a-b, c-b) < 0) return 2; //a -> b -> c
  return 0;
}

bool iscollinear(P a1, P a2, P b1, P b2){
  return abs(cross(a2-a1, b2-b1)) == 0;
}

int isInterSS(P a1, P a2, P b1, P b2){
  if(iscollinear(a1, a2, b1, b2)) return false;
  
  int a = ccw(b1, b2, a1);
  int b = ccw(b1, b2, a2);
  int c = ccw(a1, a2, b1);
  int d = ccw(a1, a2, b2);

  if(a*b <= 0 && c*d < 0) return 1;
  if(a*b <= 0 && c == 0) return -1;
  if(a*b <= 0 && d == 0) return -2;
  return 0;
}

int isInterLS(P a1, P a2, P b1, P b2){
  if(iscollinear(a1, a2, b1, b2)) return false;

  int c = ccw(a1, a2, b1);
  int d = ccw(a1, a2, b2);
  
  if(abs(c) != 1) return -1;
  if(abs(d) != 1) return -2;
  if(c*d < 0) return 1;
  return 0;
}

bool iscontainedPP(int n, P *g, P p){
  bool f = false;
  for(int i=0;i<n;i++){
    P a = g[i] - p, b = g[(i+1)%n] - p;
    if(abs(cross(a,b)) <= 0 && dot(a,b) <= 0) return true;
    if(a.imag() > b.imag()) swap(a,b);
    if(a.imag() <= 0 && 0 < b.imag() && cross(a,b) > 0) f = !f;
  }
  return f;
}

Pd getCrossPoint(P a1, P a2, P b1, P b2){
  P a = a2 - a1;
  P b = b2 - b1;
  Pd ad = Pd(a.real(), a.imag());
  Pd a1d = Pd(a1.real(), a1.imag());
  return a1d + ad * (ld)cross(b, b1-a1) / (ld)cross(b, a);
}

double absll(P a){
  return sqrt(a.real() * a.real() + a.imag() * a.imag());
}

Pd toPd(P a){
  return Pd(a.real(), a.imag());
}

int T = 0;

bool solve(){
  int n;
  int x[SIZE], y[SIZE];
  P p[SIZE];
  Pd pd[SIZE];
  
  if(scanf("%d",&n) == EOF) return false;
  if(n == 0) return false;
  
  printf("Case %d: ",++T);
  
  for(int i=0;i<n;i++){
    scanf("%d%d",x+i, y+i);
    p[i] = P(x[i], y[i]);
    pd[i] = Pd(x[i], y[i]);
  }

  bool inS[SIZE][SIZE][2][2] = {}; // [a][b][{a:0,b:1}][{0:in,1:out}]
  
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i == j) continue;
      
      P a = p[(i-1+n)%n];
      P b = p[i];
      P c = p[(i+1)%n];
      P d = p[j];

      int r1 = ccw(b, a, c);
      int r2 = ccw(b, a, d);
      int r3 = ccw(b, d, c);
      
      inS[i][j][0][0] = (r2 == 2 || r2 == 0 || r3 == 2 || r3 == 0); // online
      inS[i][j][0][0] |= (r1 == 1 && (r2 * r3 == -1 || r2 == -2 || r3 == -2));
      inS[i][j][0][0] |= (r2 == -1 && r3 == -1);

      //cerr << i << " " << j << " : " << inS[i][j][0][0] << " " << inS[i][j][0][1] << endl;
      //cerr << r1 << " " << r2 << " " << r3 << endl;
      
      d = b * 2LL - d;
      r2 = ccw(b, a, d);
      r3 = ccw(b, d, c);
      
      inS[i][j][0][1] = (r2 == 2 || r2 == 0 || r3 == 2 || r3 == 0); // online
      inS[i][j][0][1] |= (r1 == 1 && (r2 * r3 == -1 || r2 == -2 || r3 == -2));
      inS[i][j][0][1] |= (r2 == -1 && r3 == -1);

      inS[j][i][1][0] = inS[i][j][0][0];
      inS[j][i][1][1] = inS[i][j][0][1];

      //cerr << i << " " << j << " : " << inS[i][j][0][0] << " " << inS[i][j][0][1] << endl;
      //cerr << r1 << " " << r2 << " " << r3 << endl;
    }
  }

  double ans = 0;

  for(int i=0;i<n;i++){
    ans = max(ans, absll(p[i] - p[(i+1)%n]));
  }
  
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      bool f = true;

      if (i+1 != j){
        for(int k=0;k<n;k++){
          if(k == i || (k+1)%n == i || k == j || (k+1)%n == j) continue;

          int resISS = isInterSS(p[i], p[j], p[k], p[(k+1)%n]);
          
          if(resISS == 1 ||
             (resISS == -1 && (!inS[i][k][1][1] || !inS[i][k][1][0])) ||
             (resISS == -2 && (!inS[i][(k+1)%n][1][1] || !inS[i][(k+1)%n][1][0]))){
            f = false;
            break;
          }

        }
        if (!f) continue;
      }
      
      Pd cp1, cp2;
      bool cp1f = false, cp2f = false;
      
      for(int k=0;k<n;k++){
        if(k == i || (k+1)%n == i || k == j || (k+1)%n == j) continue;
        
        int resILS = isInterLS(p[i], p[j], p[k], p[(k+1)%n]);
        Pd cp = getCrossPoint(p[i], p[j], p[k], p[(k+1)%n]);
        
        if(resILS){
          bool near1 = false;
          bool near2 = false;
          
          if(abs(pd[i] - cp) < abs(pd[j] - cp)){
            if (!cp1f || abs(pd[i] - cp) < abs(pd[i] - cp1)){
              if(resILS == 1 ||
                 (resILS == -1 && !inS[i][k][1][1]) ||
                 (resILS == -2 && !inS[i][(k+1)%n][1][1]))
                near1 = true;
            }
          }else{
            if (!cp2f || abs(pd[j] - cp) < abs(pd[j] - cp2)){
              if(resILS == 1 ||
                 (resILS == -1 && !inS[j][k][1][1]) ||
                 (resILS == -2 && !inS[j][(k+1)%n][1][1]))
                near2 = true;
            }
          }
          
          if(near1){
            cp1 = cp; cp1f = true;
          }
          
          if(near2){
            cp2 = cp; cp2f = true;
          }
        }
      }

      
      if(inS[i][j][0][0]){
        ans = max(ans, absll(p[i] - p[j]));
      } else {
        continue;
      }

      //1
      
      if (cp1f && inS[i][j][0][1]){
        ans = max(ans, (double)abs(pd[j] - cp1));
      }
      
      //2
      if (cp2f && inS[i][j][1][1]) {
        ans = max(ans, (double)abs(cp2 - pd[i]));
        if(cp1f && inS[i][j][0][1])
          ans = max(ans, (double)abs(cp1-cp2));
      }
    }
  }
  
  printf("%.10lf\n",(double)ans);
  
  return true;
}
  

int main(){
  //while(solve());

  for(int i=0;;i++){
    if(!solve()) break;
  }
  return 0;
}