#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <map>
#include <queue>
using namespace std;
const double EPS = 1e-6;
const double INF = 1e12;
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()
 
typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};
 
namespace std{
    bool operator < (const P& a, const P& b){
        return !EQ(a.X,b.X) ? a.X<b.X : a.Y+EPS<b.Y;
    }
    bool operator == (const P& a, const P& b){
        return abs(a-b) < EPS;
    }
}
 
double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) < -EPS) return -1; //cw
    if(dot(b,c) < -EPS) return +2; //c-a-b
    if(abs(c)-abs(b) > EPS) return -2; //a-b-c
    return 0; //a-c-b
}
 
bool intersectSP(const L& s, const P &p){
    return abs(cross(s[0]-p, s[1]-p))<EPS  && dot(s[0]-p, s[1]-p)<EPS;
}
bool intersectSS(const L& a, const L& b){
    return ( ccw(a[0],a[1],b[0]) *ccw(a[0],a[1],b[1]) <= 0 ) &&
        ( ccw(b[0],b[1],a[0]) *ccw(b[0],b[1],a[1]) <= 0 );
}

double distanceLP(const L &l, const P &p) {
    return abs(cross(l[1]-l[0], p-l[0])) /abs(l[1]-l[0]);
}
double distanceSP(const L &s, const P &p) {
    if(dot(s[1]-s[0], p-s[0]) < EPS) return abs(p-s[0]);
    if(dot(s[0]-s[1], p-s[1]) < EPS) return abs(p-s[1]);
    return distanceLP(s, p);
}
 
bool isParallel(const P &a, const P &b){
    return abs(cross(a,b)) < EPS;
}
bool isParallel(const L &a, const L &b){
    return isParallel(a[1]-a[0], b[1]-b[0]);
}
P crosspointLL(const L &l, const L &m) {
  double A = cross(l[1]-l[0], m[1]-m[0]);
  double B = cross(l[1]-l[0], l[1]-m[0]);
  return m[0] + B/A *(m[1]-m[0]);
}
 
double getarea(const VP &poly){
    double ret = 0;
    for (int i=0; i<(int)poly.size(); i++){ 
        ret += cross(poly[i], poly[(i+1)%poly.size()]);
    }
    return ret*0.5;
}
int in_poly(const P &p, const VP &poly){
    int n = poly.size();
    int ret = -1;
    for(int i=0; i<n; i++){
        P a = poly[i]-p;
        P b = poly[(i+1)%n]-p;
        if(a.Y > b.Y) swap(a,b);
        if(intersectSP(L(a,b), P(0,0))) return 0;
        if(a.Y<=0 && b.Y>0 && cross(a,b)<0) ret = -ret;
    }
    return ret;
}
 
VP convex(VP v){
    VP ret;
    int n = v.size();
    sort(v.begin(), v.end());
    for(int i=0; i<n; i++){
        while((int)ret.size()>1 && cross(ret.back()-ret[ret.size()-2], v[i]-ret.back()) < EPS){
            ret.pop_back();
        }
        ret.push_back(v[i]);
    }
    int t = ret.size();
    for(int i=n-2; i>=0; i--){
        while((int)ret.size()>t && cross(ret.back()-ret[ret.size()-2], v[i]-ret.back()) < EPS){
            ret.pop_back();
        }
        ret.push_back(v[i]);
    }
    if((int)ret.size() > 1) ret.pop_back();
    return ret;
}
 
VP convex_cut(const VP& p, const L& l){
    VP ret;
    int n = p.size();
    for(int i=0; i<n; i++){
        P curr = p[i];
        P next = p[(i+1)%n];
        if(ccw(l[0], l[1], curr) != -1) ret.push_back(curr);
        if(ccw(l[0], l[1], curr) *ccw(l[0], l[1], next) == -1){
            ret.push_back(crosspointLL(L(curr, next), l));
        }
    }
    return ret;
}
 
vector<VP> volonoi_division(VP plist, VP poly){
    int m = plist.size();
    vector<VP> ret(m);
    if(m == 1){
        ret.push_back(poly);
        return ret;
    }
    for(int i=0; i<m; i++){
        VP v = poly;
        for(int j=0; j<m; j++){
            if(i==j) continue;
            P mid = (plist[i] +plist[j]) /2.0;
            L bisector(mid, mid +(plist[j]-plist[i])*P(0,1));
            v = convex_cut(v, bisector);
        }
        ret[i] = v;
    }
    return ret;
}
 
int main(){
    int w,h,n;
    cin >> w >> h >> n;
    VP sq{P(0, 0), P(w, 0), P(w, h), P(0, h)};
    VP plist(n);
    for(int i=0; i<n; i++){
        int x,y;
        cin >> x >> y;
        plist[i] = P(x, y);
    }
    vector<VP> polys = volonoi_division(plist, sq);

    vector<L> edge;
    for(const VP &poly: polys){
        int m = poly.size();
        for(int i=0; i<m; i++){
            L e(poly[i], poly[(i+1)%m]);
            if(e[1] < e[0]) swap(e[0], e[1]);
            edge.push_back(e);
        }
    }
    sort(edge.begin(), edge.end());
    edge.erase(unique(edge.begin(), edge.end()), edge.end());
    map<P, int> conv;
    int count = 0;
    for(const L &e: edge){
        for(int d=0; d<2; d++){
            if(conv.count(e[d]) == 0){
                conv[e[d]] = count;
                count++;
            }
        }
    }
 
    vector<vector<pair<int, double> > > adj(count);
    for(const L &e: edge){
        int idx0 = conv[e[0]];
        int idx1 = conv[e[1]];
        double dist = INF;
        if(!EQ(e[0].Y, e[1].Y) || (!EQ(e[0].Y, 0) && !EQ(e[0].Y, h))){
            for(const P &p: plist){
                dist = min(dist, distanceSP(e, p));
            }
        }
        adj[idx0].emplace_back(idx1, dist);
        adj[idx1].emplace_back(idx0, dist);
    }

    int sidx = conv[P(0, 0)];
    int gidx = conv[P(w, h)];
    priority_queue<pair<double, int> > wait;
    wait.push(make_pair(INF, sidx));
    vector<double> maxdist(adj.size(), 0);
    maxdist[sidx] = INF;
    while(!wait.empty()){
        double dist = wait.top().first;
        int pos = wait.top().second;
        wait.pop();
        if(dist +EPS < maxdist[pos]) continue;
        if(pos == gidx) break;
        for(const pair<int, double> &next: adj[pos]){
            int npos = next.first;
            double ndist = min(dist, next.second);
            if(ndist > maxdist[npos] +EPS){
                maxdist[npos] = ndist;
                wait.push(make_pair(ndist, npos));
            }
        }
    }
    cout << fixed << setprecision(10);
    cout << maxdist[gidx] << endl;
    return 0;
}


Measured memory_bytes: 3612