#include <iostream>
#include <stdlib.h>
#include <math.h>

int main(int argc, char* argv[]) {
	
	int W, H, R, Q;
	std::cin >> W >> H >> R >> Q;
	
	double Pb = W * H;        // povrsina keksa
	double Pc = 2 * R * 3.14; // povrsina kruga
	
	for (int i = 1; i <= Q; i++) {
		int option;
		std::cin >> option;
		switch (option) {
			case 1: {
				
				// pozicija kruga
				int x1, y1;
				std::cin >> x1 >> y1;
				
				int Bc = pow(x1, 2) + pow((y1 - H), 2) - pow(R, 2);
				int Bb = -2 * W;
				int Bx = (-Bb - sqrt(pow(Bb, 2) - 4 * Bc)) / 2;
				int By = H;
				
				int Cc = pow(y1, 2) + pow((x1 - W), 2) - pow(R, 2);
				int Cb = -2 * H;
				int Cx = W;
				int Cy = (-Cb - sqrt(pow(Cb, 2) - 4 * Cc)) / 2;
				
				
				
				int Ax = Cx - Bx;
				int Ay = Cy - By;
				
				int Dx = (Cx+Bx)/2;
				int Dy = (Cy+By)/2;
				
				
				int S = sqrt(pow(Ax, 2) + pow(Ay, 2));
				
				int d = S/2;
				
				int alfa = 2 * asin(d/R);
				
				// povrsina trougla
				int poluobim_trougla = (R+R+S)/2;
				int Pt = sqrt(poluobim_trougla * (poluobim_trougla - R) * (poluobim_trougla - R) * (poluobim_trougla * S));
				
				int Pi = (alfa / 360) * pow(R, 2) * 3.14;
				
				int breg = Pi - Pt;
				
				int L = H - Cy;
				int G = W - Bx;
				
				int trougao = G * L;
				
				int ugriz = trougao + breg;

				Pb -= ugriz;
				
				break;
			}
			case 2: {
				
				// pozicija lenjira
				int x1;
				std::cin >> x1;
				std::cout << W;
			}
		}
	}
	
	std::cout << Pb << std::endl;
	
    return 0;
}