#define EJUDGE
#define NOFOOTER

#include <math.h>
#include "testlib.h"

const int NMAX = 305;

struct Point
{
    int x, y;
};

Point border[2*NMAX];
int square;
int n, k;

double jans;
double pans;
int r[NMAX];
int rn;

int Vc(const Point &p1, const Point &p2)
{
    return p1.x * p2.y - p1.y * p2.x;
}

int Vc(const Point &p1, const Point &p2, const Point &p3, const Point &p4)
{
    return (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x);
}

int Sc(const Point &p1, const Point &p2, const Point &p3, const Point &p4)
{
    return (p2.x - p1.x) * (p4.x - p3.x) + (p2.y - p1.y) * (p4.y - p3.y);
}

int Sign(int x)
{
    if (x > 0)
        return 1;
    else if (x == 0)
        return 0;
    else
        return -1;
}

bool Cross(const Point &p1, const Point &p2, const Point &p3, const Point &p4)
{
    return Sign(Vc(p1, p2, p1, p3)) * Sign(Vc(p1, p2, p1, p4)) < 0
        && Sign(Vc(p3, p4, p3, p1)) * Sign(Vc(p3, p4, p3, p2)) < 0;
}

bool BuildFenceSegment(int i, int j)
{
    if (i > j)
    {
        int tmp = i;
        i = j;
        j = tmp;
    }

    int s1 = Vc(border[j], border[i]);
    for (int k = i; k < j; k++)
        s1 += Vc(border[k], border[k + 1]);

    int s2 = Vc(border[i], border[j]);
    for (int k = j; k < i + n; k++)
        s2 += Vc(border[k], border[k + 1]);

    bool ok = abs(s1) + abs(s2) == square;

	bool sn[3];
	memset(sn, 0, sizeof(sn));

	if (ok)
		for (int k = 0; k < n; k++)
			if (Vc(border[i], border[j], border[i], border[k]) == 0
				&& Sc(border[k], border[i], border[k], border[j]) < 0)
			{
				int k1 = k > 0 ? k - 1 : n - 1;
				int k2 = k + 1;

				sn[Sign(Vc(border[i], border[j], border[i], border[k1])) + 1] = true;
				sn[Sign(Vc(border[i], border[j], border[i], border[k2])) + 1] = true;
				if (sn[0] && sn[2])
				{
					ok = false;
					break;
				}

			}

    if (ok)
        for (int k = 0; k < n; k++)
            if (Cross(border[i], border[j], border[k], border[k + 1]))
            {
                ok = false;
                break;
            }

    return ok;
}

int main(int argc, char *argv[])
{
    registerTestlibCmd(argc, argv);

    n = inf.readInt();
    k = inf.readInt();
    
    for (int i = 0; i < n; i++)
    {
        border[i].x = inf.readInt();
        border[i].y = inf.readInt();
        border[i + n] = border[i];
    }

    square = 0;
    for (int i = 0; i < n; i++)
        square += Vc(border[i], border[i + 1]);

    jans = ans.readDouble();
    pans = ouf.readDouble();

    if (pans + 1e-5 < jans)
        quitf(_wa, "Jury's answer is better: %.2lf vs %.2lf", pans, jans);

    rn = ouf.readInt();

    if (rn > k)
        quitf(_wa, "Too many vertices in the fence: %d %d\n", rn, k);

    for (int i = 0; i < rn; i++)
        r[i] = ouf.readInt();
    r[rn] = r[0];

    int sq = 0;
    for (int i = 0; i < rn; i++)
        sq += Vc(border[r[i] - 1], border[r[i + 1] - 1]);

    if (fabs(sq / 2.0 - pans) > 1e-5)
        quitf(_wa, "Calculated square doesn't correspond to the fence: %.2lf vs %.2lf", pans, sq / 2.0);

    for (int i = 0; i < rn - 1; i++)
        for (int j = i + 1; j < rn; j++)
            if (r[i] == r[j])
                quitf(_wa, "One vertex appears twice: %d", r[i]);

    for (int i = 0; i < rn; i++)
        if (!BuildFenceSegment(r[i] - 1, r[i + 1] - 1))
            quitf(_wa, "Segment %d %d is partially out of Flatland", r[i], r[i + 1]);

    for (int i = 0; i < rn - 1; i++)
        for (int j = 0; j < rn; j++)
            if (Cross(border[r[i] - 1], border[r[i + 1] - 1], border[r[j] - 1], border[r[j + 1] - 1]))
                quitf(_wa, "Fence segments %d %d and %d %d cross", r[i], r[i + 1], r[j], r[j + 1]);

    if (pans > jans + 1e-5)
        quitf(_fail, "Participant's answer is better: %.2lf vs %.2lf", pans, jans);

    quitf(_ok, "Good fence: %.2lf vs %.2lf", pans, jans);   

    return 0;
}
