#include #include #include #include #include using namespace std; double distance(double x0, double y0, double x1, double y1) { const double x = x0 - x1; const double y = y0 - y1; return sqrt(x * x + y * y); } bool go(vector > >& graph, double r) { const int n = graph.size(); const int leftNode = n - 2; const int rightNode = n - 1; vector open; open.push_back(leftNode); vector memo(n); memo[leftNode] = true; while (!open.empty() && !memo[rightNode]){ const int current = open.back(); open.pop_back(); for (vector >::iterator it = graph[current].begin(); it != graph[current].end(); ++it){ const int next = it->first; const double cost = it->second; if (!memo[next] && cost < r){ open.push_back(next); memo[next] = true; } } } return memo[rightNode] != 0; } int main() { for (int W, H, N; cin >> W >> H >> N && W && H && N;){ const int leftNode = N; const int rightNode = N + 1; vector xs; vector ys; for (int i = 0; i < N; ++i){ int x, y; cin >> x >> y; xs.push_back(x); ys.push_back(y); } vector > > graph(N + 2); for (int i = 0; i < N; ++i){ for (int j = i + 1; j < N; ++j){ const double r = distance(xs[i], ys[i], xs[j], ys[j]); graph[i].push_back(make_pair(j, r * 0.5)); graph[j].push_back(make_pair(i, r * 0.5)); } } for (int i = 0; i < N; ++i){ graph[leftNode].push_back(make_pair(i, xs[i])); graph[i].push_back(make_pair(leftNode, xs[i])); graph[i].push_back(make_pair(rightNode, W - xs[i])); graph[rightNode].push_back(make_pair(i, W - xs[i])); } double l = 0; double r = 1e10; for (int loop = 0; loop < 100; ++loop){ const double m = (l + r) * 0.5; if (go(graph, m)){ r = m; } else { l = m; } } const double m = (l + r) * 0.5; printf("%.20lf\n", m); } }