muntasir007

Untitled

Feb 18th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main () {
  4. int T, cs = 1;
  5. scanf("%d", &T);
  6. for (cs = 1; cs <= T; cs++) {
  7. double a, b;
  8. scanf("%lf %lf", &a, &b);
  9. if (b>2*a-b) b = 2*a-b;
  10.  
  11. 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));
  12. }
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment