#include #include using namespace std; int f = 0; struct point { int x; int y; int nr; int n[2]; int clock; bool operator<(const point & a) const { switch(f) { case 0: if(x!=a.x) return x %d %d: %d %d/%d\n", i, tab[i].x, tab[i].y, tab[i].n[0], tab[i].n[1], tab[i].clock); } return 1;*/ //// f=2; sort(tab,tab+N);getskok(N); p = 0; do { //printf("%d: %d %d/%d\n", tab[p].nr, tab[p].n[0], tab[p].n[1],tab[p].clock); int x = tab[skok[tab[p].n[tab[p].clock]]].x; int y = tab[skok[tab[p].n[tab[p].clock]]].y; char c; if(x>tab[p].x) c = 'E'; else if(xtab[p].y) c = 'N'; else if(y