-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1196C.cpp
More file actions
35 lines (32 loc) · 724 Bytes
/
1196C.cpp
File metadata and controls
35 lines (32 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
int q;
cin>>q;
int l1=-100000,u1=100000,r1=100000,d1=-100000;
for(int i=0;i<q;i++){
int x,y,a,b,c,d;
cin>>x>>y>>a>>b>>c>>d;
if(a==0){
l1=max(l1,x);
}
if(b==0){
u1=min(u1,y);
}
if(c==0){
r1=min(r1,x);
}
if(d==0){
d1=max(d1,y);
}
}
if(d1>u1 || l1>r1){
cout<<0<<"\n";
continue;
}
cout<<1<<" "<<r1<<" "<<u1<<"\n";
}
}