#include <cstdio>
#include <cmath>
int main() {
int T;
scanf("%d", &T);
for (int t = 0; t < T; ++t) {
int W, H, N;
scanf("%d%d%d", &W, &H, &N);
double X, Y, R;
scanf("%lf%lf%lf", &X, &Y, &R);
double PI = 2 * acos(0.0);
double res = 2 * PI;
if (fabs(W - X) < R) {
res -= 2 * acos((W - X) / R);
}
res *= R;
printf("res = %.7lf\n", res);
printf("cor = %.7lf\n", 2 * PI * R);
printf("dif = %.7lf\n", fabs(2 * PI * R - res));
}
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGNtYXRoPgoKaW50IG1haW4oKSB7CiAgICBpbnQgVDsKICAgIHNjYW5mKCIlZCIsICZUKTsKICAgIGZvciAoaW50IHQgPSAwOyB0IDwgVDsgKyt0KSB7CiAgICAgICAgaW50IFcsIEgsIE47CiAgICAgICAgc2NhbmYoIiVkJWQlZCIsICZXLCAmSCwgJk4pOwogICAgICAgIGRvdWJsZSBYLCBZLCBSOwogICAgICAgIHNjYW5mKCIlbGYlbGYlbGYiLCAmWCwgJlksICZSKTsKICAgICAgICBkb3VibGUgUEkgPSAyICogYWNvcygwLjApOwogICAgICAgIGRvdWJsZSByZXMgPSAyICogUEk7CiAgICAgICAgaWYgKGZhYnMoVyAtIFgpIDwgUikgewogICAgICAgICAgICByZXMgLT0gMiAqIGFjb3MoKFcgLSBYKSAvIFIpOwogICAgICAgIH0KICAgICAgICByZXMgKj0gUjsKICAgICAgICBwcmludGYoInJlcyA9ICUuN2xmXG4iLCByZXMpOwogICAgICAgIHByaW50ZigiY29yID0gJS43bGZcbiIsIDIgKiBQSSAqIFIpOwogICAgICAgIHByaW50ZigiZGlmID0gJS43bGZcbiIsIGZhYnMoMiAqIFBJICogUiAtIHJlcykpOwogICAgfQogICAgcmV0dXJuIDA7Cn0K