erfanul007

LOJ 1305

Apr 14th, 2021
292
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×