#include #include int main (void) { int k, K, b; float h, w, m, d, rr, hh, excess; float pi = (float) atan2(0,-1); FILE *in = fopen ("castles.in", "r"); fscanf (in, "%d\n", &K); for (k = 1; k <= K; k ++) { fscanf (in, "%f %f %f %f %d\n", &h, &w, &m, &d, &b); excess = 2*m*d*(h+w-2*m); while (b > 0) { fscanf (in, "%f %f\n", &hh, &rr); excess = excess - pi*rr*rr*hh; b --; } printf ("Data Set %d:\n", k); printf ("%.2f\n", excess/(h*w)); } fclose (in); return 0; }