Thursday, September 3, 2015

UVa 10678 - The Grazing Cow

// UVa 10678 - The Grazing Cow
#include <math.h>
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
	int t;
	for (cin >> t; t; t--) {
		double d, l;
		cin >> d >> l;
		double a = sqrt(l * l / 4 - d * d / 4);
		double b = l / 2;
		printf("%.3f\n", M_PI * a * b);
	}
	return 0;
}

No comments:

Post a Comment