1. JAVA, Simon Baumgartner


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/*
* ACM Programming Contest
*
* Problem: 534 Frogger
* Status: Accepted
* Run Time: 0.356
* Date: 2009-06-09
* Author: Simon Baumgartner
*
*/

public class Main {

public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
// BufferedReader in = new BufferedReader(new FileReader("input.txt"));
int count = 1;
int nrOfStones = Integer.parseInt(in.readLine());
while(nrOfStones != 0){

int[][] stones = new int[nrOfStones][2];
double[][] matrix = new double[nrOfStones][nrOfStones];
double[][] d = new double[nrOfStones][nrOfStones];
for (double[] es : d) {
Arrays.fill(es, Double.MAX_VALUE);
}
// parse stones
for (int i = 0; i < nrOfStones; i++) {
String tokens[] = in.readLine().split(" ");
stones[i] = new int[]{Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1])};
}
// pre compute all distance
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix[i].length; j++) {
double res = distance(stones[i], stones[j]);
if(res != 0.0){
matrix[i][j] = res;
d[i][j] = res;
}
}
}

// Floyd & Warshall
for (int k = 0; k < nrOfStones; k++)
for (int i = 0; i < matrix.length; i++)
for (int j = 0; j < matrix[i].length; j++)
if(i != j)
d[i][j] = Math.min(d[i][j],Math.max(d[i][k],d[k][j]));

System.out.printf("Scenario #%d\nFrog Distance = %.3f\n\n", count, d[0][1]);
count++;

in.readLine();// read blank line at end of each test case
nrOfStones = Integer.parseInt(in.readLine());
}
}

private static double distance(int[] from, int[] to) {
return Math.sqrt(Math.pow(from[0]-to[0], 2) + Math.pow(from[1]-to[1], 2));
}

}