#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

typedef pair<double, double> PD;
 
typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = 1e-9;    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D 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;  // counter clockwise
  if (cross(b,c) < -EPS) return -1;  // clockwise
  if (dot(b,c)   < -EPS) return +2;  // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line or a==b
  return 0;                          // a--c--b on line or a==c or b==c
}

bool isecLS(P a1, P a2, P b1, P b2) {
  return cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS;
}

bool isecLP(P a1, P a2, P b) {
  return abs(ccw(a1, a2, b)) != 1;  // return EQ(cross(a2-a1, b-a1), 0); と等価
}
bool isecLL(P a1, P a2, P b1, P b2) {
  return !isecLP(a2-a1, b2-b1, 0) || isecLP(a1, b1, b2);
}

P crosspointLL(P a1, P a2, P b1, P b2) {
  D d1 = cross(b2-b1, b1-a1);
  D d2 = cross(b2-b1, a2-a1);
  if (EQ(d1, 0) && EQ(d2, 0)) return a1;  // same line
  //if (EQ(d2, 0)) throw "kouten ga nai";   // 交点がない
  return a1 + d1/d2 * (a2-a1);
}

int w, h, n;
P p[205];
L lines[200];
vector<PD> borders;

void solve() {
    rep(i,2*n) {
        double x, y;
        cin >> x >> y;
        p[i] = P(x,y);
    }
    p[2*n] = P(0,0);
    p[2*n+1] = P(w,0);
    p[2*n+2] = P(0,h);
    p[2*n+3] = P(w,h);
    rep(i,2*n+4) {
        for (int j = i+1; j < 2*n+4; j++) {
            if (p[i] == p[j]) continue;
            if (isecLS(p[i], p[j], P(0,0), P(0,h)) && isecLS(p[i], p[j], P(w,0), P(w,h))) {
                P pl = crosspointLL(P(0,0), P(0,h), p[i], p[j]);
                P pr = crosspointLL(P(w,0), P(w,h), p[i], p[j]);
                int cnt = 0, cnt2 = 0;
                rep(k,2*n) {
                    //P pc = crosspointLL(p[k], P(p[k].X, p[k].Y+1), p[i], p[j]);
                    double vc = cross(p[k]-p[i], p[j]-p[i]);
                    //if (GE(pc.Y, p[k].Y)) cnt++;
                    //if (GE(p[k].Y, pc.Y)) cnt2++;
                    if (vc+EPS > 0.0) cnt++;
                    if (vc-EPS < 0.0) cnt2++;
                }
                if (cnt < n || cnt2 < n) continue;
                borders.push_back(PD(min((double)h, max(0.0,pl.Y)), min((double)h, max(0.0,pr.Y))));
            }
        }
    }
    sort(borders.begin(), borders.end());
    double sum = 0.0;
    rep(i,(int)borders.size()) {
        if (i == (int)borders.size()-1) break;
        P pm = P(0, (borders[i+1].first+borders[i].first)/2.0);
        D td = -1.0, dd = h;
        rep(j,2*n+4) {
            if (pm == p[j]) continue;
            if (isecLS(pm, p[j], P(0,0), P(0,h)) && isecLS(pm, p[j], P(w,0), P(w,h))) {
                P pl = crosspointLL(P(0,0), P(0,h), pm, p[j]);
                P pr = crosspointLL(P(w,0), P(w,h), pm, p[j]);
                int cnt = 0, cnt2 = 0;
                rep(k,2*n) {
                    //P pc = crosspointLL(p[k], P(p[k].X, p[k].Y+1), pm, p[j]);
                    double vc = cross(p[k]-pm, p[j]-pm);
                    if (vc+EPS > 0.0) cnt++;
                    if (vc-EPS < 0.0) cnt2++;
                    //if (GE(pc.Y, p[k].Y)) cnt++;
                    //if (GE(p[k].Y, pc.Y)) cnt2++;
                }
                if (cnt < n || cnt2 < n) continue;
                td = max(td, pr.Y);
                dd = min(dd, pr.Y);
            }
        }
        if (td < 0.0) continue;
        sum += (borders[i+1].first - borders[i].first) * (td - dd);
    }
    printf("%.9f\n", sum / (h * h));
}

int main() {
    while (cin >> w >> h >> n) {
        if (w == 0 && h == 0 && n == 0) break;
        solve();
    }
}




Measured memory_bytes: 3332