import java.io.File;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class green_gk {
    static Scanner in;
    static PrintWriter out;

    void run() {
        int n = in.nextInt();
        int m = in.nextInt();
        double a = in.nextInt() * Math.PI / 180;
        double cosA = Math.cos(a);
        double sinA = Math.sin(a);

        int[] heights = new int[n];
        for (int i = 0; i < n; i++) {
            heights[i] = in.nextInt();
        }

        double[] xs = new double[m];
        double[] ys = new double[m];
        for (int i = 0; i < m; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            xs[i] = x * cosA - y * sinA;
            ys[i] = y * cosA + x * sinA;
        }

        int maxYI = 0;
        for (int i = 0; i < m; i++) {
            if (ys[maxYI] < ys[i]) {
                maxYI = i;
            }
        }

        int totalHeight = 0;
        int maxHeightI = 0;
        for (int i = 0; i < n; i++) {
            totalHeight += heights[i];
            if (heights[maxHeightI] < heights[i]) {
                maxHeightI = i;
            }
        }

        double answer = Math.min(Math.max(0, ys[maxYI] - ys[0]) / cosA + heights[maxHeightI], totalHeight);
        double[] towers = new double[n];
        towers[maxHeightI] = xs[maxYI] * cosA + ys[maxYI] * sinA;

        double y = ys[0];
        int j = 1;
        for (int i = 0; i < n; i++) {
            if (i != maxHeightI) {
                while (j != m && y > ys[j]) {
                    j++;
                }
                if (j == m) {
                    towers[i] = xs[maxYI] * cosA + ys[maxYI] * sinA;
                } else {
                    double x = (y - ys[j - 1]) / (ys[j] - ys[j - 1]) * (xs[j] - xs[j - 1]) + xs[j - 1];
                    towers[i] = x * cosA + y * sinA;
                }
                y += heights[i] * cosA;
            }
        }

        out.println(answer);
        for (double tower : towers) {
            out.println(tower);
        }
    }


    public static void main(String[] args) throws Exception {
        in = new Scanner(new File("green.in"));
        out = new PrintWriter("green.out");

        new green_gk().run();

        in.close();
        out.close();
    }
}
