Advertisement
jakaria_hossain

lightoj - 1305 - Area of a Parallelogram

Aug 23rd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement