import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * Solution for NEERC'2013 Problem T:
 * This solution checks correctness of the input.
 *
 * @author Roman Elizarov
 */
public class green_re {
    private static final int MAX_N = 10_000;
    private static final int MAX_M = 10_000;
    private static final int MAX_H = 1000;
    private static final int MAX_ABS_X = 100_000;
    private static final int MAX_ABS_Y = 1000;

    public static void main(String[] args) throws Exception {
        new green_re().go();
    }

    void go() throws Exception {
        long time = System.currentTimeMillis();
        read();
        solve();
        write();
        System.out.printf("Done in %d ms%n", System.currentTimeMillis() - time);
    }

    int n;
    int m;
    int a;
    int[] h;
    int[] x;
    int[] y;

    void read() throws Exception {
        Scanner in = new Scanner(new File("green.in"));
        n = in.nextInt();
        m = in.nextInt();
        a = in.nextInt();
        in.nextLine();
        assert n >= 1 && n <= MAX_N;
        assert m >= 2 && m <= MAX_M;
        assert a >= 1 && a < 90;
        h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = in.nextInt();
            assert h[i] >= 1 && h[i] <= MAX_H;
        }
        in.nextLine();
        x = new int[m];
        y = new int[m];
        for (int j = 0; j < m; j++) {
            x[j] = in.nextInt();
            y[j] = in.nextInt();
            in.nextLine();
            assert Math.abs(x[j]) <= MAX_ABS_X;
            assert Math.abs(y[j]) <= MAX_ABS_Y;
            assert j == 0 || x[j - 1] < x[j];
        }
        in.close();
    }

    static class Tower {
        final int i;
        final int h;

        double x;
        double z;

        Tower(int i, int h) {
            this.i = i;
            this.h = h;
        }
    }

    static final Comparator<Tower> BY_H_DESC = new Comparator<Tower>() {
        @Override
        public int compare(Tower o1, Tower o2) {
            return o2.h - o1.h;
        }
    };

    static final Comparator<Tower> BY_I_ASC = new Comparator<Tower>() {
        @Override
        public int compare(Tower o1, Tower o2) {
            return o1.i - o2.i;
        }
    };

    List<Tower> towers;
    double sum;

    void solve() {
        double[] z = new double[m];
        double[] obscured = new double[m];
        double zx = Math.sin(a * Math.PI / 180);
        double zy = Math.cos(a * Math.PI / 180);
        double zMax = Double.NEGATIVE_INFINITY;
        int startJ = -1;
        for (int j = 0; j < m; j++) {
            z[j] = x[j] * zx + y[j] * zy;
            if (z[j] > zMax) {
                zMax = z[j];
                startJ = j;
            }
            obscured[j] = zMax;
        }
        towers = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
            towers.add(new Tower(i, h[i]));
        Collections.sort(towers, BY_H_DESC);
        Tower u = towers.get(0);
        u.x = x[startJ];
        u.z = z[startJ];
        sum = u.h;
        int j = startJ;
        for (int i = 1; i < n; i++) {
            Tower v = towers.get(i);
            double zLen = v.h * zy;
            double zWant = u.z - zLen;
            while (j >= 0 && obscured[j] > zWant)
                j--;
            // here obscured[j] <= zWant || j < 0
            if (j < 0) {
                v.x = x[0];
                v.z = z[0];
                sum += (u.z - v.z) / zLen * v.h;
            } else {
                // v.x = x[j] + (x[j+1] - x[j]) * t
                // v.z = z[j] + (z[j+1] - z[j]) * t == zWant
                double t = (zWant - z[j]) / (z[j + 1] - z[j]);
                v.x = x[j] + (x[j + 1] - x[j]) * t;
                v.z = zWant;
                sum += v.h;
            }
            u = v;
        }
        Collections.sort(towers, BY_I_ASC);
    }

    void write() throws Exception {
        PrintWriter out = new PrintWriter("green.out");
        out.println(sum);
        for (int i = 0; i < n; i++)
            out.println(towers.get(i).x);
        out.close();
    }

//----------------- just for validation ------------------

    /**
     * Strict scanner to verify 100% correspondence between input files and input file format specification.
     * It is a drop-in replacement for {@link java.util.Scanner} that could be added to a solution source
     * (cut-and-paste) without breaking its ability to work with {@link java.util.Scanner}.
     */
    public class Scanner {
        private final BufferedReader in;
        private String line = "";
        private int pos;
        private int lineNo;

        public Scanner(File source) throws FileNotFoundException {
            in = new BufferedReader(new FileReader(source));
            nextLine();
        }

        public void close() {
            assert line == null : "Extra data at the end of file";
            try {
                in.close();
            } catch (IOException e) {
                throw new AssertionError("Failed to close with " + e);
            }
        }

        public void nextLine() {
            assert line != null : "EOF";
            assert pos == line.length() : "Extra characters on line " + lineNo;
            try {
                line = in.readLine();
            } catch (IOException e) {
                throw new AssertionError("Failed to read line with " + e);
            }
            pos = 0;
            lineNo++;
        }

        public String next() {
            assert line != null : "EOF";
            assert line.length() > 0 : "Empty line " + lineNo;
            if (pos == 0)
                assert line.charAt(0) > ' ' : "Line " + lineNo + " starts with whitespace";
            else {
                assert pos < line.length() : "Line " + lineNo + " is over";
                assert line.charAt(pos) == ' ' : "Wrong whitespace on line " + lineNo;
                pos++;
                assert pos < line.length() : "Line " + lineNo + " is over";
                assert line.charAt(pos) > ' ' : "Line " + lineNo + " has double whitespace";
            }
            StringBuilder sb = new StringBuilder();
            while (pos < line.length() && line.charAt(pos) > ' ')
                sb.append(line.charAt(pos++));
            return sb.toString();
        }

        public int nextInt() {
            String s = next();
            assert s.length() == 1 || s.charAt(0) != '0' : "Extra leading zero in number " + s + " on line " + lineNo;
            assert s.charAt(0) != '+' : "Extra leading '+' in number " + s + " on line " + lineNo;
            try {
                return Integer.parseInt(s);
            } catch (NumberFormatException e) {
                throw new AssertionError("Malformed number " + s + " on line " + lineNo);
            }
        }
    }
}
