import java.io.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

public class green_pm {

    private void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        double a = 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] = nextInt();
        }
        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(h[o1], h[o2]);
            }
        });
        for (int i = 0; i < m; i++) {
            x[i] = nextInt();
            y[i] = nextInt();
        }
        double vx = Math.sin(a);
        double vy = Math.cos(a);
        double curLev = x[0] * vx + y[0] * vy;
        double minLev = curLev;
        double maxLev = curLev;
        double lastX = x[0];
        double lastY = y[0];
        double[] res = new double[n];
        int j = 0;
        for (int i = 1; i < m; i++) {
            double lev = x[i] * vx + y[i] * vy;
            while (lev > curLev && j < n) {
                double k = (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
                double y0 = y[i] - x[i] * k;
                //vx * x + vy * (k * x + y0) = (vx + vy * k) * x + vy * y0
                double xx = (curLev - vy * y0) / (vx + vy * k);
                double yy = k * xx + y0;
                res[p[j]] = xx;
                curLev = vx * xx + vy * (yy + h[p[j]]);
                j++;
            }
            if (lev > maxLev) {
                maxLev = lev;
                lastX = x[i];
                lastY = y[i];
            }
        }
        while (j < n) {
            res[p[j]] = lastX;
            curLev = vx * lastX + vy * (lastY + h[p[j]]);
            j++;
        }
        out.println((curLev - minLev) / vy);
        for (int i = 0; i < n; i++) {
            out.println(res[i]);
        }
    }

    private BufferedReader br;
    private PrintWriter out;
    private StringTokenizer st;

    String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public static void main(String[] args) {
        new green_pm().run();
    }

    private void run() {
        try {
            br = new BufferedReader(new FileReader("green.in"));
            out = new PrintWriter("green.out");
            solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            System.exit(239);
        }
    }

}
