// PA2014, runda 1, Lustra
// Andrzej Pezarski
#include <cstdlib>
#include <cstdio>
#include <vector>
using namespace std;
int main() {
int t;
scanf("%d", &t);
while(t--) {
int n;
scanf("%d", &n);
vector<pair<pair<int, int>, pair<int, int> > > A(n);
int x1=1000000000, x2=1, y1=1000000000, y2=1;
for (auto& a:A) {
scanf("%d%d%d%d", &a.first.first, &a.first.second, &a.second.first, &a.second.second);
x1=min(x1, a.first.first);
x2=max(x2, a.first.second);
y1=min(y1, a.second.first);
y2=max(y2, a.second.second);
}
bool ok=false;
for (auto& a:A) {
ok=ok || (x1==a.first.first && a.first.second==x2 && y1==a.second.first && a.second.second ==y2);
}
printf(ok?"TAK\n":"NIE\n");
}
return 0;
}
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 | // PA2014, runda 1, Lustra // Andrzej Pezarski #include <cstdlib> #include <cstdio> #include <vector> using namespace std; int main() { int t; scanf("%d", &t); while(t--) { int n; scanf("%d", &n); vector<pair<pair<int, int>, pair<int, int> > > A(n); int x1=1000000000, x2=1, y1=1000000000, y2=1; for (auto& a:A) { scanf("%d%d%d%d", &a.first.first, &a.first.second, &a.second.first, &a.second.second); x1=min(x1, a.first.first); x2=max(x2, a.first.second); y1=min(y1, a.second.first); y2=max(y2, a.second.second); } bool ok=false; for (auto& a:A) { ok=ok || (x1==a.first.first && a.first.second==x2 && y1==a.second.first && a.second.second ==y2); } printf(ok?"TAK\n":"NIE\n"); } return 0; } |
English