Advertisement
jakaria_hossain

lightoj - 1211 - Intersection of Cubes

Aug 22nd, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6.  
  7. int t;
  8. cin>>t;
  9. for(int i=1; i<=t; i++)
  10. {
  11. int a=0,b=0,c=0,d=100000,e=100000,f=100000;
  12. int n;
  13. cin>>n;
  14. while(n--)
  15. {
  16. int x1,y1,z1,x2,y2,z2;
  17. cin>>x1>>y1>>z1>>x2>>y2>>z2;
  18. a=max(a,x1);
  19. b=max(b,y1);
  20. c=max(c,z1);
  21. d=min(d,x2);
  22. e=min(e,y2);
  23. f=min(f,z2);
  24. //cout<<d<<" "<<e<<" "<<f<<endl;
  25. }
  26.  
  27. int k=0, val=(d-a)*(e-b)*(f-c);
  28. val=max(val,k);
  29. printf("Case %d: %d\n",i,val);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement