#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#define vpd vector<pair<long double, long double>>

using namespace std;

int* read(int n) {
	int* t = new int[n];
	for (int i = 0; i < n; i++)
		scanf("%d", t + i);
	return t;
}

void print(int n, int* t) {
	for (int i = 0; i < n; i++)
		printf("%d ", t[i]);
}

int main() {
	int w, h, r, q;
	cin >> w >> h >> r >> q;
	vpd* t = new vpd[w + 1];
	for (; q > 0; q--) {
		int k;
		scanf("%d", &k);
		if (k == 1) {
			int x, y;
			scanf("%d%d", &x, &y);
			if (y >= h + r || y <= -r)
				continue;
			int p = x - r, q = x + r;
			if (y >= h) {
				p = (int)ceil(x - sqrt(r * r - (y - h) * (y - h)));
				q = (int)(x + sqrt(r * r - (y - h) * (y - h)));
			}
			if (y <= 0) {
				p = (int)ceil(x - sqrt(r * r - y * y));
				q = (int)(x + sqrt(r * r - y * y));
			}
			p = max(p, 0);
			q = min(q, w);
			for (int i = p; i <= q; i++) {
				long double a, b;
				a = y - sqrt(r * r - (x - i) * (x - i));
				a = max(a, (long double)0);
				b = y + sqrt(r * r - (x - i) * (x - i));
				b = min(b, (long double)h);
				vpd x;
				if(t[i].size() == 0 || t[i][0].first > b)
					x.push_back(make_pair(a, b));
				else if (t[i][0].second < a)
					x.push_back(t[i][0]);
				else
					x.push_back(make_pair(min(a, t[i][0].first), max(b, t[i][0].second)));
				for (int j = 1; j < t[i].size(); j++) {
					if (t[i][j].first > b)
						x.push_back(make_pair(a, b));
					else if (t[i][j].second < a)
						x.push_back(t[i][j]);
					else
						x.push_back(make_pair(min(a, t[i][j].first), max(b, t[i][j].second)));
					for (int k = x.size() - 2; k >= 0 && x[x.size() - 1].first <= x[k].second; k--) {
						x[k].second = x[x.size() - 1].second;
						x.pop_back();
					}
				}
				t[i] = x;
			}
		}
		else {
			int x;
			scanf("%d", &x);
			long double s = h;
			for (int i = 0; i < t[x].size(); i++)
				s += t[x][i].first - t[x][i].second;
			printf("%Le\n", s);
		}
	}
	delete[] t;
	return 0;
}