//Flash.cc //ECNA 2012 - Flash Mob #include #include #include using namespace std; #define IFDB if(DEBUG) const bool DEBUG = false; #define FOR(i,n) for(int i=0;i Hor, Ver; void Print(){ int h,v; cout<<"Hor:"; FOR(i,n) { h=Hor[i]; cout<>n; while(n>0){ FOR(i,n){ cin>>h>>v; Hor.push_back(h); Ver.push_back(v); } IFDB Print(); sort(Hor.begin(), Hor.end()); sort(Ver.begin(), Ver.end()); IFDB Print(); // if n odd, find middle spot if (n % 2 == 1){ hmid = Hor[n/2]; vmid = Ver[n/2]; //now get lowest E-W loc EW = n/2; while(Hor[EW]==hmid) EW--; EW++; //get lowest N-S loc NS=n/2; while(Ver[NS]==vmid) NS--; NS++; IFDB cout<<"*** "<>n; } return 0; }