Advertisement
erfanul007

LOJ 1433

Apr 14th, 2021
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main() {
  4.     int n,i;
  5.     double ox,oy,ax,ay,bx,by,r,x,X,S;
  6.     scanf("%d",&n);
  7.     for(i=1;i<=n;i++){
  8.         scanf("%lf %lf %lf %lf %lf %lf",&ox,&oy,&ax,&ay,&bx,&by);
  9.         x = sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
  10.         r = sqrt((ax-ox)*(ax-ox)+(ay-oy)*(ay-oy));
  11.         X = acos((r*r+r*r-x*x)/(2*r*r));
  12.         S = r*X;
  13.         printf("Case %d: %.5lf\n",i,S);
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement