import ru.ifmo.testlib.Checker;
import ru.ifmo.testlib.InStream;
import ru.ifmo.testlib.Outcome;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Locale;

import static ru.ifmo.testlib.Outcome.Type.*;


public class Check implements Checker {

    private static final double EPS = 1e-5;

    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        int n = inf.nextInt();
        int m = inf.nextInt();
        double a = inf.nextInt() * Math.PI / 180;
        final double[] h = new double[n];
        double[] x = new double[m];
        double[] y = new double[m];
        for (int i = 0; i < n; i++) {
            h[i] = inf.nextInt();
        }
        for (int i = 0; i < m; i++) {
            x[i] = inf.nextInt();
            y[i] = inf.nextInt();
        }
        double pa = ouf.nextDouble();
        double ja = ans.nextDouble();

        final double[] pos = new double[n];
        for (int i = 0; i < n; i++) {
            pos[i] = ouf.nextDouble();
        }
        if (!ouf.seekEoF())
            throw new Outcome(PE, "Extra data in output file");

        for (int i = 0; i < n; i++) {
            if (compare(pos[i], x[0]) < 0 || compare(pos[i], x[m - 1]) > 0) return new Outcome(WA, String.format("Position of tower %d is outside of range", i));
            if (pos[i] < x[0]) pos[i] = x[0];
            if (pos[i] > x[m - 1]) pos[i] = x[m - 1];
        }

        Integer[] p = new Integer[n];
        for (int i = 0; i < n; i++) p[i] = i;
        Arrays.sort(p, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return Double.compare(pos[o1], pos[o2]);
            }
        });

        double vx = Math.sin(a);
        double vy = Math.cos(a);
        double curLev = x[0] * vx + y[0] * vy;
        double res = 0;

        int j = 0;
        for (int i = 1; i < m; i++) {
            while (j < n && pos[p[j]] <= x[i]) {
                double k = (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
                double y0 = y[i] - x[i] * k;
                double xx = pos[p[j]];
                double y1 = y0 + k * xx;
                double y2 = y1 + h[p[j]];
                double lev1 = xx * vx + y1 * vy;
                double lev2 = xx * vx + y2 * vy;
                if (lev2 > curLev) {
                    res += (lev2 - Math.max(lev1, curLev));
                    curLev = lev2;
                }
                j++;
            }
            curLev = Math.max(curLev, x[i] * vx + y[i] * vy);
        }

        if (j != n) return new Outcome(FAIL, "Not all towers listed");

        res /= vy;

        if (compare(res, pa) != 0) return new Outcome(WA, String.format(Locale.US, "Wrong total length calculated: %f instead of %f", res, pa));
        if (compare(ja, pa) > 0) return new Outcome(WA, String.format(Locale.US, "Jury solution is better: %f > %f", ja, pa));
        if (compare(ja, pa) < 0) return new Outcome(FAIL, String.format(Locale.US, "Contestant solution is better: %f < %f", ja, pa));
        return new Outcome(OK, String.format(Locale.US, "%f for %d %d", pa, n, m));
    }

    private int compare(double a, double b) {
        //double max = Math.max(Math.abs(a), Math.abs(b));
        if (Math.abs(a - b) < EPS) return 0;
        //if (max > 0 && Math.abs(a - b) / max < EPS) return 0;
        if (a < b)
            return -1;
        else
            return 1;
    }
}
