double getarea(point p1, point p2, point p3) { return fabs((p1 - p2) * (p3 - p2)) /2.0; }
int main() { int scin, poln, i, j; double area =0.0; point pp;
scanf("%d", &poln);
for (i =0; i < poln; ++i) { scanf("%lf%lf", &pp.x, &pp.y); polygon.push_back(pp); }
scanf("%d",&scin); for (i =0; i < scin; ++i) { scanf("%lf%lf", &pp.x, &pp.y); scissor.push_back(pp); }
scissor.push_back(scissor[0]);
for (i =0; i < scin; ++i) { temp.clear(); if (polygon.size() <3) break;
for (j =0; j < polygon.size() -1; ++j) { if (intersect(scissor[i], scissor[i +1], polygon[j], polygon[j +1], pp)) temp.push_back(pp); if (at_right(scissor[i], scissor[i +1], polygon[j +1])) temp.push_back(polygon[j +1]); }
if (intersect(scissor[i], scissor[i +1], polygon[j], polygon[0], pp)) temp.push_back(pp); if (at_right(scissor[i], scissor[i +1], polygon[0])) temp.push_back(polygon[0]); polygon = temp; }
if (polygon.size() >2) for (i =1; i < polygon.size() -1; ++i) area += getarea(polygon[0], polygon[i], polygon[i +1]); printf("%.2lf\n",area); return0; }