Advertisement
noshin98

uva 10991

Jan 14th, 2017
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include<math.h>
  3. #include<stdio.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9.     double r1,r2,r3,a,b,c,A,B,C,s,area;
  10.     int t;
  11.     scanf("%d",&t);
  12.     while(t--){
  13.         scanf("%lf%lf%lf",&r1,&r2,&r3);
  14.         a=r1+r2;
  15.         b=r2+r3;
  16.         c=r3+r1;
  17.         s =(a+b+c)/2;
  18.         C = acos((a*a+b*b-c*c)/(2*a*b));
  19.         A = acos((b*b+c*c-a*a)/(2*b*c));
  20.         B = acos((c*c+a*a-b*b)/(2*c*a));
  21.         area =sqrt(s*(s-a)*(s-b)*(s-c))-(r1*r1*B+r2*r2*C+r3*r3*A)/2;
  22.         printf("%.6lf\n",area);
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement