Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #include<cmath>
- using namespace std;
- int main()
- {
- long long int t,i,n;
- cin>>t;
- for(i=1;i<=t;i++){
- cin>>n;
- 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;
- while(n--){
- cin>>x1>>y1>>z1>>x2>>y2>>z2;
- if(x1>mx)
- mx=x1;
- if(y1>my)
- my=y1;
- if(z1>mz)
- mz=z1;
- if(x2<hx)
- hx=x2;
- if(y2<hy)
- hy=y2;
- if(z2<hz)
- hz=z2;
- }
- if(hx>mx && hy>my && hz>mz){
- x=abs(mx-hx);
- y=abs(my-hy);
- z=abs(mz-hz);
- }
- v=x*y*z;
- cout<<"Case "<<i<<": "<<v<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement