Saleh127

light oj 1056.cpp

Jun 11th, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  4. #define pi acos(-1)
  5. #define yes printf("YES\n");
  6. #define no printf("NO\n");
  7. int main()
  8. {
  9. Faster
  10. int i,t;
  11. double a,c,r,s,xx,theta;
  12. scanf("%d",&t);
  13. for(i=1;i<=t;i++)
  14. {
  15. scanf("%lf : %lf",&a,&c);
  16. r = sqrt(a*a+c*c)/2.0;
  17. theta = acos((r*r + r*r - c*c)/(2.0*r*r));
  18. s = r*theta;
  19. xx = 400.0/(2.0*a+2.0*s);
  20. printf("Case %d: %.7lf %.7lf\n",i, a*xx, c*xx);
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment