Advertisement
erfanul007

LOJ 1305

Apr 14th, 2021
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,n,x1,y1,x2,y2,x3,y3,x4,y4,ab,q,are;
  5.     scanf("%d",&n);
  6.     for(i=1;i<=n;i++){
  7.         scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
  8.         y4=y1-(y2-y3);
  9.         x4=x1-(x2-x3);
  10.         q=(x1*y2+x2*y3+x3*y4+x4*y1)-(y1*x2+y2*x3+y3*x4+y4*x1);
  11.         if(q<0)
  12.             q=-q;
  13.         are=q/2;
  14.         printf("Case %d: %d %d %d\n",i,x4,y4,are);
  15.     }
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement