// CERC 2012 // Problem I: The Dragon and the knights // Model solution, O(n^2 + nm) // Author: Lech Duraj #include #include #include using namespace std; const int maxn = 201; const int maxm = 50010; int A[maxn],B[maxn],C[maxn],R[maxn]; long long X[maxm],Y[maxm]; int main() { int TT; scanf("%d",&TT); while(TT--) { int n,m; scanf("%d%d",&n,&m); for(int i=0; i > G; G.resize(1); for(int i=0; i v[2]; for(int k=0; k0) v[0].push_back(q); else v[1].push_back(q); } if (v[0].empty()) swap(v[0],v[1]); G[j] = v[0]; if (!v[1].empty()) G.push_back(v[1]); } } fprintf(stderr,"Regions: %d, posts: %d.\n",regions,G.size()); printf(regions==G.size() ? "PROTECTED\n" : "VULNERABLE\n"); } }