SHARE
TWEET

lightoj - 1305 - Area of a Parallelogram

jakaria_hossain Aug 23rd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6.     int te;
  7.     cin>>te;
  8.     for(int t=1;t<=te;t++)
  9.     {
  10.         int ax,ay,bx,by,cx,cy,dx,dy;
  11.         cin>>ax>>ay>>bx>>by>>cx>>cy;
  12.         dy=cy+ay-by;
  13.         dx=cx-bx+ax;
  14.         int area=ax*by-bx*ay+bx*cy-cx*by+cx*ay-ax*cy;
  15.         cout<<"Case "<<t<<": "<<dx<<" "<<dy<< " "<<abs(area)<<endl;
  16.     }
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top