以第二个样例为例子理解题意
下为代码
#include<bits/stdc++.h>
using namespace std;
void solve(){
int xmax = 1e5,ymax = 1e5,xmin = -1e5,ymin = -1e5;
int t;
cin >> t;
while(t--)
{
int a,b;
//a,b为初始位置坐标
cin >> a >> b;
int x;
cin >> x;
//左上右下
//若为1,代表能走,不断缩小范围
if(!x) xmin = max(a,xmin);
cin >> x;
if(!x) ymax = min(b,ymax);
cin >> x;
if(!x) xmax = min(a,xmax);
cin >> x;
if(!x) ymin = max(b, ymin);
}
if(xmax < xmin || ymax < ymin) cout << 0 << '\n';
else cout << 1 <<' ' << xmin << ' ' << ymin << '\n';
//输出任意一个满足题意的即可,此处为左下角的那个坐标
}
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int q;
cin >> q;
while(q--)
solve();
return 0;
}