Advertisement
erfanul007

Light OJ 1211

Jan 2nd, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long long int t,i,n;
  8. cin>>t;
  9. for(i=1;i<=t;i++){
  10. cin>>n;
  11. long long int x1,y1,z1,x2,y2,z2,hx=9999,hy=9999,hz=9999,mx=0,my=0,mz=0,x=0,y=0,z=0,v;
  12. while(n--){
  13. cin>>x1>>y1>>z1>>x2>>y2>>z2;
  14. if(x1>mx)
  15. mx=x1;
  16. if(y1>my)
  17. my=y1;
  18. if(z1>mz)
  19. mz=z1;
  20. if(x2<hx)
  21. hx=x2;
  22. if(y2<hy)
  23. hy=y2;
  24. if(z2<hz)
  25. hz=z2;
  26. }
  27. if(hx>mx && hy>my && hz>mz){
  28. x=abs(mx-hx);
  29. y=abs(my-hy);
  30. z=abs(mz-hz);
  31. }
  32. v=x*y*z;
  33. cout<<"Case "<<i<<": "<<v<<endl;
  34. }
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement