#include <cstdio>#include <cmath>#include <algorithm>#include <iostream>#include <vector>usingnamespacestd;
constdouble eps = 1e-8;
constdouble INF = 1e20;
constdouble pi = acos (-1.0);
int dcmp (double x) {
if (fabs (x) < eps) return0;
return (x < 0 ? -1 : 1);
}
inlinedouble sqr (double x) {return x*x;}
//*************点struct Point {
double x, y;
Point (double _x = 0, double _y = 0):x(_x), y(_y) {}
void input () {scanf ("%lf%lf", &x, &y);}
void output () {printf ("%.2f %.2f\n", x, y);}
booloperator == (const Point &b) const {
return (dcmp (x-b.x) == 0 && dcmp (y-b.y) == 0);
}
booloperator < (const Point &b) const {
return (dcmp (x-b.x) == 0 ? dcmp (y-b.y) < 0 : x < b.x);
}
Point operator + (const Point &b) const {
return Point (x+b.x, y+b.y);
}
Point operator - (const Point &b) const {
return Point (x-b.x, y-b.y);
}
Point operator * (double a) {
return Point (x*a, y*a);
}
Point operator / (double a) {
return Point (x/a, y/a);
}
double len2 () {//返回长度的平方return sqr (x) + sqr (y);
}
double len () {//返回长度returnsqrt (len2 ());
}
Point change_len (double r) {//转化为长度为r的向量double l = len ();
if (dcmp (l) == 0) return *this;//零向量返回自身
r /= l;
return Point (x*r, y*r);
}
Point rotate_left () {//顺时针旋转90度return Point (-y, x);
}
Point rotate_right () {//逆时针旋转90度return Point (y, -x);
}
Point rotate (Point p, double ang) {//绕点p逆时针旋转ang
Point v = (*this)-p;
double c = cos (ang), s = sin (ang);
return Point (p.x + v.x*c - v.y*s, p.y + v.x*s + v.y*c);
}
Point normal () {//单位法向量double l = len ();
return Point (-y/l, x/l);
}
};
double cross (Point a, Point b) {//叉积return a.x*b.y-a.y*b.x;
}
double dot (Point a, Point b) {//点积return a.x*b.x + a.y*b.y;
}
double dis (Point a, Point b) {//两个点的距离
Point p = b-a; return p.len ();
}
double rad_degree (double rad) {//弧度转化为角度return rad/pi*180;
}
double rad (Point a, Point b) {//两个向量的夹角returnfabs (atan2 (fabs (cross (a, b)), dot (a, b)) );
}
bool parallel (Point a, Point b) {//向量平行double p = rad (a, b);
return dcmp (p) == 0 || dcmp (p-pi) == 0;
}
//************直线 线段struct Line {
Point s, e;//直线的两个点
Line () {}
Line (Point _s, Point _e) : s(_s), e(_e) {}
//一个点和倾斜角确定直线
Line (Point p, double ang) {
s = p;
if (dcmp (ang-pi/2) == 0) {
e = s + Point (0, 1);
}
else
e = s + Point (1, tan (ang));
}
//ax+by+c=0确定直线
Line (double a, double b, double c) {
if (dcmp (a) == 0) {
s = Point (0, -c/b);
e = Point (1, -c/b);
}
elseif (dcmp (b) == 0) {
s = Point (-c/a, 0);
e = Point (-c/a, 1);
}
else {
s = Point (0, -c/b);
e = Point (1, (-c-a)/b);
}
}
void input () {
s.input ();
e.input ();
}
void adjust () {
if (e < s) swap (e, s);
}
double length () {//求线段长度return dis (s, e);
}
double angle () {//直线的倾斜角double k = atan2 (e.y-s.y, e.x-s.x);
if (dcmp (k) < 0) k += pi;
if (dcmp (k-pi) == 0) k -= pi;
return k;
}
};
Point line_intersection (Line a, Line v) {//直线交点//调用前确保有交点double a1 = cross (v.e-v.s, a.s-v.s);
double a2 = cross (v.e-v.s, a.e-v.s);
return Point ((a.s.x*a2-a.e.x*a1)/(a2-a1), (a.s.y*a2-a.e.y*a1)/(a2-a1));
}
//*************多边形double polygon_area (Point *p, int n) {//多边形的有向面积,加上绝对值就是面积//n个点double area = 0;
for (int i = 1; i < n-1; i++) {
area += cross (p[i]-p[0], p[i+1]-p[0]);
}
return area/2;
}
int convex_cut (Line u, Point *p, int n, Point *po) {//直线切割多边形左侧//返回切割后多边形的数量int top = 0;
for (int i = 0; i < n; i++) {
int d1 = dcmp (cross (u.e-u.s, p[i]-u.s));
int d2 = dcmp (cross (u.e-u.s, p[(i+1)%n]-u.s));
if (d1 >= 0) po[top++] = p[i];
if (d1*d2 < 0) po[top++] = line_intersection (u, Line (p[i], p[(i+1)%n]));
}
return top;
}
#define maxn 22int n, m;
Point p[maxn], ch[maxn];
Line l;
int main () {
while (cin >> n && n) {
for (int i = 0; i < n; i++) p[i].input ();
l.input ();
m = convex_cut (l, p, n, ch);
double ans1 = fabs (polygon_area (ch, m));
double ans2 = fabs (polygon_area (p, n))-ans1;
if (ans1 < ans2) swap (ans1, ans2);
printf ("%.0f %.0f\n", ans1, ans2);
}
return0;
}