Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main () {
- int T, cs = 1;
- scanf("%d", &T);
- for (cs = 1; cs <= T; cs++) {
- double a, b;
- scanf("%lf %lf", &a, &b);
- if (b>2*a-b) b = 2*a-b;
- printf("Case %d: %.6lf\n", cs, ((a/2)*(a/2) - (a*a)/4 +b*b)/(a/2 - b) * ((a/2)*(a/2) - (a*a)/4 +b*b)/(a/2 - b));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment